blazegraph / database

Blazegraph High Performance Graph Database
GNU General Public License v2.0
898 stars 173 forks source link

Inference does not properly handle subtypes, especially for multiple parent types #188

Open franzlst opened 3 years ago

franzlst commented 3 years ago

In our custom OWL ontology, we have defined the following type hierarchy (excerpt):

owl:Thing
    Entity
        Physical
            Object
                Agent
                    Robot
                        LbrArm
                            Lbr3
                            Lbr4
                SelfConnectedObject
                    CorpuscularObject
                        Artifact
                            Device
                                Robot
                                    LbrArm
                                        Lbr3
                                        Lbr4

Here Robot shows up twice in the hierarchy, as it is defined as subtype of both Agent and Device:

<rdf:Description rdf:about="http://purl.org/ieee1872-owl/cora-bare#Robot">
    <rdfs:subClassOf rdf:resource="http://purl.org/ieee1872-owl/sumo-cora#Agent"/>
    <rdfs:subClassOf rdf:resource="http://purl.org/ieee1872-owl/sumo-cora#Device"/>
</rdf:Description>

Now I want to get all information about Lbr3:

SELECT  ?s ?p ?o
WHERE {  <https://ontology.SHORTENED.de/SHORTENED#Lbr3> ?p ?o  }

On my system, I get the following result:

s p o
rdf:type rdfs:Class
rdf:type owl:Class
rdfs:subClassOf http://purl.org/ieee1872-owl/cora-bare#Robot
rdfs:subClassOf https://ontology.SHORTENED.de/SHORTENED#LbrArm
rdfs:subClassOf https://ontology.SHORTENED.de/SHORTENED#Lbr3
rdfs:subClassOf rdfs:Resource

I would have expected that the result includes also subClassOf entries for owl:Thing, Entity, Physical, Object, Agent and Device, but the entries stop at Robot.

Related to this issue is when querying information about an instance of Lbr3, named example_lbr:

SELECT  ?s ?p ?o
WHERE {  <https://ontology.SHORTENED.de/SHORTENED#example_lbr> ?p ?o  }
s p o
  rdf:type http://purl.org/ieee1872-owl/cora-bare#Robot
  rdf:type owl:NamedIndividual
  rdf:type https://ontology.SHORTENED.de/SHORTENED#LbrArm
  rdf:type https://ontology.SHORTENED.de/SHORTENED#Lbr3
  rdf:type t744
  rdf:type t752

The result shows two unnamed nodes (t744 and t752). I could imagine that these relate to Device and Agent. But what don't they have names and why are the types not listed up to Thing?

franzlst commented 3 years ago

Interestingly, a colleague of mine has the very same setup (including the *.properties file). For the same query

SELECT  ?s ?p ?o
WHERE {  <https://ontology.SHORTENED.de/SHORTENED#example_lbr> ?p ?o  }

his result shows the full type hierarchy:

p o
rdf:type http://purl.org/ieee1872-owl/sumo-cora#Artifact
rdf:type http://purl.org/ieee1872-owl/sumo-cora#CorpuscularObject
rdf:type http://purl.org/ieee1872-owl/sumo-cora#Entity
rdf:type http://purl.org/ieee1872-owl/sumo-cora#Object
rdf:type http://purl.org/ieee1872-owl/sumo-cora#Physical
rdf:type http://purl.org/ieee1872-owl/sumo-cora#SelfConnectedObject
rdf:type http://purl.org/ieee1872-owl/cora-bare#Robot
rdf:type owl:NamedIndividual
rdf:type https://ontology.SHORTENED.de/SHORTENED#LbrArm
rdf:type https://ontology.SHORTENED.de/SHORTENED#Lbr3
rdf:type t1053
rdf:type t1122

So in summary, there are three issues here: