npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ezs/loterre

v2.0.5

Published

Loterre statements for EZS

Downloads

78

Readme

Loterre

Ce plugin propose une série d'instructions spécifiques à l’usage de loterre

installation

npm install @ezs/loterre

usage

Table of Contents

SKOSHierarchy

Output:

 [
     {
         "source": ...,
         "target": ...,
         "weight": ...
     }
 ]

Parameters

  • language String Choose language of prefLabel (optional, default en)

Returns Promise Return fed Object

SKOSObject

Take Object generated by XMLMapping & SKOS data and create a new basic object with only keys & values

Parameters

Returns Object

SKOSPathEnum

Take an Object and transform "broader","narrower" and "related" properties to an 'Object' containing the prefLabel and rdf$about

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#">

     <skos:Concept rdf:about="http://example.com/dishes#potatoBased">
          <skos:prefLabel xml:lang="fr">Plats à base de pomme de terre</skos:prefLabel>
          <skos:prefLabel xml:lang="en">Potato based dishes</skos:prefLabel>
          <skos:prefLabel xml:lang="de">Kartoffelgerichte</skos:prefLabel>
          <skos:inScheme rdf:resource="http://example.com/dishes"/>
          <skos:topConceptOf rdf:resource="http://example.com/dishes"/>
      </skos:Concept>

      <skos:Concept rdf:about="http://example.com/dishes#fries">
          <skos:prefLabel xml:lang="fr">Frites</skos:prefLabel>
          <skos:prefLabel xml:lang="en">French fries</skos:prefLabel>
          <skos:prefLabel xml:lang="de">Französisch frites</skos:prefLabel>
          <skos:inScheme rdf:resource="http://example.com/dishes"/>
          <skos:broader rdf:resource="http://example.com/dishes#potatoBased"/>
      </skos:Concept>

      <skos:Concept rdf:about="http://example.com/dishes#mashed">
          <skos:prefLabel xml:lang="fr">Purée de pomme de terre</skos:prefLabel>
          <skos:prefLabel xml:lang="en">Mashed potatoes</skos:prefLabel>
          <skos:prefLabel xml:lang="de">Kartoffelpüree</skos:prefLabel>
          <skos:inScheme rdf:resource="http://example.com/dishes"/>
          <skos:broader rdf:resource="http://example.com/dishes#potatoBased"/>
      </skos:Concept>

</rdf:RDF>

Script:

[use]
plugin = loterre

[concat]
[XMLParse]
separator = /rdf:RDF/skos:Concept
[SKOSObject]

[SKOSPathEnum]
path = broader
path = narrower
label = prefLabel@fr

Output:

  [
   {
      "rdf$about": "http://example.com/dishes#fries",
      "prefLabel@fr": "Frites",
      "prefLabel@en": "French fries",
      "prefLabel@de": "Französisch frites",
      "inScheme": "http://example.com/dishes",
      "broader": [ [{ "rdf$about": "http://example.com/dishes#potatoBased", "prefLabel@fr": "Plats à base de pomme de terre" }] ]
    },
    {
      "rdf$about": "http://example.com/dishes#mashed",
      "prefLabel@fr": "Purée de pomme de terre",
      "prefLabel@en": "Mashed potatoes",
      "prefLabel@de": "Kartoffelpüree",
      "inScheme": "http://example.com/dishes",
      "broader": [ [{ "rdf$about": "http://example.com/dishes#potatoBased", "prefLabel@fr": "Plats à base de pomme de terre" }] ]
    },
    {
      "rdf$about": "http://example.com/dishes#potatoBased",
      "prefLabel@fr": "Plats à base de pomme de terre",
      "prefLabel@en": "Potato based dishes",
      "prefLabel@de": "Kartoffelgerichte",
      "inScheme": "http://example.com/dishes",
      "topConceptOf": "http://example.com/dishes",
      "narrower": [
         { "rdf$about": "http://example.com/dishes#fries", "prefLabel@fr": "Frites" },
         {
             "rdf$about": "http://example.com/dishes#mashed",
             "prefLabel@fr": "Purée de pomme de terre"
         }
      ]
    }
  ]

Parameters

  • path String Choose one or more paths to enum (optional, default skos$broader)
  • path String Choose one path to select uri from found concepts (optional, default rdf$about)
  • path String Choose one path to select label from found concepts (optional, default skos$prefLabel)
  • recursion String Follow path to enum (usefull for broaderConcept) (optional, default false)

Returns Object Returns object

SKOSToGexf

Output:

 [
     {
         "source": ...,
         "target": ...,
         "weight": ...
     }
 ]

Parameters

  • language String Choose language of prefLabel (optional, default en)

Returns Promise Return fed Object