The column RDF is used only when you need to specify something different from Class/name
Eg given vocab_iri: http://schema.org/ and vocab_prefix: s,
the following excerpt refers to s:Event, s:EventSeries and otkg:EventPartcipation
(leading dashes indicate the class hierarchy):
Class/prop
range/inherits
RDF
Event
-EventSeries
Event
-EventParticipation
Event
otkg:EventPartcipation
However, Semantic Objects currently supports only abstract superclasses, so if we want to use all 3 classes with instance data,
we need to enter an abstract parent like this:
Class/prop
range/inherits
char
RDF
EventCommon
kind: abstract
-Event
EventCommon
-EventSeries
EventCommon
-EventParticipation
EventCommon
otkg:EventPartcipation
It's quite common for one of the children (in this case Event) not to have any props of its own,
but to inherit the props of the parent.
This works fine for tsv2soml, but tsv2owl would generate a parasitic (non-existent) class s:EventCommon.
I thought of using the value RDF: none to signal that such class should not be generated.
But then we'd need to carry over the properties and parent of that parasitic class to one of its children (in this case Event).
So instead we add an extra column RDF replacement that indicates which other class is used instead of the parasitic class:
Class/prop
range/inherits
char
RDF
RDF replacement
EventCommon
kind: abstract
Event
-Event
EventCommon
-EventSeries
EventCommon
-EventParticipation
EventCommon
otkg:EventPartcipation
This replaces all references to EventCommon with Event: domain (prop attachment), range (prop target), superclass (parent), subclasses (children).
Notes:
It uses the fact that RDFS/OWL triples can be emitted in any order
It emits an extra reflective triple s:Event rdfs:subClassOf s:Event, which is harmless and in fact is part of the RDFS semantics
It uses the RDF expression of the replacement class: in this case s:Event because the RDF column is not used, but you can specify something else in RDF
label and descr of the parasitic class are ignored to avoid emitting multiple labels/descriptions for the replacement class
You can also use replacement on leaf-level classes.
Consider the following example from the Ontotext Knowledge Graph (OTKG) (we use two dashes to indicate the properties attached to the prev class):
Class/prop
range/inherits
char
RDF
RDF replacement
Concept
name: prefLabel, kind: abstract
skos:Concept
--prefLabel
string
min: 1
skos:prefLabel
--inScheme
ConceptScheme
skos:inScheme
-Audience
Concept
typeProp: inScheme
OTKG:audience
none
-ContentType
Concept
typeProp: inScheme
OTKG:contentType
Concept
--appliesToClass
iri
otkg:appliesToClass
PersonCommon
Thing
kind: abstract
Person
--jobTitle
string
--worksFor
Organization
min: 1
--sameAs
iri
max: inf
-Person
PersonCommon
-OntotextPerson
PersonCommon
typeProp: worksFor
OTKG-agent:Ontotext
none
Here all sub-classes except Person have an additional type discriminator: rdf:type and the extra prop designated by typeProp
Audience is a Concept that is further distinguished by skos:inScheme=OTKG:audience.
Since there is no RDF class s:Concept and it adds to props compared to Concept, we set replacement=none to ignore this class altogether
ContentType is also a Concept that is further distinguished by skos:inScheme.
There is also no RDF class s:ContentType.
But this one has an extra prop otkg:appliesToClass, so we specify replacement=Concept to carry over this prop to that parent class.
Note: this prop indicates which concept goes with which Schema class, eg OTKG:contentType/blogPost goes with s:BlogPosting
PersonCommon is a parasitic (abstract) parent class, so we replace it with Person (which is emitted in RDF as s:Person).
We already saw this case in the previous example.
OntotextPerson is a semantic object that is the same as Person, but with fixed s:worksFor=OTKG-agent:Ontotext
and with stronger information requirements (we demand that it has at least one s:sameAs).
There's neither RDF class s:OntotextPerson nor otkg:OntotextPerson, and it doesn't add any extra prop.
So we use replacement=none to omit it from RDF altogether.
RDF
is used only when you need to specify something different fromClass/name
Eg givenvocab_iri: http://schema.org/
andvocab_prefix: s
, the following excerpt refers tos:Event
,s:EventSeries
andotkg:EventPartcipation
(leading dashes indicate the class hierarchy):It's quite common for one of the children (in this case
Event
) not to have any props of its own, but to inherit the props of the parent.This works fine for
tsv2soml
, buttsv2owl
would generate a parasitic (non-existent) classs:EventCommon
. I thought of using the valueRDF: none
to signal that such class should not be generated. But then we'd need to carry over the properties and parent of that parasitic class to one of its children (in this caseEvent
).So instead we add an extra column
RDF replacement
that indicates which other class is used instead of the parasitic class:This replaces all references to
EventCommon
withEvent
: domain (prop attachment), range (prop target), superclass (parent), subclasses (children).Notes:
s:Event rdfs:subClassOf s:Event
, which is harmless and in fact is part of the RDFS semanticss:Event
because theRDF
column is not used, but you can specify something else inRDF
label
anddescr
of the parasitic class are ignored to avoid emitting multiple labels/descriptions for the replacement classHere all sub-classes except
Person
have an additional type discriminator:rdf:type
and the extra prop designated bytypeProp
Audience
is aConcept
that is further distinguished byskos:inScheme=OTKG:audience
. Since there is no RDF classs:Concept
and it adds to props compared toConcept
, we setreplacement=none
to ignore this class altogetherContentType
is also aConcept
that is further distinguished byskos:inScheme
. There is also no RDF classs:ContentType
. But this one has an extra propotkg:appliesToClass
, so we specifyreplacement=Concept
to carry over this prop to that parent class. Note: this prop indicates which concept goes with which Schema class, egOTKG:contentType/blogPost
goes withs:BlogPosting
PersonCommon
is a parasitic (abstract) parent class, so we replace it withPerson
(which is emitted in RDF ass:Person
). We already saw this case in the previous example.OntotextPerson
is a semantic object that is the same asPerson
, but with fixeds:worksFor=OTKG-agent:Ontotext
and with stronger information requirements (we demand that it has at least ones:sameAs
). There's neither RDF classs:OntotextPerson
norotkg:OntotextPerson
, and it doesn't add any extra prop. So we usereplacement=none
to omit it from RDF altogether.