I loaded in a repository of GraphDB the following statements:
@prefix foo: <http://fopo.com#> .
@prefix bar: <http://dd.com#> .
foo:Car a owl:Class .
foo:Animal a owl:Class ;
owl:disjointWith foo:Car .
foo:isEndangered a owl:ObjectProperty ;
rdf:domain foo:Animal ;
rdf:range bar:SomeSpecies .
foo:Ape a owl:Class ;
foo:isEndangered bar:SomeSpecies .
If I'm not wrong, since OWL2 introduced the punning (i.e., using the same IRI of a Class for an individual for metamodelling), the following statements should be inferred:
foo:Ape a foo:Animal .
But it doesn't happen. I tried also different repositories settings without luck.
Is there a way to get that kind of inferences or am I doing something wrong?
You should just replace this statement:
foo:isEndangered rdf:domain foo:Animal .
with this:
foo:isEndangered rdfs:domain foo:Animal .
After replacing, foo:Ape a foo:Animal
should be inferred:
In SPARQL mode, be sure that the second >
in the >>
icon is not dotted, otherwise click the icon.
It works for me under RDFS and OWL-Max rulesets, I have not checked other ones.
As @Ignazio has said, OWL 2 DL punning does not grant inferences, the purpose of punning is rather opposite. OWL 2 DL punning allows entities to be classes and individuals simultaneously without considering an ontology being inconsistent (i. e. full of inferences) or invalid.
OWL punning is just a small part of total RDF(S) freedom:
RDFS does not partition the universe into disjoint categories of classes, properties and individuals. Anything in the universe can be used as a class or as a property, or both, while retaining its status as an individual which may be in classes and have properties. Thus, RDFS permits classes which contain other classes, classes of properties, properties of classes, etc.
Actually, the inference you need is granted by the rdfs2
RDFS entailment pattern.
I hope the mnemonic table below would be helpful. It shows which term mentioned in the RDFS vocabulary is of which prefix.
+--------------------+----------------+
| rdfs: | rdf: |
+--------------------+----------------+
| Classes |
+--------------------+----------------+
| rdfs:Resource | rdf:Property |
| rdfs:Class | rdf:langString |
| rdfs:Literal | rdf:HTML |
| rdfs:Datatype | rdf:XMLLiteral |
+--------------------+----------------+
| Properties |
+--------------------+----------------+
| rdfs:range | rdf:type |
| rdfs:domain | |
| rdfs:subClassOf | |
| rdfs:subPropertyOf | |
| rdfs:label | |
| rdfs:comment | |
+--------------------+----------------+
| Other Vocabulary |
+--------------------+----------------+
| rdfs:Container | rdf:Bag |
| rdfs:member | rdf:Seq |
| rdfs:seeAlso | rdf:Alt |
| rdfs:isdDefinedBy | rdf:List |
| | rdf:first |
| | rdf:rest |
| | rdf:nil |
| | rdf:_1 |
| | rdf:Statement |
| | rdf:subject |
| | rdf:predicate |
| | rdf:object |
| | rdf:value |
+--------------------+----------------+
P.S. Even if the statement you need is not inferred, this is not a bug:
For example, while an RDF vocabulary can assert that an
author
property is used to indicate resources that are instances of the classPerson
, it does not say whether or how an application should act in processing that range information. Different applications will use this information in different ways. For example, data checking tools might use this to help discover errors in some data set, an interactive editor might suggest appropriate values, and a reasoning application might use it to infer additional information from instance data.
:-)