I'm using Jena in Java with Pellet as the reasoner. Now I need to query the class of a specific URI, but the problem is is that I don't know before hand what kind of instance it is, in what kind of class hierarchy, so I can't use filter options. When using:
SELECT * WHERE {<" + uri + "> rdf:type ?x}
It returns all superclasses. My hierarchy for this specific example looks like:
-Thing
-Person
-Adult
-Animal
-Dog
Every class has multiple instances. I don't know what kind of instance I'm querying beforehand. But let's say for example I'm querying an URI of an instance who is a type Dog. It will also return Animal and Thing. But I only want it to return Dog. Is that possible? Using LIMIT 1 only returns the direct superclass.