VladimirAlexiev / soml

Semantic Objects Modeling Language
8 stars 2 forks source link

add column `RDF replacement` to tsv2owl #7

Closed VladimirAlexiev closed 1 year ago

VladimirAlexiev commented 1 year ago
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:

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