What the toolkit does
The RDF Toolkit does several things for the Ontology developer (not just the FIBO developer, anyone who develops OWL ontologies or works with any of the derived Products from those ontologies):
- "Serialize" RDF files
- "Build" artifacts from ontologies
- Test all artifacts
- Visualize artifacts (Frontend "specsite")
- Manage governance and eco-system (Frontend "specsite")
See for more explanation the subsequent paragraphs.
Besides that, the RDF Toolkit is a program that can be run on the machine of the ontology developer, in the working directory of the git clone of the git repository that contains the ontologies. It can also be run on a "CI-server" such as Jenkins (for instance https://jenkins.edmcouncil.org) where it will run in the "workspace" of a "job" where it also runs in the directory of a git clone of the ontology repository.
The RDF Toolkit only has a Command Line Interface (CLI), there is no other interface.
Commands
The RDF Toolkit supports two main commands: serialize
and build
. (And in the future commands like rename
).
Serialize
The serialize
command allows you to read OWL ontology files or any other RDF file in any of the main Serialization Formats and "serialize" or rewrite those files in the same or other Serialization Formats where it will ensure that the output is always in the same sorted order. This is important if you are storing your ontologies in a text/line-oriented version control system, e.g. Git or GitHub, and require differencing and merging work sensibly and correctly.
Format Name | Serializer CLI Name | Input Format? | Output Format? |
JSON-LD | json-ld | Yes | Yes |
N3 | n3 | Yes | No |
RDF/A | rdf-a | Yes | No |
RDF/XML | rdf-xml | Yes | Yes |
TriG | trig | Yes | No |
TriX | trix | Yes | No |
Turtle | turtle | Yes | Yes |
The serializer is not FIBO-specific; you can use it with any ontologies or other RDF files. It has the following features that can be controlled from the CLI:
- URIs can be shortened using a “prefer prefixes” or “prefer relative to base URI” strategy, where supported by the RDF format.
- Blank nodes can be inlined, where supported by the RDF format. NOTE: this works for most RDF/OWL files, but there are edge cases where it will not work.
- The base URI can be set.
- The base URI can be inferred from the ontology URI.
- The indent string can be set.
- Leading and/or trailing comments can be added to the output, where supported by the RDF format. NOTE: JSON-LD does not support comments.
- URIs can be re-written by specifying a ‘match’ pattern and a ‘replacement’ string. The match pattern is a Java regular expression.
Build
The build
command allows you to read an OWL ontology file or whole directory of such files and generate various "Products" from it, collections of "Deliverables" or "Artifacts" that can be published on a target web server. For the OWL ontology "product" that would be done in a way where all OWL axioms have IRIs that are resolvable to a functioning HTTP-server (see Ontology Builder). For the SKOS vocabulary products we would do something similar, where each SKOS-concept has a resolvable IRI as its identity (see Vocabulary Builder).
Rename
One future command we might support is the rename
command which would allow an ontology developer to rename OWL axioms across an ontology architecture like FIBO.
Configuration
The RDF Toolkit assumes that in the root directory or the etc directory of the git repository that there is a config file called rdf-toolkit.ttl which will contain the configuration for the RDF-Toolkit, basically the model of your ontology architecture, for instance where can we find the "Domains", what are the main branches and their meaning and so forth.
See Artifact Ontology.