n4o-rse / ta4-conservation-dev

https://n4o-rse.github.io/ta4-conservation-dev/
1 stars 2 forks source link

Align table schema with jskos-convert #2

Open nichtich opened 1 month ago

nichtich commented 1 month ago

The command line tool jskos-convert created and used at VZG has a similar purpose. It's CSV format uses

I can add parent as alias for broaderNotation and need to think about how to process notation vs. identifier. In any case both tools should accept the same format.

nichtich commented 1 month ago

We just published jskos-cli 0.7.0 with support of parent in addition to broaderNotation. Try this file example.csv

notation,prefLabel,parent
X85C,food,
437D,vegetables,X85C

together with example.json:

{
  "uri": "http://example.org/",
  "namespace": "http://example.org/"
}

And convert with jskos-convert concepts example.csv -s example.json -m:

{"uri":"http://example.org/X85C","notation":["X85C"],"inScheme":[{"uri":"http://example.org/"}],"prefLabel":{"en":"food"},"topConceptOf":[{"uri":"http://example.org/"}]}
{"uri":"http://example.org/437D","notation":["437D"],"inScheme":[{"uri":"http://example.org/"}],"prefLabel":{"en":"vegetables"},"broader":[{"uri":"http://example.org/X85C","notation":["X85C"]}]}

When converted to RDF with JSKOS JSON-LD context this equals:

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

<http://example.org/437D> skos:broader <http://example.org/X85C> ;
  skos:inScheme <http://example.org/> ;
  skos:notation "437D" ;
  skos:prefLabel "vegetables"@en .

<http://example.org/X85C> skos:inScheme <http://example.org/> ;
  skos:notation "X85C" ;
  skos:prefLabel "food"@en ;
  skos:topConceptOf <http://example.org/> .

If this is expected outcome of this tool as well, I'd recommend to:

LasseMempel commented 1 week ago

@nichtich Thank you for your valuable suggestions! I am going to align our table scheme to your scheme at vzg in the future.