tsv2soml.pl generates SOML from a sheet.
In internal projects we've been using a script owl-gen.pl that generates OWL from the same sheet.
Commit it here as tsv2owl.pl.
For example, for the Ontotext KG (OTKG), we use schema.org (s:) as vocabulary namespace but otkg: as the ontology URL.
Typically you'd use an ontology preamble, eg like this otkg-preamble.ttl:
-vocab: default namespace for classes and props that don't have a specific URL in the RDF column. Eg
keywords will be emitted as s:keywords because it doesn't have an RDF value
but buyersJourney will be emitted as otkg:buyersJourney because that is its RDF value
-ontology:
The value should match the owl:Ontology URL that you use in the preamble
It can be a prefixed URL (eg otkg:, in this case the URL ends in a slash) or a full URL (eg <https://kg.ontotext.com/resource/ontology>)
For each term (class and prop), adds rdfs:isDefinedBy pointing to the ontology. This is a common practice and is used eg by MetaPhactory when collecting properties to generate forms.
Adds the current date as dct:modified of the ontology
This generates term definitions from the sheet, prepends the preamble, formats the result with Jena riot, and finally sorts it by term (Turtle block: such "paragraphs" are separated by a double newline)
tsv2soml.pl
generates SOML from a sheet. In internal projects we've been using a scriptowl-gen.pl
that generates OWL from the same sheet. Commit it here as tsv2owl.pl.For example, for the Ontotext KG (OTKG), we use schema.org (
s:
) as vocabulary namespace butotkg:
as the ontology URL. Typically you'd use an ontology preamble, eg like thisotkg-preamble.ttl
:Add two options:
-vocab
: default namespace for classes and props that don't have a specific URL in theRDF
column. Egkeywords
will be emitted ass:keywords
because it doesn't have anRDF
valuebuyersJourney
will be emitted asotkg:buyersJourney
because that is itsRDF
value-ontology
:owl:Ontology
URL that you use in the preambleotkg:
, in this case the URL ends in a slash) or a full URL (eg<https://kg.ontotext.com/resource/ontology>
)rdfs:isDefinedBy
pointing to the ontology. This is a common practice and is used eg by MetaPhactory when collecting properties to generate forms.dct:modified
of the ontologyYou can run the tool with a
Makefile
like this:This generates term definitions from the sheet, prepends the preamble, formats the result with Jena
riot
, and finally sorts it by term (Turtle block: such "paragraphs" are separated by a double newline)