On 10/06/12 16:52, Pieter Wouter Hartog wrote:
I created a simple ontology with two classes (A and B) that are disjoint
with eachother.
Then I created RDF data assigning the same resource being rdf:type class A
and in another statement made the same resource rdf:type Class B.
I expected the owl reasoner to give a validation error but it didn't give me
any error when running the validation on it.
I don't think this is a bug, but rather my understanding of what the
reasoned is actually validating, and perhaps the way I defined the ontology
and the data.
The latter.
[snip]
m.add(rs, RDF.type,
"http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassA");
m.add(rs, RDF.type,
"http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassB");
This is defining the type of rs as being a pair of strings rather than
the classes themselves. Instead do something like:
OntClass A =
ontm.getOntClass("http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassA");
OntClass B =
ontm.getOntClass("http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassB");
m.add(rs, RDF.type, A);
m.add(rs, RDF.type, B);
The validity report will then include:
[[[
Error ("conflict"): "Two individuals both same and different, may be due
to disjoint classes or functional properties"
Culprit = http://exanple.org/A-product
Implicated node: http://exanple.org/A-product
Error ("conflict"): "Individual a member of disjoint classes"
Culprit = http://exanple.org/A-product
Implicated node:
http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassA
Implicated node:
http://www.semanticweb.org/ontologies/2012/5/questionSample1.owl#ClassB
]]]
Dave