...
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.Todo: Anthony Coates can you elaborate on this here? 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. For the SKOS vocabulary products we would do something similar, where each SKOS-concept has a resolvable IRI as its identity.
...
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 Configuration FileArtifact Ontology.