Property Graphs and RDF
2024-11-22
I have a dream for the Web [in which computers] become capable of analyzing all the data on the Web – the content, links, and transactions between people and computers.
– Tim Berners Lee
<Padmé> a <person> ; <gender> "female" .
<Anakin> a <person> ; <gender> "male" .
<Luke> a <person> ; <gender> "male" .
<R2D2> a <robot> .
<C3PO> a <robot> .
<Padmé> <owns> <R2D2> .
<Anakin> <owns> <R2D2> .
<Anakin> <child> <Luke> .
<Padmé> <child> <Luke> .
<Luke> <owns> <R2D2> .
<Luke> <owns> <C3PO> .
flowchart LR male([male]) female([female]) Padmé -- a --> person Anakin -- a --> person Luke -- a --> person R2D2 -- a --> robot C3PO -- a --> robot Padmé -- owns --> R2D2 Anakin -- owns --> R2D2 Luke -- owns --> R2D2 Luke -- owns --> C3PO Anakin -- child --> Luke Padmé -- child --> Luke Padmé -- gender --> female Luke -- gender --> male Anakin -- gender --> male
flowchart LR male([male]) female([female]) Padmé -- owns --> R2D2 Anakin -- owns --> R2D2 Luke -- owns --> R2D2 Luke -- owns --> C3PO Anakin -- child --> Luke Padmé -- child --> Luke Padmé -- gender --> female Luke -- gender --> male Anakin -- gender --> male
rdf:type
(= a
) instead of node labels<Padmé> <owns> <R2D2> {| <episode> 1 |} .
<Anakin> <owns> <R2D2> {| <episode> 2 |} .
<Anakin> <parent> <Luke> {| <episode> 3 |} .
<Padmé> <parent> <Luke> {| <episode> 3 |} .
<Luke> <owns> <R2D2> {| <episode> 4 |} .
SPARQL query
RDF | Property Graphen |
---|---|
nodes and edges | nodes, edges, properties |
standard (W3C), but… | standard (ISO), but… |
global IRIs | local references |
either schema-less… | either schema-less… |
…or shared ontologies | …or local schema |
optional inference and rules | strict schemas and custom rules |
SPARQL | Cypher |
↑ Performant & Scalable
↓ Flexible
But RDF also supports data integration!