Typically people think of RDF as graph. But it is actually a subject of research on how to represent RDF as formal Graph.

I will show examples of RDFs and how they would be represented as formal graph if we do naive “transformation”.

See: A Comparative Study on Representing RDF as Graph and Hypergraph Data Model.

Directed graph

RDF

:a → ex:1 → :b
:c → ex:1 → :d

Graph

:a
ex:1
:b
:c
:d

Not quite what we want - we can’t distinguish that there is no connection between :a and :d.

Directed labeled graph

RDF

:a → ex:1 → :b
ex:1 → ex:2 → :d

Graph

ex:1
ex:2
:a
:b
ex:1
:d

Not quite what we want - we can’t use label as start (or end) of an edge.

Bipartite graph

See: Bipartite Graphs as Intermediate Model for RDF-star, Inductive Triple Graphs: A purely functional approach to represent RDF

RDF

:a → ex:1 → :b
ex:1 → ex:2 → :d

Graph

s
p
o
s
p
o
e1
e2
:a
:b
:d
ex:1
ex:2

Some observations:

  • it is bipartite graph
  • but also directed labeled graph with only three labels:
    • s - subject
    • p - predicate
    • o - object
  • It is also visually reminds standard RDF reification
  • but it looks nothing like what original RDF “graph”

Directed hypergraph

See: Directed hyper-graphs for RDF documents

To be precise it is 3-unifor F-hypergraph with additionally defined function(s), which tells which node is subject, object and tail (on the graph I use edge labels to denote this, but this is for visual purposes only, this is no labeled graph)

RDF:

:a → ex:1 → :b
ex:1 → ex:2 → :d

Graph:

s
o
p
s
o
p
:a
:b
ex:1
:d
ex:2

as bipartite graph

s
o
p
s
o
p
e1
e2
:a
:b
:d
ex:1
ex:2

The Labeled Directed Multigraph with Triple Nodes (LDM-3N)

See: A Formal Graph Model for RDF and Its Implementation

RDF:

:a → ex:1 → :b
ex:1 → ex:2 → :d
e1(I)
e1(T)
e2(I)
e2(T)
:a
ex:1
:b
ex:2
:d

RDF triple is splitted into two labeled edges - they get same unique suffix and one of two suffixes: I stands for initial, T stands for terminal.