Closed s0rin closed 1 year ago
This is mostly an internal tool, but there is some documentation:
ruby gen_context.rb --help
Usage: script/gen_context [options] URL ...
--body Include the vocabulary definition in the body of the document
--hierarchical Create a hierachy using 'children' as reverse of rdfs:subClassOf
--initial Initial context to load, overrides default
--language Default language for vocabulary
--output, -o Output to the specified file path
--prefix space-separated prefix uri combination
--quiet Supress most output other than progress indicators
--verbose Detail on execution
--vocab Set context @vocab to specified URI
--help, -? This message
The --initial
option expects a JSON-LD context, while you're providing the oncology itself.
There was a bug in some of the necessary code, which I've updated on the develop branch and will be out in the next release. If you clone the gem on your machine, do a bundle install
, then run bundle exec ruby script/gen_context --language en --prefix "https://d-nb.info/standards/elementset" --vocab "https://d-nb.info/standards/vocab/gnd" https://d-nb.info/standards/elementset/gnd.rdf
. You can add a --output
option, but the next argument is treated as the output file.
Although gen_context
is mentioned and recomended in the documentation https://github.com/ruby-rdf/json-ld#features, it won't be installed within the gem, but with git clone https://github.com/ruby-rdf/json-ld.git
, then cd json-ld
and bundle install
and I guess this is the reason why it is an internal tool.
./json-ld/script/gen_context --language en --prefix "https://d-nb.info/standards/elementset" --vocab "https://d-nb.info/standards/vocab/gnd" https://d-nb.info/standards/elementset/gnd.rdf --output context.json
runs without error now, thank you!
I could consider merging it into bin/jsonld
, which is installed, if it is popular enough.
Personally I am using this script and it would be useful to be available after gem installation.
To create a context from an RDFS/OWL definition using the script/gen_context script several parameters are mandatory required, but no example is documented.
Attempted to do with the ontology https://d-nb.info/standards/elementset/gnd.rdf, but got the following error:
What am I doing wrong here?