Flexible RML-Based Mapping of Property Graphs to RDF Ali Elhalawati1 , Anastasia Dimou1 , Olaf Hartig2 and Daniel Hernández3 1 KU Leuven, Leuven, Belgium 2 Linköping University, Linköping, Sweden 3 University of Stuttgart, Stuttgart, Germany Abstract RDF graphs and (Labeled) Property Graphs (PGs) have emerged as data models for representing graph databases. Given the differences between the two models, ensuring interoperability between them has become essential, to leverage the strengths of both models. Various approaches have been proposed to map PGs to RDF graphs. However, these approaches differ in terms of structure, representation, size of the generated RDF graph, and degree of configuration provided to the user, making direct comparisons challenging. While declarative methods prevailed to construct RDF graphs from other data formats, the mapping languages proposed for such transformations have not been considered so far for mapping PGs to RDF graphs. In this work, we provide a representation of PG-to-RDF approaches through templates described using RML, a mapping language to construct RDF graphs from heterogeneous data. We show that all considered PG-to-RDF approaches can be represented in RML and, by having a uniform representation of them, we can compare them showcasing their differences. Finally, we show that not only can RML be used to capture PG-to-RDF mappings, but it actually offers more expressive power than the considered PG-to-RDF approaches. Person Sport example, the triple n1:Person ex:plays n2:Sport in plays name: Roger Federer since: 1998 name: Tennis Fig. 2 can be the subject to the triple «n1:Person ex:plays n2:Sport» ex:since “1998”. PGs and RDF graphs have representational and Figure 1: A Representation of a PG with a real-life scenario. structural differences [6]. RDF graphs do not have edges, properties, or labels, and are not multigraphs as PGs. On the other hand, RDF graphs rely on IRIs ex:plays Roger Federer ex:name n1:Person n2:Sport ex:name Tennis to have global unique identifiers for RDF components, unlike PGs that rely on IDs to uniquely identify PG Figure 2: An RDF graph with a real-life scenario. components only inside the scope of the PG. Since PGs and RDF graphs differ, the choice be- tween them depends on the use case. However, to leverage the strengths of both, several approaches have 1. Introduction been proposed to enable their interoperability. Sev- Graph databases are powerful representation methods eral works exist in the literature on RDF-to-PG map- to model data with relationships and dependencies ping [7, 8, 9], as well as PG-to-RDF mapping [10, 11, across various fields [1, 2]. In graph databases, nodes 12, 13, 14, 15, 16]. Some of the PG-to-RDF approaches normally represent entities, while edges capture their provide direct mappings to convert PGs to RDF auto- relationships. The most prominent and widely adopted matically without user intervention [10, 11, 12], while forms of graph databases today are Property Graphs other approaches offer configuration on the RDF terms (PGs) [2] and RDF Graphs [3]. in the output RDF graph [13], or even generate an Assuming the reader’s familiarity with the concepts RDF graph for a specific PG sub-graph [14, 15]. and terminologies of PGs and RDF graphs [4], Fig. 1 Despite the existence of several PG-to-RDF map- shows a PG with two nodes, labeled “Person” and ping approaches, it is hard to compare them directly, “Sport”, an edge with the label “plays”, node proper- since each approach differs in terms of the structure, ties as name: “Roger Federer”, and an edge property representation, size of the generated RDF graph, the since: “1998”. Fig. 2 illustrates an RDF graph with degree of configuration provided to the user, and as- triples having two subjects n1:Person and n2:Sport, sumes different data formats for the input PG. In Predicates as ex:plays and ex:name, and objects as addition, these approaches impose restrictions on the n2:Sport and “Tennis”. generated RDF terms in their mappings. For example, RDF-star [5] is an extension of RDF where the all the PG-to-RDF approaches do not allow combining subject and the object can be triples, i.e. an RDF more than one PG component in one RDF term in the triple can be treated as a node within the graph. For generated RDF graph, and restrict property values in a PG to be literals in the generated RDF graph. Several declarative mapping languages were pro- Published in the Proceedings of the Workshops of the posed to construct RDF graphs from heterogeneous EDBT/ICDT 2025 Joint Conference (March 25-28, 2025), data sources [17]. However, these mapping languages Barcelona, Spain are not considered so far for mapping PGs to RDF $ ali.elhalawati@kuleuven.be (A. Elhalawati); anastasia.dimou@kuleuven.be (A. Dimou); olaf.hartig@liu.se graphs. The RDF Mapping Language (RML) is a (O. Hartig); daniel.hernandez@ki.uni-stuttgart.de declarative mapping language used to generate RDF (D. Hernández) graphs from heterogeneous data sources [18, 19], by  0000-0003-1457-0031 (A. Elhalawati); 0000-0003-2138-7972 extending the W3C recommended R2RML [20] to het- (A. Dimou); 0000-0002-1741-2090 (O. Hartig); erogeneous data sources. RML has been extended 0000-0002-7896-0875 (D. Hernández) Copyright © 2025 for this paper by its authors. Use permitted under to RML-star [21], enabling declarative mappings to Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings generate RDF-star graphs. Asserted Triples Maps, and Non-Asserted Triples Maps. In this work, we provide a uniform method for com- The RDF triples constructed by the asserted triples paring the existing PG-to-RDF approaches using RML maps are also generated in the output graph, unlike and show that RML can map PGs to RDF graphs. the non-asserted triples maps where the constructed We accomplish this by representing each considered RDF triples are only referenced inside RDF-star triples. PG-to-RDF mapping approach as a template of RML Asserted and non-asserted triples maps contain Star mappings and providing a uniform input format for Maps for subject and object maps. Each Star Map has the PG across all considered approaches. These RML a Quoted Triples Map referencing another asserted or templates require the user to define only the property non-asserted triples map. keys and values to be mapped from the PG. This uni- form representation of the most prominent PG-to-RDF mapping approaches enables direct comparisons, high- 3. RML Templates for PG-to-RDF lighting their differences. In addition, we highlight the Several works map PGs to RDF graphs, we review limitations of the considered PG-to-RDF approaches these works and provide their corresponding RML in generating RDF graphs and showcase that not only templated mappings necessary for generating RDF RML supports mapping PG-to-RDF, but it also of- graphs on a running example. These templated map- fers more expressive power and configuration than the pings only require the user to specify the property keys considered PG-to-RDF approaches. and values to be mapped from their PG. In our work, Neo4j serves as the database system for managing PGs. 2. Preliminaries Neo4j enables users to query the stored PGs using the Cypher query language. The query results are then In this section, we revisit the formal definition of exported to a JSON using the APOC [22] plugin in PGs and briefly summarize RML. We refrain from Neo4j. We present the templated RML mappings in formally defining RDF graphs as it is unnecessary for a YARRRML serialization [23]. The full YARRRML this work and instead, refer to the RDF specification and RML templates of each considered approach are for details [3]. We adopt the formal definition of PGs available in a dedicated GitHub repo (https://github. from [6, 12, 4], as follows. com/dtai-kg/PG-to-RDF-RML-Templates). Definition 1. A PG is the tuple (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) such that 𝑁 is a finite set of nodes and 𝐸 is a finite set 3.1. The Oracle Approaches of edges where 𝑁 ∩ 𝐸 = ∅. 𝜌 : 𝐸 → (𝑁 × 𝑁 ) is the Das et al. [10] introduced three PG-to-RDF direct map- edge construction total function. 𝜆 : (𝑁 ∪ 𝐸) → 𝐿 is a pings for Oracle databases, which differ in the mapping total function that maps nodes and edges to labels in of edge properties: reification-based (RF), subproper- 𝐿. 𝜎 : (𝑁 ∪ 𝐸) × 𝑃 → 𝒱𝒜 is a partial function that ty-based (SP), and named graph-based (NG). None of takes a node/edge and a property from 𝑃 and assigns them covers node labels. Predefined transformation them to a property value from 𝒱𝒜. functions IRI and Literal, are used to transfer PG elements to IRIs and literals in the output RDF graph. Example 1. The formal definition of PGs captures the PG in Fig. 1 as follows: RF Mapping Let 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) be a PG, an 𝑁 = {𝑛1, 𝑛2}, 𝜆(𝑛1) = “Person”, 𝜆(𝑛2) = “Sport”, RDF graph is generated from 𝑃 𝐺 as follows: 𝐸 = {𝑒1}, 𝜆(𝑒1) = “plays”, 𝜌(𝑒1) = (𝑛1, 𝑛2), 1. For every 𝑒 ∈ 𝐸 with 𝜌(𝑒) = (𝑛1, 𝑛2) and 𝜎(𝑛1, 𝑛𝑎𝑚𝑒) = “Roger Federer”, 𝜆(𝑒) = 𝑙, triples are generated as follows: 𝜎(𝑛2, 𝑛𝑎𝑚𝑒) = “Tennis”, 𝜎(𝑒1, 𝑠𝑖𝑛𝑐𝑒) = “1998” IRI(𝑒) rdf : subject IRI(𝑛1). IRI(𝑒) rdf : predicate IRI(𝑙). IRI(𝑒) rdf : object IRI(𝑛2). An RML Mapping Document ℳ describes how to IRI(𝑛1) IRI(𝑙) IRI(𝑛2). generate RDF graphs from input data sources. ℳ is formed from a set of Triples Maps that define how to 2. For every 𝑥 ∈ 𝑁 ∪ 𝐸, where 𝑥 is an edge or a generate triples in an RDF graph. A triples map has node with 𝜎(𝑥, 𝑝) = 𝑣 where 𝑝 ∈ 𝑃 and 𝑣 ∈ 𝒱𝒜, zero or one Logical Source, one Subject Map, zero or a triple is generated following the construction more Predicate-Object Maps, and zero or more Graph IRI(𝑥) IRI(𝑝) Literal(𝑣). Maps. The logical source specifies the input data source. The subject map defines how to create sub- Example 2. Applying the RF mapping to the PG in jects in triples. A predicate-object map consists of one Fig. 1 yields an RDF graph with the following triples: or more Predicate Map that defines the rule generating pg : e1 rdf : subject pg : n1 . the predicates in RDF triples. Additionally, a predi- pg : e1 rdf : predicate pg : r / plays . cate map is accompanied by one or more Object Map pg : e1 rdf : object pg : n2 . that defines how to generate objects in triples. Graph pg : n1 pg : r / plays pg : n2 . pg : k / name “Roger Federer”. maps can be specified in subject maps and object maps pg : n1 pg : n2 pg : k / name “Tennis”. to group the generated triples in named graphs. pg : e1 pg : k / since “1998”. To support the extension of RDF with RDF-star, Delva et al. introduce an extension of RML, RML- Star [21], which enables the generation of RDF-star For the RF mapping, the template RML mappings to triples. An RML-Star ℳ may include Triples Maps, generate the RDF graph in Ex. 2 are the following: Listing 1: The RF Template Mappings 3.2. Singleton Property Graph Approach TM1 : 1 Nguyen et al. [11] propose a direct PG-to-RDF map- s : pg : e$( id ) ping through an intermediate unified graph model 2 po : 3 - [ rdf : predicate , pg : r /$( label ) ] 4 called Singleton Property Graph (SPG). SPGs capture - [ rdf : subject , pg : n$( start . id ) ] 5 the structures of both PGs and RDF graphs. To trans- - [ rdf : object , pg : n$( end . id ) ] 6 form PGs into SPGs, each node and edge in the PG is - [ pg : k / since , $( properties . since ) ] 7 mapped to a node in the SPG. Furthermore, two edges TM2 : are introduced in the SPG: one connects the edge’s 8 s : pg : n$( start . id ) 9 po : 10 created node to the source node, and the other links - [ pg : r /$( label ) , pg : n$( end . id ) ] 11 the edge’s node to the destination node. The same - [ pg : k / name , $( start . properties . name ) ] 12 non-configurable transformation functions IRI and TM3 : 13 Literal defined in the Oracle approaches are assumed. s : pg : n$( end . id ) Also, three unique IRIs IRI𝑖𝑛 , IRI𝑜𝑢𝑡 , IRI𝑙𝑎𝑏𝑒𝑙 are 14 po : 15 - [ pg : k / name , $( end . properties . name ) ] 16 used to describe the edge relation and node/edge la- bels in the output RDF graph. The PG is mapped TM1 generates the triples where the edge is the subject, to an SPG, which is mapped to an RDF graph as while TM2 and TM3 generate the triples where the follows: Let 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) be a PG, for every source node and the target node are subjects. 𝑛 ∈ 𝑁 and 𝜆(𝑛) = 𝑙𝑛 a triple is generated following the construction IRI(𝑛) IRI𝑙𝑎𝑏𝑒𝑙 Literal(𝑙𝑛). For ev- SP Mapping For 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎), the corre- ery 𝑒 ∈ 𝐸 with 𝜌(𝑒) = (𝑛1, 𝑛2) and 𝜆(𝑒) = 𝑙𝑒 triples sponding RDF graph is generated such that for every are generated as follows: 𝑒 ∈ 𝐸 where 𝜌(𝑒) = (𝑛1, 𝑛2) and 𝜆(𝑒) = 𝑙 triples are IRI(𝑛1) IRI𝑖𝑛 IRI(𝑒). generated as follows: IRI(𝑒) IRI𝑜𝑢𝑡 IRI(𝑛2). IRI(𝑒) rdfs : subPropertyOf IRI(𝑙). IRI(𝑒) IRI𝑙𝑎𝑏𝑒𝑙 Literal(𝑙𝑒). IRI(𝑛1) IRI(𝑙) IRI(𝑛2). IRI(𝑛1) IRI(𝑒) IRI(𝑛2). For 𝑥 ∈ 𝑁 ∪ 𝐸, the triples are generated as step 2 in RF mapping. For 𝑥 ∈ 𝑁 ∪ 𝐸 with 𝜎(𝑥, 𝑝) = 𝑣, the triples are gener- ated following step 2 in RF mapping. Example 5. Applying the SPG mapping to the PG in Fig. 1 yields an RDF graph as follows: Example 3. On the PG of Fig. 1, SP maps edges and their labels as follows: ex : n1 rdfs : label “Person”. ex : n1 ex : name “Roger Federer”. pg : e1 rdfs : subPropertyOf pg : r / plays . ex : n2 rdfs : label “Sport”. pg : n1 pg : e1 pg : n2 . ex : n2 ex : name “Tennis”. ex : e1 rdfs : label “plays”. SP overlaps with the RF in the generated RDF graph ex : e1 ex : since “1998”. ex : n1 ex : nodeToedge ex : e1 . for the nodes and properties. However, they differ ex : e1 ex : EdgeTonode ex : e2 . in the RDF graph for the edges and their labels by relying on the subPropertyOf relationship to express SPG does not differentiate between edge and node the edges instead of reification. This requires slight labels. To address this, a variation of the SPG mapping modifications to the template in Listing 1, the modified was proposed [6], where the unique IRI IRI𝑙𝑎𝑏𝑒𝑙 is split template is available in our dedicated GitHub repo. into two distinct IRIs IRI𝑒𝑙𝑎𝑏𝑒𝑙 and IRI𝑛𝑙𝑎𝑏𝑒𝑙 for edge and node labels respectively. NG Mapping For 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎), an RDF We showcase the template RML mappings by gen- graph is generated following the NG mapping as fol- erating the RDF graph in Ex. 5 as follows: lows: (i) For every 𝑒 ∈ 𝐸 where 𝜌(𝑒) = (𝑛1, 𝑛2) and 𝜆(𝑒) = 𝑙 a triple is generated and grouped in Listing 2: The SPG Template Mappings a named graph following the construction IRI(𝑛1) TM1 : 1 IRI(𝑙) IRI(𝑛2) IRI(𝑒), (ii) for every 𝜎(𝑒, 𝑝) = 𝑣, we s : ex : n$( id ) 2 group the edge properties in named graphs following po : 3 the construction IRI(𝑒) IRI(𝑝) Literal(𝑣) IRI(𝑒), - [ rdfs : label , $( labels ) ] 4 (iii) for every 𝑛 ∈ 𝑁 , the triples are generated as step - [ ex : name , $( properties . name ) ] 5 TM2 : 2 in RF mapping. 6 s : ex : n$( start . id ) 7 Example 4. On the PG of Fig. 1, the NG mapping po : 8 - [ ex : nodeToedge , ex : e$( id ) ] 9 groups edges, labels, and properties in named graphs: TM3 : 10 pg : n1 pg : r / plays pg : n2 pg : e1 . s : ex : e$( id ) 11 pg : e1 pg : k / since “1998” pg : e1 . po : 12 - [ rdfs : label , $( label ) ] 13 NG mapping is similar to RF and SP in generating - [ ex : edgeTonode , ex : n$( end . id ) ] 14 - [ ex : since , $( properties . since ) ] RDF graphs for PG nodes and node properties. How- 15 ever, it differs in generating RDF graphs for edges, TM1 generates RDF triples that describe the prop- edge properties, and edge labels. Slight modifications erties of nodes in the graph. TM2 generates triples are required for the template in Listing 1, where edge that link the source node to the edge. TM3 generates relations, properties, and labels are placed in named triples that describe the edge’s properties and label graphs categorized by the edges. and connect the edge to the target node. 3.3. RDF-Star-Based Approach IRI(𝑒) rdf : type pgo : Edge . IRI(𝑒) pgo : startNode IRI(𝑛1). Hartig [13] proposes an RDF-star-based mapping ap- IRI(𝑒) pgo : endtNode IRI(𝑛2). proach that converts PGs to RDF-star graphs by de- scribing edge properties using RDF-star triples, where For each 𝑒 ∈ 𝐸 with 𝜎(𝑒, 𝑝) = 𝑣 a triple is generated fol- the triple connecting the edge label to the source lowing the construction IRI(𝑒) pgo:hasEdgeProperty node and the target node is used as the subject in IRI(𝜎𝑒,𝑝,𝑣 ). For 𝑥 ∈ 𝑁 ∪ 𝐸 such that 𝜎(𝑥, 𝑝) = 𝑣 the these RDF-star triples. This approach enables users following triples are generated: to choose patterns for generating IRIs that denote IRI(𝜎𝑥,𝑝,𝑣 ) rdf : type pgo : Property . edge labels and property keys, and the desired RDF IRI(𝜎𝑥,𝑝,𝑣 ) pgo : key Literal(𝑝). term in the resulting RDF-star graph for certain PG IRI(𝜎𝑥,𝑝,𝑣 ) pgo : value Literal(𝑣). components. The functions IRI, Literal, 𝜑 and 𝛾 For 𝑥 ∈ 𝑁 ∪ 𝐸 where 𝜆(𝑥) = 𝑙, the triple IRI(𝑥) take a PG component 𝐶 and transfer it to an RDF pgo:label Literal(𝑙) is generated. term such that IRI(𝐶) and Literal(𝐶) generate an IRI and a literal. 𝜑(𝐶) generates either a literal or an Example 7. We show a sample of the PGO mapping IRI, and 𝛾(𝐶) generates a blank node or an IRI. The on the PG in Fig. 1: functions IRI, 𝜑, and 𝛾 are configurable, i.e. the user ex : n1 rdf : type pgo : Node . can define the IRIs to be used, as well as the desired ex : n1 pgo : label “Person”. RDF term in 𝜑 and 𝛾. In addition, an IRI IRI𝑙𝑎𝑏𝑒𝑙 is ex : n1 pgo : hasNodeProperty ex : p1 . used to describe the presence of a node label. ex : n2 rdf : type pgo : Node . Let 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) be a PG, for every 𝑛 ∈ 𝑁 ex : p1 rdf : type pgo : Property . ex : p1 pgo : key “name”. where 𝜆(𝑛) = 𝑙𝑛 a triple is generated following the ex : p1 pgo : value “Roger Federer”. construction 𝛾(𝑛) IRI𝑙𝑎𝑏𝑒𝑙 𝜑(𝑙𝑛). For every 𝑛 ∈ 𝑁 ex : e1 rdf : type pgo : Edge . with 𝜎(𝑛, 𝑝) = 𝑣, a triple is generated following the ex : e1 pgo : startNode ex : n1 . construction 𝛾(𝑛) IRI(𝑝) literal(𝑣). For every 𝑒 ∈ ex : e1 pgo : endNode ex : n2 . 𝐸 where 𝜌(𝑒) = (𝑛1, 𝑛2) and 𝜆(𝑒) = 𝑙𝑒, a triple is ex : e1 pgo : label “plays”. ex : e1 pgo : hasEdgeProperty ex : p2 . generated following the construction 𝛾(𝑛1) IRI(𝑙𝑒) ex : p2 rdf : type pgo : Property . 𝛾(𝑛2). For every 𝑒 ∈ 𝐸 where 𝜌(𝑒) = (𝑛1, 𝑛2), 𝜆(𝑒) = ex : p2 pgo : key “since”. 𝑙𝑒 and 𝜎(𝑒, 𝑝′ ) = 𝑣 ′ , the triple describing the edge is ex : p2 pgo : value “1998”. reused as a subject to generate the RDF-star triple «𝛾(𝑛1) IRI(𝑙𝑒) 𝛾(𝑛2)» IRI(𝑝′ ) literal(𝑣 ′ ). Besides relying on specific ontology terms, the PGO Example 6. We show how to generate the RDF-star translation generates a large RDF graph even for a triples for edge properties on the PG in Fig. 1: small PG, as repeated triples are generated for PG components to comply with the ontology. To adapt ex : n1 ex : plays ex : n2 . << ex : n1 ex : plays ex : n2 > > ex : since “1998”. to the assumption of having unique property IDs, we attach the property value to the node/edge and use In this approach, the edge triple uses the edge label it as a unique ID for each property. In addition, to as a predicate, raising the question of what happens if correctly construct triples specialized to nodes/edges, edges have no label. This approach overlaps with the we use functions in RML to check the type of the PG SPG approach in producing node labels and properties. component. The template RML mappings to generate The difference lies in expressing the edge relations, the RDF graph in Ex. 7 are as follows. labels, and properties using RDF-star. The mappings Listing 3: The PGO Template Mappings in Listing 2 are modified with RML-star mappings to generate the desired triples. We provide this modified TM1 : 1 s : ex : n$( id ) template in our GitHub repo. 2 condition : 3 function : idlab - fn : equal 4 3.4. PGO Approach parameters : 5 - [ grel : valueParameter , $( type ) , s ] 6 Tomaszuk et al. proposed the Property Graph Ontol- - [ grel : valueParameter2 , " node " , o ] 7 ogy (PGO), an OWL ontology designed for describing po : 8 - [a , pgo : Node ] PGs in RDF [12]. Users are restricted to using the 9 - [ pgo : label , $( labels ) ] 10 predefined ontology terms provided by PGO and can - [ pgo : hasNodeProperty , 11 only integrate these terms with a limited set of other ex : p_$( properties . name ) _$( id ) ] 12 ontologies specified in [12]. The same non-configurable TM2 : 13 transformation functions IRI and Literal described s : ex : e$( id ) 14 condition : in the oracle approach are used to convert a PG com- 15 function : idlab - fn : equal 16 ponent to an IRI or literal. parameters : 17 Let 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) be a PG, each node/edge - [ grel : valueParameter , $( type ) , s ] 18 property mapping 𝜎(𝑥, 𝑝) = 𝑣 is assumed to have a - [ grel : valueParameter2 , 19 unique identifier 𝜎𝑥,𝑝,𝑣 . For every 𝑛 ∈ 𝑁 , a triple is " relationship " , o ] 20 po : generated following the construction IRI(𝑛) rdf:type 21 - [a , pgo : Edge ] 22 pgo:Node. For each 𝑛 ∈ 𝑁 with 𝜎(𝑛, 𝑝) = 𝑣, a - [ pgo : hasEdgeProperty , 23 triple is generated following the construction IRI(𝑛) ex : p_$( properties . since ) _$( id ) ] 24 pgo:hasNodeProperty IRI(𝜎𝑛,𝑝,𝑣 ). For every 𝑒 ∈ 𝐸 TM3 : 25 where 𝜌(𝑒) = (𝑛1, 𝑛2), triples are generated as follows: s : ex : p_$( properties . name ) _$( id ) 26 po : 27 required to specify all the property names and labels - [a , pgo : property ] 28 of 𝑥, even if these are not intended to be included - [ pgo : key , " name "] 29 in the production part of the rule. This requirement - [ pgo : value , $( properties . name ) ] can be tedious, particularly for property graphs with 30 TM4 : 31 s : ex : p_$( properties . since ) _$( id ) 32 numerous properties and labels. po : 33 PREC [14] follows the same structure as PRSC - [a , pgo : property ] 34 but introduces some differences. In the target part of - [ pgo : key , " since "] 35 PREC rules, the target can be a property instead of - [ pgo : value , $( properties . since ) ] only a node/edge. Moreover, unlike PRSC, omitting 36 TM5 : 37 s : ex : e$( id ) 38 certain property names of the target node or edge does po : 39 not imply their non-existence. PREC is deemed in [24] - [ pgo : startNode , ex : n$( start . id ) ] 40 as a low-level mapping that is “not user-friendly" and - [ pgo : endNode , ex : n$( end . id ) ] 41 “difficult" as it requires the user to be very familiar - [ pgo : label , $( label ) ] with the language and learn an extensive vocabulary 42 TM1 generates the triples that identify the node, at- to utilize it effectively. Another limitation of PREC is tach the node to its label, and create the unique prop- that it sometimes produces unexpected triples specif- erties IDs for each node. TM2 does the same as TM1 ically in cases where different nodes/edges share the but for edges. TM3 and 4 construct the triples to same property names. In addition, PREC cannot deal describe the node/edge properties. TM5 generates the with nodes/edges having empty labels. triples that describe the edge label, and connect the Despite the high degree of configuration, PREC and edge to its source and target nodes. PRSC share some limitations. Both systems convert the entire PG to an RDF graph following the PGO ontology [12], this proved some scalability issues as 3.5. PRSC and PREC Approaches mentioned in [15]. Both systems enforce certain RDF Bruyat [24] introduces two user-defined mappings that term types for each PG component, e.g., nodes/edges convert PGs to RDF PRSC [15] and PREC [14]. are always blanks and property values are always lit- PRSC [15] is defined as mapping rules written in erals. Property values are enforced to be used only as RDF-star [25]. PRSC mapping rules are divided into objects in the output RDF graph, and it is impossible target and production parts. The target specifies to combine different PG components in one RDF term. the intended component in the PG based on its type (node or edge), label, and property names. The labels PRSC Solution Let 𝑚PRSC be a set of mappings in and property names of the target node/edge must be PRSC format, every mapping rule 𝑟 in 𝑚PRSC has specified since omitting them implies that they do not a target t and a production prod. t has a type exist in the original PG. In the production part of node or edge, a possible-empty label 𝑙, and a possible- the rule, the user specifies the desired output in the empty set of property names 𝑃 . prod represents an RDF-star graph. Let 𝑃 𝐺 = (𝑁, 𝐸, 𝜌, 𝜆, 𝜎) be a PG, RDF-star graph where every triple in prod can con- PRSC assumes the following variables: tain user-defined constant IRIs, another triple, or a PRSC-defined variable 𝑑𝑣. For every 𝑟 in 𝑚PRSC , if • pvar:self represents 𝑛 ∈ 𝑁 or 𝑒 ∈ 𝐸 in the t has a type node, then for any 𝑑𝑣 ∈ prod, 𝑑𝑣 ∈ form of a blank node. {𝑝𝑣𝑎𝑟:𝑠𝑒𝑙𝑓, 𝑝𝑟𝑒𝑐:𝑣𝑎𝑙𝑢𝑒𝑂𝑓 (𝑝)} where 𝑝 is a property • pvar:source represents the source node 𝑛1 of name in the PG. Otherwise, if t has a type edge, any edge 𝑒 with 𝜌(𝑒) = (𝑛1, 𝑛2) as a blank node. then 𝑑𝑣 ∈ {𝑝𝑣𝑎𝑟:𝑠𝑒𝑙𝑓 , 𝑝𝑣𝑎𝑟:𝑠𝑜𝑢𝑟𝑐𝑒, 𝑝𝑣𝑎𝑟:𝑑𝑒𝑠𝑡𝑖𝑛𝑎𝑡𝑖𝑜𝑛, • pvar:destination represents the target node 𝑝𝑟𝑒𝑐:𝑣𝑎𝑙𝑢𝑒𝑂𝑓 (𝑝)}. 𝑛2 for any edge 𝑒 with 𝜌(𝑒) = (𝑛1, 𝑛2) in the For every 𝑟 in 𝑚𝑃 𝑅𝑆𝐶 , let 𝒞(𝑟) → 𝑐𝑞 be a function form of a blank node. that constructs a cypher query 𝑐𝑞 for 𝑡 in 𝑟. We show • prec:valueOf(p) is a literal representing the how to construct 𝑐𝑞 based on the content of 𝑡 as follows: value 𝑣 for 𝜎(𝑥, 𝑝) = 𝑣 where 𝑥 ∈ 𝑁 ∪ 𝐸, 𝑝 has to be specified. • if 𝑡 has type node, a non-empty label 𝑙, and 𝑃 = {𝑝1 , 𝑝2 , . . . 𝑝𝑗 } where 𝑗 ≥ 0: In the production part of every rule, users can combine MATCH ( n :𝑙) WHERE n .𝑝1 IS NOT NULL AND these variables with any desired constant IRI to define n .𝑝2 IS NOT NULL . . . AND n .𝑝𝑗 IS NOT the intended output in the RDF-star graph. NULL AND size ( keys ( n ) ) = 𝑗 RETURN (n) Example 8. Applying this PRSC rule on the PG in Fig. 1 selects edges with a specific label and property: • if 𝑡 has type node, an empty label, and 𝑃 = {𝑝1 , 𝑝2 , . . . 𝑝𝑗 } where 𝑗 ≥ 0: _ : playsRule a prec : PRSCEdgeRule ; prec : label “plays”; MATCH ( n ) WHERE size ( labels ( n ) ) = 0 AND prec : propertyKey “since”; n .𝑝1 IS NOT NULL AND n .𝑝2 IS NOT prec : produces NULL . . . AND n .𝑝𝑗 IS NOT NULL AND <<<< pvar : source ex : plays pvar : destination > > > > size ( keys ( n ) ) = 𝑗 RETURN ( n ) ex : since “since”^^ prec : valueOf . • if 𝑡 has type edge, a non-empty label 𝑙, and As a result of this rule, the RDF-star triple «_:n1 𝑃 = {𝑝1 , 𝑝2 , . . . 𝑝𝑗 } where 𝑗 ≥ 0: ex:plays _:n2» ex:since “1998” is generated. MATCH ( n ) -[ r :𝑙] - >( q ) WHERE n .𝑝1 IS NOT NULL AND n .𝑝2 IS NOT NULL . . . AND n . It is observed that, in any PRSC rule, if a user in- 𝑝𝑗 IS NOT NULL AND size ( keys ( r ) ) = tends to target a specific node or edge 𝑥, they are 𝑗 RETURN ( r ) PG comp. RF SP NG SPG star PGO great mapping flexibility of RML. The full version of nodes 0 0 0 1 1 1 the Listing is provided in the dedicated GitHub repo. node labels 0 0 0 1 1 1 edges 4 3 1q 3 1 3 Listing 4: Highly Flexible RML Mappings edge label 1 1 1q 1 1 1 node prop. 1 1 1 1 1 4 TM1 : 1 s : ex :$( labels ) /$( properties . name ) 2 edge prop. 1 1 1q 1 1* 4 po : 3 Table 1 - [ ex : nodeID , $( id ) ] 4 Minimum no. of triples per PG component TM2 : 5 s : ex :$( start . properties . name ) 6 po : 7 - [ ex :$( label ) , 8 The 𝑠𝑖𝑧𝑒(𝑘𝑒𝑦𝑠()) condition ensures only a specific num- $( end . properties . name ) ] 9 ber of properties as PRSC operates. After constructing TM3 : 10 s : ex : since 11 𝑐𝑞, 𝑐𝑞 can be exported to a JSON 𝐽𝑆𝑂𝑁𝑐𝑞 with any po : 12 PG database system, where 𝐽𝑆𝑂𝑁𝑐𝑞 contains all the - p : ex :$( properties . since ) 13 necessary components to generate the corresponding o: 14 RDF-star graph. 𝐽𝑆𝑂𝑁𝑐𝑞 is then provided to RML - quoted : TM2 15 mappings as an input data source and combined with Applying the RML mappings in Listing 4 on the PG the user-defined constant IRIs in prod to generate the in Fig. 1 results in the following RDF-star graph: RDF-star graph intended by 𝑟. < ex : Person / Roger %20 Federer > ex : nodeID “1”. < ex : Sport / Tennis > ex : nodeID “2”. 3.6. Discussion < ex : Roger %20 Federer > ex : plays “Tennis”. ex : since ex :1998 << ex : Roger %20 Federer ex : We compare the considered PG-to-RDF approaches in plays “Tennis” > >. terms of the no. of triples per PG component (Table 1). We notice that PGO generates the most triples for This RDF graph generated from Listing 4 shows that properties, while Oracle generates the most triples for RML can flexibly map PG components to RDF. TM1 edges. RDF-star constructs RDF-star triples (*) when generates the first and second triples, where the object mapping edge properties, while NG generates named is the node, and the subject is an IRI combining the graphs (q) when mapping edges, edge labels, and edge property value and label. Such triples are not achiev- properties. PRSC is not mentioned in Table 1 as it able by any of the considered PG-to-RDF approaches, allows configuring the no. of triples. as they force the property value to be an object literal. We observe that all the approaches considered have They also restrict PG nodes to be IRIs or blank nodes limitations. All the approaches limit every PG com- and do not allow mapping multiple PG components ponent to certain RDF term types, e.g., all the ap- as a single IRI. TM2 generates the third triple, which proaches restrict the property values to be literal in the is used as an object in TM3 to generate the fourth generated RDF graph. Most approaches lack configu- RDF-star triple. None of the considered approaches ration. Only the PRSC approach allows configuration allows using triples in the object of an RDF-star triple. in the content and size of the generated RDF/RDF- star graphs, but this does not include properties. The RDF-star approach also allows configuration in the 4. Conclusions generated RDF graph concerning the IRI patterns and In this work, we presented RML as a uniform and flex- the RDF terms for certain PG components. None ible solution for mapping PGs to RDF. We studied the of the approaches supports using more than one PG most prominent PG-to-RDF translations and provided component within a single IRI, e.g., it is not possible templated RML mappings that show RML’s capabil- to generate an RDF term containing an IRI with both ity in performing these translations. For future work, the node and its label from a PG, which means that we plan to conduct a thorough performance compar- each PG component must be mapped to a single RDF ison between the considered PG-to-RDF approaches term. None of the approaches supports combining the in generating RDF graphs with RML. PG with other data sources for RDF construction if the user is interested in joining data across different Acknowledgments data sources. None of the approaches supports having triples in the object of an RDF-star triple. Hartig’s contributions to this work were funded by Vetenskapsrådet (the Swedish Research Council, project 3.7. RML as a Flexible Solution reg. no. 2019-05655). Dimou and Elhalawati’s contri- butions to this research were partially supported by Besides covering all the PG-to-RDF translations con- Flanders Make, the strategic research centre for the sidered, RML overcomes all their limitations by pro- manufacturing industry, and the Flemish Government viding full control over the RDF terms, the desired under the “Onderzoeksprogramma Artificiële Intelli- output (RDF or RDF star), and the ability to combine gentie (AI) Vlaanderen” program. Hernández’s contri- multiple components from the input data. We show- butions to the work were funded by the German Re- case in Listing 4 RML-star mappings that generate a search Foundation, DFG (GA SFB-1574-471687386). custom RDF graph for portions of the PG in Fig. 1. This RDF graph is impossible to generate with any of the considered PG-to-RDF approaches and shows the References Graphs in RDF, IEEE Access 8 (2020). doi:10. 1109/ACCESS.2020.3002018. [1] Tian, Yuanyuan, The World of Graph Databases [13] Hartig, Olaf, Foundations to Query Labeled from An Industry Perspective, SIGMOD Rec. 51 Property Graphs using SPARQL, in: Joint (2022). doi:10.1145/3582302.3582320. Proceedings of the 1st International Workshop [2] Robinson, Ian and Webber, Jim and Eifrem, Emil, On Semantics For Transport and the 1st Inter- Graph Databases: New Opportunities for Con- national Workshop on Approaches for Making nected Data, 2nd ed., O’Reilly Media, Inc., 2015. Data Interoperable co-located with SEMANTiCS, [3] R. Cyganiak, D. Wood, M. Lanthaler, RDF 1.1 CEUR-WS.org, 2019. URL: https://ceur-ws.org/ Concepts and Abstract Syntax, Recommendation, Vol-2447/paper3.pdf. World Wide Web Consortium (W3C), 2014. URL: [14] Bruyat, Julian and Champin, Pierre-Antoine and http://www.w3.org/TR/rdf11-concepts/. Médini, Lionel and Laforest, Frederique, PREC: [4] Angles, Renzo and Arenas, Marcelo and Barceló, semantic translation of property graphs, in: 1st Pablo and Hogan, Aidan and Reutter, Juan and workshop on Squaring the Circles on Graphs, Vrgoč, Domagoj, Foundations of Modern Query SEMANTiCS, 2021. URL: https://hal.science/ Languages for Graph Databases, ACM Comput. hal-03407785v1. Surv. 50 (2017). doi:10.1145/3104031. [15] Bruyat, Julian and Champin, Pierre-Antoine and [5] Hartig, Olaf and Champin, Pierre-Antoine and Médini, Lionel and Laforest, Frederique, PRSC: Kellogg, Gregg and Seaborne, Andy, RDF- From PG to RDF and back, using schemas, Se- star and SPARQL-star, W3C Final Community mantic Web (2024). doi:10.3233/SW-243675. Group Report, 2021. URL: https://w3c.github. [16] NeoSemantics, Accessed: 2025-01-06. URL: https: io/rdf-star/cg-spec/2021-12-17.html. //github.com/neo4j-labs/neosemantics. [6] Khayatbashi, Shahrzad and Ferrada, Sebastián [17] D. Van Assche, T. Delva, G. Haesendonck, P. Hey- and Hartig, Olaf, Converting property graphs to vaert, B. De Meester, A. Dimou, Declarative RDF: a preliminary study of the practical impact RDF graph generation from heterogeneous (semi- of different mappings, in: Proceedings of the 5th )structured data: A systematic literature review, ACM SIGMOD Joint International Workshop on Journal of Web Semantics (2023). doi:https: Graph Data Management Experiences & Systems //doi.org/10.1016/j.websem.2022.100753. (GRADES) and Network Data Analytics (NDA), [18] A. Dimou, M. Vander Sande, P. Colpaert, R. Ver- ACM, 2022. doi:10.1145/3534540.3534695. borgh, E. Mannens, R. Van de Walle, RML: [7] R. Angles, H. Thakkar, D. Tomaszuk, Mapping A Generic Language for Integrated RDF Map- RDF Databases to Property Graph Databases, pings of Heterogeneous Data, in: Proceedings of IEEE Access 8 (2020). doi:10.1109/ACCESS.2020. the 7th Workshop on Linked Data on the Web, 2993117. CEUR, 2014. URL: http://ceur-ws.org/Vol-1184/ [8] D. Tomaszuk, RDF Data in Property Graph ldow2014_paper_01.pdf. Model, in: Metadata and Semantics Research, [19] A. Iglesias-Molina, D. Van Assche, J. Arenas- Springer International Publishing, 2016. doi:10. Guerrero, B. De Meester, C. Debruyne, S. Joza- 1007/978-3-319-49157-8_9. shoori, P. Maria, F. Michel, D. Chaves- [9] G. Abuoda, D. Dell’Aglio, A. Keen, K. Hose, Fraga, A. Dimou, The RML Ontology: A Transforming rdf-star to property graphs: A pre- Community-Driven Modular Redesign After a liminary analysis of transformation approaches, Decade of Experience in Mapping Heteroge- in: Proceedings of the QuWeDa 2022: 6th neous Data to RDF, in: International Semantic Workshop on Storing, Querying and Benchmark- Web Conference, Springer, 2023. doi:10.1007/ ing Knowledge Graphs co-located with ISWC, 978-3-031-47243-5_9. CEUR-WS.org, 2022. URL: https://ceur-ws.org/ [20] S. Das, S. Sundara, R. Cyganiak, R2RML: RDB Vol-3279/paper2.pdf. to RDF Mapping Language, Working Group Rec- [10] Das, Souripriya and Srinivasan, Jagannathan and ommendation, 2012. URL: http://www.w3.org/ Perry, Matthew and Chong, Eugene Inseok and TR/r2rml/. Banerjee, Jayanta, A Tale of Two Graphs: Prop- [21] T. Delva, J. Arenas-Guerrero, A. Iglesias-Molina, erty Graphs as RDF in Oracle., in: Proceedings O. Corcho, D. Chaves-Fraga, A. Dimou, RML- of the 17th International Conference on Extend- star: A declarative mapping language for RDF- ing Database Technology, EDBT, OpenProceed- star generation, 2021. URL: https://ceur-ws.org/ ings.org, 2014. doi:10.5441/002/edbt.2014.82. Vol-2980/paper374.pdf. [11] Nguyen, Vinh and Yip, Hong Yung and Thakkar, [22] APOC, Accessed: 2025-01-06. URL: https:// Harsh and Li, Qingliang and Bolton, Evan neo4j.com/docs/apoc/current/. and Bodenreider, Olivier, Singleton Property [23] YARRRML, Accessed: 2025-01-06. URL: https: Graph: Adding A Semantic Web Abstraction //rml.io/yarrrml/. Layer to Graph Databases., in: Proceedings [24] Bruyat, Julian, From property graphs to knowl- of the Blockchain enabled Semantic Web Work- edge graphs, Theses, INSA Lyon, 2024. URL: shop (BlockSW) and Contextualized Knowledge https://hal.science/tel-04772451. Graphs (CKG) Workshop co-located with ISWC, [25] D. Beckett, T. Berners-Lee, E. Prud’hommeaux, CEUR-WS.org, 2019. URL: https://ceur-ws.org/ G. Carothers, RDF 1.1 Turtle – Terse RDF Triple Vol-2599/CKG2019_paper_4.pdf. Language, Recommendation, World Wide Web [12] Tomaszuk, Dominik and Angles, Renzo and Consortium (W3C), 2014. URL: http://www.w3. Thakkar, Harsh, PGO: Describing Property org/TR/turtle/.