On 03/12/15 09:22, Dibyanshu Jaiswal wrote:
Say I have an Ontology (OWL file) with two classes A and B (siblings to
each other, under Thing) with instances A1,A2.. (rdf:type A)and B1,B2..
(rdf:type B)  respectively, along with some datatype and Object properties
with A as domain class and B as Range class.

On SPARQL Query

SELECT * WHERE {?ind rdf:type :A}
return me individuals of both A as well as B.. along with the object
properties.

Jena's Inbuilt Infernece Model linke this:

Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
InfModel infModel = ModelFactory.createInfModel(reasoner, ontModel);


As per my expectations I should get a list of individuals which are of
rdf:type A or rdf:type (subclasses of A)

The chances are those individuals appearing in the SPARQL result which you believe to be of type B are *also* of type A by virtue of domain/range inference from their properties.

If you can't spot the problem then isolate a small test case, e.g. starting with one problem individual and expand from there. If you have a small test case but still can't see why those inferences are cropping up then you have something small enough to post to see if others can help you diagnose.

Dave

Reply via email to