Most of the code in this repository is generated from RDF vocabularies using Roslyn script executed with Scripty.
The template generates partial classes and they are not to be committed to the repository.
To add a new vocabulary to the solution follow these steps:
- Add an RDF file to the project
The file name will be used as prefix. Any format supported by dotNetRDF can be used. (JSON-LD may be coming later).
It is important that the owl:Ontology
and the base namespaces are the same. So, in the case of hash URIs, you can't have
ontology id http://example.org/vocab
but the base http://example.org/vocab#
. Both must include the trailing hash.
-
Add a command like below to
Vocabs.csx
CreateVocabulary(Output, "ex.rdf", ontologyId: "http://example.org/vocab#", skipDefinedByCheck: true);
Depending on the vocabulary file, you may not need the
ontologyId
andskipDefinedByCheck
parameters. The former is required if the input doesn't contain a graph named like the the vocabulary. The latter is necessary if the input triples don't includerdfs:isDefinedBy
statements.
If a manual addition is necessary, please add/modify a partial class in the NonGenerated
folder.