I’m using the Jena OWL reasoner with this ontology:
http://www.mind-tap.net/kbswt/simple_no_inheritance.ttl

I want to get the named individuals that are instances of a 
modelica:BinaryExpression along with the rdfs:label of the class directly 
implemented by the named individual.

I hope there is a SPARQL guru who can help identify what I need to do. If 
adding a Jena rule to the reasoner would help I have no problem going that 
route either.

In essence:
c subClassOf b
b subClassOf a

c rdfs:label “class c”
b rdfs:label “class b”
a rdfs:label “class a”

x typeOf c
x rdfs:label “instance x”

I need to run a query to get:
“instance x”, “class c”

but my SPARQL gives me:
“instance x”, “class c”
“instance x”, “class b”
“instance x”, “class a”

I’ve tried some filter expressions but they wind up filtering out all the 
results. I was thinking there is some path modifier that might work but haven’t 
been successful going down that route either.

My starter SPARQL:

PREFIX modelica: <http://mind-tap.net/kbswt/modelica#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://mind-tap.net/kbswt/simple_no_inheritance#>

select distinct * { ?s rdfs:subClassOf modelica:BinaryExpression ;
rdfs:label ?equationName .
?i a ?s.
}
ORDER BY ?i

Thanks in advance,
Chris


Reply via email to