graphlava

Article

Statement graphs: the one idea under graphlava

graphlava articles · 24 November 2026

RDF, RDF-star and property graphs can all be read as one kind of graph: a graph of statements, where every statement has an identity. graphlava is designed around that idea. This article explains the model and then the physical choices graphlava makes to store it.

The model in one paragraph

In 2023 Ewout Gelling, George Fletcher and Michael Schmidt described Statement Graphs, a single data model under RDF, RDF-star and labeled property graphs. The full version appeared at DASFAA 2024. A statement graph is a directed acyclic graph with two kinds of vertex. Leaves hold concrete values: IRIs, blank nodes, literals, labels, property names and values. Internal vertices are statements. Each statement vertex has exactly three outgoing edges, labeled subject, predicate and object. The subject and the object may point at another statement. The predicate may not, and no path may lead back to where it started.

The model gives no meaning to statements on its own. Meaning comes from images, subsets of statement graphs that encode one surface model each:

The model formalises Amazon's OneGraph (1G) idea, which we look at in a separate article. The paper is clear that it is a logical model. It says nothing about how a store should lay statements out on disk. graphlava (working name meta-core in the specs) is one answer to that question, tuned for agent memory.

Statement graph (logical) #42 #77 spos :alice :worksAt :acme p :confidenceo 0.9 a vertex plus three edges per statement graphlava (physical) stmt #42 → (:alice, :worksAt, :acme) props of #42 :confidence 0.9 (no ID yet) + SPO, POS, OSP entries for #42 one ID, one record, one property slot
The same two facts. On the left, each statement is a vertex. On the right, the statement is one record and the literal-valued annotation lives in its property record until something needs to point at it.

A statement is a 64-bit ID

In graphlava every term is one u64. The top bits are a kind tag: IRI, blank node, dictionary literal, statement, graph, hyperedge or inline literal. Joins, orderings and range scans work on these integers. Strings are decoded only at the final projection.

A statement is a subject, predicate and object with an ID of kind statement. Because that ID is an ordinary term, it can stand in subject or object position of another statement. That is the statement graph's "subject or object may point at a statement" rule, with no extra table. The predicate is always an IRI, as in the paper.

One rule goes further than the logical model. The spec says that updating the object of a statement keeps its ID (dm-update-in-place). The old (s, p, o) leaves every index and the new one appears in the same transaction. Annotations stay attached. In a pure statement graph, a statement is its three edges, so changing the object would make a different statement. graphlava treats the ID as the identity and the object as a value that can change. That suits agent memory, where "Alice works at Acme, confidence 0.9" becomes "Alice works at Globex" and the confidence and source should follow.

# in-place update: the same reifier on both sides keeps the ID
DELETE { << :alice :worksAt ?old ~ ?r >> }
INSERT { << :alice :worksAt :globex ~ ?r >> }
WHERE  { << :alice :worksAt ?old ~ ?r >> }

The reifier ?r in SPARQL 1.2 is the statement ID. Binding it costs nothing extra in a scan, and rdf:reifies is never stored. The spec recommends returning it to clients as an IRI of the form urn:meta-core:stmt:{id}; the exact form is still open.

A predicate can also be declared functional in the meta-model (ADR 0028): at most one object per subject. Then a plain INSERT DATA { :alice :worksAt :globex } updates the existing statement in place as well, and the planner can treat (s, p) as a key.

Sets by default, duplicates on request

The images disagree about duplicates. The RDF and RDF-star images forbid two statements with the same three targets. The OneGraph image allows them, because property graphs allow parallel edges. A store has to choose.

graphlava chooses per predicate (ADR 0004). By default a predicate allows at most one statement per (s, p, o). Inserting an existing triple returns the existing ID and changes nothing, unless it is inserted into another graph, which adds a membership (ADR 0024). That is RDF set semantics, and it keeps the ordering keys narrow: an entry is (a, b, c) → id, with the ID as a value. A predicate declared multi in the meta-model gets keys (a, b, c, id) and allows parallel statements, each with its own ID. So the RDF image is the default, and the OneGraph image is available for the predicates that need it.

The cost shows in Cypher, which arrives in v1: CREATE (a)-[:T]->(b) on a non-multi predicate binds the existing statement instead of making a second one. The spec lists this as a deviation from Cypher.

Properties without an ID, until they need one

In the LPG image, property statements cannot be referenced. You cannot say where a property value came from. graphlava keeps the ability to reference everything, but does not pay for it up front.

A statement whose object is a literal is an inline property. It lives in its subject's property record, not in the three orderings, so an overwrite touches one tree. To queries it is an ordinary statement. It has no statement ID yet. When something annotates it, or an API asks for its ID, it is promoted: it gets an ID, it is written to stmt and the orderings, and its slot in the property record becomes a pointer to the ID. Promotion is one-way.

# :name is an inline property; annotating it promotes it
INSERT DATA { :alice :name "Alice" {| :source :chat17 |} }

The same pattern repeats across the design. Four things are virtual until annotated:

Virtual itemStored asGets an ID when
Inline propertyslot in the subject's property recordit is annotated or its ID is requested
Hyperedge role (e, :agent, n)slot in the hyperedge record plus an incidence keythe role filling is annotated
Graph membership (x, :in, g)the chunk the ID came from, or a gmem entrythe membership is annotated (ADR 0017)
Derived facta rule's derived tablethe fact is annotated

Logically, all four are statements in the paper's sense: they have a subject, a predicate and an object. Physically, most of them never need an identity, so they do not get one. The statement graph is fully there for queries. The ID is materialised only where someone wants to say something about it.

Deleting follows the subject edges

A statement graph describes structure, not change. A store needs to say what a delete takes with it. graphlava's rule (ADR 0006): deleting a statement deletes, in the same transaction and transitively, every statement whose subject is its ID. An annotation has no meaning without the thing it annotates. IDs are never reused, so a stale reference can never land on a new statement.

Two escape hatches exist in SPARQL. DELETE KEEP ANNOTATIONS deletes only the statement and leaves its annotations reachable by their own IDs. A statement or node that fills a hyperedge role cannot be deleted silently: the delete fails unless the request says DELETE DETACH, which removes the whole hyperedge as well. A cascade is limited per transaction (100,000 items by default) and rolls back if it would go further.

Only the subject edge cascades. A statement that merely has a deleted statement as its object, such as (:note, :about, stmt#42), is not an annotation. What happens to it is still an open question in the specs.

Beyond the images: hyperedges

The paper's images cover triples, RDF-star and property graphs. They have no n-ary relation. In a statement graph you model a meeting with an agent, a target and a topic as a node with three role statements. graphlava keeps that logical view but stores it differently.

A hyperedge has a type declared in the meta-model, with named roles. It is one record, keyed by its ID, holding the type and the role fillers. An incidence index answers "which hyperedges does this node fill, in which role". Role fillers are not written to the SPO, POS and OSP orderings, so a k-role hyperedge write touches one record and k incidence keys instead of 3k ordering entries. A literal value such as the meeting's date is not a role: it is an inline property of the hyperedge (ADR 0028), so role fillers are always nodes. Queries still see role triples and properties alike:

SELECT ?a ?t ?w WHERE { ?e a :Meeting ; :agent ?a ; :target ?t ; :when ?w }

Those triples are produced from the record and the index, never stored. From v2 the planner is designed to turn such a star into one scan of the record. In v0 it runs as a join of virtual role relations.

Graphs: membership statements without the rows

In the RDF-star image, a membership statement (t, in, g) puts each triple in a graph. graphlava has the same triple, (x, :in, g), but it is virtual. Every statement and hyperedge gets its ID from a chunk of about a million IDs leased to one graph and one kind of item. The chunk number is part of the ID, so the home graph of an item is a function of its ID: primary membership costs zero bytes per item. Membership in other graphs is one gmem entry.

One statement can be in several graphs (ADR 0024). Inserting a triple that already exists into a second graph adds a membership and keeps the ID. Deleting it inside one GRAPH removes only that membership; the statement goes when its last membership goes. Facts that differ per episode, such as who said it in that session, are annotations on the membership << X :in g >>, which gets an ID when annotated.

Graphs are nodes and can nest. Nesting is a DAG: a graph may have several parents, and an :in edge that would close a cycle is rejected. GRAPH :g { … } matches g and every graph nested under it; GRAPH! :g { … } matches only direct members, which is standard SPARQL. The paper's images have flat named graphs only, so nesting is another place where graphlava extends the model.

What statement graphs give that graphlava does not (yet)

What graphlava adds is a set of physical decisions: one 64-bit ID per item with a kind tag, IDs that survive updates, sets by default and duplicates per predicate, identity only where it is used, deletes that follow subject edges, n-ary records, and nested graphs that cost nothing per member. The logical picture stays the statement graph.

References

  1. E. Gelling, G. Fletcher, M. Schmidt. Bridging graph data models: RDF, RDF-star, and property graphs as directed acyclic graphs [extended abstract]. arXiv:2304.13097, 2023.
  2. E. Gelling, G. Fletcher, M. Schmidt. Statement Graphs: Unifying the Graph Data Model Landscape. DASFAA 2024, LNCS, pp. 364–376.
  3. O. Lassila, M. Schmidt et al. The OneGraph Vision: Challenges of Breaking the Graph Model Lock-In. Semantic Web Journal 14(1), 2023.
  4. graphlava specifications: data model, hyperedges, named and nested graphs, SPARQL 1.2; decision records 0004, 0005, 0006 and 0017. github.com/Volland/graphlava.
  5. Tiramemsu. Statement graphs and tiramemsu: one idea, one row deep, 2026.
← All articles