I feel like this has an obvious answer I'm missing, but here's the problem:
I have an ontology which has a class 'Class_N1', with a subclass 'Class_N2', which has a subclass 'Class_N3', which has a subclass 'Class_N4'
When I run this query:
SELECT ?entity
WHERE {
?entity rdf:type :Class_N1
}
I get individuals from the top class ('Class_N1') and from its subclass and respective subclasses.
Is there anyway to get results which belong only in the top/super class?
You have inferencing enabled. There are three options to disable inferencing:
Choose the "No inference" ruleset when creating your repository (screenshot).
Uncheck the >>
-like icon in the query editor (screenshots).
Use GraphDB pseudo-graphs:
SELECT ?entity
FROM <http://www.ontotext.com/explicit>
WHERE { ?entity rdf:type :Class_N1 }