CARVIEW |
R2RML and Direct Mapping Test Cases
W3C Working Group Note 14 August 2012
- This version:
- https://www.w3.org/TR/2012/NOTE-rdb2rdf-test-cases-20120814/
- Latest version:
- https://www.w3.org/TR/rdb2rdf-test-cases/
- Editors:
- Boris Villazón-Terrazas, Universidad Politécnica de Madrid
- Michael Hausenblas, DERI, NUI Galway
Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
Abstract
This document defines the R2RML and Direct Mapping Test Cases deliverable for the RDB2RDF Working Group as defined in the Working Group's Charter.
Status of this Document
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document is a Working Group Note, produced by the RDB2RDF Working Group. It contains test cases for the Working Group's main deliverables (the R2RML and Direct Mapping specifications). It presents a snapshot at the time of publication (14 August 2012) of the test suite that the Working Group has maintained in parallel with the development of these specifications. This snapshot was used by implementers to document the status of their implementations for the RDB2RDF Implementation Report. While work on the R2RML and Direct Mapping specifications is considered complete, the Working Group may continue work on the test suite in order to improve its coverage, usability and documentation. This R2RML and Direct Mapping Test Cases document may be updated to reflect these changes.
Comments on this document should be sent to public-rdb2rdf-comments@w3.org, a mailing list with a public archive.
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Table of Contents
1 Introduction2 Organization
3 Terminology
4 Test Cases
- D002-1table2columns1row - One table, two columns, one row, no primary key
- DirectGraphTC0002 - Two columns mapping, generation of a BlankNode subject
- R2RMLTC0002a - Two columns mapping, generation of a subject URI by the concatenation of two column values
- R2RMLTC0002b - Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType
- R2RMLTC0002c - Two columns mapping, an undefined SQL identifier
- R2RMLTC0002d - Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns
- R2RMLTC0002e - Two columns mapping, an undefined rr:tableName
- R2RMLTC0002f - Two columns mapping, delimited identifiers referenced as regular identifiers
- R2RMLTC0002g - Two columns mapping, invalid SQL query
- R2RMLTC0002h - Two columns mapping, duplicate column name in SELECT
- R2RMLTC0002i - Two columns mapping, SQL Version identifier
- R2RMLTC0002j - Two columns mapping, qualified column names
- DirectGraphTC0002 - Two columns mapping, generation of a BlankNode subject
- D003-1table3columns1row - One table, three columns, one row, no primary key
- DirectGraphTC0003 - Three columns mapping, generation of a BlankNode
- R2RMLTC0003a - Three columns mapping, undefined SQL Version identifier
- R2RMLTC0003b - Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal
- R2RMLTC0003c - Three columns mapping, by using a rr:template to produce literal
- DirectGraphTC0003 - Three columns mapping, generation of a BlankNode
- D007-1table1primarykey2columns1row - One table, one primary key, two columns, one row
- DirectGraphTC0007 - Generation of a subject
- R2RMLTC0007a - Typing resources by relying on rdf:type predicate
- R2RMLTC0007b - Assigning triples to Named Graphs
- R2RMLTC0007c - One column mapping, using rr:class
- R2RMLTC0007d - One column mapping, specifying an rr:predicateObjectMap with rdf:type
- R2RMLTC0007e - One column mapping, using rr:graphMap and rr:class
- R2RMLTC0007f - One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type
- R2RMLTC0007g - Assigning triples to the default graph
- R2RMLTC0007h - Assigning triples to a non-IRI named graph
- DirectGraphTC0007 - Generation of a subject
- D008-1table1compositeprimarykey3columns1row - One table, a composite primary key, three columns, one row
- DirectGraphTC0008 - Generation of direct graph from a table with composite primary key
- R2RMLTC0008a - Generation of triples to a target graph by using rr:graphMap and rr:template
- R2RMLTC0008b - Generation of triples referencing object map
- R2RMLTC0008c - Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap
- DirectGraphTC0008 - Generation of direct graph from a table with composite primary key
- D012-2tables2duplicates0nulls - Two tables, two duplicate records, zero nulls, no primary key
- DirectGraphTC0012 - Generation of direct graph from a database without primary keys
- R2RMLTC0012a - Duplicate tuples generate same blank node
- R2RMLTC0012b - Duplicate tuples generate same blank node
- R2RMLTC0012c - TriplesMap without subjectMap
- R2RMLTC0012d - TriplesMap with two subjectMap
- R2RMLTC0012e - Default mapping
- DirectGraphTC0012 - Generation of direct graph from a database without primary keys
- D014-3tables1primarykey1foreignkey - 3 tables, one primary key, one foreign key
- DirectGraphTC0014 - Generation of direct graph from a database with primary key referencing candidate key
- R2RMLTC0014a - Subjectmap with rr:inverseExpression
- R2RMLTC0014b - Triplesmaps with rr:inverseExpression and rr:joinCondition
- R2RMLTC0014c - Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps
- R2RMLTC0014d - three tables, one primary key, one foreign key
- DirectGraphTC0014 - Generation of direct graph from a database with primary key referencing candidate key
- D016-1table1primarykey10columns3rowsSQLdatatypes - One table, one primary key, ten columns, three rows with sql datatypes
- DirectGraphTC0016 - Generation of direct graph from a database with sql datatypes
- R2RMLTC0016a - Table with datatypes: string and integer
- R2RMLTC0016b - Table with datatypes: real and float
- R2RMLTC0016c - Table with datatypes: date and timestamp
- R2RMLTC0016d - Table with datatypes, boolean conversions
- R2RMLTC0016e - Table with datatypes, binary column
- DirectGraphTC0016 - Generation of direct graph from a database with sql datatypes
1 Introduction
This document defines the R2RML and Direct mapping test cases, consisting of a collection of test case documents (input and expected output) and the test case manifest document (describing each test case).
The purpose of the Test Cases is to verify and validate the specification of the R2RML language and Direct mapping. Moreover, these test cases can be useful to create a test harness or automated test framework for testing the interoperable implementors, i.e. R2RML engines.
The R2RML Test Case coverage matrix is available here . The DM Test Case coverage matrix is available here .
2 Organization
Test cases are organized by database. We use a descriptive naming convention for the databases. For each database we have:
- Graphical representation of the tables involved.
- The SQL script associated to the database (sql file).
- Direct mappping associated to the database and it includes:
- Title
- Purpose
- Specification Reference
- Review Status
- Associated file (ttl)
- One or more R2RML Test Cases associated to the database. A R2RML test case includes:
- Title
- Purpose
- Specification Reference
- Review Status
- Associated file (nq)
The associated files (sql, ttl, and nq) are available at the W3C repository.
The following picture illustrates the organization.

3 Terminology
- R2RML engine
- A software that takes a relational database (RDB) and a R2RML mapping document as input and produces an RDF graph according to the mapping document.
- Test case manifest document
- An RDF document that describe the test cases, relating input with expected output as well as containing additional metadata (such as description) about each test case. Typically used in a harness to automatically test an implementation regarding its conformance.
4 Test Cases
This section presents the set of test cases we have created. It is worth mentioning that the schema-qualified name feature is not excercise in the test cases.
Each test case is described using the Test Metadata vocabulary in RDFa.
Throughout all test cases, we use the base IRI <https://example.com/base/>:
- to turn relative IRIs generated by the Direct Mapping into absolute IRIs,
- as the required base IRI input to the R2RML processor.
R2RML is a mapping language for SQL 2008. Databases that do not support the standard SQL 2008 datatypes cannot pass the tests. Section 10 of the R2RML specification already discusses how you are supposed to deal with vendor-specific types. Implemenetors who are interested in supporting R2RML over non-SQL-compatible databases like PostgreSQL essentially need to define a slightly modified flavour of R2MRL that can handle the vendor-specific aspects. To validate an implementation of such a modified R2RML flavour, implementors obviously need a slightly modified test suite. It is not the responsibility of the WG to produce such R2RML flavours or modified test suites. On the other hand, several WG members will be interested in producing some of those, and of course it would be good if they collaborate and share results, and the WG mailing lists are a good place to discuss such work.
D000-1table1column0rows
Title: One table, a column, zero rows, no primary key
Graphical representation:
Name VARCHAR(50) |
---|
SQL:
CREATE TABLE "Student" ( "Name" varchar(50) );
File: D000-1table1column0rows
DirectGraphTC0000
Title: Direct mapping of an empty table
Purpose: Tests if an empty table produces an empty RDF graph
Specification reference: #no-pk
Review status: unreviewed
Input: D000-1table1column0rows
Expected result: DirectGraphTC0000
RDF:
# empty graph
R2RMLTC0000
Title: one table, one column, zero rows
Purpose: Tests if an empty table produces an empty RDF graph
Specification reference: #physical-tables
Review status: unreviewed
Input: D000-1table1column0rows
Expected result: mapped.nq
RDF:
Subject | Predicate | Object | Graph |
---|
R2RML mapping: R2RMLTC0000
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ] ; rr:subjectMap [ rr:template "https://example.com/{\"Name\"}" ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
D001-1table1column1row
Title: One table, one column, one row, no primary key
Graphical representation:
Name VARCHAR(50) |
---|
Venus |
SQL:
CREATE TABLE "Student" ( "Name" varchar(50) ); INSERT INTO "Student" ("Name") VALUES ('Venus');
File: D001-1table1column1row
DirectGraphTC0001
Title: Direct mapping that generates a BlankNode
Purpose: Tests: (1) one column mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property
Specification reference: #no-pk
Review status: unreviewed
Input: D001-1table1column1row
Expected result: DirectGraphTC0001
RDF:
@base <https://example.com/base/> . _:a <Student#Name> "Venus". _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> .
R2RMLTC0001a
Title: One column mapping, subject URI generation by using rr:template
Purpose: Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D001-1table1column1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0001a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"Name\"}" ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0001b
Title: One column mapping, generation of a BlankNode subject by using rr:termType
Purpose: Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property
Specification reference: #termtype
Review status: unreviewed
Input: D001-1table1column1row
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:Venus | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0001b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "{\"Name\"}"; rr:termType rr:BlankNode ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"Name\"" ] ] .
D002-1table2columns1row
Title: One table, two columns, one row, no primary key
Graphical representation:
ID INTEGER |
Name VARCHAR(15) |
---|---|
10 | Venus |
SQL:
CREATE TABLE "Student" ( "ID" INTEGER, "Name" VARCHAR(15) ); INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
File: D002-1table2columns1row
DirectGraphTC0002
Title: Two columns mapping, generation of a BlankNode subject
Purpose: Tests: (1) two columns mapping; (2) generation of a BlankNode subject; (3) one column to one property
Specification reference: #no-pk
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: DirectGraphTC0002
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . _:a <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . _:a <Student#Name> "Venus" .
R2RMLTC0002a
Title: Two columns mapping, generation of a subject URI by the concatenation of two column values
Purpose: Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property
Specification reference: #from-template
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
<https://example.com/10/Venus> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
R2RML mapping: R2RMLTC0002a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Name\"}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0002b
Title: Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType
Purpose: Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property
Specification reference: #termtype
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:students10 | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0002b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:template "students{\"ID\"}"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0002c
Title: Two columns mapping, an undefined SQL identifier
Purpose: Tests the presence of an undefined SQL identifier
Specification reference: #dfn-sql-identifier
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0002c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"IDs\""; ] ] .
R2RMLTC0002d
Title: Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns
Purpose: Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property
Specification reference: #dfn-sql-query
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: mappedd.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:Student10 | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0002d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ Select ('Student' || "ID" ) AS StudentId , "ID" , "Name" from "Student" """ ]; rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0002e
Title: Two columns mapping, an undefined rr:tableName
Purpose: Tests the presence of an undefined rr:tableName
Specification reference: #dfn-sql-identifier
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0002e
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Students\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; .
R2RMLTC0002f
Title: Two columns mapping, delimited identifiers referenced as regular identifiers
Purpose: Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not
Specification reference: #from-template
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0002f
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{ID}/{Name}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0002g
Title: Two columns mapping, invalid SQL query
Purpose: Tests the presence of an invalid SQL query
Specification reference: #dfn-sql-identifier
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0002g
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ THIS IS NOT A VALID SQL QUERY """ ]; rr:subjectMap [ rr:column "StudentId"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; .
R2RMLTC0002h
Title: Two columns mapping, duplicate column name in SELECT
Purpose: Tests the presence of duplicate column names in the SELECT list of the SQL query
Specification reference: #dfn-sql-identifier
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0002h
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ Select ('Student' || ID ) AS StudentId , "ID" , "Name" , 1 AS "ID" from "Student" """ ]; rr:subjectMap [ rr:column "StudentId"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; .
R2RMLTC0002i
Title: Two columns mapping, SQL Version identifier
Purpose: Tests the presence of a SQL Version identifier
Specification reference: #dfn-sql-version-identifier
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: mappedi.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0002i
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "ID", "Name" FROM "Student" """; rr:sqlVersion rr:SQL2008 ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0002j
Title: Two columns mapping, qualified column names
Purpose: Tests the presence of qualified column names in the SELECT list of the SQL query
Specification reference: #dfn-schema-qualified-name
Review status: unreviewed
Input: D002-1table2columns1row
Expected result: mappedj.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
R2RML mapping: R2RMLTC0002j
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Student"."ID", "Student"."Name" FROM "Student" """ ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
D003-1table3columns1row
Title: One table, three columns, one row, no primary key
Graphical representation:
ID INTEGER |
FirstName VARCHAR(50) |
LastName VARCHAR(50) |
---|---|---|
10 | Venus | Williams |
SQL:
CREATE TABLE "Student" ( "ID" INTEGER, "FirstName" VARCHAR(50), "LastName" VARCHAR(50) ); INSERT INTO "Student" ("ID", "FirstName", "LastName") VALUES (10,'Venus', 'Williams');
File: D003-1table3columns1row
DirectGraphTC0003
Title: Three columns mapping, generation of a BlankNode
Purpose: Tests: (1) three columns mapping; (2) generation of a "BlankNode" subject; (3) one column to one property
Specification reference: #no-pk
Review status: unreviewed
Input: D003-1table3columns1row
Expected result: DirectGraphTC0003
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . _:a <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . _:a <Student#FirstName> "Venus" . _:a <Student#LastName> "Williams" .
R2RMLTC0003a
Title: Three columns mapping, undefined SQL Version identifier
Purpose: Tests the presence of an undefined SQL Version identifier
Specification reference: #dfn-sql-version-identifier
Review status: unreviewed
Input: D003-1table3columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0003a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "ID", "FirstName", "LastName" FROM "Student" """; rr:sqlVersion rr:SQL1979 ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"FirstName\"}-{\"LastName\"}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; .
R2RMLTC0003b
Title: Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal
Purpose: Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery
Specification reference: #dfn-sql-query
Review status: unreviewed
Input: D003-1table3columns1row
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
R2RML mapping: R2RMLTC0003b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "ID", ("FirstName" || ' ' || "LastName") AS Name FROM "Student" """ ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "Name" ] ] .
R2RMLTC0003c
Title: Three columns mapping, by using a rr:template to produce literal
Purpose: Tests: (1) three column mapping; and (2) the use of rr:template to produce literal
Specification reference: #from-template
Review status: unreviewed
Input: D003-1table3columns1row
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student10> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
R2RML mapping: R2RMLTC0003c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:template "{\"FirstName\"} {\"LastName\"}"; rr:termType rr:Literal; ] ] .
D004-1table2columns1row
Title: One table, two columns, one row, projection, no primary key
Graphical representation:
Student VARCHAR(50) |
Sport VARCHAR(50) |
---|---|
Venus | Tennis |
SQL:
CREATE TABLE "Student_Sport"( "Student" varchar(50), "Sport" varchar(50) ); INSERT INTO "Student_Sport" ("Student","Sport") VALUES ('Venus', 'Tennis');
File: D004-1table2columns1row
DirectGraphTC0004
Title: Two column mapping, generation of a BlankNode subject
Purpose: Tests: (1) two column mapping (2) generation of a "BlankNode" subject
Specification reference: #no-pk
Review status: unreviewed
Input: D004-1table2columns1row
Expected result: DirectGraphTC0004
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student_Sport> . _:a <Student_Sport#Student> "Venus" . _:a <Student_Sport#Sport> "Tennis" .
R2RMLTC0004a
Title: Two column mapping, from one row table to two different triples
Purpose: Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class
Specification reference: #typing
Review status: unreviewed
Input: D004-1table2columns1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
<https://example.com/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/Student> | |
<https://example.com/Tennis> | <https://xmlns.com/foaf/0.1/name> | "Tennis" | |
<https://example.com/Tennis> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/Sport> | |
R2RML mapping: R2RMLTC0004a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student_Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"Student\"}"; rr:class ex:Student ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Student\"" ] ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student_Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"Sport\"}"; rr:class ex:Sport ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Sport\"" ] ] .
R2RMLTC0004b
Title: Two column mapping, presence of rr:termType rr:Literal on rr:subjectMap
Purpose: Tests: (1) two column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid
Specification reference: #termtype
Review status: unreviewed
Input: D004-1table2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0004b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT ('Student' || "Student") AS StudentId, "Student" FROM "Student_Sport" """; ] ; rr:subjectMap [ rr:column "StudentId"; rr:termType rr:Literal; rr:class ex:Student ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Student\"" ] ] .
D005-1table3columns3rows2duplicates
Title: One table, three columns, three rows, two duplicate tuples, no primary key
Graphical representation:
fname VARCHAR(20) |
lname VARCHAR(20) |
amount DOUBLE |
---|---|---|
Bob | Smith | 30.0E0 |
Sue | Jones | 20.0E0 |
Bob | Smith | 30.0E0 |
SQL:
CREATE TABLE "IOUs" ( "fname" VARCHAR(20), "lname" VARCHAR(20), "amount" FLOAT); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Sue', 'Jones', 20); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30);
DirectGraphTC0005
Title: Generation of BlankNodes from duplicate tuples
Purpose: Tests the generation of Blank Nodes for duplicate tuples
Specification reference: #no-pk
Review status: unreviewed
Input: D005-1table3columns3rows2duplicates
Expected result: DirectGraphTC0005
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:a <IOUs#fname> "Bob" . _:a <IOUs#lname> "Smith" . _:a <IOUs#amount> "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> . _:b <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:b <IOUs#fname> "Sue" . _:b <IOUs#lname> "Jones" . _:b <IOUs#amount> "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> . _:c <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:c <IOUs#fname> "Bob" . _:c <IOUs#lname> "Smith" . _:c <IOUs#amount> "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> .
R2RMLTC0005a
Title: Typing of resources
Purpose: Tests the typing of resources
Specification reference: #typing
Review status: unreviewed
Input: D005-1table3columns3rows2duplicates
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Bob;Smith> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Bob;Smith> | <https://example.com/owes> | "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Sue;Jones> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Sue;Jones> | <https://example.com/owes> | "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
R2RML mapping: R2RMLTC0005a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"fname\"};{\"lname\"}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:owes ; rr:objectMap [ rr:column "\"amount\""; ] ]; .
R2RMLTC0005b
Title: Default mapping
Purpose: Tests the generation of a default mapping for tables without a primary key
Specification reference: #default-mappings
Review status: unreviewed
Input: D005-1table3columns3rows2duplicates
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:BobSmith | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/IOUs> | |
_:BobSmith | <https://example.com/base/IOUs#fname> | "Bob" | |
_:BobSmith | <https://example.com/base/IOUs#lname> | "Smith" | |
_:BobSmith | <https://example.com/base/IOUs#amount> | "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
_:SueJones | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/IOUs> | |
_:SueJones | <https://example.com/base/IOUs#fname> | "Sue" | |
_:SueJones | <https://example.com/base/IOUs#lname> | "Jones" | |
_:SueJones | <https://example.com/base/IOUs#amount> | "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
R2RML mapping: R2RMLTC0005b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}"; rr:class <IOUs>; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate <IOUs#fname> ; rr:objectMap [ rr:column "\"fname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#lname> ; rr:objectMap [ rr:column "\"lname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#amount> ; rr:objectMap [ rr:column "\"amount\""; ] ]; .
D006-1table1primarykey1column1row
Title: One table, one primary key, one column, one row
Graphical representation:
Name (PK) VARCHAR(50) |
---|
Venus |
SQL:
CREATE TABLE "Student" ( "Name" varchar(50) PRIMARY KEY ); INSERT INTO "Student" ("Name") VALUES ('Venus');
DirectGraphTC0006
Title: Generation of subjects
Purpose: Tests the generation of subjects
Specification reference: #lead-ex
Review status: unreviewed
Input: D006-1table1primarykey1column1row
Expected result: DirectGraphTC0006
RDF:
@base <https://example.com/base/> . <Student/Name=Venus> <Student#Name> "Venus" . <Student/Name=Venus> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> .
R2RMLTC0006a
Title: Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap
Purpose: Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap
Specification reference: #constant
Review status: unreviewed
Input: D006-1table1primarykey1column1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/BadStudent> | <https://example.com/description> | "Bad Student" | <https://example.com/graph/student> |
R2RML mapping: R2RMLTC0006a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:constant ex:BadStudent; rr:graphMap [ rr:constant <https://example.com/graph/student> ]; ]; rr:predicateObjectMap [ rr:predicateMap [ rr:constant ex:description ]; rr:objectMap [ rr:constant "Bad Student"; ] ] .
D007-1table1primarykey2columns1row
Title: One table, one primary key, two columns, one row
Graphical representation:
ID (PK) INTEGER |
Name VARCHAR(50) |
---|---|
10 | Venus |
SQL:
CREATE TABLE "Student" ( "ID" integer, "Name" varchar(50), PRIMARY KEY ("ID") ); INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
DirectGraphTC0007
Title: Generation of a subject
Purpose: Tests the generation of a subject
Specification reference: #lead-ex
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: DirectGraphTC0007
RDF:
@base <https://example.com/base/> . <Student/ID=10> <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=10> <Student#Name> "Venus" . <Student/ID=10> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> .
R2RMLTC0007a
Title: Typing resources by relying on rdf:type predicate
Purpose: Tests the typing resources by relying on rdf:type predicate
Specification reference: #typing
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
R2RML mapping: R2RMLTC0007a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:object foaf:Person; ]; .
R2RMLTC0007b
Title: Assigning triples to Named Graphs
Purpose: Tests the generation of triples to a named graph
Specification reference: #named-graphs
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | <https://example.com/PersonGraph> |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | <https://example.com/PersonGraph> |
R2RML mapping: R2RMLTC0007b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graph ex:PersonGraph; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007c
Title: One column mapping, using rr:class
Purpose: Tests subjectmap with more than one class IRIs, rr:class
Specification reference: #typing
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
<https://example.com/Student/10/Venus> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/Student> | |
R2RML mapping: R2RMLTC0007c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:class foaf:Person,ex:Student; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007d
Title: One column mapping, specifying an rr:predicateObjectMap with rdf:type
Purpose: Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type
Specification reference: #typing
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappedd.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
<https://example.com/Student/10/Venus> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/Student> | |
R2RML mapping: R2RMLTC0007d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object ex:Student; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007e
Title: One column mapping, using rr:graphMap and rr:class
Purpose: Tests subjectmap with rr:graphMap and rr:class
Specification reference: #named-graphs
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappede.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | <https://example.com/PersonGraph> |
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | <https://example.com/PersonGraph> |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | <https://example.com/PersonGraph> |
R2RML mapping: R2RMLTC0007e
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graph ex:PersonGraph ; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007f
Title: One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type
Purpose: Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type
Specification reference: #named-graphs
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappedf.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | <https://example.com/PersonGraph> |
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | <https://example.com/PersonGraph> |
<https://example.com/Student/10/Venus> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | <https://example.com/PersonGraph> |
R2RML mapping: R2RMLTC0007f
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graph ex:PersonGraph ; ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:object foaf:Person ; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007g
Title: Assigning triples to the default graph
Purpose: Tests the generation of triples to the default graph
Specification reference: #named-graphs
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: mappedg.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus> | <https://xmlns.com/foaf/0.1/name> | "Venus" | |
<https://example.com/Student/10/Venus> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
R2RML mapping: R2RMLTC0007g
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graph rr:defaultGraph; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0007h
Title: Assigning triples to a non-IRI named graph
Purpose: Tests the generation of triples to a non-IRI named graph, which is an error
Specification reference: #named-graphs
Review status: unreviewed
Input: D007-1table1primarykey2columns1row
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0007h
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graphMap [ rr:column "\"Name\""; rr:termType rr:Literal; ] ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"Name\"" ] ] .
D008-1table1compositeprimarykey3columns1row
Title: One table, a composite primary key, three columns, one row
Graphical representation:
ID (PK) INTEGER |
Name (PK) VARCHAR(50) |
Sport VARCHAR(50) |
---|---|---|
10 | Venus Williams | Tennis |
SQL:
CREATE TABLE "Student" ( "ID" integer, "Name" varchar(50), "Sport" varchar (50), PRIMARY KEY ("ID","Name") ); INSERT INTO "Student" ("ID", "Name","Sport") VALUES(10,'Venus Williams','Tennis');
DirectGraphTC0008
Title: Generation of direct graph from a table with composite primary key
Purpose: Tests the generation of a direct graph from a table with a composite primary key
Specification reference: #lead-ex
Review status: unreviewed
Input: D008-1table1compositeprimarykey3columns1row
Expected result: DirectGraphTC0008
RDF:
@base <https://example.com/base/> . <Student/ID=10;Name=Venus%20Williams> <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=10;Name=Venus%20Williams> <Student#Name> "Venus Williams" . <Student/ID=10;Name=Venus%20Williams> <Student#Sport> "Tennis" . <Student/ID=10;Name=Venus%20Williams> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> .
R2RMLTC0008a
Title: Generation of triples to a target graph by using rr:graphMap and rr:template
Purpose: Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template
Specification reference: #named-graphs
Review status: unreviewed
Input: D008-1table1compositeprimarykey3columns1row
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus%20Williams> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | <https://example.com/graph/Student/10/Venus%20Williams> |
<https://example.com/Student/10/Venus%20Williams> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | <https://example.com/graph/Student/10/Venus%20Williams> |
<https://example.com/Student/10/Venus%20Williams> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | <https://example.com/graph/Student/10/Venus%20Williams> |
<https://example.com/Student/10/Venus%20Williams> | <https://example.com/Sport> | "Tennis" | <https://example.com/graph/Student/10/Venus%20Williams> |
R2RML mapping: R2RMLTC0008a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; rr:graphMap [ rr:template "https://example.com/graph/Student/{\"ID\"}/{\"Name\"}"; ] ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ]; rr:predicateObjectMap [ rr:predicate ex:Sport ; rr:objectMap [ rr:column "\"Sport\"" ] ] .
R2RMLTC0008b
Title: Generation of triples referencing object map
Purpose: Tests the mapping specification referencing object map without join
Specification reference: #dfn-referencing-object-map
Review status: unreviewed
Input: D008-1table1compositeprimarykey3columns1row
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus%20Williams> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Student/10/Venus%20Williams> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
<https://example.com/Student/10/Venus%20Williams> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Student/10/Venus%20Williams> | <https://example.com/Sport> | <https://example.com/Tennis> | |
<https://example.com/Tennis> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/activity/Sport> | |
R2RML mapping: R2RMLTC0008b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix activity: <https://example.com/activity/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"Sport\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:object activity:Sport ; ]; . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:object foaf:Person ; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ]; rr:predicateObjectMap [ rr:predicate ex:Sport ; rr:objectMap <RefObjectMap1> ] . <RefObjectMap1> a rr:RefObjectMap; rr:parentTriplesMap <TriplesMap2> ; .
R2RMLTC0008c
Title: Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap
Purpose: Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap
Specification reference: #physical-tables
Review status: unreviewed
Input: D008-1table1compositeprimarykey3columns1row
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Student/10/Venus%20Williams> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
<https://example.com/Student/10/Venus%20Williams> | <https://example.com/name> | "Venus Williams" | |
R2RML mapping: R2RMLTC0008c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/Student/{\"ID\"}/{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:predicate ex:name ; rr:objectMap [ rr:column "\"Name\"" ] ]; .
D009-2tables1primarykey1foreignkey
Title: Two tables, a primary key, a foreign key
Graphical representation:
ID (PK) INTEGER |
Sport (FK) INTEGER |
Name VARCHAR(50) |
---|---|---|
10 | 100 | Venus Williams |
20 | NULL | Demi Moore |
ID (PK) INTEGER |
Name VARCHAR(50) |
---|---|
100 | Tennis |
SQL:
CREATE TABLE "Sport" ( "ID" integer, "Name" varchar (50), PRIMARY KEY ("ID") ); CREATE TABLE "Student" ( "ID" integer, "Name" varchar(50), "Sport" integer, PRIMARY KEY ("ID"), FOREIGN KEY("Sport") REFERENCES "Sport"("ID") ); INSERT INTO "Sport" ("ID", "Name") VALUES (100,'Tennis'); INSERT INTO "Student" ("ID", "Name", "Sport") VALUES (10,'Venus Williams', 100); INSERT INTO "Student" ("ID", "Name", "Sport") VALUES (20,'Demi Moore', NULL);
DirectGraphTC0009
Title: Two tables 1 primary key 1 foreign key
Purpose: Tests two tables with a primary key and a foreign key
Specification reference: #fk-candidate
Review status: unreviewed
Input: D009-2tables1primarykey1foreignkey
Expected result: DirectGraphTC0009
RDF:
@base <https://example.com/base/> . <Student/ID=10> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . <Student/ID=10> <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=10> <Student#Name> "Venus Williams" . <Student/ID=10> <Student#Sport> "100"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=10> <Student#ref-Sport> <Sport/ID=100> . <Student/ID=20> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . <Student/ID=20> <Student#ID> "20"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=20> <Student#Name> "Demi Moore" . <Sport/ID=100> <Sport#ID> "100"^^<https://www.w3.org/2001/XMLSchema#integer> . <Sport/ID=100> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Sport> . <Sport/ID=100> <Sport#Name> "Tennis" .
R2RMLTC0009a
Title: Generation of triples from foreign key relations
Purpose: Test foreign key relationships among logical tables
Specification reference: #foreign-key
Review status: unreviewed
Input: D009-2tables1primarykey1foreignkey
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/resource/student_10> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
<https://example.com/resource/student_20> | <https://xmlns.com/foaf/0.1/name> | "Demi Moore" | |
<https://example.com/resource/sport_100> | <https://www.w3.org/2000/01/rdf-schema#label> | "Tennis" | |
<https://example.com/resource/student_10> | <https://example.com/ontology/practises> | <https://example.com/resource/sport_100> | |
R2RML mapping: R2RMLTC0009a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/resource/student_{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\""; ]; ]; rr:predicateObjectMap [ rr:predicate <https://example.com/ontology/practises> ; rr:objectMap [ a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap2>; rr:joinCondition [ rr:child "\"Sport\"" ; rr:parent "\"ID\"" ; ] ]; ]; . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/resource/sport_{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdfs:label ; rr:objectMap [ rr:column "\"Name\""; ]; ]; .
R2RMLTC0009b
Title: Generation of triples to multiple graphs
Purpose: Test that results from distinct parts of the mapping can be directed to different target graphs.
Specification reference: #named-graphs
Review status: unreviewed
Input: D009-2tables1primarykey1foreignkey
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/resource/student_10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/ontology/Student> | <https://example.com/graph/students> |
<https://example.com/resource/student_10> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | <https://example.com/graph/students> |
<https://example.com/resource/student_20> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/ontology/Student> | <https://example.com/graph/students> |
<https://example.com/resource/student_20> | <https://xmlns.com/foaf/0.1/name> | "Demi Moore" | <https://example.com/graph/students> |
<https://example.com/resource/sport_100> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/ontology/Sport> | <https://example.com/graph/sports> |
<https://example.com/resource/sport_100> | <https://www.w3.org/2000/01/rdf-schema#label> | "Tennis" | <https://example.com/graph/sports> |
<https://example.com/resource/student_10> | <https://example.com/ontology/practises> | <https://example.com/resource/sport_100> | <https://example.com/graph/practise> |
<https://example.com/resource/student_10> | <https://example.com/ontology/practises> | <https://example.com/resource/sport_100> | <https://example.com/graph/students> |
R2RML mapping: R2RMLTC0009b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/resource/student_{\"ID\"}"; rr:class <https://example.com/ontology/Student>; rr:graph <https://example.com/graph/students> ; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\""; ]; rr:graph <https://example.com/graph/students> ; ]; rr:predicateObjectMap [ rr:predicate <https://example.com/ontology/practises> ; rr:objectMap [ a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap2>; rr:joinCondition [ rr:child "\"Sport\"" ; rr:parent "\"ID\"" ; ] ]; rr:graph <https://example.com/graph/practise> ; ]; . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/resource/sport_{\"ID\"}"; rr:class <https://example.com/ontology/Sport>; rr:graph <https://example.com/graph/sports> ; ]; rr:predicateObjectMap [ rr:predicate rdfs:label ; rr:objectMap [ rr:column "\"Name\""; ]; ]; .
R2RMLTC0009c
Title: Unnamed column in a logical table
Purpose: Test a logical table with unnamed column.
Specification reference: #dfn-sql-query
Review status: unreviewed
Input: D009-2tables1primarykey1foreignkey
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/resource/student_Venus%20Williams> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
<https://example.com/resource/student_Demi%20Moore> | <https://xmlns.com/foaf/0.1/name> | "Demi Moore" | |
R2RML mapping: R2RMLTC0009c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Name", COUNT("Sport") FROM "Student" GROUP BY "Name" """ ]; rr:subjectMap [ rr:template "https://example.com/resource/student_{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\""; ]; ]; .
R2RMLTC0009d
Title: Named column in logical table
Purpose: Test a logical table named column.
Specification reference: #dfn-sql-query
Review status: unreviewed
Input: D009-2tables1primarykey1foreignkey
Expected result: mappedd.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/resource/student_Venus%20Williams> | <https://xmlns.com/foaf/0.1/name> | "Venus Williams" | |
<https://example.com/resource/student_Venus%20Williams> | <https://example.com/numSport> | "1"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/resource/student_Demi%20Moore> | <https://xmlns.com/foaf/0.1/name> | "Demi Moore" | |
<https://example.com/resource/student_Demi%20Moore> | <https://example.com/numSport> | "0"^^<https://www.w3.org/2001/XMLSchema#integer> | |
R2RML mapping: R2RMLTC0009d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Name", COUNT("Sport") as SPORTCOUNT FROM "Student" GROUP BY "Name" """ ]; rr:subjectMap [ rr:template "https://example.com/resource/student_{\"Name\"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\""; ]; ]; rr:predicateObjectMap [ rr:predicate ex:numSport ; rr:objectMap [ rr:column "SPORTCOUNT"; ]; ]; .
D010-1table1primarykey3colums3rows
Title: One table, a primary key, three columns, three rows
Graphical representation:
Country Code (PK) INTEGER |
Name VARCHAR(100) |
ISO 3166 VARCHAR(10) |
---|---|---|
1 | Bolivia, Plurinational State of | BO |
2 | Ireland | IE |
3 | Saint Martin (French part) | MF |
SQL:
CREATE TABLE "Country Info" ( "Country Code" INTEGER PRIMARY KEY, "Name" VARCHAR(100), "ISO 3166" VARCHAR(10) ); INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (1, 'Bolivia, Plurinational State of', 'BO'); INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (2, 'Ireland', 'IE'); INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (3, 'Saint Martin (French part)', 'MF');
DirectGraphTC0010
Title: Generation of direct graph for table names with spaces
Purpose: Tests the generation of the direct graph for table names with spaces
Specification reference: #lead-ex
Review status: unreviewed
Input: D010-1table1primarykey3colums3rows
Expected result: DirectGraphTC0010
RDF:
@base <https://example.com/base/> . <Country%20Info/Country%20Code=1> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country%20Info> . <Country%20Info/Country%20Code=1> <Country%20Info#Country%20Code> "1"^^<https://www.w3.org/2001/XMLSchema#integer> . <Country%20Info/Country%20Code=1> <Country%20Info#Name> "Bolivia, Plurinational State of" . <Country%20Info/Country%20Code=1> <Country%20Info#ISO%203166> "BO" . <Country%20Info/Country%20Code=2> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country%20Info> . <Country%20Info/Country%20Code=2> <Country%20Info#Country%20Code> "2"^^<https://www.w3.org/2001/XMLSchema#integer> . <Country%20Info/Country%20Code=2> <Country%20Info#Name> "Ireland" . <Country%20Info/Country%20Code=2> <Country%20Info#ISO%203166> "IE" . <Country%20Info/Country%20Code=3> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country%20Info> . <Country%20Info/Country%20Code=3> <Country%20Info#Country%20Code> "3"^^<https://www.w3.org/2001/XMLSchema#integer> . <Country%20Info/Country%20Code=3> <Country%20Info#Name> "Saint Martin (French part)" . <Country%20Info/Country%20Code=3> <Country%20Info#ISO%203166> "MF" .
R2RMLTC0010a
Title: Template with table column with special chars
Purpose: Tests a template with blank space in column value
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D010-1table1primarykey3colums3rows
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/1> | <https://example.com/name> | "Bolivia, Plurinational State of" | |
<https://example.com/2> | <https://example.com/name> | "Ireland" | |
<https://example.com/3> | <https://example.com/name> | "Saint Martin (French part)" | |
R2RML mapping: R2RMLTC0010a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Country Info\""; ] ; rr:subjectMap [ rr:template "https://example.com/{\"Country Code\"}" ]; rr:predicateObjectMap [ rr:predicate ex:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0010b
Title: Template with table columns with special chars
Purpose: Tests a template with special chars in column value
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D010-1table1primarykey3colums3rows
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/1/Bolivia%2C%20Plurinational%20State%20of> | <https://example.com/name> | "Bolivia, Plurinational State of" | |
<https://example.com/2/Ireland> | <https://example.com/name> | "Ireland" | |
<https://example.com/3/Saint%20Martin%20%28French%20part%29> | <https://example.com/name> | "Saint Martin (French part)" | |
R2RML mapping: R2RMLTC0010b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Country Info\""; ] ; rr:subjectMap [ rr:template "https://example.com/{\"Country Code\"}/{\"Name\"}" ]; rr:predicateObjectMap [ rr:predicate ex:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
R2RMLTC0010c
Title: Template with table columns with special chars and backslashes
Purpose: Tests a template with special chars in column value and backslash escapes in string templates
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D010-1table1primarykey3colums3rows
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/1/Bolivia%2C%20Plurinational%20State%20of> | <https://example.com/code> | "{{{ BO }}}" | |
<https://example.com/2/Ireland> | <https://example.com/code> | "{{{ IE }}}" | |
<https://example.com/3/Saint%20Martin%20%28French%20part%29> | <https://example.com/code> | "{{{ MF }}}" | |
R2RML mapping: R2RMLTC0010c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Country Info\""; ] ; rr:subjectMap [ rr:template "https://example.com/{\"Country Code\"}/{\"Name\"}" ]; rr:predicateObjectMap [ rr:predicate ex:code ; rr:objectMap [ rr:template "\\{\\{\\{ {\"ISO 3166\"} \\}\\}\\}"; rr:termType rr:Literal; ] ] .
D011-M2MRelations
Title: Database with many to many relations
Graphical representation:
ID (PK) INTEGER |
FirstName VARCHAR(50) |
LastName VARCHAR(50) |
---|---|---|
10 | Venus | Williams |
11 | Fernando | Alonso |
12 | David | Villa |
ID_Student (PFK) INTEGER |
ID_Sport (PFK) INTEGER |
---|---|
10 | 110 |
11 | 111 |
11 | 112 |
12 | 111 |
ID (PK) INTEGER |
Description VARCHAR(50) |
---|---|
110 | Tennis |
111 | Football |
112 | Formula1 |
SQL:
CREATE TABLE "Student" ( "ID" integer PRIMARY KEY, "FirstName" varchar(50), "LastName" varchar(50) ); CREATE TABLE "Sport" ( "ID" integer PRIMARY KEY, "Description" varchar(50) ); CREATE TABLE "Student_Sport" ( "ID_Student" integer, "ID_Sport" integer, PRIMARY KEY ("ID_Student","ID_Sport"), FOREIGN KEY ("ID_Student") REFERENCES "Student"("ID"), FOREIGN KEY ("ID_Sport") REFERENCES "Sport"("ID") ); INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (10,'Venus', 'Williams'); INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (11,'Fernando', 'Alonso'); INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (12,'David', 'Villa'); INSERT INTO "Sport" ("ID", "Description") VALUES (110,'Tennis'); INSERT INTO "Sport" ("ID", "Description") VALUES (111,'Football'); INSERT INTO "Sport" ("ID", "Description") VALUES (112,'Formula1'); INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (10,110); INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (11,111); INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (11,112); INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (12,111);
File: D011-M2MRelations
DirectGraphTC0011
Title: Many to Many relations
Purpose: Tests the generation of triples from tables M to M relations
Specification reference: #lead-ex
Review status: unreviewed
Input: D011-M2MRelations
Expected result: DirectGraphTC0011
RDF:
@base <https://example.com/base/> . <Student/ID=10> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . <Student/ID=10> <Student#FirstName> "Venus". <Student/ID=10> <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=10> <Student#LastName> "Williams" . <Student/ID=11> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . <Student/ID=11> <Student#FirstName> "Fernando". <Student/ID=11> <Student#ID> "11"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=11> <Student#LastName> "Alonso" . <Student/ID=12> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . <Student/ID=12> <Student#FirstName> "David". <Student/ID=12> <Student#ID> "12"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student/ID=12> <Student#LastName> "Villa" . <Student_Sport/ID_Student=10;ID_Sport=110> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student_Sport> . <Student_Sport/ID_Student=10;ID_Sport=110> <Student_Sport#ID_Student> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=10;ID_Sport=110> <Student_Sport#ref-ID_Student> <Student/ID=10> . <Student_Sport/ID_Student=10;ID_Sport=110> <Student_Sport#ID_Sport> "110"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=10;ID_Sport=110> <Student_Sport#ref-ID_Sport> <Sport/ID=110> . <Student_Sport/ID_Student=11;ID_Sport=111> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student_Sport> . <Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ID_Student> "11"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ref-ID_Student> <Student/ID=11> . <Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ID_Sport> "111"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ref-ID_Sport> <Sport/ID=111> . <Student_Sport/ID_Student=11;ID_Sport=112> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student_Sport> . <Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ID_Student> "11"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ref-ID_Student> <Student/ID=11> . <Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ID_Sport> "112"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ref-ID_Sport> <Sport/ID=112> . <Student_Sport/ID_Student=12;ID_Sport=111> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student_Sport> . <Student_Sport/ID_Student=12;ID_Sport=111> <Student_Sport#ID_Student> "12"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=12;ID_Sport=111> <Student_Sport#ref-ID_Student> <Student/ID=12> . <Student_Sport/ID_Student=12;ID_Sport=111> <Student_Sport#ID_Sport> "111"^^<https://www.w3.org/2001/XMLSchema#integer> . <Student_Sport/ID_Student=12;ID_Sport=111> <Student_Sport#ref-ID_Sport> <Sport/ID=111> . <Sport/ID=110> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Sport> . <Sport/ID=110> <Sport#ID> "110"^^<https://www.w3.org/2001/XMLSchema#integer> . <Sport/ID=110> <Sport#Description> "Tennis" . <Sport/ID=111> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Sport> . <Sport/ID=111> <Sport#ID> "111"^^<https://www.w3.org/2001/XMLSchema#integer> . <Sport/ID=111> <Sport#Description> "Football" . <Sport/ID=112> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Sport> . <Sport/ID=112> <Sport#ID> "112"^^<https://www.w3.org/2001/XMLSchema#integer> . <Sport/ID=112> <Sport#Description> "Formula1" .
R2RMLTC0011a
Title: M to M relation, by using a SQL query
Purpose: Tests, M to M relations, by using a SQL query
Specification reference: #r2rml-views
Review status: unreviewed
Input: D011-M2MRelations
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/110/Tennis> | <https://example.com/description> | "Tennis" | |
<https://example.com/110/Tennis> | <https://example.com/id> | "110"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/10/Venus;Williams> | <https://example.com/plays> | <https://example.com/110/Tennis> | |
<https://example.com/10/Venus;Williams> | <https://example.com/lastName> | "Williams" | |
<https://example.com/10/Venus;Williams> | <https://example.com/firstName> | "Venus" | |
<https://example.com/10/Venus;Williams> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/111/Football> | <https://example.com/description> | "Football" | |
<https://example.com/111/Football> | <https://example.com/id> | "111"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/12/David;Villa> | <https://example.com/plays> | <https://example.com/111/Football> | |
<https://example.com/12/David;Villa> | <https://example.com/lastName> | "Villa" | |
<https://example.com/12/David;Villa> | <https://example.com/firstName> | "David" | |
<https://example.com/12/David;Villa> | <https://example.com/id> | "12"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/112/Formula1> | <https://example.com/description> | "Formula1" | |
<https://example.com/112/Formula1> | <https://example.com/id> | "112"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/11/Fernando;Alonso> | <https://example.com/lastName> | "Alonso" | |
<https://example.com/11/Fernando;Alonso> | <https://example.com/firstName> | "Fernando" | |
<https://example.com/11/Fernando;Alonso> | <https://example.com/id> | "11"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/11/Fernando;Alonso> | <https://example.com/plays> | <https://example.com/111/Football> | |
<https://example.com/11/Fernando;Alonso> | <https://example.com/plays> | <https://example.com/112/Formula1> | |
R2RML mapping: R2RMLTC0011a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Student"."ID" as ID, "Student"."FirstName" as FirstName, "Student"."LastName" as LastName, "Sport"."Description" as Description, "Sport"."ID" as Sport_ID FROM "Student","Sport","Student_Sport" WHERE "Student"."ID" = "Student_Sport"."ID_Student" AND "Sport"."ID" = "Student_Sport"."ID_Sport"; """; ]; rr:subjectMap [ rr:template "https://example.com/{ID}/{FirstName};{LastName}" ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "ID"; ] ]; rr:predicateObjectMap [ rr:predicate ex:firstName ; rr:objectMap [ rr:column "FirstName" ] ]; rr:predicateObjectMap [ rr:predicate ex:lastName ; rr:objectMap [ rr:column "LastName" ] ]; rr:predicateObjectMap [ rr:predicate ex:plays ; rr:objectMap [ rr:template "https://example.com/{Sport_ID}/{Description}" ] ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}/{\"Description\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:description ; rr:objectMap [ rr:column "\"Description\"" ] ] .
R2RMLTC0011b
Title: M to M relation, by using an additional Triples Map
Purpose: Tests, M to M relations, by using an additional Triples Map
Specification reference: #physical-tables
Review status: unreviewed
Input: D011-M2MRelations
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/student/10> | <https://example.com/lastName> | "Williams" | |
<https://example.com/student/10> | <https://example.com/firstName> | "Venus" | |
<https://example.com/student/12> | <https://example.com/lastName> | "Villa" | |
<https://example.com/student/12> | <https://example.com/firstName> | "David" | |
<https://example.com/student/11> | <https://example.com/lastName> | "Alonso" | |
<https://example.com/student/11> | <https://example.com/firstName> | "Fernando" | |
<https://example.com/sport/110> | <https://example.com/description> | "Tennis" | |
<https://example.com/sport/110> | <https://example.com/id> | "110"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/sport/111> | <https://example.com/description> | "Football" | |
<https://example.com/sport/111> | <https://example.com/id> | "111"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/sport/112> | <https://example.com/description> | "Formula1" | |
<https://example.com/sport/112> | <https://example.com/id> | "112"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/student/10> | <https://example.com/plays> | <https://example.com/sport/110> | |
<https://example.com/student/12> | <https://example.com/plays> | <https://example.com/sport/111> | |
<https://example.com/student/11> | <https://example.com/plays> | <https://example.com/sport/112> | |
<https://example.com/student/11> | <https://example.com/plays> | <https://example.com/sport/111> | |
R2RML mapping: R2RMLTC0011b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ] ; rr:subjectMap [ rr:template "https://example.com/student/{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:firstName ; rr:objectMap [ rr:column "\"FirstName\"" ] ]; rr:predicateObjectMap [ rr:predicate ex:lastName ; rr:objectMap [ rr:column "\"LastName\"" ] ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Sport\""; ] ; rr:subjectMap [ rr:template "https://example.com/sport/{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:description ; rr:objectMap [ rr:column "\"Description\"" ] ] . <LinkMap_1_2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student_Sport\"" ]; rr:subjectMap [ rr:template "https://example.com/student/{\"ID_Student\"}" ]; rr:predicateObjectMap [ rr:predicate ex:plays ; rr:objectMap [ rr:template "https://example.com/sport/{\"ID_Sport\"}" ]; ].
D012-2tables2duplicates0nulls
Title: Two tables, two duplicate records, zero nulls, no primary key
Graphical representation:
fname VARCHAR(20) |
lname VARCHAR(20) |
amount DOUBLE |
---|---|---|
Bob | Smith | 30.0E0 |
Sue | Jones | 20.0E0 |
Bob | Smith | 30.0E0 |
fname VARCHAR(20) |
lname VARCHAR(20) |
city VARCHAR(20) |
---|---|---|
Bob | Smith | London |
Sue | Jones | Madrid |
Bob | Smith | London |
SQL:
CREATE TABLE "IOUs" ( "fname" VARCHAR(20), "lname" VARCHAR(20), "amount" FLOAT); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Sue', 'Jones', 20); INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30); CREATE TABLE "Lives" ( "fname" VARCHAR(20), "lname" VARCHAR(20), "city" VARCHAR(20)); INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Bob', 'Smith', 'London'); INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Sue', 'Jones', 'Madrid'); INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Bob', 'Smith', 'London');
DirectGraphTC0012
Title: Generation of direct graph from a database without primary keys
Purpose: Test the generation of direct graph from a database without primary keys, by creating subject BlankNodes
Specification reference: #no-pk
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: DirectGraphTC0012
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:a <IOUs#fname> "Bob" . _:a <IOUs#lname> "Smith" . _:a <IOUs#amount> "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> . _:b <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:b <IOUs#fname> "Sue" . _:b <IOUs#lname> "Jones" . _:b <IOUs#amount> "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> . _:c <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <IOUs> . _:c <IOUs#fname> "Bob" . _:c <IOUs#lname> "Smith" . _:c <IOUs#amount> "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> . _:d <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Lives> . _:d <Lives#fname> "Bob" . _:d <Lives#lname> "Smith" . _:d <Lives#city> "London" . _:e <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Lives> . _:e <Lives#fname> "Sue" . _:e <Lives#lname> "Jones" . _:e <Lives#city> "Madrid" . _:f <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Lives> . _:f <Lives#fname> "Bob" . _:f <Lives#lname> "Smith" . _:f <Lives#city> "London" .
R2RMLTC0012a
Title: Duplicate tuples generate same blank node
Purpose: Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.
Specification reference: #blank-nodes
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:BobSmith30 | <https://example.com/amount> | "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
_:BobSmith30 | <https://xmlns.com/foaf/0.1/name> | "Bob Smith" | |
_:SueJones20 | <https://example.com/amount> | "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
_:SueJones20 | <https://xmlns.com/foaf/0.1/name> | "Sue Jones" | |
R2RML mapping: R2RMLTC0012a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}_{\"amount\"}"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:template "{\"fname\"} {\"lname\"}"; rr:termType rr:Literal ; ] ]; rr:predicateObjectMap [ rr:predicate ex:amount ; rr:objectMap [ rr:column "\"amount\""; ] ]; .
R2RMLTC0012b
Title: Duplicate tuples generate same blank node
Purpose: Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.
Specification reference: #blank-nodes
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:BobSmith | <https://example.com/city> | "London" | |
_:BobSmith | <https://xmlns.com/foaf/0.1/name> | "Bob Smith" | |
_:SueJones | <https://example.com/city> | "Madrid" | |
_:SueJones | <https://xmlns.com/foaf/0.1/name> | "Sue Jones" | |
R2RML mapping: R2RMLTC0012b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}"; rr:termType rr:BlankNode ; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:template "{\"fname\"} {\"lname\"}"; rr:termType rr:Literal ; ] ]; . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Lives\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate ex:city ; rr:objectMap [ rr:column "\"city\""; ] ]; .
R2RMLTC0012c
Title: TriplesMap without subjectMap
Purpose: Tests a R2RML with missing information, TriplesMap without subjectMap.
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0012c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:template "{\"fname\"} {\"lname\"}"; rr:termType rr:Literal ; ] ]; rr:predicateObjectMap [ rr:predicate ex:amount ; rr:objectMap [ rr:column "\"amount\""; ] ]; .
R2RMLTC0012d
Title: TriplesMap with two subjectMap
Purpose: Tests a R2RML with wrong information, TriplesMap with two subjectMap.
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0012d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}_{\"amount\"}"; ]; rr:subjectMap [ rr:template "{\"amount\"}_{\"fname\"}_{\"lname\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:amount ; rr:objectMap [ rr:column "\"amount\""; ] ]; .
R2RMLTC0012e
Title: Default mapping
Purpose: Tests the generation of a default mapping for tables without a primary key.
Specification reference: #default-mappings
Review status: unreviewed
Input: D012-2tables2duplicates0nulls
Expected result: mappede.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:BobSmith30 | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/IOUs> | |
_:BobSmith30 | <https://example.com/base/IOUs#fname> | "Bob" | |
_:BobSmith30 | <https://example.com/base/IOUs#lname> | "Smith" | |
_:BobSmith30 | <https://example.com/base/IOUs#amount> | "3.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
_:SueJones20 | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/IOUs> | |
_:SueJones20 | <https://example.com/base/IOUs#fname> | "Sue" | |
_:SueJones20 | <https://example.com/base/IOUs#lname> | "Jones" | |
_:SueJones20 | <https://example.com/base/IOUs#amount> | "2.0E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
_:BobSmithLondon | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/Lives> | |
_:BobSmithLondon | <https://example.com/base/IOUs#fname> | "Bob" | |
_:BobSmithLondon | <https://example.com/base/IOUs#lname> | "Smith" | |
_:BobSmithLondon | <https://example.com/base/IOUs#city> | "London" | |
_:SueJonesMadrid | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/base/Lives> | |
_:SueJonesMadrid | <https://example.com/base/IOUs#fname> | "Sue" | |
_:SueJonesMadrid | <https://example.com/base/IOUs#lname> | "Jones" | |
_:SueJonesMadrid | <https://example.com/base/IOUs#city> | "Madrid" | |
R2RML mapping: R2RMLTC0012e
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"IOUs\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}_{\"amount\"}"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object <IOUs>; ]; rr:predicateObjectMap [ rr:predicate <IOUs#fname> ; rr:objectMap [ rr:column "\"fname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#lname> ; rr:objectMap [ rr:column "\"lname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#amount> ; rr:objectMap [ rr:column "\"amount\""; ] ]; . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Lives\"" ]; rr:subjectMap [ rr:template "{\"fname\"}_{\"lname\"}_{\"city\"}"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object <Lives>; ]; rr:predicateObjectMap [ rr:predicate <IOUs#fname> ; rr:objectMap [ rr:column "\"fname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#lname> ; rr:objectMap [ rr:column "\"lname\""; ] ]; rr:predicateObjectMap [ rr:predicate <IOUs#city> ; rr:objectMap [ rr:column "\"city\""; ] ]; .
D013-1table1primarykey3columns2rows1nullvalue
Title: One table, one primary key, three columns, two rows, a null value
Graphical representation:
ID (PK) INTEGER |
Name VARCHAR(50) |
DateOfBirth VARCHAR(50) |
---|---|---|
1 | Alice | NULL |
2 | Bob | September, 2010 |
SQL:
CREATE TABLE "Person" ( "ID" integer, "Name" varchar(50), "DateOfBirth" varchar(50), PRIMARY KEY ("ID") ); INSERT INTO "Person" ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL); INSERT INTO "Person" ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
DirectGraphTC0013
Title: Generation of a direct graph from a table with NULL values
Purpose: Tests the generation of a Direct Graph from a table with NULL values
Specification reference: #lead-ex
Review status: unreviewed
Input: D013-1table1primarykey3columns2rows1nullvalue
Expected result: DirectGraphTC0013
RDF:
@base <https://example.com/base/> . <Person/ID=1> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Person> . <Person/ID=1> <Person#ID> "1"^^<https://www.w3.org/2001/XMLSchema#integer> . <Person/ID=1> <Person#Name> "Alice" . <Person/ID=2> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Person> . <Person/ID=2> <Person#ID> "2"^^<https://www.w3.org/2001/XMLSchema#integer> . <Person/ID=2> <Person#Name> "Bob" . <Person/ID=2> <Person#DateOfBirth> "September, 2010" .
R2RMLTC0013a
Title: Generation of empty triples from referenced columns that have null values
Purpose: Tests the generation of empty triples from referenced columns that have null values
Specification reference: #dfn-template-valued-term-map
Review status: unreviewed
Input: D013-1table1primarykey3columns2rows1nullvalue
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Person/2/Bob/September%2C%202010> | <https://example.com/BirthDay> | "September, 2010" | |
R2RML mapping: R2RMLTC0013a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Person\"" ]; rr:subjectMap [ rr:template "https://example.com/Person/{\"ID\"}/{\"Name\"}/{\"DateOfBirth\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:BirthDay ; rr:objectMap [ rr:column "\"DateOfBirth\"" ] ] .
D014-3tables1primarykey1foreignkey
Title: 3 tables, one primary key, one foreign key
Graphical representation:
empno (PK) INTEGER |
deptno (FK) INTEGER |
ename VARCHAR(100) |
job VARCHAR(30) |
etype VARCHAR(30) |
---|---|---|---|---|
7369 | 10 | SMITH | CLERK | PART_TIME |
id INTEGER |
likeType VARCHAR(30) |
likedObj VARCHAR(100) |
---|---|---|
7369 | Playing | Soccer |
7369 | Watching | Basketball |
deptno INTEGER |
dname VARCHAR(30) |
loc VARCHAR(100) |
---|---|---|
10 | APPSERVER | NEW YORK |
SQL:
CREATE TABLE "DEPT" ( "deptno" INTEGER UNIQUE, "dname" VARCHAR(30), "loc" VARCHAR(100)); INSERT INTO "DEPT" ("deptno", "dname", "loc") VALUES (10, 'APPSERVER', 'NEW YORK'); CREATE TABLE "EMP" ( "empno" INTEGER PRIMARY KEY, "ename" VARCHAR(100), "job" VARCHAR(30), "deptno" INTEGER REFERENCES "DEPT" ("deptno"), "etype" VARCHAR(30)); INSERT INTO "EMP" ("empno", "ename", "job", "deptno", "etype" ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME'); CREATE TABLE "LIKES" ( "id" INTEGER, "likeType" VARCHAR(30), "likedObj" VARCHAR(100)); INSERT INTO "LIKES" ("id", "likeType", "likedObj") VALUES (7369, 'Playing', 'Soccer'); INSERT INTO "LIKES" ("id", "likeType", "likedObj") VALUES (7369, 'Watching', 'Basketball');
DirectGraphTC0014
Title: Generation of direct graph from a database with primary key referencing candidate key
Purpose: Test the generation of direct graph from a database with primary key referencing candidate key
Specification reference: #lead-ex
Review status: unreviewed
Input: D014-3tables1primarykey1foreignkey
Expected result: DirectGraphTC0014
RDF:
@base <https://example.com/base/> . <EMP/empno=7369> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <EMP> . <EMP/empno=7369> <EMP#empno> "7369"^^<https://www.w3.org/2001/XMLSchema#integer> . <EMP/empno=7369> <EMP#deptno> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <EMP/empno=7369> <EMP#ref-deptno> _:c . <EMP/empno=7369> <EMP#ename> "SMITH" . <EMP/empno=7369> <EMP#job> "CLERK" . <EMP/empno=7369> <EMP#etype> "PART_TIME" . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <LIKES> . _:a <LIKES#id> "7369"^^<https://www.w3.org/2001/XMLSchema#integer> . _:a <LIKES#likeType> "Playing" . _:a <LIKES#likedObj> "Soccer" . _:b <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <LIKES> . _:b <LIKES#id> "7369"^^<https://www.w3.org/2001/XMLSchema#integer> . _:b <LIKES#likeType> "Watching" . _:b <LIKES#likedObj> "Basketball" . _:c <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <DEPT> . _:c <DEPT#deptno> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . _:c <DEPT#dname> "APPSERVER" . _:c <DEPT#loc> "NEW YORK" .
R2RMLTC0014a
Title: Subjectmap with rr:inverseExpression
Purpose: Tests a rr:subjectMap with rr:inverseExpression
Specification reference: #inverse
Review status: unreviewed
Input: D014-3tables1primarykey1foreignkey
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
_:Department10 | <https://example.com/dept#location> | "NEW YORK" | |
R2RML mapping: R2RMLTC0014a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix dept: <https://example.com/dept#> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT ('Department' || "deptno") AS "deptId" , "deptno" , "dname" , "loc" FROM "DEPT" """ ]; rr:subjectMap [ rr:column "\"deptId\""; rr:termType rr:BlankNode; rr:inverseExpression "{\"deptno\"} = substr({\"deptId\"},length('Department')+1)"]; rr:predicateObjectMap [ rr:predicate dept:location ; rr:objectMap [ rr:column "\"loc\"" ] ]; .
R2RMLTC0014b
Title: Triplesmaps with rr:inverseExpression and rr:joinCondition
Purpose: Test two triplesmaps, one with a rr:inverseExpression and the other with a rr:joinCondition for foerign key relations
Specification reference: #dfn-join-condition
Review status: unreviewed
Input: D014-3tables1primarykey1foreignkey
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/emp/7369> | <https://example.com/emp#jobtype> | <https://example.com/emp/job/CLERK> | |
<https://example.com/emp/7369> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/emp/job/CLERK> | |
<https://example.com/emp/7369> | <https://example.com/emp#emptype> | <https://example.com/emp/etype/PART_TIME> | |
<https://example.com/emp/7369> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/emp/etype/PART_TIME> | |
<https://example.com/emp/7369> | <https://example.com/emp#empno> | "7369"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/emp/7369> | <https://example.com/emp#name> | "SMITH" | |
<https://example.com/emp/7369> | <https://example.com/emp#job> | "CLERK" | |
<https://example.com/emp/7369> | <https://example.com/emp#deptNum> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/emp/7369> | <https://example.com/emp#etype> | "PART_TIME" | |
<https://example.com/emp/7369> | <https://example.com/emp#c_ref_deptno> | _:Department10 | |
_:Department10 | <https://example.com/dept#deptno> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
_:Department10 | <https://example.com/dept#name> | "APPSERVER" | |
_:Department10 | <https://example.com/dept#location> | "NEW YORK" | |
_:Department10 | <https://example.com/dept#COMPANY> | "EXAMPLE Corporation" | |
R2RML mapping: R2RMLTC0014b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/ns#> . @prefix emp: <https://example.com/emp#> . @prefix dept: <https://example.com/dept#> . @prefix likes: <https://example.com/likes#> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT ('Department' || "deptno") AS deptId , "deptno" , "dname" , "loc" FROM "DEPT" """ ]; rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode; rr:inverseExpression "{\"deptno\"} = substr({deptId},length('Department')+1)" ]; rr:predicateObjectMap [ rr:predicate dept:deptno ; rr:objectMap [ rr:column "\"deptno\""; ] ]; rr:predicateObjectMap [ rr:predicate dept:name ; rr:objectMap [ rr:column "\"dname\"" ] ]; rr:predicateObjectMap [ rr:predicate dept:location ; rr:objectMap [ rr:column "\"loc\"" ] ]; rr:predicateObjectMap [ rr:predicate dept:COMPANY ; rr:object "EXAMPLE Corporation" ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT ('https://example.com/emp/' || "empno") AS empURI , "empno" , "ename" , ('https://example.com/emp/job/'|| "job") AS jobTypeURI , "job" , "deptno" , ('https://example.com/emp/etype/'|| "etype") AS empTypeURI , "etype" , ('https://example.com/graph/'|| "job" || '/' || "etype") AS graphURI FROM "EMP" """ ]; rr:subjectMap [ rr:column "empURI"; ]; rr:predicateObjectMap [ rr:predicate emp:jobtype ; rr:objectMap [ rr:column "jobTypeURI"; rr:termType rr:IRI; ] ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:objectMap [ rr:column "jobTypeURI"; rr:termType rr:IRI; ] ]; rr:predicateObjectMap [ rr:predicate emp:emptype ; rr:objectMap [ rr:column "empTypeURI"; rr:termType rr:IRI; ] ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:objectMap [ rr:column "empTypeURI"; rr:termType rr:IRI; ] ]; rr:predicateObjectMap [ rr:predicate emp:empno ; rr:objectMap [ rr:column "\"empno\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:name ; rr:objectMap [ rr:column "\"ename\"" ]; ]; rr:predicateObjectMap [ rr:predicate emp:job ; rr:objectMap [ rr:column "\"job\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:deptNum ; rr:objectMap [ rr:column "\"deptno\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:etype ; rr:objectMap [ rr:column "\"etype\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:c_ref_deptno ; rr:objectMap [ a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap1>; rr:joinCondition [ rr:child "\"deptno\""; rr:parent "\"deptno\""; ]; ]; ] .
R2RMLTC0014c
Title: Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps
Purpose: Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps
Specification reference: #foreign-key
Review status: unreviewed
Input: D014-3tables1primarykey1foreignkey
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/emp/7369> | <https://example.com/emp#jobtype> | <https://example.com/emp/job/CLERK> | |
<https://example.com/emp/7369> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/emp/job/CLERK> | |
<https://example.com/emp/7369> | <https://example.com/emp#emptype> | <https://example.com/emp/etype/PART_TIME> | |
<https://example.com/emp/7369> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://example.com/emp/etype/PART_TIME> | |
<https://example.com/emp/7369> | <https://example.com/emp#empno> | "7369"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/emp/7369> | <https://example.com/emp#job> | "CLERK" | |
<https://example.com/emp/7369> | <https://example.com/emp#deptNum> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/emp/7369> | <https://example.com/emp#etype> | "PART_TIME" | |
<https://example.com/emp/7369> | <https://example.com/emp#c_ref_deptno> | _:Department10 | |
<https://example.com/emp/7369> | <https://example.com/emp#name> | "SMITH" | |
_:Department10 | <https://example.com/dept#deptno> | "10"^^<https://www.w3.org/2001/XMLSchema#positiveInteger> | |
_:Department10 | <https://example.com/dept#name> | "APPSERVER" | |
_:Department10 | <https://example.com/dept#location> | "NEW YORK" | |
_:Department10 | <https://example.com/dept#COMPANY> | "EXAMPLE Corporation" | |
R2RML mapping: R2RMLTC0014c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/ns#> . @prefix emp: <https://example.com/emp#> . @prefix dept: <https://example.com/dept#> . @prefix likes: <https://example.com/likes#> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ Select ('Department' || "deptno") AS deptId , "deptno" , "dname" , "loc" from "DEPT" """ ]; rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode; rr:inverseExpression "{\"deptno\"} = substr({deptId},length('Department')+1)"]; rr:predicateObjectMap [ rr:predicate dept:deptno ; rr:objectMap [ rr:column "\"deptno\""; rr:datatype xsd:positiveInteger ] ]; rr:predicateObjectMap [ rr:predicate dept:name ; rr:objectMap [ rr:column "\"dname\"" ] ]; rr:predicateObjectMap [ rr:predicate dept:location ; rr:objectMap [ rr:column "\"loc\"" ] ]; rr:predicateObjectMap [ rr:predicate dept:COMPANY ; rr:objectMap [ rr:constant "EXAMPLE Corporation"; ] ] . <jobtypeObjectMap> a rr:ObjectMap; rr:template "https://example.com/emp/job/{\"job\"}" . <emptypeObjectMap> a rr:ObjectMap; rr:template "https://example.com/emp/etype/{\"etype\"}" . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"EMP\"" ]; rr:subjectMap [ rr:template "https://example.com/emp/{\"empno\"}"; ]; rr:predicateObjectMap [ rr:predicate emp:jobtype ; rr:objectMap <jobtypeObjectMap> ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:objectMap <jobtypeObjectMap> ]; rr:predicateObjectMap [ rr:predicate emp:emptype ; rr:objectMap <emptypeObjectMap> ]; rr:predicateObjectMap [ rr:predicate rdf:type ; rr:objectMap <emptypeObjectMap> ]; rr:predicateObjectMap [ rr:predicate emp:empno ; rr:objectMap [ rr:column "\"empno\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:name ; rr:objectMap [ rr:column "\"ename\"" ]; ]; rr:predicateObjectMap [ rr:predicate emp:job ; rr:objectMap [ rr:column "\"job\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:deptNum ; rr:objectMap [ rr:column "\"deptno\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:etype ; rr:objectMap [ rr:column "\"etype\"" ] ]; rr:predicateObjectMap [ rr:predicate emp:c_ref_deptno ; rr:objectMap [ a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap1>; rr:joinCondition [ rr:child "\"deptno\""; rr:parent "\"deptno\""; ]; ]; ] .
R2RMLTC0014d
Title: three tables, one primary key, one foreign key
Purpose: Test the translation of database type codes to IRIs
Specification reference: #example-translationtable
Review status: unreviewed
Input: D014-3tables1primarykey1foreignkey
Expected result: mappedd.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://data.example.com/employee/7369> | <https://example.com/ns#role> | <https://data.example.com/roles/general-office> | |
R2RML mapping: R2RMLTC0014d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/ns#> . @prefix emp: <https://example.com/emp#> . @prefix dept: <https://example.com/dept#> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap4> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "EMP".*, (CASE "job" WHEN 'CLERK' THEN 'general-office' WHEN 'NIGHTGUARD' THEN 'security' WHEN 'ENGINEER' THEN 'engineering' END) AS ROLE FROM "EMP" """ ]; rr:subjectMap [ rr:template "https://data.example.com/employee/{\"empno\"}"; ]; rr:predicateObjectMap [ rr:predicate ex:role; rr:objectMap [ rr:template "https://data.example.com/roles/{ROLE}" ]; ].
D015-1table3columns1composityeprimarykey3rows2languages
Title: One table, three columns, one composite primary key, three rows, two languages
Graphical representation:
Code (PK) VARCHAR(2) |
Lan (PK) VARCHAR(10) |
Name VARCHAR(100) |
---|---|---|
BO | EN | Bolivia, Plurinational State of |
BO | ES | Estado Plurinacional de Bolivia |
IE | EN | Ireland |
IE | ES | Irlanda |
SQL:
CREATE TABLE "Country" ( "Code" VARCHAR(2), "Name" VARCHAR(100), "Lan" VARCHAR(10), PRIMARY KEY ("Code","Lan") ); INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('IE', 'Ireland', 'EN'); INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('IE', 'Irlanda', 'ES');
File: D015-1table3columns1composityeprimarykey3rows2languages
DirectGraphTC0015
Title: Generation of direct graph from multi-column primary keys
Purpose: Tests the generation of direct graph from multi-column primary keys
Specification reference: #multi-key
Review status: unreviewed
Input: D015-1table3columns1composityeprimarykey3rows2languages
Expected result: DirectGraphTC0015
RDF:
@base <https://example.com/base/> . <Country/Code=BO;Lan=EN> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country> . <Country/Code=BO;Lan=EN> <Country#Code> "BO" . <Country/Code=BO;Lan=EN> <Country#Lan> "EN" . <Country/Code=BO;Lan=EN> <Country#Name> "Bolivia, Plurinational State of" . <Country/Code=BO;Lan=ES> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country> . <Country/Code=BO;Lan=ES> <Country#Code> "BO" . <Country/Code=BO;Lan=ES> <Country#Lan> "ES" . <Country/Code=BO;Lan=ES> <Country#Name> "Estado Plurinacional de Bolivia" . <Country/Code=IE;Lan=EN> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country> . <Country/Code=IE;Lan=EN> <Country#Code> "IE" . <Country/Code=IE;Lan=EN> <Country#Lan> "EN" . <Country/Code=IE;Lan=EN> <Country#Name> "Ireland" . <Country/Code=IE;Lan=ES> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Country> . <Country/Code=IE;Lan=ES> <Country#Code> "IE" . <Country/Code=IE;Lan=ES> <Country#Lan> "ES" . <Country/Code=IE;Lan=ES> <Country#Name> "Irlanda" .
R2RMLTC0015a
Title: Generation of language tags from a table with language information
Purpose: Generation of language tags from a table with language information
Specification reference: #language-tags
Review status: unreviewed
Input: D015-1table3columns1composityeprimarykey3rows2languages
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/BO> | <https://www.w3.org/2000/01/rdf-schema#label> | "Bolivia, Plurinational State of"@en | |
<https://example.com/BO> | <https://www.w3.org/2000/01/rdf-schema#label> | "Estado Plurinacional de Bolivia"@es | |
<https://example.com/IE> | <https://www.w3.org/2000/01/rdf-schema#label> | "Ireland"@en | |
<https://example.com/IE> | <https://www.w3.org/2000/01/rdf-schema#label> | "Irlanda"@es | |
R2RML mapping: R2RMLTC0015a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Code", "Name", "Lan" FROM "Country" WHERE "Lan" = 'EN'; """ ] ; rr:subjectMap [ rr:template "https://example.com/{\"Code\"}" ]; rr:predicateObjectMap [ rr:predicate rdfs:label; rr:objectMap [ rr:column "\"Name\""; rr:language "en" ] ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Code", "Name", "Lan" FROM "Country" WHERE "Lan" = 'ES'; """ ] ; rr:subjectMap [ rr:template "https://example.com/{\"Code\"}" ]; rr:predicateObjectMap [ rr:predicate rdfs:label; rr:objectMap [ rr:column "\"Name\""; rr:language "es" ] ] .
R2RMLTC0015b
Title: Generation of language tags from a table with language information, and a term map with invalid rr:language value
Purpose: Tests a term map with an invalid rr:language value, which is an error
Specification reference: #language-tags
Review status: unreviewed
Input: D015-1table3columns1composityeprimarykey3rows2languages
Expected result: non-conforming R2RML mapping
R2RML mapping: R2RMLTC0015b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Code", "Name", "Lan" FROM "Country" WHERE "Lan" = 'EN'; """ ] ; rr:subjectMap [ rr:template "https://example.com/{\"Code\"}" ]; rr:predicateObjectMap [ rr:predicate rdfs:label; rr:objectMap [ rr:column "\"Name\""; rr:language "english" ] ] . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "Code", "Name", "Lan" FROM "Country" WHERE "Lan" = 'ES'; """ ] ; rr:subjectMap [ rr:template "https://example.com/{\"Code\"}" ]; rr:predicateObjectMap [ rr:predicate rdfs:label; rr:objectMap [ rr:column "\"Name\""; rr:language "spanish" ] ] .
D016-1table1primarykey10columns3rowsSQLdatatypes
Title: One table, one primary key, ten columns, three rows with sql datatypes
Graphical representation:
ID (PK) INTEGER |
FirstName VARCHAR(50) |
LastName VARCHAR(50) |
Sex VARCHAR(6) |
Weight DOUBLE |
Height DOUBLE |
BirthDate DATE |
EntranceDate TIMESTAMP |
PaidInAdvance BOOLEAN |
Photo VARBINARY |
---|---|---|---|---|---|---|---|---|---|
10 | Monica | Geller | female | 80.25E0 | 1.65E0 | 1981-10-10 | 2009-10-10 12:12:22.000000 | FALSE | [Binary Data] |
11 | Rachel | Green | female | 70.22E0 | 1.7E0 | 1982-11-12 | 2008-11-12 09:45:44.000000 | TRUE | [Binary Data] |
12 | Chandler | Bing | male | 90.31E0 | 1.76E0 | 1978-04-06 | 2007-03-12 02:13:14.000000 | TRUE | [Binary Data] |
SQL:
CREATE TABLE "Patient" ( "ID" INTEGER, "FirstName" VARCHAR(50), "LastName" VARCHAR(50), "Sex" VARCHAR(6), "Weight" REAL, "Height" FLOAT, "BirthDate" DATE, "EntranceDate" TIMESTAMP, "PaidInAdvance" BOOLEAN, "Photo" VARBINARY(200), PRIMARY KEY ("ID") ); INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo") VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo") VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo") VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
DirectGraphTC0016
Title: Generation of direct graph from a database with sql datatypes
Purpose: Tests the generation of direct graph from a database with sql datatypes
Specification reference: #lead-ex
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: DirectGraphTC0016
RDF:
@base <https://example.com/base/> . <Patient/ID=10> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Patient> . <Patient/ID=10> <Patient#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . <Patient/ID=10> <Patient#FirstName> "Monica" . <Patient/ID=10> <Patient#LastName> "Geller" . <Patient/ID=10> <Patient#Sex> "female" . <Patient/ID=10> <Patient#Weight> "8.025E1"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=10> <Patient#Height> "1.65E0"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=10> <Patient#BirthDate> "1981-10-10"^^<https://www.w3.org/2001/XMLSchema#date> . <Patient/ID=10> <Patient#EntranceDate> "2009-10-10T12:12:22"^^<https://www.w3.org/2001/XMLSchema#dateTime> . <Patient/ID=10> <Patient#PaidInAdvance> "false"^^<https://www.w3.org/2001/XMLSchema#boolean> . <Patient/ID=10> <Patient#Photo> "89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082"^^<https://www.w3.org/2001/XMLSchema#hexBinary> . <Patient/ID=11> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Patient> . <Patient/ID=11> <Patient#ID> "11"^^<https://www.w3.org/2001/XMLSchema#integer> . <Patient/ID=11> <Patient#FirstName> "Rachel" . <Patient/ID=11> <Patient#LastName> "Green" . <Patient/ID=11> <Patient#Sex> "female" . <Patient/ID=11> <Patient#Weight> "7.022E1"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=11> <Patient#Height> "1.7E0"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=11> <Patient#BirthDate> "1982-11-12"^^<https://www.w3.org/2001/XMLSchema#date> . <Patient/ID=11> <Patient#EntranceDate> "2008-11-12T09:45:44"^^<https://www.w3.org/2001/XMLSchema#dateTime> . <Patient/ID=11> <Patient#PaidInAdvance> "true"^^<https://www.w3.org/2001/XMLSchema#boolean> . <Patient/ID=11> <Patient#Photo> "89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082"^^<https://www.w3.org/2001/XMLSchema#hexBinary> . <Patient/ID=12> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Patient> . <Patient/ID=12> <Patient#ID> "12"^^<https://www.w3.org/2001/XMLSchema#integer> . <Patient/ID=12> <Patient#FirstName> "Chandler" . <Patient/ID=12> <Patient#LastName> "Bing" . <Patient/ID=12> <Patient#Sex> "male" . <Patient/ID=12> <Patient#Weight> "9.031E1"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=12> <Patient#Height> "1.76E0"^^<https://www.w3.org/2001/XMLSchema#double> . <Patient/ID=12> <Patient#BirthDate> "1978-04-06"^^<https://www.w3.org/2001/XMLSchema#date> . <Patient/ID=12> <Patient#EntranceDate> "2007-03-12T02:13:14"^^<https://www.w3.org/2001/XMLSchema#dateTime> . <Patient/ID=12> <Patient#PaidInAdvance> "true"^^<https://www.w3.org/2001/XMLSchema#boolean> . <Patient/ID=12> <Patient#Photo> "89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082"^^<https://www.w3.org/2001/XMLSchema#hexBinary> .
R2RMLTC0016a
Title: Table with datatypes: string and integer
Purpose: Tests the rr:termtype and datatype conversions: string and integer
Specification reference: #datatype-conversions
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Patient/10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient/10> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Patient/10> | <https://example.com/firstName> | "Monica" | |
<https://example.com/Patient/10> | <https://example.com/lastName> | "Geller" | |
<https://example.com/Patient/10> | <https://example.com/gender> | "female" | |
<https://example.com/Patient/11> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient/11> | <https://example.com/id> | "11"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Patient/11> | <https://example.com/firstName> | "Rachel" | |
<https://example.com/Patient/11> | <https://example.com/lastName> | "Green" | |
<https://example.com/Patient/11> | <https://example.com/gender> | "female" | |
<https://example.com/Patient/12> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient/12> | <https://example.com/id> | "12"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/Patient/12> | <https://example.com/firstName> | "Chandler" | |
<https://example.com/Patient/12> | <https://example.com/lastName> | "Bing" | |
<https://example.com/Patient/12> | <https://example.com/gender> | "male" | |
R2RML mapping: R2RMLTC0016a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Patient\"" ]; rr:subjectMap [ rr:template "https://example.com/Patient/{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:firstName; rr:objectMap [ rr:column "\"FirstName\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:lastName; rr:objectMap [ rr:column "\"LastName\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:gender; rr:objectMap [ rr:column "\"Sex\""; ] ]; .
R2RMLTC0016b
Title: Table with datatypes: real and float
Purpose: Tests the rr:termtype and datatype conversions: real and float
Specification reference: #datatype-conversions
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: mappedb.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Patient10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient10> | <https://example.com/weight> | "8.025E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Patient10> | <https://example.com/height> | "1.65E0"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Patient11> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient11> | <https://example.com/weight> | "7.022E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Patient11> | <https://example.com/height> | "1.7E0"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Patient12> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient12> | <https://example.com/weight> | "9.031E1"^^<https://www.w3.org/2001/XMLSchema#double> | |
<https://example.com/Patient12> | <https://example.com/height> | "1.76E0"^^<https://www.w3.org/2001/XMLSchema#double> | |
R2RML mapping: R2RMLTC0016b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Patient\"" ]; rr:subjectMap [ rr:template "https://example.com/Patient{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:weight; rr:objectMap [ rr:column "\"Weight\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:height; rr:objectMap [ rr:column "\"Height\""; ] ]; .
R2RMLTC0016c
Title: Table with datatypes: date and timestamp
Purpose: Tests the rr:termtype and datatype conversions: date and timestamp
Specification reference: #datatype-conversions
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: mappedc.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Patient10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient10> | <https://example.com/birthdate> | "1981-10-10"^^<https://www.w3.org/2001/XMLSchema#date> | |
<https://example.com/Patient10> | <https://example.com/entrancedate> | "2009-10-10T12:12:22"^^<https://www.w3.org/2001/XMLSchema#dateTime> | |
<https://example.com/Patient11> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient11> | <https://example.com/birthdate> | "1982-11-12"^^<https://www.w3.org/2001/XMLSchema#date> | |
<https://example.com/Patient11> | <https://example.com/entrancedate> | "2008-11-12T09:45:44"^^<https://www.w3.org/2001/XMLSchema#dateTime> | |
<https://example.com/Patient12> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient12> | <https://example.com/birthdate> | "1978-04-06"^^<https://www.w3.org/2001/XMLSchema#date> | |
<https://example.com/Patient12> | <https://example.com/entrancedate> | "2007-03-12T02:13:14"^^<https://www.w3.org/2001/XMLSchema#dateTime> | |
R2RML mapping: R2RMLTC0016c
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Patient\"" ]; rr:subjectMap [ rr:template "https://example.com/Patient{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:birthdate; rr:objectMap [ rr:column "\"BirthDate\""; ] ]; rr:predicateObjectMap [ rr:predicate ex:entrancedate; rr:objectMap [ rr:column "\"EntranceDate\""; ] ]; .
R2RMLTC0016d
Title: Table with datatypes, boolean conversions
Purpose: Tests the rr:termtype and datatype conversions: boolean
Specification reference: #datatype-conversions
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: mappedd.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Patient10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient10> | <https://example.com/paid> | "false"^^<https://www.w3.org/2001/XMLSchema#boolean> | |
<https://example.com/Patient11> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient11> | <https://example.com/paid> | "true"^^<https://www.w3.org/2001/XMLSchema#boolean> | |
<https://example.com/Patient12> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient12> | <https://example.com/paid> | "true"^^<https://www.w3.org/2001/XMLSchema#boolean> | |
R2RML mapping: R2RMLTC0016d
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Patient\"" ]; rr:subjectMap [ rr:template "https://example.com/Patient{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:paid; rr:objectMap [ rr:column "\"PaidInAdvance\""; ] ]; .
R2RMLTC0016e
Title: Table with datatypes, binary column
Purpose: Tests the rr:termtype and datatype conversions: binary
Specification reference: #datatype-conversions
Review status: unreviewed
Input: D016-1table1primarykey10columns3rowsSQLdatatypes
Expected result: mappede.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/Patient10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient10> | <https://example.com/photo> | <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> | |
<https://example.com/Patient11> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient11> | <https://example.com/photo> | <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> | |
<https://example.com/Patient12> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/Patient12> | <https://example.com/photo> | <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> | |
R2RML mapping: R2RMLTC0016e
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Patient\"" ]; rr:subjectMap [ rr:template "https://example.com/Patient{\"ID\"}"; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; rr:predicateObjectMap [ rr:predicate ex:photo; rr:objectMap [ rr:template "data:image/png;hex,{\"Photo\"}"; ]; ]; .
D017-I18NnoSpecialChars
Title: I18N No Special Chars
Graphical representation:
植物名 (FK) VARCHAR(10) |
使用部 (FK) VARCHAR(10) |
皿 VARCHAR(10) |
---|---|---|
しそ | 葉 | しそのとまと |
名 (PK) VARCHAR(10) |
使用部 (PK) VARCHAR(10) |
条件 VARCHAR(10) |
---|---|---|
しそ | 葉 | 新鮮な |
SQL:
CREATE TABLE "植物" ( "名" VARCHAR(10), "使用部" VARCHAR(10), "条件" VARCHAR(10), PRIMARY KEY ("名", "使用部") ); INSERT INTO "植物" ("名", "使用部", "条件") VALUES ('しそ', '葉', '新鮮な'); CREATE TABLE "成分" ( "皿" VARCHAR(10), "植物名" VARCHAR(10), "使用部" VARCHAR(10), FOREIGN KEY ("植物名", "使用部") REFERENCES "植物"("名", "使用部") ); INSERT INTO "成分" ("皿", "植物名", "使用部") VALUES ('しそのとまと', 'しそ', '葉');
File: D017-I18NnoSpecialChars
DirectGraphTC0017
Title: I18N No Special Chars
Purpose: Test de generation of a direct graph from a I18N No Special Chars database
Specification reference: #no-pk
Review status: unreviewed
Input: D017-I18NnoSpecialChars
Expected result: DirectGraphTC0017
RDF:
@base <https://example.com/base/> . <植物/名=しそ;使用部=葉> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <植物> . <植物/名=しそ;使用部=葉> <植物#使用部> "葉" . <植物/名=しそ;使用部=葉> <植物#名> "しそ" . <植物/名=しそ;使用部=葉> <植物#条件> "新鮮な" . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <成分> . _:a <成分#使用部> "葉" . _:a <成分#植物名> "しそ" . _:a <成分#ref-植物名;使用部> <植物/名=しそ;使用部=葉> . _:a <成分#皿> "しそのとまと" .
D018-1table1primarykey2columns3rows
Title: One table, one primary key, two columns, three rows
Graphical representation:
ID INTEGER |
Name CHARACTER(15) |
---|---|
10 | Venus |
20 | Fernando |
30 | David |
SQL:
CREATE TABLE "Student" ( "ID" INTEGER, "Name" CHAR(15) ); INSERT INTO "Student" ("ID","Name") VALUES (10,'Venus'); INSERT INTO "Student" ("ID","Name") VALUES (20,'Fernando'); INSERT INTO "Student" ("ID","Name") VALUES (30,'David');
DirectGraphTC0018
Title: Generation of triples by using CHAR datatype column
Purpose: Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.
Specification reference: #lead-ex
Review status: unreviewed
Input: D018-1table1primarykey2columns3rows
Expected result: DirectGraphTC0018
RDF:
@base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . _:a <Student#ID> "10"^^<https://www.w3.org/2001/XMLSchema#integer> . _:a <Student#Name> "Venus " . _:b <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . _:b <Student#ID> "20"^^<https://www.w3.org/2001/XMLSchema#integer> . _:b <Student#Name> "Fernando " . _:c <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Student> . _:c <Student#ID> "30"^^<https://www.w3.org/2001/XMLSchema#integer> . _:c <Student#Name> "David " .
R2RMLTC0018a
Title: Generation of triples by using CHAR datatype column
Purpose: Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.
Specification reference: #from-template
Review status: unreviewed
Input: D018-1table1primarykey2columns3rows
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/10> | <https://xmlns.com/foaf/0.1/name> | "Venus " | |
<https://example.com/10> | <https://example.com/id> | "10"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/10> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/20> | <https://xmlns.com/foaf/0.1/name> | "Fernando " | |
<https://example.com/20> | <https://example.com/id> | "20"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/20> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/30> | <https://xmlns.com/foaf/0.1/name> | "David " | |
<https://example.com/30> | <https://example.com/id> | "30"^^<https://www.w3.org/2001/XMLSchema#integer> | |
<https://example.com/30> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
R2RML mapping: R2RMLTC0018a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\"" ]; rr:subjectMap [ rr:template "https://example.com/{\"ID\"}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate ex:id ; rr:objectMap [ rr:column "\"ID\""; ] ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column "\"Name\"" ] ] .
D019-1table1primarykey3columns3rows
Title: One table, one primary key, three columns, three rows
Graphical representation:
ID INTEGER |
FirstName VARCHAR(50) |
LastName VARCHAR(50) |
---|---|---|
10 | https://example.com/ns#Jhon | Smith |
20 | Carlos | Mendoza |
30 | Juan Daniel | Crespo |
SQL:
CREATE TABLE "Employee" ( "ID" INTEGER, "FirstName" VARCHAR(50), "LastName" VARCHAR(50) ); INSERT INTO "Employee" ("ID","FirstName","LastName") VALUES (10,'https://example.com/ns#Jhon','Smith'); INSERT INTO "Employee" ("ID","FirstName","LastName") VALUES (20,'Carlos','Mendoza'); INSERT INTO "Employee" ("ID","FirstName","LastName") VALUES (30,'Juan Daniel','Crespo');
R2RMLTC0019a
Title: Generation of triples by using IRI value in columns
Purpose: Test the generation of triples by using IRI value in columns
Specification reference: #from-column
Review status: unreviewed
Input: D019-1table1primarykey3columns3rows
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/ns#Jhon> | <https://xmlns.com/foaf/0.1/name> | "https://example.com/ns#Jhon" | |
<https://example.com/base/Carlos> | <https://xmlns.com/foaf/0.1/name> | "Carlos" | |
R2RML mapping: R2RMLTC0019a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "ID", "FirstName", "LastName" FROM "Employee" WHERE "ID" < 30 """ ]; rr:subjectMap [ rr:column "\"FirstName\"" ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"FirstName\"" ]; ]; .
R2RMLTC0019b
Title: Generation of triples by using IRI value in columns, with data error
Purpose: Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)
Specification reference: #from-column
Review status: unreviewed
Input: D019-1table1primarykey3columns3rows
Expected result: Conforming R2RML mapping with data error
R2RML mapping: R2RMLTC0019b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Employee\"" ]; rr:subjectMap [ rr:column "\"FirstName\"" ]; rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "\"FirstName\"" ]; ]; .
D020-1table1column5rows
Title: One table, one column, five rows
Graphical representation:
Name VARCHAR(50) |
---|
https://example.com/company/Alice |
Bob |
Bob/Charles |
path/../Danny |
Emily Smith |
SQL:
CREATE TABLE "Student" ( "Name" VARCHAR(50) ); INSERT INTO "Student" ("Name") VALUES ('https://example.com/company/Alice'); INSERT INTO "Student" ("Name") VALUES ('Bob'); INSERT INTO "Student" ("Name") VALUES ('Bob/Charles'); INSERT INTO "Student" ("Name") VALUES ('path/../Danny'); INSERT INTO "Student" ("Name") VALUES ('Emily Smith');
File: D020-1table1column5rows
R2RMLTC0020a
Title: Generation of triples by using IRI value in columns
Purpose: Test the generation of triples by using IRI value in columns
Specification reference: #from-template
Review status: unreviewed
Input: D020-1table1column5rows
Expected result: mappeda.nq
RDF:
Subject | Predicate | Object | Graph |
---|---|---|---|
<https://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/base/Bob> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/base/Bob%2FCharles> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/base/path%2F..%2FDanny> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
<https://example.com/base/Emily%20Smith> | <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://xmlns.com/foaf/0.1/Person> | |
R2RML mapping: R2RMLTC0020a
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:template "{\"Name\"}"; rr:termType rr:IRI; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; .
R2RMLTC0020b
Title: Generation of triples by using IRI value in columns, with data errors
Purpose: Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)
Specification reference: #from-column
Review status: unreviewed
Input: D020-1table1column5rows
Expected result: Conforming R2RML mapping with data error
R2RML mapping: R2RMLTC0020b
RDF:
@prefix rr: <https://www.w3.org/ns/r2rml#> . @prefix foaf: <https://xmlns.com/foaf/0.1/> . @prefix ex: <https://example.com/> . @prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @prefix rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#> . @base <https://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName "\"Student\""; ]; rr:subjectMap [ rr:column "\"Name\""; rr:termType rr:IRI; ]; rr:predicateObjectMap [ rr:predicate rdf:type; rr:object foaf:Person; ]; .
D021-2tables2primarykeys1foreignkeyReferencesAllNulls
Title: Two tables, two primary keys, a foreign key, references all nulls
Graphical representation:
ID (PK) INTEGER |
attrA (FK) CHARACTER(5) |
attrB (FK) CHARACTER(5) |
---|---|---|
1100 | K2A21 | K2A11 |
1101 | K2A22 | NULL |
1102 | NULL | NULL |
PK (PK) INTEGER |
key1attr1 CHARACTER(5) |
key1attr2 CHARACTER(5) |
key2attr1 CHARACTER(5) |
key2attr2 CHARACTER(5) |
---|---|---|---|---|
1010 | K1A11 | K1A21 | K2A11 | K2A21 |
1011 | K1A12 | K1A22 | NULL | K2A22 |
1012 | K1A13 | K1A23 | NULL | NULL |
SQL:
CREATE TABLE "Target" ( "PK" INT, PRIMARY KEY("PK"), "key1attr1" CHAR(5), "key1attr2" CHAR(5), UNIQUE ("key1attr1", "key1attr2"), "key2attr1" CHAR(5), "key2attr2" CHAR(5), UNIQUE ("key2attr2", "key2attr1") ); CREATE TABLE "Source" ( "ID" INT, PRIMARY KEY("ID"), "attrA" CHAR(5), "attrB" CHAR(5), FOREIGN KEY ("attrA", "attrB") REFERENCES "Target"("key2attr2", "key2attr1") ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1010, 'K1A11' , 'K1A21' , 'K2A11' , 'K2A21' ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1011, 'K1A12' , 'K1A22' , NULL , 'K2A22' ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1012, 'K1A13' , 'K1A23' , NULL , NULL ); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1100, 'K2A21', 'K2A11'); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1101, 'K2A22', NULL ); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1102, NULL , NULL );
DirectGraphTC0021
Title: Generation of triples for two tables, two primary keys, a foreign key, references all nulls
Purpose: Generation of triples two tables, two primary keys, a foreign key, references all nulls
Specification reference: #lead-ex
Review status: unreviewed
Input: D021-2tables2primarykeys1foreignkeyReferencesAllNulls
Expected result: DirectGraphTC0021
RDF:
@prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <Target/PK=1010> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1010> <Target#PK> 1010 . <Target/PK=1010> <Target#key1attr1> "K1A11" . <Target/PK=1010> <Target#key1attr2> "K1A21" . <Target/PK=1010> <Target#key2attr1> "K2A11" . <Target/PK=1010> <Target#key2attr2> "K2A21" . <Target/PK=1011> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1011> <Target#PK> 1011 . <Target/PK=1011> <Target#key1attr1> "K1A12" . <Target/PK=1011> <Target#key1attr2> "K1A22" . <Target/PK=1011> <Target#key2attr2> "K2A22" . <Target/PK=1012> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1012> <Target#PK> 1012 . <Target/PK=1012> <Target#key1attr1> "K1A13" . <Target/PK=1012> <Target#key1attr2> "K1A23" . <Source/ID=1100> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A21" . <Source/ID=1100> <Source#attrB> "K2A11" . <Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> . <Source/ID=1101> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1101> <Source#ID> 1101 . <Source/ID=1101> <Source#attrA> "K2A22" . <Source/ID=1102> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1102> <Source#ID> 1102 .
D022-2tables1primarykey1foreignkeyReferencesNoPrimaryKey
Title: Two tables, a primary key, a foreign key, references no primary keys
Graphical representation:
ID (PK) INTEGER |
attrA (FK) CHARACTER(4) |
attrB (FK) CHARACTER(4) |
---|---|---|
1100 | K2A2 | K2A1 |
litattr1 INTEGER |
key1attr1 CHARACTER(4) |
key1attr2 CHARACTER(4) |
key2attr1 CHARACTER(4) |
key2attr2 CHARACTER(4) |
---|---|---|---|---|
1010 | K1A1 | K1A2 | K2A1 | K2A2 |
SQL:
CREATE TABLE "Target" ( "litattr1" INT, -- PRIMARY KEY("PK"), "key1attr1" CHAR(4), "key1attr2" CHAR(4), UNIQUE ("key1attr1", "key1attr2"), "key2attr1" CHAR(4), "key2attr2" CHAR(4), UNIQUE ("key2attr2", "key2attr1") ); CREATE TABLE "Source" ( "ID" INT, PRIMARY KEY("ID"), "attrA" CHAR(4), "attrB" CHAR(4), FOREIGN KEY ("attrA", "attrB") REFERENCES "Target"("key2attr2", "key2attr1") ); INSERT INTO "Target" ("litattr1", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1010 , 'K1A1' , 'K1A2' , 'K2A1' , 'K2A2'); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1100, 'K2A2' , 'K2A1' );
File: D022-2tables1primarykey1foreignkeyReferencesNoPrimaryKey
DirectGraphTC0022
Title: Generation of triples from two tables, a primary key, a foreign key, references no primary keys
Purpose: Generation of triples from two tables, a primary key, a foreign key, references no primary keys
Specification reference: #lead-ex
Review status: unreviewed
Input: D022-2tables1primarykey1foreignkeyReferencesNoPrimaryKey
Expected result: DirectGraphTC0022
RDF:
@prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . _:a <Target#litattr1> 1010 . _:a <Target#key1attr1> "K1A1" . _:a <Target#key1attr2> "K1A2" . _:a <Target#key2attr1> "K2A1" . _:a <Target#key2attr2> "K2A2" . <Source/ID=1100> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A2" . <Source/ID=1100> <Source#attrB> "K2A1" . <Source/ID=1100> <Source#ref-attrA;attrB> _:a .
D023-2tables2primarykeys2foreignkeysReferencesToNon-primarykeys
Title: Two tables, two primary keys, two foreign keys, references to a key other than primary key
Graphical representation:
ID (PK) INTEGER |
attrA (FK) CHARACTER(4) |
attrB (FK) CHARACTER(4) |
---|---|---|
1100 | K2A2 | K2A1 |
PK (PK) INTEGER |
key1attr1 CHARACTER(4) |
key1attr2 CHARACTER(4) |
key2attr1 CHARACTER(4) |
key2attr2 CHARACTER(4) |
---|---|---|---|---|
1010 | K1A1 | K1A2 | K2A1 | K2A2 |
SQL:
CREATE TABLE "Target" ( "PK" INT, PRIMARY KEY("PK"), "key1attr1" CHAR(4), "key1attr2" CHAR(4), UNIQUE ("key1attr1", "key1attr2"), "key2attr1" CHAR(4), "key2attr2" CHAR(4), UNIQUE ("key2attr2", "key2attr1") ); CREATE TABLE "Source" ( "ID" INT, PRIMARY KEY("ID"), "attrA" CHAR(4), "attrB" CHAR(4), FOREIGN KEY ("attrA", "attrB") REFERENCES "Target"("key2attr2", "key2attr1") ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1010, 'K1A1' , 'K1A2' , 'K2A1' , 'K2A2' ); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1100, 'K2A2' , 'K2A1' );
File: D023-2tables2primarykeys2foreignkeysReferencesToNon-primarykeys
DirectGraphTC0023
Title: Generation of triples for two tables, two primary keys, two foreign keys, references to a key other than primary key
Purpose: Generation of triples from two tables, two primary keys, two foreign keys, references to a key other than primary key
Specification reference: #lead-ex
Review status: unreviewed
Input: D023-2tables2primarykeys2foreignkeysReferencesToNon-primarykeys
Expected result: DirectGraphTC0023
RDF:
@prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <Target/PK=1010> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1010> <Target#PK> 1010 . <Target/PK=1010> <Target#key1attr1> "K1A1" . <Target/PK=1010> <Target#key1attr2> "K1A2" . <Target/PK=1010> <Target#key2attr1> "K2A1" . <Target/PK=1010> <Target#key2attr2> "K2A2" . <Source/ID=1100> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A2" . <Source/ID=1100> <Source#attrB> "K2A1" . <Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> .
D024-2tables2primarykeys1foreignkeyToARowWithSomeNulls
Title: Two tables, two primary keys, a foreign key to a row with some NULLs in the key.
Graphical representation:
ID (PK) INTEGER |
attrA (FK) CHARACTER(5) |
attrB (FK) CHARACTER(5) |
---|---|---|
1100 | K2A21 | K2A11 |
1101 | K2A22 | NULL |
PK (PK) INTEGER |
key1attr1 CHARACTER(5) |
key1attr2 CHARACTER(5) |
key2attr1 CHARACTER(5) |
key2attr2 CHARACTER(5) |
---|---|---|---|---|
1010 | K1A11 | K1A21 | K2A11 | K2A21 |
1011 | K1A12 | K1A22 | NULL | K2A22 |
SQL:
CREATE TABLE "Target" ( "PK" INT, PRIMARY KEY("PK"), "key1attr1" CHAR(5), "key1attr2" CHAR(5), UNIQUE ("key1attr1", "key1attr2"), "key2attr1" CHAR(5), "key2attr2" CHAR(5), UNIQUE ("key2attr2", "key2attr1") ); CREATE TABLE "Source" ( "ID" INT, PRIMARY KEY("ID"), "attrA" CHAR(5), "attrB" CHAR(5), FOREIGN KEY ("attrA", "attrB") REFERENCES "Target"("key2attr2", "key2attr1") ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1010, 'K1A11' , 'K1A21' , 'K2A11' , 'K2A21' ); INSERT INTO "Target" ("PK", "key1attr1", "key1attr2", "key2attr1", "key2attr2") VALUES (1011, 'K1A12' , 'K1A22' , NULL , 'K2A22' ); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1100, 'K2A21', 'K2A11'); INSERT INTO "Source" ("ID", "attrA", "attrB") VALUES (1101, 'K2A22', NULL );
File: D024-2tables2primarykeys1foreignkeyToARowWithSomeNulls
DirectGraphTC0024
Title: Generation of triples from two tables, two primary keys, a foreign key to a row with some NULLs in the key.
Purpose: Generation of triples from two tables, two primary keys, a foreign key to a row with some NULLs in the key.
Specification reference: #lead-ex
Review status: unreviewed
Input: D024-2tables2primarykeys1foreignkeyToARowWithSomeNulls
Expected result: DirectGraphTC0024
RDF:
@prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <Target/PK=1010> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1010> <Target#PK> 1010 . <Target/PK=1010> <Target#key1attr1> "K1A11" . <Target/PK=1010> <Target#key1attr2> "K1A21" . <Target/PK=1010> <Target#key2attr1> "K2A11" . <Target/PK=1010> <Target#key2attr2> "K2A21" . <Target/PK=1011> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1011> <Target#PK> 1011 . <Target/PK=1011> <Target#key1attr1> "K1A12" . <Target/PK=1011> <Target#key1attr2> "K1A22" . <Target/PK=1011> <Target#key2attr2> "K2A22" . <Source/ID=1100> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A21" . <Source/ID=1100> <Source#attrB> "K2A11" . <Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> . <Source/ID=1101> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1101> <Source#ID> 1101 . <Source/ID=1101> <Source#attrA> "K2A22" .
D025-3tables3primarykeys3foreignkeys
Title: Three tables, three primary keys, three foreign keys
Graphical representation:
deptName (FK) VARCHAR(50) |
deptCity (FK) VARCHAR(50) |
lead (FK) INTEGER |
name VARCHAR(50) |
---|---|---|---|
accounting | Cambridge | 8 | pencil survey |
accounting | Cambridge | 8 | eraser survey |
ID (PK) INTEGER |
city VARCHAR(10) |
state CHARACTER(2) |
---|---|---|
18 | Cambridge | MA |
worker (PFK) INTEGER |
project (PFK) VARCHAR(50) |
deptName (FK) VARCHAR(50) |
deptCity (FK) VARCHAR(50) |
deptName (FK) VARCHAR(50) |
deptCity (FK) VARCHAR(50) |
---|---|---|---|---|---|
7 | pencil survey | accounting | Cambridge | accounting | Cambridge |
ID (PK) INTEGER |
manager (FK) INTEGER |
name VARCHAR(50) |
city VARCHAR(50) |
---|---|---|---|
23 | 8 | accounting | Cambridge |
ID (PK) INTEGER |
addr (FK) INTEGER |
deptName (FK) VARCHAR(50) |
deptCity (FK) VARCHAR(50) |
fname VARCHAR(10) |
---|---|---|---|---|
7 | 18 | accounting | Cambridge | Bob |
8 | NULL | NULL | NULL | Sue |
SQL:
CREATE TABLE "Addresses" ( "ID" INT, PRIMARY KEY("ID"), "city" VARCHAR(10), "state" CHAR(2) ); CREATE TABLE "Department" ( "ID" INT, PRIMARY KEY("ID"), "name" VARCHAR(50), "city" VARCHAR(50), UNIQUE ("name", "city"), "manager" INT ); CREATE TABLE "People" ( "ID" INT, PRIMARY KEY("ID"), "fname" VARCHAR(10), "addr" INT, FOREIGN KEY ("addr") REFERENCES "Addresses"("ID"), "deptName" VARCHAR(50), "deptCity" VARCHAR(50) ); ALTER TABLE "Department" ADD FOREIGN KEY("manager") REFERENCES "People"("ID"); ALTER TABLE "People" ADD FOREIGN KEY("deptName", "deptCity") REFERENCES "Department"("name", "city"); INSERT INTO "Addresses" ("ID", "city", "state") VALUES (18, 'Cambridge', 'MA'); INSERT INTO "People" ("ID", "fname", "addr", "deptName", "deptCity" ) VALUES (8, 'Sue', NULL, NULL, NULL); INSERT INTO "Department" ("ID", "name", "city", "manager") VALUES (23, 'accounting', 'Cambridge', 8); INSERT INTO "People" ("ID", "fname", "addr", "deptName", "deptCity" ) VALUES (7, 'Bob', 18, 'accounting', 'Cambridge'); CREATE TABLE "Projects" ( "lead" INT, "name" VARCHAR(50), UNIQUE ("lead", "name"), "deptName" VARCHAR(50), "deptCity" VARCHAR(50), UNIQUE ("name", "deptName", "deptCity"), FOREIGN KEY ("deptName", "deptCity") REFERENCES "Department"("name", "city") ); CREATE TABLE "TaskAssignments" ( "worker" INT, "project" VARCHAR(50), PRIMARY KEY ("worker", "project"), "deptName" VARCHAR(50), "deptCity" VARCHAR(50), FOREIGN KEY ("project", "deptName", "deptCity") REFERENCES "Projects"("name", "deptName", "deptCity"), FOREIGN KEY ("deptName", "deptCity") REFERENCES "Department"("name", "city") ); ALTER TABLE "Projects" ADD FOREIGN KEY("lead") REFERENCES "People"("ID"); ALTER TABLE "TaskAssignments" ADD FOREIGN KEY("worker") REFERENCES "People"("ID"); INSERT INTO "Projects" ("lead", "name", "deptName", "deptCity" ) VALUES (8, 'pencil survey', 'accounting', 'Cambridge'); INSERT INTO "Projects" ("lead", "name", "deptName", "deptCity" ) VALUES (8, 'eraser survey', 'accounting', 'Cambridge'); INSERT INTO "TaskAssignments" ("worker", "project", "deptName", "deptCity" ) VALUES (7, 'pencil survey', 'accounting', 'Cambridge');
DirectGraphTC0025
Title: Generation of triples from three tables, three primary keys, three foreign keys
Purpose: Generation of triples from three tables, three primary keys, three foreign keys
Specification reference: #lead-ex
Review status: unreviewed
Input: D025-3tables3primarykeys3foreignkeys
Expected result: DirectGraphTC0025
RDF:
@prefix xsd: <https://www.w3.org/2001/XMLSchema#> . @base <https://example.com/base/> . <People/ID=7> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <People> . <People/ID=7> <People#ID> 7 . <People/ID=7> <People#fname> "Bob" . <People/ID=7> <People#addr> 18 . <People/ID=7> <People#ref-addr> <Addresses/ID=18> . <People/ID=7> <People#deptName> "accounting" . <People/ID=7> <People#deptCity> "Cambridge" . <People/ID=7> <People#ref-deptName;deptCity> <Department/ID=23> . <People/ID=8> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <People> . <People/ID=8> <People#ID> 8 . <People/ID=8> <People#fname> "Sue" . <Addresses/ID=18> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Addresses> . <Addresses/ID=18> <Addresses#ID> 18 . <Addresses/ID=18> <Addresses#city> "Cambridge" . <Addresses/ID=18> <Addresses#state> "MA" . <Department/ID=23> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Department> . <Department/ID=23> <Department#ID> 23 . <Department/ID=23> <Department#name> "accounting" . <Department/ID=23> <Department#city> "Cambridge" . <Department/ID=23> <Department#manager> 8; . <Department/ID=23> <Department#ref-manager> <People/ID=8> . _:c <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Projects> . _:c <Projects#lead> 8 . _:c <Projects#ref-lead> <People/ID=8> . _:c <Projects#name> "pencil survey" . _:c <Projects#deptName> "accounting" . _:c <Projects#deptCity> "Cambridge" . _:c <Projects#ref-deptName;deptCity> <Department/ID=23> . _:d <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Projects> . _:d <Projects#lead> 8 . _:d <Projects#ref-lead> <People/ID=8> . _:d <Projects#name> "eraser survey" . _:d <Projects#deptName> "accounting" . _:d <Projects#deptCity> "Cambridge" . _:d <Projects#ref-deptName;deptCity> <Department/ID=23> . <TaskAssignments/worker=7;project=pencil%20survey> <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <TaskAssignments> . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#worker> 7 . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#ref-worker> <People/ID=7> . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#project> "pencil survey" . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#deptName> "accounting" . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#deptCity> "Cambridge" . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#ref-deptName;deptCity> <Department/ID=23> . <TaskAssignments/worker=7;project=pencil%20survey> <TaskAssignments#ref-project;deptName;deptCity> _:c .