1

How are you?

I 'm taking my first steps with GraphDb and I've found a couple of behaviors that I don't quite understand. Let me build the case.

I have the following Ontology, which I have loaded into GraphDb. enter image description here

Let's only consider the tree under Persona. When I go to Visual Graph and type :Persona in the search bar, this is what returns: enter image description here

As you can see all the nodes corresponding to the ontology are there, but also some other nodes like Class (in different colors), and Thing and Nothing. (Ignore Paul which is an instance I added)

What are these other nodes? and how can I prevent them from appearing in this view?


Now, when I query with SPARQL, and I run

select * where {
?s ?p ?o .
}

If I have "Include inferred data in results" Off, I get this

enter image description here

Which is fine. It's what I would expect.

But ... when I turn inference On , which I believe is one of the true powers of working with rdf, I get around 800 records with all sort of triples with definitions for owl and rdf generic objects.

In order to get only my stuff and keep the inference capability on, I filtered as follows

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pe: <http://www.semanticlab.com/ontologias/EmpresasYPersonas#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

select * where {
?s ?p ?o .
    FILTER (REGEX(str(?s),"Persona*" )).
    FILTER (!REGEX(str(?o),"owl*" )).
    FILTER (!REGEX(str(?o),"rdf*" )).
}
    order by ?s

Which returns

enter image description here

Here I see some inferencing, for example Paul classified as a Persona, which is not explicitly stated. But on the other hand there are a bunch of new triples that I don't understand nor want, as they don't bring any value: for example the ones with owl:sameAs, owl:equivalentClass, or the ones stating that Persona is a subClassOf Persona (which in fact I believe is wrong).

Could you please explain why this is happening, and how to prevent this behavior?

I'm aware that I might be making some mistakes, so if you spot any, please let me know.

logi-kal
  • 7,107
  • 6
  • 31
  • 43
Ric
  • 65
  • 9
  • 1) in the image you see OWL class and RDFS class entities which are implicitly the type of any class in an OWL ontology and in your ontology also explicitly contained. That's why it's also rendered. – UninformedUser Apr 06 '21 at 03:18
  • 2) it shows the axiomatic statements of OWL, i.e. triples that always hold – UninformedUser Apr 06 '21 at 03:22
  • 3) those are trivial inferences, like any entity is the same as itself, i.e. `:x owl:sameAs :x` for any `:x` being an individual – UninformedUser Apr 06 '21 at 03:23
  • Hi UU, Thank you very much for your comments! My final goal here is to be able to present the results from the queries to final users through an easy to use interface, and the triples with non functional meaning like the ones you mentioned shouldn't be part of the result. So what would be the right way to do this? Perhaps filtering could be a solution, but it sounds artificial to have to filter in the query all these triples every time. For example, when I query an RDB, I get what I asked for, and no metadata. Again, I'm totally new to triples and perhaps I lack some core concepts. Thank you! – Ric Apr 06 '21 at 15:41

0 Answers0