I want to gather data via ontology matching and reasoning. To do that, I'd like to first identify relevant Individuals for later use if they fulfill certain criteria (using general class axioms).
Currently however, I am unable to achieve the necessary inferences using Protégé. The data consisting of various individuals looks like this:
# Data
# Common Prefixes omitted for readability
@prefix ns: <http://example.org/underlyingSchema#> .
@prefix data: <http://example.org/data#> .
data:A1 a ns:A .
data:A2 a ns:A .
data:R1 a ns:R .
ns:defines data:A1 ;
ns:definedBy data:P1 .
data:R2 a ns:R .
ns:defines data:A2 ;
ns:definedBy data:P2 .
data:P1 a ns:P ;
ns:hasS data:S1.
data:P2 a ns:P ;
ns:hasS data:S2.
data:S1 a ns:S ;
ns:hasI data:I1 ;
ns:hasV data:B1 .
data:S2 a ns:S ;
ns:hasI data:I1 ;
ns:hasV data:B2 .
data:I1 a ns:I ;
expr:hasString "relevant" .
data:B1 a ns:B ;
expr:hasBoolean "true"^^xsd:boolean .
data:B2 a ns:B ;
expr:hasBoolean "false"^^xsd:boolean .
I want to infer that every instance of A for which the relevant attribute is true is also an instance of my example-class, defined in my own ontology as eg:Example a owl:class
.
Unfortunately, since the underlying schema for the data is very cumbersome, I have to do that via A -> R -> P -> S -> I and B
. As R however isn't a straightforward definition (A <- R -> P -> S -> I and B
is probably a more accurate representation), I can't just do a someValuesFrom chain and (I assume) this is where I fail.
Using Protégé, I loaded the schema which defines the properties and classes (Namespace ns) to be able to use the suggestions/auto-complete in the class expression editor. In my own ontology (containing only the example-class) following a previous suggestion I tried using the axiom:
A and (inverse defines some) and definedBy some (hasS some (hasI some(hasString value "relevant")) and (hasV some(hasBoolean value "true"^^xsd:boolean))) EquivalentTo: Example
I then merged my ontology with the data and ran the reasoner, expecting to see A1 (but not A2) as an instance of my example-class, but didn't get any results. I also tried using just "true"
and true
as well as "relevant"^^xsd:string
to see if datatypes were causing the problem, yet it is only inferred that Example is a subclass of A.
I believe that my understanding of what inverse
does is incorrect (I thought it's used since A1 is the object in the triple R1 defines A1
; so I also tried inverse defines self
), but I cannot figure it out. Any help is greatly appreciated.
Edit:
As Joshua correctly pointed out, my example lacks declarations. In my case, these are made in a different schema ontology, so I forgot about them here. Will add for the sake of completeness:
# Might as well include prefixes
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix expr: <http://purl.org/voc/express#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
# Classes
ns:A a owl:Class .
ns:R a owl:Class .
ns:P a owl:Class .
ns:S a owl:Class .
ns:I a owl:Class .
ns:B a owl:Class .
# Object Properties
ns:defines a owl:ObjectProperty .
ns:definedBy a owl:ObjectProperty .
ns:hasS a owl:ObjectProperty .
ns:hasI a owl:ObjectProperty .
ns:hasV a owl:ObjectProperty .
# Data Properties
expr:hasString a owlDatatypeProperty .
expr:hasBoolean a owlDatatypeProperty .