isamplesorg / isamples_webui

Web interface to iSB and iSC APIs
https://isamplesorg.github.io/isamples_webui/
Apache License 2.0
0 stars 1 forks source link

Have the UI vocabulary JSON files generated as part of the build #137

Open dannymandel opened 1 year ago

dannymandel commented 1 year ago
datadavev commented 1 year ago

The navocab tool collates vocabularies from the .ttl files into a "triple store" using RDFLib, and supports various operations on the triple store. The process is a bit clunky, but basically involves building the store, then using the store to generate the json.

Building the store (can use local file path or url):

vocab load "https://raw.githubusercontent.com/isamplesorg/metadata/develop/src/vocabularies/materialtype.ttl"
vocab load "https://raw.githubusercontent.com/isamplesorg/metadata/develop/src/vocabularies/sampledfeature.ttl"
vocab load "https://raw.githubusercontent.com/isamplesorg/metadata/develop/src/vocabularies/specimentype.ttl"

Then adding the various extensions.

The webui JSON can be produced by:

vocab uijson VOCABULARY

Where VOCABULARY is one of the root vocabularies. These can be found by the command:

vocab vocabs

Then using one of the root vocabularies, and adding -e to include the extensions. e.g.:

vocab uijson mat:materialsvocabulary -e

Output is json to stdout.