Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Debunking some
“RDF vs. Property Graph”
Alternative Facts
Dr. Jesús Barrasa
Neo Technology
Quick refresher on LPG & RDF
RDF Resource
Description
Framework
W3C recommendation model for
information exchange. Feb‘99
The Semantic Web
“RDF is a key tech for
developing the
Semantic Web”.
Article on SciAm in 2001
(1) https://www.scientifica...
Persisted RDF
Specialized RDF stores
(triple/quad stores)
Semantic Graph Databases
LPG
Sweden (2000 - 2007)
efficient (graph native) storage
fast query and traversal
humane model: close to the way we human...
A look at the models
GRAPH = VERTICES + EDGES
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
ppl://ann is a person
ppl//ann user ID is @ann
ppl://ann name is Ann Smith
ppl://dan likes ppl://ann
RDF statements (tripl...
There is a person that is described by her name: Ann, her user ID: @ann
and a globally unique identifier: <ppl://ann>
Ther...
There is a person that is described by her name: Ann, her user ID:
@ann and a globally unique identifier: <ppl://ann>
Ther...
There is a person that is described by her name: Ann, her user ID: @ann
and a globally unique identifier: <ppl://ann>
Ther...
There is a person that is described by her name: Ann, her user ID: @ann
and a globally unique identifier: <ppl://ann>
Ther...
There is a person that is described by her name: Ann, her user ID: @ann
and a globally unique identifier: <ppl://ann>
Ther...
RDF Graph
Vertices
Every statement produces two vertices in the graph.
Some are uniquely identified by URIs: Resources
Som...
RDF Graph
Vertices
Every statement produces two vertices in the graph.
Some are uniquely identified by URIs: Resources
Som...
The query languages
Query: Who likes a person named Ann?
Cypher
MATCH (who)-[:LIKES]->(a:Person)
WHERE a.name CONTAINS ‘Ann’
RETURN who
SPARQL...
End of refresher.
OK so far?
#1 RDF vs Graph DBs. Apples to apples
#2 the semantics of semantics
#3 structured vs unstructured data
#1 RDF vs Graph DBs. Apples to apples
What are we comparing? Is it models or is it stores?
“RDF vs Graph DBs…”
RDF Stores ...
#1 RDF vs Graph DBs. Apples to apples
Separating the model from the storage
○ RDF does not impose any particular type of d...
#1 Demo
#1 Demo
<RDF>
=
#2 The semantics of semantics
“suppose you entered the details ‘Philip owns a Mercedes’
where ‘Philip’ and ‘Mercedes’ are ...
#2 The semantics of semantics
“suppose you entered the details ‘Philip owns a Mercedes’
where ‘Philip’ and ‘Mercedes’ are ...
#2 The semantics of semantics
The semantics in RDF are JUST RULES (!)
These rules are called ontologies and are an optiona...
#2 The semantics of semantics
Yes, inference is expensive. When considering
it, you should:
1) run it over as small a data...
#3 Unstructured data likes RDF
● RDF is no less structured than the LPG
● Association between NLP/EE and RDF
“NLP is based...
● Consider both model and storage option separately
○ How do you want to represent and query your data?
○ How are you goin...
Thank you!
Debunking some “RDF vs. Property Graph” Alternative Facts
Upcoming SlideShare
Loading in …5
×

Debunking some “RDF vs. Property Graph” Alternative Facts

3,612 views

Published on

GraphConnect Europe 2017
Jesús Barrasa, Neo4j

Published in: Technology
  • Be the first to comment

Debunking some “RDF vs. Property Graph” Alternative Facts

  1. 1. Debunking some “RDF vs. Property Graph” Alternative Facts
  2. 2. Dr. Jesús Barrasa Neo Technology
  3. 3. Quick refresher on LPG & RDF
  4. 4. RDF Resource Description Framework W3C recommendation model for information exchange. Feb‘99
  5. 5. The Semantic Web “RDF is a key tech for developing the Semantic Web”. Article on SciAm in 2001 (1) https://www.scientificamerican.com/article/the-semantic-web/
  6. 6. Persisted RDF Specialized RDF stores (triple/quad stores) Semantic Graph Databases
  7. 7. LPG Sweden (2000 - 2007) efficient (graph native) storage fast query and traversal humane model: close to the way we humans understand and reason about the world
  8. 8. A look at the models
  9. 9. GRAPH = VERTICES + EDGES
  10. 10. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples)
  11. 11. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples) ppl://an n is_a _:Person
  12. 12. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples) ppl://an n @ann is_a user_ID _:Person
  13. 13. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples) ppl://an n @ann Ann Smith is_a name _:Person user_ID
  14. 14. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples) ppl://an n ppl://da n @ann Ann Smith is_a name _:Person likes user_ID
  15. 15. ppl://ann is a person ppl//ann user ID is @ann ppl://ann name is Ann Smith ppl://dan likes ppl://ann RDF statements (triples) ppl://an n ppl://da n @ann Ann Smith is_a name _:Person likes Vertices Edges user_ID
  16. 16. There is a person that is described by her name: Ann, her user ID: @ann and a globally unique identifier: <ppl://ann> There is another person with a unique identifier: <ppl://dan> Dan likes Ann LPG connected objects (with properties)
  17. 17. There is a person that is described by her name: Ann, her user ID: @ann and a globally unique identifier: <ppl://ann> There is another person with a unique identifier: <ppl://dan> Dan likes Ann LPG connected objects (with properties) { name: Ann, app_user_ID: @ann, uri: ppl://ann } :Person
  18. 18. There is a person that is described by her name: Ann, her user ID: @ann and a globally unique identifier: <ppl://ann> There is another person with a unique identifier: <ppl://dan> Dan likes Ann LPG connected objects (with properties) { uri: ppl://dan} { name: Ann, app_user_ID: @ann, uri: ppl://ann } :Person:Person
  19. 19. There is a person that is described by her name: Ann, her user ID: @ann and a globally unique identifier: <ppl://ann> There is another person with a unique identifier: <ppl://dan> Dan likes Ann LPG connected objects (with properties) LIKES { date: 02/03/17} { uri: ppl://dan} { name: Ann, app_user_ID: @ann, uri: ppl://ann } :Person:Person
  20. 20. There is a person that is described by her name: Ann, her user ID: @ann and a globally unique identifier: <ppl://ann> There is another person with a unique identifier: <ppl://dan> Dan likes Ann LPG connected objects (with properties) LIKES { date: 02/03/17} { uri: ppl://dan} { name: Ann, app_user_ID: @ann, uri: ppl://ann } Vertices Edges :Person:Person
  21. 21. RDF Graph Vertices Every statement produces two vertices in the graph. Some are uniquely identified by URIs: Resources Some are property values: Literals Edges Every statement produces an edge. Uniquely identified by URIs Vertices or Edges have NO internal structure
  22. 22. RDF Graph Vertices Every statement produces two vertices in the graph. Some are uniquely identified by URIs: Resources Some are property values: Literals Edges Every statement produces an edge. Uniquely identified by URIs Vertices or Edges have NO internal structure Property Graph Vertices Unique Id + set of key-value pairs Edges Unique Id + set of key-value pairs Vertices and Edges have internal structure
  23. 23. The query languages
  24. 24. Query: Who likes a person named Ann? Cypher MATCH (who)-[:LIKES]->(a:Person) WHERE a.name CONTAINS ‘Ann’ RETURN who SPARQL prefix ms: <http://myschma.me/> prefix rdf: <http://www[...]#> SELECT ?who { ?a rdf:type ms:Person . ?a ms:name ?asName . FILTER regex(?asName,’Ann’) ?who ms:likes ?a . }
  25. 25. End of refresher. OK so far?
  26. 26. #1 RDF vs Graph DBs. Apples to apples #2 the semantics of semantics #3 structured vs unstructured data
  27. 27. #1 RDF vs Graph DBs. Apples to apples What are we comparing? Is it models or is it stores? “RDF vs Graph DBs…” RDF Stores Native Graph DB (Neo4j) ❏ Very strongly index based (some graph DBs are also strongly index based!! Graph as a feature) ❏ RDFsed on mostly additive, typically slow changing if not immutable data sets ❏ Neo4j is Graph native ❏ Neo4j excels with highly dynamic datasets & transactional UC where data Integrity is key
  28. 28. #1 RDF vs Graph DBs. Apples to apples Separating the model from the storage ○ RDF does not impose any particular type of data storage ○ Micro-demo: A Turing test of RDFness(*) “RDF vs Graph DBs…” (*) https://jesusbarrasa.wordpress.com/2016/11/17/neo4j-is-your-rdf-store-part-1/
  29. 29. #1 Demo
  30. 30. #1 Demo <RDF> =
  31. 31. #2 The semantics of semantics “suppose you entered the details ‘Philip owns a Mercedes’ where ‘Philip’ and ‘Mercedes’ are both entities and ‘owns’ is a relationship. An inference engine can deduce that Mercedes in this instance is a car whereas in ‘Juan is married to Mercedes’ it would deduce that Mercedes is a person [...] contrast this with the inability of a database to understand anything it isn’t explicitly told then you should be able to see the potential advantages”
  32. 32. #2 The semantics of semantics “suppose you entered the details ‘Philip owns a Mercedes’ where ‘Philip’ and ‘Mercedes’ are both entities and ‘owns’ is a relationship. An inference engine can deduce that Mercedes in this instance is a car whereas in ‘Juan is married to Mercedes’ it would deduce that Mercedes is a person [...] contrast this with the inability of a database to understand anything it isn’t explicitly told then you should be able to see the potential advantages” WRONG!!
  33. 33. #2 The semantics of semantics The semantics in RDF are JUST RULES (!) These rules are called ontologies and are an optional layer on top of RDF data. Noone likes rules engines → horrible to debug / performance Reasoning with ontology languages quickly gets intractable/undecidable
  34. 34. #2 The semantics of semantics Yes, inference is expensive. When considering it, you should: 1) run it over as small a dataset as possible 2) use only the rules you need 3) consider alternatives to inference Wow! Thanks for the tip, vendor of “the world’s only Enterprise Triple Store” ;-)
  35. 35. #3 Unstructured data likes RDF ● RDF is no less structured than the LPG ● Association between NLP/EE and RDF “NLP is based on subjects, verbs and objects. There is a simple parallel between this and RDF” “RDF stores have the flexibility to accommodate unstructured data”
  36. 36. ● Consider both model and storage option separately ○ How do you want to represent and query your data? ○ How are you going to use your data? Analytical / operational ● What’s the nature of your data: Immutable, slow changing or dynamic and transactional? ● Do I need really need rule based inferencing? Please, try it! don’t make decisions based on “alternative facts” Takeaways: Before starting your graph project...
  37. 37. Thank you!

×