-
Notifications
You must be signed in to change notification settings - Fork 0
Mapping Rules RDF2PG (RDF to Property Graph)
Subjects of triples are mapped to nodes in Neo4J or any . A node in Neo4J/PG representing an RDF resource will be labeled :Resource and have a property uri with the resource’s URI.
(S,P,O) => (:Resource {value:S,kind:uri})...
dbr:Mondeca rdf:type dbo:Agent ,
dbo:Organisation .
Mondeca subject would look like this
(:Resource {value:’dbr:Mondeca’,kind:’uri’})
Rule 2 : Predicates of triples are mapped to relationships in Neo4j if the object of the triple is a literal
(S,P,O) && isLiteral(O) => (:Resource {value:S,kind:uri})-[:P]->(:Resource {value:O,kind:literal})
dbr:Mondeca rdfs:label "Mondeca".
(:Resource {value:’dbr:Mondeca’,kind:’uri’})-[:
rdfs:label]->(:Resource {value:
Mondeca,kind:
literal} )
This rule is generic enough to handle multi valued properties, datatypes of literals, multilingual values in literals. Therefore, it is much easier to add in a given node the properties of Neo4J such as lang, type of a literal.
dbr:Mondeca rdfs:label "Mondeca"@fr ,
"Mondeca"@en.
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'rdfs:label'
]->(:Resource {value:'Mondeca',kind:'literal',lang:'fr'} )`
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'rdfs:label']->(:Resource {value:'Mondeca',kind:'literal',lang:'en'} )
dbr:Mondeca dbo:numberOfEmployees "21"^^xsd:nonNegativeInteger; dbo:foundingYear "2000"^^xsd:gYear
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'dbo:numberOfEmployees']->(:Resource {value:'21',kind:'literal',type:'xsd:nonNegativeInteger'} )
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'dbo:foundingYear']->(:Resource {value:'1999',kind:'literal',type:'xsd:gYear'} )
Rule 3 : Predicates of triples are mapped to relationships in Neo4j if the object of the triple is a resource
(S,P,O) && !isLiteral(O) => (:Resource {value:S,kind:uri})-[:P]->(:Resource {value:O,kind:’uri’})
dbr:Mondeca dbo:location dbr:Paris.
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'dbo:foundingYear']->(:Resource {value:'1999',kind:'literal',type:'xsd:gYear'} )
(:Resource {value:
dbr:Mondeca,kind:
uri})-[:
dbo:location]->(:Resource {value:
dbr:Paris,kind:
uri})
(:Resource {value:'dbr:Mondeca',kind:'uri'})-[:'dbo:numberOfEmployees']->(:Resource {value:'15',kind:'literal',type:'xsd:nonNegativeInteger'} )
ex:Person rdf:type owl:Class .
(:Resource {value:
ex:Mondeca,kind:
uri})-[:
rdf:type]->(:Resource {value:
owl:Class,kind:
uri})
by Mondeca Team - last update (05/03/2018)