betaFeedback

WorksComputer Science

Translating RDF 1.2 Graphs to Property Graphs

Abstract

RDF 1.2 introduces statement-level constructs, such as triple terms, reifiers, and descriptions, that pose new challenges for transforming RDF data into labeled property graphs (LPGs). This work presents and compares three algorithms for translating RDF 1.2 data into LPGs, each interpreting a different amount of the RDF 1.2 reification vocabulary. Algorithm Structural interprets no vocabulary and losslessly supports arbitrary RDF 1.2 graphs by representing triple terms explicitly as nodes; Direct interprets rdf:reifies to recover annotated edges while preserving reifiers as graph objects; and Fold additionally folds reifier descriptions into edge properties, resulting in a more concise, albeit lossy, LPG representation. We define the three translations, analyze which class of RDF 1.2 graphs each preserves, and experimentally evaluate their implementations. The experiments confirm the predicted trade-offs: all variants scale linearly on the tested workloads, the generality of Structural has no runtime penalty, and folding descriptions into edge records can significantly reduce the number of edges on description-heavy data.

Introduction

Graph-structured data has become an increasingly important means of representing and integrating complex information across a wide range of application domains. As graph-based applications continue to grow in scale and complexity, so does the need to exchange data between different graph data management systems and data models.

RDF and labeled property graphs (LPGs) are the two predominant models for graph-structured data. Although both represent information as nodes connected by edges, they differ in how they model relationships and their associated metadata. In many applications, edges/relationships carry additional metadata, such as provenance, confidence scores, timestamps, or sources. LPGs support this natively, since edges may themselves have properties. RDF, by contrast, has no native mechanism for attaching metadata directly to a triple, motivating a long line of work on statement-level metadata, most prominently RDF-star [1].

RDF 1.2, now at Candidate Recommendation status [2], standardizes a new mechanism for capturing such meta. Its central construct is the triple term, an RDF triple used as a term in the object position of another triple. Metadata is attached through a reifier, a resource linked to a triple term by the dedicated predicate rdf:reifies. Interoperability with property graphs was an explicit motivation for the W3C RDF & SPARQL Working Group chartered to standardize RDF-star [3]. At first sight, the correspondence appears straightforward: the edge-with-properties construct that LPGs provide natively has a natural counterpart in RDF through the combined use of reifiers and triple terms.

The correspondence is nonetheless less direct than it first appears, as RDF 1.2 permits configurations that an LPG cannot represent. A triple term may be the object of any predicate, not only rdf:reifies; it may contain another triple term, nesting to arbitrary depth; and the triple it represents need not itself be asserted, that is, included as a statement in the RDF graph. An LPG edge is more rigid: it cannot be the endpoint of another edge, and it cannot be nested. The apparent correspondence between an annotated triple and an edge with properties is therefore a modeling pattern that RDF 1.2 data may follow, not one guaranteed by the data model. Translating RDF 1.2 into LPGs consequently requires deciding how to handle graphs that depart from this pattern.

Figure 1 illustrates three challenges that arise from this mismatch.

:sun :madeOf :plasma ~ :r2 .

:r1 rdf:reifies <<( :sun :madeOf :popcorn )>> ;
    :statedBy :alice ;
    :certainty 0.8 .

:r3 rdf:reifies <<( :sun :madeOf :popcorn )>> ;
    :statedBy :bob .

Figure 1. An RDF 1.2 graph in Turtle. The first statement is asserted and carries the reifier :r2; the proposition that the sun is made of popcorn is not asserted, and is reified twice.

Referenceability. The triple :r1 :statedBy :alice states that :sun :madeOf :popcorn was stated by Alice. Ideally, this annotation should be stored in an edge’s record. However, record entries are plain values, whereas :alice denotes a graph object in its own right (and might be an endpoint of other edges). Descriptions thus relate statements to graph objects, while edge properties hold values; a translation must bridge this gap, for instance by references from records to nodes.

Assertedness. The first statement of Figure 1 is written with ~ :r2, a shorthand that both asserts the triple (i.e., it also includes it as a statement of the graph) and reifies it. In contrast, rdf:reifies alone simply refers to a triple term without asserting it: the triple reified by :r1 and :r3 is not asserted. Whether a triple term is asserted is thus independent of its reification. An LPG edge has no such freedom; it is simply present. So, a translation must resolve the distinction one way or another: record assertedness explicitly, encode it structurally, or discard it.

Multiplicity. Both :r1 and :r3 reify the same triple term. More generally, RDF 1.2 allows several reifiers to relate to the same triple term, and a single reifier to relate to several triple terms. The correspondence between reifiers and triple terms is many-to-many. Then, interpreting every reifier as a distinct LPG edge is a modeling assumption rather than a consequence of the RDF 1.2 data model.

These challenges expose a central design choice: how much of the RDF 1.2 reification vocabulary should a translation interpret? At one extreme, a translation interprets none of it and represents every triple term as a node: the complete graph is preserved, but the LPG serves as a generic container in which no annotation is ever stored as an edge property. At the other extreme, a translation interprets rdf:reifies and folds annotations into edge records, where an LPG natively keeps them, but at the price of restricting the inputs and discarding information that does not fit.

We investigate this design space through three translations. Structural interprets no vocabulary and losslessly supports arbitrary RDF 1.2 graphs by representing triple terms explicitly. Direct interprets rdf:reifies, representing each reified triple as an edge while preserving reifiers as graph objects. Fold additionally folds reifier descriptions into edge records (which is the native LPG representation of annotated statements) at the cost of reifier identity. We formally define the translations, analyze their trade-offs, and evaluate them experimentally.

Translation between RDF and property graphs has been studied extensively in both directions. Angles et al. [4] define three direct RDF-to-property-graph mappings, two of which preserve both information and semantics, while Rabbani et al. [5] additionally exploit SHACL and PG-Schema during translation. Hartig [6] formalizes the property graph model and defines transformations in both directions; for the opposite direction specifically, Das et al. [7] represent property graphs as RDF in Oracle, including a reification-based encoding. Closest to our setting, Abuoda et al. [8] analyze transformations from RDF-star to property graphs and identify the cases in which existing approaches fail. Our work differs in targeting RDF 1.2. Previous approaches consider RDF 1.1 or RDF-star, where quoted triples correspond more directly to annotated LPG edges. RDF 1.2 replaces that design with reifiers, restricts triple terms to object position, and gives rdf:reifies a generic interpretation.

The remainder of this paper is organized as follows. Section 2 introduces the required notation. Section 3 presents the translation approaches, each illustrated using the running example of Figure 1. Section 4 evaluates the approaches, and Section 5 concludes this paper with an outlook to future work.

Preliminaries

We briefly recall the two data models involved: RDF 1.2 graphs and labeled property graphs.

RDF 1.2 Graphs Let IRIs, Blanks, and Literals be mutually disjoint, countably infinite sets of IRIs, blank nodes, and literals; these are the basic RDF terms. To account for RDF 1.2’s nested triples, the set of RDF terms Terms and the set of RDF triples Triples are defined by mutual recursion. An RDF triple (s,p,o)(s,p,o) has a subject s∈IRIs∪Blankss \in\mathrm{IRIs} \cup\mathrm{Blanks}, a predicate p∈IRIsp \in\mathrm{IRIs}, and an object o∈Termso \in\mathrm{Terms}; that is, Triples⊆(IRIs∪Blanks)×IRIs×Terms\mathrm{Triples} \subseteq(\mathrm{IRIs} \cup\mathrm{Blanks}) \times\mathrm{IRIs} \times\mathrm{Terms}. An RDF term is an IRI, a blank node, a literal, or a triple: Terms=IRIs∪Blanks∪Literals∪Triples\mathrm{Terms} = \mathrm{IRIs} \cup\mathrm{Blanks} \cup\mathrm{Literals} \cup\mathrm{Triples}. An RDF graph GG is a finite set of RDF triples, G⊆TriplesG \subseteq\mathrm{Triples}. A triple that is an element of GG is said to be asserted in GG, sometimes also called a top-level triple.

Triple Terms and Reification An RDF triple that occurs as the object of another triple is called a triple term. The same triple may occur as an asserted triple, as a (nested) triple term, or both; the two are independent. Indeed, a nested triple need not be asserted. RDF 1.2 uses the IRI reifies ∈IRIs\in\mathrm{IRIs}1 in the predicate of so-called reifying triples. A reifying triple is a triple (r,reifies,τ)(r,\mathrm{reifies},\tau) whose object τ\tau is a triple term and whose subject rr is called the reifier of τ\tau [2]. Reifier rr is used in further triples that describe τ\tau. We call a triple (r,p,o)(r,p,o) with p≠reifiesp \ne\mathrm{reifies}, whose subject rr is a reifier of τ\tau, a description triple of τ\tau.

Labeled Property Graphs Let Nodes and Edges be mutually disjoint, countably infinite sets representing Nodes and Edges, respectively. Let Keys be a countably infinite set of property keys, and let Values be a countably infinite set of property values. The set of all Labels is denoted by Labels, and the set of all Records (finite mappings from keys to values) is defined as Records={r:K→Values∣K⊆Keys}\mathrm{Records} = \{r : K \to\mathrm{Values} \mid K \subseteq\mathrm{Keys}\}. A labeled property graph GG is defined as a tuple G=(N,E,edg,lab,rec)G = (N,E,\mathrm{edg},\mathrm{lab},\mathrm{rec}) where:

  • N⊆NodesN \subseteq\mathrm{Nodes} is a finite set of nodes; E⊆EdgesE \subseteq\mathrm{Edges} is a finite set of edges such that N∩E=∅N \cap E = \varnothing;

  • edg:E→(N×N)\mathrm{edg}: E \to(N \times N) is a total function mapping each edge to an ordered pair of nodes, where for e∈Ee \in E with edg(e)=(u,v)\mathrm{edg}(e) = (u,v), we call uu the source and vv the target of ee;

  • lab:(N∪E)→2Labels\mathrm{lab}: (N \cup E) \to2^{\mathrm{Labels}} is a total function mapping nodes and edges to finite sets of labels (including the empty set);

  • rec:(N∪E)→Records\mathrm{rec}: (N \cup E) \to\mathrm{Records} is a total function mapping nodes and edges to records (their properties).

We say a node or edge oo carries a property key kk when kk is defined in rec(o)\mathrm{rec}(o), and that it carries k↦vk \mapsto v when additionally rec(o)(k)=v\mathrm{rec}(o)(k) = v.

Translating RDF 1.2 to LPGs

The three translations share the same principle: every basic RDF term occurring as a subject or object becomes a node (literals included, so a literal is represented once as a node shared by all triples mentioning it, rather than inlined as a value) and every triple becomes an edge, labeled by its predicate.

Throughout, blank nodes are Skolemized and treated as IRIs. The translations deviate from this only in their treatment of triple terms, reifiers, descriptions, and assertedness (cf. Table 1). Structural interprets no vocabulary. Direct and Fold interpret reifies, representing each reified triple as an edge: Direct keeps reifiers as nodes referenced from these edges, while Fold folds a reifier’s descriptions into the edge record itself, the native LPG representation of an annotated statement.

StructuralDirectFold
Input graphsall of RDF 1.2flat graphsstrict flat graphs
Triple termnode + content edgeedge per reifying tripleedge(s) per reifying triple
Reifierordinary nodeReifier nodeabsent
Descriptionsordinary edgesordinary edgesfolded into edge records
Assertednessabsence of inasserted keyasserted key
Losslessyesyes, on its classno: reifiers lost
Size (nodes + edges)largestintermediatesmallest

Table 1. Overview. Flat graphs: triple terms occur only as objects of reifies and are not nested; strict: additionally, reifiers occur only as subjects, each reifying a single triple term.

From RDF terms to LPG nodes. We reconcile the two data models with a single naming convention. Writing Strings for the set of all finite strings, we assume Strings ⊆\subseteq Nodes ∩\cap Values ∩\cap Labels, so that one string may serve as a node, as a property value, and as a label. Fix an injective function id⁡:Terms→Strings\operatorname{id} : \text{Terms} \to\text{Strings} that assigns every RDF term a distinct string identifier.2 Since Strings ⊆\subseteq Nodes, the identifier id⁡(t)\operatorname{id}(t) is itself a node, and we take it as the node representing the RDF term tt. Indeed, injectivity is what makes node identity sound: two occurrences of the same term yield the same node.

Our translations reference nodes from within edge records. However, concrete systems keep node identifiers internal and do not expose them as addressable values [9]. To keep the translations realizable, every node additionally carries its identifier as an ordinary property under the reserved key refId: the node of tt carries refId ↦id⁡(t)\mapsto\operatorname{id}(t), and edges never carry refId. A reference is then an equality between property values, in the manner of a foreign key: a referring key, carried on an edge, holds the refId of the node it denotes. Each variant has its own referring keys: in for Structural, reifiedBy for Direct, and, for Fold it is references.

Predicates, in contrast, become labels: the predicate pp of a triple becomes the label id⁡(p)∈Labels\operatorname{id}(p) \in\text{Labels} of its edge (an IRI occurring both as a predicate and as a subject or object thus results in both a label and a node). Finally, two helpers, shared by all algorithms, type and populate the node of a term tt. Kind : Terms →\to Labels returns IRI, Literal, or TripleTerm according to whether t∈IRIst \in\text{IRIs}, t∈Literalst \in\text{Literals}, or t∈Triplest \in\text{Triples}. Record : Terms →\to Records returns {refId↦id⁡(t)}\{\text{refId} \mapsto\operatorname{id}(t)\}, extended for literals with value and datatype (plus language or direction for language-tagged and directional strings).

Translation Structural

Structural interprets no RDF 1.2 vocabulary; in particular, it treats reifies as an ordinary predicate. Each triple term τ\tau is materialized as a node id⁡(τ)\operatorname{id}(\tau) labeled “TripleTerm”. Being a node, id⁡(τ)\operatorname{id}(\tau) can be pointed at by edges, so any triple whose object is τ\tau (e.g., a reifying triple (r, reifies, τ)(r,\ \textit{reifies},\ \tau) or otherwise) is just a plain edge into id⁡(τ)\operatorname{id}(\tau), with no special handling. Then, to represent the triple τ=(s,p,o)\tau=(s,p,o) itself, we emit it as an edge ee from ss to oo labeled pp. However, ee must be distinguished from an assertion and it must be tied back to id⁡(τ)\operatorname{id}(\tau). Since we cannot simply create an edge from ee to id⁡(τ)\operatorname{id}(\tau) itself (that would mean making ee an endpoint of another edge, which LPGs forbid), Structural uses the refId introduced above. The edge key in ∈Keys\in\text{Keys} is added to the record of ee which carries the reference to id⁡(τ)\operatorname{id}(\tau). Furthermore, an edge with in ↦id⁡(τ)\mapsto\operatorname{id}(\tau) as part of its record represents the triple term τ\tau, whereas an edge with no in key represents an asserted triple of GG. Assertedness is thus recorded structurally; one can verify assertedness by checking the presence of in.

Throughout this section we illustrate each translation on the running example of Figure 1. We build it up gradually: we begin with the small fragment that already exercises the essential case for Structural, then add the asserted triple, the second description, and the second reifier as they become relevant for Direct and Fold.

Example 1. We start from the smallest interesting fragment of Figure 1. Let τ1=(sun, madeOf, popcorn)\tau_1=(\textit{sun},\ \textit{madeOf},\ \textit{popcorn}) and GStructural={(r1, reifies, τ1),(r1, statedBy, alice)}G_{\text{Structural}}=\{(r_1,\ \textit{reifies},\ \tau_1),(r_1,\ \textit{statedBy},\ \textit{alice})\}. Here r1r_1 reifies τ1\tau_1, and the description (r1, statedBy, alice)(r_1,\ \textit{statedBy},\ \textit{alice}) records who stated it. Note that τ1\tau_1 is not asserted: it occurs only as a triple term, never as a top-level triple of GStructuralG_{\text{Structural}}. Structural creates five nodes: id⁡(sun)\operatorname{id}(\textit{sun}), id⁡(r1)\operatorname{id}(r_1), id⁡(alice)\operatorname{id}(\textit{alice}), and id⁡(popcorn)\operatorname{id}(\textit{popcorn}) labeled IRI, id⁡(τ1)\operatorname{id}(\tau_1) labeled TripleTerm, and three edges: two for the triples of GStructuralG_{\text{Structural}}, and one carrying in ↦id⁡(τ1)\mapsto\operatorname{id}(\tau_1) for the content of τ1\tau_1. Figure 2 shows the output Structural⁡(GStructural)\operatorname{Structural}(G_{\text{Structural}}).

Figure 2. The Structural encoding of Example 1. Solid arrows are LPG edges. The gray dashed arrow indicates the foreign key reference.

Algorithm 1 has a shared state consisting of the five LPG components and an additional set encoded across all procedure calls. The core procedure Emit turns one triple into one edge; its second argument records the context of that triple, either ⊥\bot (an asserted triple, top level) or the identifier of the enclosing triple term. When the object is itself a triple term τ\tau that has not yet been emitted, Emit recurses on τ\tau to emit its triple; deeper nesting is handled by the same recursion. The guard on line 12 emits each triple term exactly once, so a triple term with several reifiers keeps its distinct reifies edges (one per reifier) while sharing a single node with label ‘TripleTerm’ and a single copy of its triple.

Algorithm 1 Structural: interprets no vocabulary
Shared state: N, E, edg, lab, rec, encoded

1: procedure Structural(G)
2:     N ← ∅; E ← ∅; edg, lab, rec ← empty maps; encoded ← ∅
3:     for all (s, p, o) ∈ G do
4:         Emit((s, p, o), ⊥)                    ▷ ⊥: this is a graph triple
5:     return (N, E, edg, lab, rec)

6: procedure Emit((s, p, o), in)                  ▷ in ∈ Values ∪ {⊥}
7:     AddNode(s); AddNode(o)
8:     choose e ∈ Edges \ E; E ← E ∪ {e}
9:     edg(e) ← (id(s), id(o))
10:    lab(e) ← {id(p)}                           ▷ the predicate is the edge label
11:    rec(e) ← { ∅                 if in = ⊥
                 { {in ↦ in}         otherwise
12:    if o ∈ Triples and id(o) ∉ encoded then    ▷ triple term whose triple is not yet emitted
13:        encoded ← encoded ∪ {id(o)}
14:        Emit(o, id(o))                          ▷ emit its triple; nesting handled by o’s object

15: procedure AddNode(t)                           ▷ materialize t as a node
16:     if id(t) ∉ N then
17:         N ← N ∪ {id(t)}
18:         lab(id(t)) ← {Kind(t)}
19:         rec(id(t)) ← Record(t)

Translation Direct

Direct makes two assumptions about its input: (i) a triple term occurs only as the object of a reifies triple; (ii) triple terms are not nested. We call an RDF 1.2 graph satisfying both a flat (reification) graph. The assumptions are imposed by the structure of LPG edges: an edge cannot be the endpoint of another edge, nor can it contain one, so a triple term that is the object of an arbitrary predicate, or that nests another triple term, cannot be represented as an edge at all. In flat graphs, every triple term can be represented as an edge: it is an RDF term using basic RDF terms, occurring only in reifying triples. The excluded nesting structures are exactly those that Structural handles by turning triple terms into nodes; Direct targets flat reification graphs and leaves the rest to Structural.

Direct interprets reifies: where Structural keeps a reifying triple (r,reifies,τ)(r,\mathit{reifies},\tau) as an edge into a TripleTerm node, Direct represents the triple term τ=(s,p,o)\tau=(s,p,o) itself as an edge from ss to oo labeled pp, which we call a triple term edge. Such an edge is distinguished from an ordinary one by carrying reifiedBy↦id⁡(r)\mathit{reifiedBy}\mapsto\operatorname{id}(r), a foreign key to the node of its reifier rr (recall that id⁡(r)\operatorname{id}(r) carries refId\mathit{refId}). The reifier rr always becomes a node labeled Reifier, serving as the target of this foreign key.

Example 2. We extend GStructuralG_{\mathit{Structural}} of Example 1 with an asserted triple and its reifier. Let τ2=(sun,madeOf,plasma)\tau_2=(sun,\mathit{madeOf},plasma) and GDirect=GStructural∪{(sun,madeOf,plasma),(r2,reifies,τ2)}G_{\mathit{Direct}}=G_{\mathit{Structural}}\cup\{(sun,\mathit{madeOf},plasma),(r_2,\mathit{reifies},\tau_2)\}. In contrast to τ1\tau_1, the triple τ2\tau_2 is asserted: it occurs both as the triple term reified by r2r_2 and as a plain triple of GDirectG_{\mathit{Direct}}. Unlike Structural, Direct never turns a reifying triple into an edge of its own; each reifying triple instead becomes a single edge recording its reifier and its assertion status. Here this creates six nodes: id⁡(sun)\operatorname{id}(sun), id⁡(popcorn)\operatorname{id}(popcorn), id⁡(plasma)\operatorname{id}(plasma), and id⁡(alice)\operatorname{id}(alice) labeled IRI, and id⁡(r1)\operatorname{id}(r_1), id⁡(r2)\operatorname{id}(r_2) labeled Reifier; and three edges: the edge for τ1\tau_1 with asserted ↦false\mapsto false; the edge for τ2\tau_2, created for r2r_2 and then flipped to asserted ↦true\mapsto true by the plain triple (sun,madeOf,plasma)(sun,\mathit{madeOf},plasma); and the asserted edge (r1,statedBy,alice)(r_1,\mathit{statedBy},alice) for the description. Each of the first two edges references its reifier node, r1r_1 and r2r_2 respectively. Figure 3 shows the output Direct(GDirect)\mathit{Direct}(G_{\mathit{Direct}}).

Figure 3. The Direct encoding of Example 2.

When a triple term edge is created, it is not yet known whether it is asserted, since the triple τ\tau may also occur as a plain triple of GG. Algorithm 2 therefore proceeds in two passes. Pass 1 creates, for each reifying triple, one triple term edge carrying asserted ↦false\mapsto false, and records it in the map ttEdgesttEdges. Pass 2 considers each top-level triple (s,p,o)(s,p,o). If ttEdgesttEdges already holds edges for (s,p,o)(s,p,o), then that triple is asserted after all and every such edge is flipped to asserted ↦true\mapsto true; otherwise (s,p,o)(s,p,o) is an ordinary triple and becomes a new edge carrying asserted ↦true\mapsto true. RDF 1.2 treats the occurrence of a triple as a triple term or top-level triple independently. Representing both occurrences using a single LPG edge carrying the asserted property is therefore a design choice of the translation.

Translation Fold

Fold considers flat reification graphs (cf. § 3.2) satisfying two further assumptions: reifiers occur in subject position only, and each reifier reifies a single triple term (several reifiers per triple term remain allowed); we call such graphs strict flat (reification) graphs. Without the latter assumption, Pass 1 below would fold a reifier’s description onto every triple term it reifies. Like Direct, Fold interprets reifies and represents a reified triple τ=(s,p,o)\tau=(s,p,o) as a triple term edge from ss to oo. It differs in what it does with the reifier. While Direct turns a reifier into a node, Fold never makes a reifier a node. Instead, descriptions for τ\tau (i.e., triples where the subject is a reifier cf. § 2) are stored in the record of the triple term edges. We call the process of storing descriptions in edge records “folding.” A reifier therefore is not a node of its own, and descriptions are folded into the triple term edge for τ\tau.

Two folding strategies are offered. Fixed folding uses two reserved keys: refProperty for the description predicate, and references for a foreign key to the description object. As these keys are fixed, one edge holds a single description, so a reifier with several descriptions requires one edge per description. Open folding instead uses each description predicate itself as a property key, with the object’s foreign key as

Algorithm 2 Direct: reifies-interpreting translation

Shared state: NN, EE, edg, lab, rec

  1. procedure Direct(GG)

  2. N←∅N \leftarrow\emptyset; E←∅E \leftarrow\emptyset; edg, lab, rec ←\leftarrow empty maps

  3. ttEdges←ttEdges \leftarrow empty map ▷ maps triples to triple term edges

Pass 1: each reifying triple creates one triple term edge

  1. for all (r,reifies,τ)∈G(r, \mathrm{reifies}, \tau) \in G with τ∈Triples\tau\in\mathrm{Triples} do

  2. &nbsp;&nbsp;&nbsp;&nbsp;AddReifier(r)(r)

  3. &nbsp;&nbsp;&nbsp;&nbsp;e←e \leftarrow CreateEdge(τ,{asserted↦false,reifiedBy↦id(r)})(\tau, \{\mathrm{asserted} \mapsto\mathrm{false}, \mathrm{reifiedBy} \mapsto\mathrm{id}(r)\})

  4. &nbsp;&nbsp;&nbsp;&nbsp;ttEdges(τ)←ttEdges(τ)∪{e}ttEdges(\tau) \leftarrow ttEdges(\tau) \cup\{e\}

Pass 2: plain triples assert triple term edges or create new edges

  1. for all (s,p,o)∈G(s,p,o) \in G with o∉Tripleso \notin\mathrm{Triples} do

  2. &nbsp;&nbsp;&nbsp;&nbsp;if ttEdges(s,p,o)≠∅ttEdges(s,p,o) \ne\emptyset then ▷ (s,p,o)(s,p,o) is a triple term edge

  3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for all e∈ttEdges(s,p,o)e \in ttEdges(s,p,o) do

  4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rec(e)(asserted)←truerec(e)(\mathrm{asserted}) \leftarrow\mathrm{true} ▷ triple term edge asserted iff its triple is in GG

  5. &nbsp;&nbsp;&nbsp;&nbsp;else

  6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CreateEdge((s,p,o),{asserted↦true})((s,p,o), \{\mathrm{asserted} \mapsto\mathrm{true}\})

  7. return (N,E,edg,lab,rec)(N,E,\mathrm{edg},\mathrm{lab},\mathrm{rec})

  1. procedure CreateEdge((s,p,o),rec)((s,p,o),rec) ▷ one edge carrying record recrec

  2. &nbsp;&nbsp;&nbsp;&nbsp;AddNode(s)(s); AddNode(o)(o) ▷ AddNode as in Algorithm 1

  3. &nbsp;&nbsp;&nbsp;&nbsp;choose e∈Edges∖Ee \in\mathrm{Edges} \setminus E; E←E∪{e}E \leftarrow E \cup\{e\}

  4. &nbsp;&nbsp;&nbsp;&nbsp;edg(e)←(id(s),id(o))\mathrm{edg}(e) \leftarrow(\mathrm{id}(s),\mathrm{id}(o)); lab(e)←{id(p)}\mathrm{lab}(e) \leftarrow\{\mathrm{id}(p)\}

  5. &nbsp;&nbsp;&nbsp;&nbsp;rec(e)←rec\mathrm{rec}(e) \leftarrow rec

  6. &nbsp;&nbsp;&nbsp;&nbsp;return ee

  1. procedure AddReifier(r)(r) ▷ materialize a reifier as a node

  2. &nbsp;&nbsp;&nbsp;&nbsp;if id(r)∉N\mathrm{id}(r) \notin N then

  3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;N←N∪{id(r)}N \leftarrow N \cup\{\mathrm{id}(r)\}

  4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lab(id(r))←{Reifier}\mathrm{lab}(\mathrm{id}(r)) \leftarrow\{\mathrm{Reifier}\}

  5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rec(id(r))←Record(r)\mathrm{rec}(\mathrm{id}(r)) \leftarrow\mathrm{Record}(r) ▷ carries refId ↦id(r)\mapsto\mathrm{id}(r)

its record value, so that all descriptions of a reifier fit in a single triple term edge. This is more concise, but requires two restrictions: predicate identifiers must serve as property keys (Strings ⊆\subseteq Keys), so the record has no predetermined key set; and since a record maps each key to one value, no two descriptions of the same reifier may share a predicate.4 In both strategies the description object is represented as a node, addressable through the foreign key in the triple term edge.

Example 3. We extend GDirectG_{\mathrm{Direct}} of Example 2 with the second description of r1r_1 and a second reifier r3r_3 of τ1\tau_1, completing the graph of Figure 1: GFold=GDirect∪{(r1,certainty,0.8),(r3,reifies,τ1),(r3,statedBy,bob)}G_{\mathrm{Fold}} = G_{\mathrm{Direct}} \cup\{(r_1,\mathrm{certainty},0.8),(r_3,\mathrm{reifies},\tau_1),(r_3,\mathrm{statedBy},\mathrm{bob})\}. Figure 4 shows Fold(GFold)\mathrm{Fold}(G_{\mathrm{Fold}}) under open folding. None of the three description triples becomes an edge, and no reifier becomes a node: their content is folded in Pass 1, and Pass 2 skips triples mentioning reifiers—the essential difference from Direct, where (r1,statedBy,alice)(r_1,\mathrm{statedBy},\mathrm{alice}) was an edge of its own. The six nodes are the five IRIs and a Literal node for 0.8: every description object is materialized so that the foreign keys in the folded records can reach it.

Figure 4. The FOLD encoding of Example 3 with open folding.

Under open folding, each reifying triple contributes one triple term edge. The two reifiers of τ1\tau_1 thus yield two parallel madeOf\mathrm{madeOf} edges from id(sun)\mathrm{id}(\mathrm{sun}) to id(popcorn)\mathrm{id}(\mathrm{popcorn}), distinguished only by their folded records—which retain the descriptions (alice, bob, 0.8) but no trace of r1r_1 or r3r_3 themselves. Both keep asserted ↦false\mapsto\mathrm{false}, as τ1\tau_1 is never asserted; the edge for τ2\tau_2, created for the description-free r2r_2, is flipped to true by Pass 2 as in Example 2. Under fixed folding, the two descriptions of r1r_1 would instead occupy one edge each (via refProperty/references), giving four triple term edges rather than three.

Algorithm 3 also defines two passes. Pass 1 folds the descriptions of each reifier onto triple term edges for τ\tau, all initially carrying asserted ↦\mapsto false: fixed folding creates one such edge per description, whereas open folding creates a single edge carrying every description. A reifier with no description creates one triple term edge carrying only asserted ↦\mapsto false. Pass 2 then visits every top-level triple whose subject and object are not reifiers. If it corresponds to a triple term edge, assertedness is flipped to asserted ↦\mapsto true; otherwise it becomes a regular (asserted) edge. A triple that mentions a reifier is skipped. Because a reifier is never a node, its descriptions were already folded in Pass 1.

Trade-offs

Table 1 summarizes the trade-off between completeness (i.e., which graphs a translation accepts, and what it preserves) and how closely its output realizes LPGs’ native edge-with-properties construct. Call a translation lossless on a class of RDF graphs if the input can be reconstructed exactly from the output LPG; as node identifiers can be read back to RDF terms, this hinges only on the four rows of Table 1, that is, how triple terms, reifiers, descriptions, and assertedness are encoded. STRUCTURAL is lossless on every RDF 1.2 graph: an edge without in is an asserted triple, and a TripleTerm node’s triple is recovered, recursively, through its in edge. DIRECT is lossless on flat reification graphs, the class delimited by its two assumptions: each edge carrying reifiedBy decodes to its reifying triple, plus the plain triple iff asserted is true, and every other edge (descriptions included) decodes directly to its triple. FOLD is lossy even on strict flat reification graphs, precisely at the reifiers: renaming r1r_1 in Figure 1 gives us the same LPG (the output in Example 3 carries no trace of r1r_1 or r3r_3), and a bare reifier of an asserted triple leaves no trace at all. Beyond these two effects nothing is lost under open folding; fixed folding additionally forgets which descriptions share a reifier, in exchange for its fixed record schema, where open folding’s keys are data-dependent (§ 3.3). Size in Table 1 counts the elements (nodes and edges) of the output on inputs all variants accept.

Experimental Evaluation

We implemented all three translation algorithms of Section 3; for FOLD, fixed and open folding are measured separately. The evaluation has two goals: (1) to demonstrate empirically that each variant converts RDF 1.2 data into labeled property graphs on its intended class of inputs, and (2) to test how the trade-offs predicted in § 3.4 materialize in practice. We measure conversion time, the converter’s memory usage (peak Resident Set Size (RSS)), and the size of the generated output.

For brevity, we omit methodological details (hardware and software configuration, repetitions per configuration, etc.); all reported numbers are averages over repeated runs. An extended version of

Algorithm 3 FOLD: reifies-interpreting translation with folded descriptions
Shared state: 𝑁, 𝐸, edg, lab, rec;    parameter form ∈ {fixed, open}

1: procedure FOLD(𝐺)
2:     𝑁 ← ∅; 𝐸 ← ∅; edg, lab, rec ← empty maps
3:     reifiers ← { 𝑟 | (𝑟, reifies, 𝜏) ∈ 𝐺, 𝜏 ∈ Triples }
4:     ttEdges ← empty map                                      ▷ maps triples to triple term edges

Pass 1: fold each reifier’s descriptions onto triple term edges
5:     for all (𝑟, reifies, 𝜏) ∈ 𝐺 with 𝜏 ∈ Triples do
6:         descriptions ← { (𝑟, 𝑞, 𝑣) ∈ 𝐺 | 𝑞 ≠ reifies }
7:         for all (𝑟, 𝑞, 𝑣) ∈ descriptions do
8:             AddNode(𝑣)                                      ▷ description object becomes a node
9:             for all rec ∈ CreateRecords(descriptions) do
10:                𝑒 ← CreateEdge(𝜏, rec)
11:                ttEdges(𝜏) ← ttEdges(𝜏) ∪ {𝑒}

Pass 2: plain triples that mention no reifier
12:    for all (𝑠, 𝑝, 𝑜) ∈ 𝐺 with 𝑜 ∉ Triples and 𝑠, 𝑜 ∉ reifiers do
13:        if ttEdges(𝑠, 𝑝, 𝑜) ≠ ∅ then
14:            for all 𝑒 ∈ ttEdges(𝑠, 𝑝, 𝑜) do
15:                rec(𝑒)(asserted) ← true
16:        else
17:            CreateEdge((𝑠, 𝑝, 𝑜), {asserted ↦ true})
18:    return (𝑁, 𝐸, edg, lab, rec)

19: procedure CreateRecords(descriptions)                         ▷ set of edge records for a reifier’s descriptions, per form
20:     if form = open then                                      ▷ all descriptions on one record
21:         rec ← {asserted ↦ false}
22:         for all (𝑟, 𝑞, 𝑣) ∈ descriptions do
23:             rec(ID(𝑞)) ← ID(𝑣)                               ▷ predicate is the key
24:         return { rec }
25:     if descriptions = ∅ then
26:         return { {asserted ↦ false} }                        ▷ fixed, bare reifier
27:     return { {asserted ↦ false, refProperty ↦ ID(𝑞), references ↦ ID(𝑣)} | (𝑟, 𝑞, 𝑣) ∈ descriptions } ▷ fixed, one record per description

this section, the raw results of every measurement, and reproduction instructions are available in the accompanying repository5.

Datasets Our main workload consists of samples of the RDF-star representation of the Biomedical Knowledge Repository (BKR) published with the REF benchmark [10] and used by StarBench [11]; we evaluate conversion only, not query execution. In BKR, each embedded triple is a biomedical proposition annotated with provenance values: the sources from which the proposition derives. As the source uses the earlier RDF-star syntax, in which an embedded triple may occupy subject position, each record <<s p o>> q v1, ..., vk is rewritten with a fresh, deterministically named blank-node reifier rr as r rdf:reifies <<(s p o)>> and r q v1, ..., vk. This retains the embedded triple’s terms, its non-asserted status, and its provenance values, but changes the graph structure and query patterns.

We sampled five target sizes, from 0.5 MB to 2.5 MB in 0.5 MB increments (Table 2). The samples are deterministic but not nested prefixes of one another, so their composition varies with size. After migration, every provenance value becomes a description of its proposition’s reifier, so the samples exhibit a high description count of 57 to 177 descriptions per reifier; we call such workloads description-heavy.

Target sizeReifiersDescriptionsDescr./reifierTurtle bytesGraph triples
0.5 MB1548,83557.4499,9328,989
1 MB13418,554138.5999,91718,688
1.5 MB15928,042176.41,499,69428,201
2 MB21137,402177.31,999,85137,613
2.5 MB28646,639163.12,499,75646,925

Table 2. Samples derived from the BKR/REF RDF-star data and migrated to RDF 1.2.

We additionally ran the implementations on a synthetic dataset covering many RDF 1.2 features, generated by a publicly available tool6. It includes standalone and nested triple terms, which fall outside the input restrictions of DIRECT and FOLD (§ 3); their implementations skip such triples unless the predicate is rdf:reifies. Successful conversion of this workload therefore demonstrates operational robustness, not information preservation outside the stated domains. Details on these additional experiments can be found in the repository.

Output formats Each conversion outputs YARS-PG syntax [12] or a Neo4j loading script in Cypher, either monolithic (the entire graph in one transaction) or batched (1,000 rows per transaction, with a loader-specific indexed identifier that is not part of the conceptual translations). Every combination of translation, folding form, output format, and input size was executed.

Results All runs completed without errors. Figure 5 shows conversion time, peak RSS, and output size on the BKR workload. Four observations stand out.

Conversion time, peak RSS, and output size for the BKR dataset

Figure 5. Conversion time, peak RSS, and output size for the BKR dataset; fixed and open folding are shown separately.

First, all measurements grow approximately linearly, and monolithic conversion time is nearly identical across the algorithms (1.02–1.15 s at 2.5 MB): the generality of STRUCTURAL has no discernible runtime penalty.

Second, the choice of output format matters more than the choice of translation. The batched scripts are designed for memory-constrained loading, and generating is a speed vs. memory trade-off: the converter tracks already-created nodes on disk rather than in memory, which for DIRECT and STRUCTURAL slows generation (4.5 s and 3.5 s at 2.5 MB, versus roughly one second in monolithic mode) and enlarges the files, but more than halves their memory usage (≈50 MiB versus 124–134 MiB). The FOLD implementation does less of this bookkeeping, so its batched generation stays fast (1.2–1.3 s), with correspondingly smaller memory savings.

Third, the folding strategy dominates output size on this description-heavy workload. DIRECT, STRUCTURAL, and fixed folding all produce one edge per description, whereas open folding produces one triple term edge per reifier (at 2.5 MB, 286 edges in place of 46,639). Byte sizes (Table 3), however, do not simply follow these counts, since what each element records matters as much. Fixed folding, though smaller in nodes and edges than Direct and Structural, produces the largest files: every per-description edge repeats the reified triple’s source, target, and label, which at 57–177 descriptions per reifier outweighs the reifier nodes and description edges it saves. The same effect ranks Structural below Direct: Direct marks every edge with the asserted flag, which on tens of thousands of edges outweighs the few hundred extra nodes Structural creates. Open folding results by far in the smallest output, though its measured bytes should be interpreted with caution: BKR’s descriptions share one provenance predicate per reifier, and our prototype retains a single value per predicate key.7

DirectFold fixedFold openStructural
Cypher8.0111.463.357.15
YARS-PG7.5511.003.176.63

Table 3. Output size at the 2.5 MB input (monolithic loading, in MB).

Fourth, complementary measurements on the synthetic workload, reported in the repository, suggest that the batched scripts pay off downstream: in the one setting measured in both modes, loading the batched script into Neo4j took 6.97 s on average, compared with 345.16 s for the monolithic script, making it roughly 50 times faster.

In total, the experiments demonstrate the feasibility of all three translations and support the trade-offs discussed in § 3.4.

Conclusion

We studied the translation of RDF 1.2 graphs into LPGs, focusing on the statement-level constructs that LPGs lack. Our three translations differ in how much of the reification vocabulary they interpret: Structural interprets none of it and is lossless on all of RDF 1.2; Direct interprets rdf:reifies and is lossless on flat reification graphs while retaining reifiers as nodes; and Fold folds descriptions into edge records, the native LPG representation of annotated statements, at the cost of reifier identity. Our experiments show that all three are practical and corroborate the predicted trade-offs: the generality of Structural carries no discernible runtime penalty, making it the safest general-purpose choice; open folding makes Fold the variant of choice for description-heavy data, producing one annotated edge per reifier where the other configurations produces one per description.

Several directions remain open. A natural next step is to complement structural losslessness with query losslessness: translating SPARQL 1.2 queries into GQL queries over the translated LPG and validating answer equivalence, thereby characterizing each translation by the queries it preserves rather than the graphs it reconstructs. On the representation side, literal-valued descriptions could be inlined as plain record values rather than materialized as referenceable nodes, improving both conciseness and performance. Finally, we plan to lift the translations from RDF graphs to RDF datasets with named-graph support, and to revisit aspects left out of scope here: entailment, native blank-node handling instead of Skolemization, and vendor-specific features of concrete graph database systems.

Acknowledgments

This publication is based upon work performed during a hackathon of COST Action CA23147 GOBLIN — Global Network on Large-Scale, Cross-domain and Multilingual Open Knowledge Graphs, supported by COST (European Cooperation in Science and Technology).

Declaration on Generative AI

During the preparation of this work, the authors used Claude Fable 5 for: Drafting content, Peer review simulation, Content enhancement, and Formatting assistance. The authors extensively reviewed and edited the content as needed and assume full responsibility for the content of the publication.

References

  1. [1]O. Hartig, Foundations of rdf* and sparql* (an alternative approach to statement-level metadata in RDF), in: AMW, volume 1912 of CEUR Workshop Proceedings, CEUR-WS.org, 2017.
  2. [2]G. Kellogg, O. Hartig, P.-A. Champin, A. Seaborne, RDF 1.2 Concepts and Abstract Data Model, Technical Report, W3C, 2026. URL: https://www.w3.org/TR/rdf12-concepts/.
  3. [3]A. Gschwend, O. Lassila, RDF & SPARQL Working Group Charter, Technical Report, W3C, 2025. URL: https://w3c.github.io/rdf-star-wg-charter/.
  4. [4]R. Angles, H. Thakkar, D. Tomaszuk, Mapping RDF databases to property graph databases, IEEE Access 8 (2020) 86091–86110.DOI
  5. [5]K. Rabbani, M. Lissandrini, A. Bonifati, K. Hose, Transforming RDF graphs to property graphs using standardized schemas, Proc. ACM Manag. Data 2 (2024) 242:1–242:25.
  6. [6]O. Hartig, Reconciliation of rdf* and property graphs, CoRR abs/1409.3288 (2014).arxiv.org/abs/1409.3288
  7. [7]S. Das, J. Srinivasan, M. Perry, E. I. Chong, J. Banerjee, A tale of two graphs: Property graphs as RDF in oracle, in: EDBT, OpenProceedings.org, 2014, pp. 762–773.DOI
  8. [8]G. Abuouda, D. Dell’Aglio, A. Keen, K. Hose, Transforming RDF-star to Property Graphs: A Preliminary Analysis of Transformation Approaches, in: QuWeDa@ISWC, volume 3279 of CEUR Workshop Proceedings, CEUR-WS.org, 2022, pp. 17–32.
  9. [9]ISO/IEC, Information Technology—Database Languages—GQL. International Standard ISO/IEC 39075:2024, International Organization for Standardization, Geneva, Switzerland, 2024. URL: https://www.iso.org/standard/76120.html.
  10. [10]F. Orlandi, D. Graux, D. O’Sullivan, Rdf reification benchmark (ref) using the biomedical knowledge repository (bkr), 2020. URL: https://doi.org/10.5281/zenodo.4148888.
  11. [11]G. Abouda, C. Aebeloe, D. Dell’Aglio, A. Keen, K. Hose, Starbench: Benchmarking rdf-star triplestores, in: # PLACEHOLDER_PARENT_METADATA_VALUE#, volume 3565, CEUR-WS. org, 2023, pp. 34–49.
  12. [12]D. Tomaszuk, R. Angles, L. Szeremeta, K. Litman, D. Cisterna, Serialization for property graphs, in: BDAS, volume 1018 of Communications in Computer and Information Science, Springer, 2019, pp. 57–69.DOI

Paper details

vlnc:W_z496vg8a
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude Fable 5 (bare)

View statement
Looking for related papers…
Contents