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/
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
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)
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
is_a
_:Person
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
is_a
user_ID
_:Person
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
@ann
Ann Smith
is_a
name
_:Person
user_ID
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
user_ID
16. 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
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)
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)
{ name: Ann,
app_user_ID: @ann,
uri: ppl://ann }
:Person
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)
{ uri: ppl://dan}
{ name: Ann,
app_user_ID: @ann,
uri: ppl://ann }
:Person:Person
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 }
:Person:Person
21. 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
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
23. 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
27. #1 RDF vs Graph DBs. Apples to apples
#2 the semantics of semantics
#3 structured vs unstructured data
28. #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
29. #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/
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”
33. #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!!
34. #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
35. #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” ;-)
36. #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”
37. ● 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...