neosemantics icon indicating copy to clipboard operation
neosemantics copied to clipboard

Schema export flaw

Open tholiebig opened this issue 4 years ago • 0 comments

The schema serialization (via /rdf/<dbname>/onto) is generating un-intended domain/range statements that lead to wrong inferences according to the RDFS semantics.

Consider the following Neo4j graph:

CREATE (n:Male {name: 'Jens'});
CREATE (n:Female {name: 'Maria'});
MATCH (n:Male {name: 'Jens'}), (m:Female {name: 'Maria'})
CREATE (n)-[r:SIBLING]->(m), (n)<-[s:SIBLING]-(m);

The generated RDFS schema is the following:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<neo4j://graph.schema#SIBLING> a owl:ObjectProperty;
  rdfs:range <neo4j://graph.schema#Male>, <neo4j://graph.schema#Female>;
  rdfs:label "SIBLING";
  rdfs:domain <neo4j://graph.schema#Male>, <neo4j://graph.schema#Female> .

<neo4j://graph.schema#Male> a owl:Class;
  rdfs:label "Male" .

<neo4j://graph.schema#Female> a owl:Class;
  rdfs:label "Female" .

The problem are the rdfs:range and rdfs:domain statements. Since they are axioms in RDFS/OWL they add the types Male and Female to all objects that are either source or target of a SIBLING relationship. That's not in the Neo4j graph and should not follow from the graph.

tholiebig avatar May 12 '21 15:05 tholiebig