R2RML
R2RML (RDB to RDF Mapping Language) is a mapping language standardized by the World Wide Web Consortium (W3C) for expressing customized mappings from relational databases to Resource Description Framework (RDF) datasets.[1] It became a W3C Recommendation on 27 September 2012.[2]
An R2RML mapping specifies how tables, views, or SQL query results are represented as RDF resources, properties, and values. Unlike the W3C's direct mapping of relational data to RDF, which defines a default transformation based on relational structure, R2RML allows a mapping author to choose the structure and target vocabulary of the resulting RDF graph.[1]
R2RML mappings are themselves RDF graphs, commonly written in Turtle. Processors can use them to generate RDF datasets, provide virtual SPARQL access over relational data, or expose a Linked Data interface.[1] Independent literature has also treated R2RML as a reference mapping language in knowledge-graph generation and virtual knowledge graph systems.[3][4]
History
In October 2007, the W3C held a workshop on RDF access to relational databases. The workshop was followed by the RDB2RDF Incubator Group, which surveyed existing approaches to mapping relational databases to RDF.[5]
The Incubator Group published its final report in 2009 and recommended that the W3C establish a working group to standardize a language for mapping relational database schemas to RDF and OWL.[6] The RDB2RDF Working Group began work in 2009 with a mission to standardize languages for mapping relational data and schemas into RDF and OWL.[5]
The first public Working Draft of R2RML was published on 28 October 2010.[7] Further Working Drafts and review stages followed during 2011 and 2012.[2]
On 27 September 2012, the W3C published both R2RML: RDB to RDF Mapping Language and A Direct Mapping of Relational Data to RDF as Recommendations.[8] The RDB2RDF Working Group also produced a common test suite and implementation report for the two specifications.[9]
During the standards process, R2RML moved directly from its second Last Call Working Draft to Proposed Recommendation after W3C reported sufficient implementation experience and multiple interoperable implementations.[10] The RDB2RDF Working Group closed on 15 October 2012.[9]
Mapping model
The central structure in an R2RML mapping is a triples map, which specifies how rows from a relational logical table generate RDF triples.[1][3]
A triples map consists principally of:
- a logical table, identifying the relational input used by the mapping;
- a subject map, determining the subjects of generated RDF triples; and
- one or more predicate-object maps, determining predicates and objects associated with those subjects.[1]
Logical tables
A logical table can correspond to an SQL base table or view, or to the result of an SQL query. This allows mappings to operate directly on existing relational structures or on a derived relational view defined for the mapping.[1]
Term maps
R2RML uses term maps to specify how RDF terms are generated from relational data. A term map can produce a constant value, obtain a value from a database column, or construct a value from a template containing column values.[1]
Term maps can generate RDF IRIs, blank nodes, or literals, depending on their role and configuration.
Relationships between tables
A referencing object map can relate resources generated from different logical tables. Join conditions can be used to connect rows from one logical table to resources generated by another triples map.[1]
This allows relationships represented through relational keys and joins to be expressed as RDF links chosen by the mapping author.
Example
Consider a relational table:
| ID | Name | City |
|---|---|---|
| 1 | Alice | London |
An R2RML mapping could specify that each row represents a resource whose IRI is constructed from the value in the ID column, while Name and City are mapped to properties in a chosen RDF vocabulary.
Conceptually, the row could produce RDF such as:
<http://example.com/person/1>
<http://example.com/name> "Alice" ;
<http://example.com/city> "London" .
The relational data does not itself determine the target RDF vocabulary. R2RML allows the mapping author to define the IRIs, properties, and graph structure used in the generated RDF.[1]
Direct Mapping and R2RML
The W3C standardized R2RML alongside A Direct Mapping of Relational Data to RDF. The two specifications address related but different mapping cases.[8]
The Direct Mapping defines a systematic RDF representation derived from the structure of a relational database and therefore does not require a custom mapping. R2RML instead allows the author to define a customized target vocabulary and RDF structure.[1]
This permits relational structures to be mapped to existing RDF vocabularies or ontologies rather than producing a graph whose vocabulary is determined primarily by the relational schema.
Uses
R2RML supports several forms of relational-to-RDF access. An R2RML processor can materialize an RDF dataset from relational data, retaining the generated triples independently of the source database.[1]
R2RML can also be used for virtual RDF access, where the relational database remains the underlying data store and mappings are used to expose an RDF-level view. In virtual knowledge graph systems, mappings connect the relational source schema to an RDF or ontology-level representation; independent literature identifies R2RML as the standard mapping language for this component.[4]
The W3C specification also identifies virtual SPARQL endpoints and Linked Data interfaces as possible R2RML processor architectures.[1]
Implementations and conformance
During standardization, the RDB2RDF Working Group maintained a common test suite and implementation report for R2RML and the Direct Mapping specification. The implementation report evaluated processors against common test cases to demonstrate implementation coverage and interoperability of specification features.[11]
By August 2012, the W3C reported sufficient implementation experience and multiple interoperable implementations to advance R2RML directly from its second Last Call Working Draft to Proposed Recommendation without another Candidate Recommendation phase.[10]
Extensions
R2RML was designed specifically for relational data sources. Later mapping languages retained parts of its model while extending it to other kinds of input.
RML (RDF Mapping Language) generalized R2RML beyond relational databases to heterogeneous data structures and formats. Independent literature describes RML as an extension of R2RML that retains its mapping-rule model and remains backward compatible with R2RML for relational sources.[3][12]
Other extensions include xR2RML, proposed in 2014 to extend the R2RML model toward non-relational and heterogeneous databases.[3]
See also
- Data integration
- Data mapping
- Knowledge graph
- Linked Data
- Resource Description Framework
- Semantic Web
- SPARQL
- Turtle (syntax)
References
- ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 "R2RML: RDB to RDF Mapping Language". World Wide Web Consortium. 27 September 2012. https://www.w3.org/TR/r2rml/.
- ↑ 2.0 2.1 "R2RML: RDB to RDF Mapping Language publication history". World Wide Web Consortium. https://www.w3.org/standards/history/r2rml/.
- ↑ 3.0 3.1 3.2 3.3 Dimou, Anastasia (2020). "Knowledge Graphs Creation". Knowledge Graphs: Methodology, Tools and Selected Use Cases. Springer. doi:10.1007/978-3-030-53199-7_4.
- ↑ 4.0 4.1 Xiao, Guohui; Calvanese, Diego; Kontchakov, Roman; Lembo, Domenico; Poggi, Antonella; Rosati, Riccardo; Zakharyaschev, Michael (2019). "Virtual Knowledge Graphs: An Overview of Systems and Use Cases". Data Intelligence 1 (3): 201–223. doi:10.1162/dint_a_00011.
- ↑ 5.0 5.1 "RDB2RDF Working Group Charter". World Wide Web Consortium. https://www.w3.org/2011/10/rdb2rdf-charter.html.
- ↑ "W3C RDB2RDF Incubator Group Report". World Wide Web Consortium. 26 January 2009. https://www.w3.org/2005/Incubator/rdb2rdf/XGR-rdb2rdf-20090126/.
- ↑ "First Draft of RDB to RDF Mapping Language (R2RML) Published". World Wide Web Consortium. 28 October 2010. https://www.w3.org/news/2010/first-draft-of-rdb-to-rdf-mapping-language-r2rml-published/.
- ↑ 8.0 8.1 "RDB to RDF Mapping Language (R2RML) and A Direct Mapping of Relational Data to RDF are W3C Recommendations". World Wide Web Consortium. 27 September 2012. https://www.w3.org/news/2012/rdb-to-rdf-mapping-language-r2rml-and-a-direct-mapping-of-relational-data-to-rdf-are-w3c-recommendat/.
- ↑ 9.0 9.1 "RDB2RDF Working Group – Publications". World Wide Web Consortium. https://www.w3.org/groups/wg/rdb2rdf/publications/.
- ↑ 10.0 10.1 "R2RML: RDB to RDF Mapping Language". World Wide Web Consortium. 14 August 2012. https://www.w3.org/TR/2012/PR-r2rml-20120814/.
- ↑ "RDB2RDF Implementation Report". World Wide Web Consortium. 14 August 2012. https://www.w3.org/TR/2012/NOTE-rdb2rdf-implementations-20120814/.
- ↑ Van Assche, Dylan; De Meester, Ben; Heyvaert, Pieter; Delva, Thomas; Dimou, Anastasia (2023). "The RML Ontology: A Community-Driven Modular Redesign After a Decade of Experience in Mapping Heterogeneous Data to RDF". Springer. doi:10.1007/978-3-031-47243-5_9.
External links
