@ezs/loterre
Loterre statements for EZS
Last updated 9 days ago by touv .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ezs/loterre 
SYNC missed versions from official npm registry.

Loterre

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

installation

npm install @ezs/loterre

usage

Table of Contents

checkIfPropertyExist

Parameters

checkIfPropertyExist

Parameters

checkIfPropertyExist

Parameters

writeHierarchy

Parameters

getBroaderAndNarrower

Parameters

Returns Promise Returns object

getBroaderAndNarrower

Parameters

Returns Promise Returns object

writeEdge

Parameters

SKOSHierarchy

SKOSHierarchy Output:

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

Parameters

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

Returns Promise Return fedd Object

SKOSHierarchy

SKOSHierarchy Output:

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

Parameters

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

Returns Promise Return fedd Object

SKOSObject

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

Parameters

Returns Object

SKOSPathEnum

Parameters

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

Returns Promise Returns object

SKOSPathEnum

Takes 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]
language = 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: [ [{ key: 'http://example.com/dishes#potatoBased', label: '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: [ [{ key: 'http://example.com/dishes#potatoBased', label: '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: [
         { key: 'http://example.com/dishes#fries', label: 'Frites' },
         {
             key: 'http://example.com/dishes#mashed',
             label: 'Purée de pomme de terre'
         }
      ]
    }
  ]

Parameters

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

Returns Object Returns object

Current Tags

  • 1.0.15                                ...           latest (9 days ago)

15 Versions

  • 1.0.15                                ...           9 days ago
  • 1.0.14                                ...           10 days ago
  • 1.0.13                                ...           12 days ago
  • 1.0.12                                ...           23 days ago
  • 1.0.11                                ...           a month ago
  • 1.0.10                                ...           2 months ago
  • 1.0.9                                ...           2 months ago
  • 1.0.8                                ...           2 months ago
  • 1.0.7                                ...           2 months ago
  • 1.0.6                                ...           2 months ago
  • 1.0.5                                ...           2 months ago
  • 1.0.4                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 42
Last Day 0
Last Week 33
Last Month 14
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |