2.0.5 • Published 3 months ago

@ezs/loterre v2.0.5

Weekly downloads
45
License
MIT
Repository
github
Last release
3 months ago

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

2.0.5

3 months ago

2.0.3

10 months ago

2.0.4

8 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.14

2 years ago

1.3.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.9

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago