2

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?

Tomás Ferreira
  • 99
  • 1
  • 1
  • 6

1 Answers1

2

You have inferencing enabled. There are three options to disable inferencing:

  1. Choose the "No inference" ruleset when creating your repository (screenshot).

  2. Uncheck the >>-like icon in the query editor (screenshots).

  3. Use GraphDB pseudo-graphs:

    SELECT ?entity
    FROM <http://www.ontotext.com/explicit>
    WHERE { ?entity rdf:type :Class_N1 } 
    
Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
  • 1
    Thank you for the answer, I was starting to suspect it was an inference problem but had no knowledge of the pseudograph thing. It will come in handy – Tomás Ferreira Oct 02 '17 at 16:25