Reading — step 1 of 5
Read
~1 min readGraph Models
RDF Triple Stores
RDF (Resource Description Framework) represents everything as triples:
(subject, predicate, object)
(:alice, :name, "Alice")
(:alice, :knows, :bob)
(:alice, :worksAt, :acme)
URIs identify resources; literals are strings/numbers/booleans.
Knowledge graphs: hundreds of billions of triples.
Query language: SPARQL:
SELECT ?friend
WHERE {
:alice :knows ?friend .
?friend :age ?age .
FILTER (?age > 25)
}
Compared to property graph:
- Triples are atomic; no edge properties (need reification).
- Standardized via W3C.
- Used by linked data (Wikidata, DBpedia, science ontologies).
- More verbose for app development; better for interop + semantics.
Storage:
- Triple table: (s, p, o, context).
- Indexes: SPO, POS, OSP at minimum (different access patterns).
- Compression: dictionary-encode URIs (most repeat).
Reification (adding metadata to triples):
:alice :knows :bob
+
:s1 :rdfType :Statement
:s1 :subject :alice
:s1 :predicate :knows
:s1 :object :bob
:s1 :since 2010
Verbose. RDF-star (newer extension) makes this less painful.
Inferencing:
- Class hierarchies (Person is a Mammal).
- Transitive properties (A knows B, B knows C → A knows C? maybe not).
- OWL reasoners do entailment.
Property graph: app-developer friendly, fast, ad-hoc schemas. RDF: standardized, semantic, interoperable, slower.
Most modern apps pick property graph. Knowledge engineering tools pick RDF.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…