neosemantics
neosemantics copied to clipboard
Schema export lacks DatatypeProperties
The schema export (via /rdf/<dbname>/onto) seems to lack any DatatypeProperty declarations which are required esp. for reasoning because without any declaration they are assumed to be AnnotationProperties.
As an example consider the following graph:
CREATE (n:Male:Person {name: 'Hans', birthdate: date('1970-10-03'), age: 51,
height: 144.3, adult: true, parents: ["Walter", "Sabine"]});
None of the slots appear in the exported schema. However, they are nicely shown with call db.schema.nodeTypeProperties:
╒══════════════════╤═════════════════╤══════════════╤═══════════════╤═══════════╕
│"nodeType" │"nodeLabels" │"propertyName"│"propertyTypes"│"mandatory"│
╞══════════════════╪═════════════════╪══════════════╪═══════════════╪═══════════╡
│":`Male`:`Person`"│["Male","Person"]│"birthdate" │["Date"] │true │
├──────────────────┼─────────────────┼──────────────┼───────────────┼───────────┤
│":`Male`:`Person`"│["Male","Person"]│"name" │["String"] │true │
├──────────────────┼─────────────────┼──────────────┼───────────────┼───────────┤
│":`Male`:`Person`"│["Male","Person"]│"adult" │["Boolean"] │true │
├──────────────────┼─────────────────┼──────────────┼───────────────┼───────────┤
│":`Male`:`Person`"│["Male","Person"]│"age" │["Long"] │true │
├──────────────────┼─────────────────┼──────────────┼───────────────┼───────────┤
│":`Male`:`Person`"│["Male","Person"]│"height" │["Double"] │true │
├──────────────────┼─────────────────┼──────────────┼───────────────┼───────────┤
│":`Male`:`Person`"│["Male","Person"]│"parents" │["StringArray"]│true │
└──────────────────┴─────────────────┴──────────────┴───────────────┴───────────┘
I vote to add them to the schema export as well as to add the propertyTypes as rdfs:range specification. As an example:
<neo4j://graph.schema#height> a owl:DatatypeProperty;
rdfs:label "height" ;
rdfs:range xsd:double .
<neo4j://graph.schema#parents> a owl:DatatypeProperty;
rdfs:label "parents" ;
rdfs:range xsd:string .
A solution has to be found for propertyTypes that don't match a corresponding xsd type such as Date.
Furthermore, the node export (/rdf/<dbname>/describe/<id>) should use the respective xsd types.