From 3214d45fa048382e362aad6fb9fe7d3bb63aa5a1 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Mon, 10 Nov 2025 17:57:09 +0100 Subject: [PATCH 1/2] fix #122: Fix JSONPath to RFC 9535 --- test-cases/RMLTC0010a-JSON/README.md | 2 +- test-cases/RMLTC0010a-JSON/mapping.ttl | 2 +- test-cases/RMLTC0010b-JSON/README.md | 2 +- test-cases/RMLTC0010b-JSON/mapping.ttl | 2 +- test-cases/RMLTC0010c-JSON/README.md | 4 ++-- test-cases/RMLTC0010c-JSON/mapping.ttl | 4 ++-- test-cases/RMLTC0023f-JSON/README.md | 2 +- test-cases/RMLTC0023f-JSON/mapping.ttl | 2 +- test-cases/RMLTC0028a-JSON/README.md | 2 +- test-cases/RMLTC0028a-JSON/mapping.ttl | 2 +- test-cases/RMLTC0028b-JSON/README.md | 2 +- test-cases/RMLTC0028b-JSON/mapping.ttl | 2 +- test-cases/RMLTC0028c-JSON/README.md | 2 +- test-cases/RMLTC0028c-JSON/mapping.ttl | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test-cases/RMLTC0010a-JSON/README.md b/test-cases/RMLTC0010a-JSON/README.md index f465982b..96fd16a3 100644 --- a/test-cases/RMLTC0010a-JSON/README.md +++ b/test-cases/RMLTC0010a-JSON/README.md @@ -49,7 +49,7 @@ rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}" + rml:template "http://example.com/{$['Country Code']}" ] . ``` diff --git a/test-cases/RMLTC0010a-JSON/mapping.ttl b/test-cases/RMLTC0010a-JSON/mapping.ttl index 370edb7c..76ab4764 100644 --- a/test-cases/RMLTC0010a-JSON/mapping.ttl +++ b/test-cases/RMLTC0010a-JSON/mapping.ttl @@ -17,5 +17,5 @@ rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}" + rml:template "http://example.com/{$['Country Code']}" ] . diff --git a/test-cases/RMLTC0010b-JSON/README.md b/test-cases/RMLTC0010b-JSON/README.md index a91ee546..026cd3d1 100644 --- a/test-cases/RMLTC0010b-JSON/README.md +++ b/test-cases/RMLTC0010b-JSON/README.md @@ -49,7 +49,7 @@ rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] . ``` diff --git a/test-cases/RMLTC0010b-JSON/mapping.ttl b/test-cases/RMLTC0010b-JSON/mapping.ttl index 1f9f4db6..b40e9619 100644 --- a/test-cases/RMLTC0010b-JSON/mapping.ttl +++ b/test-cases/RMLTC0010b-JSON/mapping.ttl @@ -17,5 +17,5 @@ rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] . diff --git a/test-cases/RMLTC0010c-JSON/README.md b/test-cases/RMLTC0010c-JSON/README.md index 62298579..784c2949 100644 --- a/test-cases/RMLTC0010c-JSON/README.md +++ b/test-cases/RMLTC0010c-JSON/README.md @@ -45,12 +45,12 @@ rml:predicateObjectMap [ rml:predicate ex:code; rml:objectMap [ - rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; + rml:template "\\{\\{\\{ {$['ISO 3166']} \\}\\}\\}"; rml:termType rml:Literal ] ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] . ``` diff --git a/test-cases/RMLTC0010c-JSON/mapping.ttl b/test-cases/RMLTC0010c-JSON/mapping.ttl index fb1afc8d..1d8c58b5 100644 --- a/test-cases/RMLTC0010c-JSON/mapping.ttl +++ b/test-cases/RMLTC0010c-JSON/mapping.ttl @@ -13,10 +13,10 @@ rml:predicateObjectMap [ rml:predicate ex:code; rml:objectMap [ - rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; + rml:template "\\{\\{\\{ {$['ISO 3166']} \\}\\}\\}"; rml:termType rml:Literal ] ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] . diff --git a/test-cases/RMLTC0023f-JSON/README.md b/test-cases/RMLTC0023f-JSON/README.md index e786a76c..fe4d09f6 100644 --- a/test-cases/RMLTC0023f-JSON/README.md +++ b/test-cases/RMLTC0023f-JSON/README.md @@ -34,7 +34,7 @@ ] ]; rml:subjectMap [ - rml:template "http://example.com/{\\{Name\\}}"; + rml:template "http://example.com/{$['\\{Name\\}']}"; rml:class foaf:Person; ] . diff --git a/test-cases/RMLTC0023f-JSON/mapping.ttl b/test-cases/RMLTC0023f-JSON/mapping.ttl index 6a619068..cdd74435 100644 --- a/test-cases/RMLTC0023f-JSON/mapping.ttl +++ b/test-cases/RMLTC0023f-JSON/mapping.ttl @@ -11,7 +11,7 @@ ] ]; rml:subjectMap [ - rml:template "http://example.com/{\\{Name\\}}"; + rml:template "http://example.com/{$['\\{Name\\}']}"; rml:class foaf:Person; ] . diff --git a/test-cases/RMLTC0028a-JSON/README.md b/test-cases/RMLTC0028a-JSON/README.md index d5d5cecc..66395c53 100644 --- a/test-cases/RMLTC0028a-JSON/README.md +++ b/test-cases/RMLTC0028a-JSON/README.md @@ -28,7 +28,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate ; diff --git a/test-cases/RMLTC0028a-JSON/mapping.ttl b/test-cases/RMLTC0028a-JSON/mapping.ttl index 140141f7..7566d122 100644 --- a/test-cases/RMLTC0028a-JSON/mapping.ttl +++ b/test-cases/RMLTC0028a-JSON/mapping.ttl @@ -10,7 +10,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate ; diff --git a/test-cases/RMLTC0028b-JSON/README.md b/test-cases/RMLTC0028b-JSON/README.md index 4428a0ae..5c68f81b 100644 --- a/test-cases/RMLTC0028b-JSON/README.md +++ b/test-cases/RMLTC0028b-JSON/README.md @@ -29,7 +29,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; rml:class s:Person ; rml:graph ; ]; diff --git a/test-cases/RMLTC0028b-JSON/mapping.ttl b/test-cases/RMLTC0028b-JSON/mapping.ttl index 9564c1e4..c6721db9 100644 --- a/test-cases/RMLTC0028b-JSON/mapping.ttl +++ b/test-cases/RMLTC0028b-JSON/mapping.ttl @@ -11,7 +11,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; rml:class s:Person ; rml:graph ; ]; diff --git a/test-cases/RMLTC0028c-JSON/README.md b/test-cases/RMLTC0028c-JSON/README.md index 2a0a6d06..8d8a6283 100644 --- a/test-cases/RMLTC0028c-JSON/README.md +++ b/test-cases/RMLTC0028c-JSON/README.md @@ -28,7 +28,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate ; diff --git a/test-cases/RMLTC0028c-JSON/mapping.ttl b/test-cases/RMLTC0028c-JSON/mapping.ttl index 8c9145de..02ec085b 100644 --- a/test-cases/RMLTC0028c-JSON/mapping.ttl +++ b/test-cases/RMLTC0028c-JSON/mapping.ttl @@ -10,7 +10,7 @@ ] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate ; From fc8e63fda87375d0bdccd211d1e4f8d0c2cf59ea Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 18 Nov 2025 15:17:56 +0100 Subject: [PATCH 2/2] test: regenerate docs --- test-cases/docs/20251118/index.html | 3867 +++++++++++++++++++++++++++ test-cases/docs/index.html | 26 +- 2 files changed, 3880 insertions(+), 13 deletions(-) create mode 100644 test-cases/docs/20251118/index.html diff --git a/test-cases/docs/20251118/index.html b/test-cases/docs/20251118/index.html new file mode 100644 index 00000000..bbb9743f --- /dev/null +++ b/test-cases/docs/20251118/index.html @@ -0,0 +1,3867 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "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"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "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 rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {"ID":110, "Description":"Tennis"},
+    {"ID":111, "Description":"Football"},
+    {"ID":112, "Description":"Formula1"}
+  ]
+}
+
+

Input 2

+
{
+  "links": [
+    {"ID_Student":10, "ID_Sport":110},
+    {"ID_Student":11, "ID_Sport":111},
+    {"ID_Student":11, "ID_Sport":112},
+    {"ID_Student":12, "ID_Sport":111}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "lives": [
+    {"fname":"Bob","lname":"Smith","city":"London"},
+    {"fname":"Sue","lname":"Jones","city":"Madrid"},
+    {"fname":"Bob","lname":"Smith","city":"London"}
+  ]
+}
+
+

Input 1

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus",
+    "Age": 21
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\\\{Name\\\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Valid IRI template with backslash-escape"

+

Description: "Test handling of a valid IRI template using backslash-escape"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$['\\{Name\\}']}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

53. RMLTC0024a-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

54. RMLTC0025a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTC0025b-JSON

+

Title: "Generation of triples from arrays with wrong reference"

+

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+
+

56. RMLTC0025c-JSON

+

Title: "Generation of triples from arrays in subject and object"

+

Description: "Tests the generation of triples from array input data structures in subject and object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.names[*]}"
+    ] .
+
+

Output

+
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

57. RMLTC0026a-JSON

+

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

+

Description: "Tests the generation of triples from relative IRIs using base IRI"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

58. RMLTC0026b-JSON

+

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

+

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://tp1.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

59. RMLTC0026c-JSON

+

Title: "Two triples maps, both with rml:baseIRI defined"

+

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

60. RMLTC0026d-JSON

+

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

+

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

61. RMLTC0027a-JSON

+

Title: "Generation of triples using the URI term type"

+

Description: "Tests the generation of triples with a URI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Zoë Krüger"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:URI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Zo%C3%AB%20Kr%C3%BCger> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

62. RMLTC0027b-JSON

+

Title: "Generation of triples using the UnsafeIRI term type"

+

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Bob/Charles"},
+    {"Name": "Emily Smith"},
+    {"Name": "Zoë Krüger"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeIRI
+    ] .
+
+

Output

+
<http://example.com/Person/Bob/Charles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Zoë Krüger> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

63. RMLTC0027c-JSON

+

Title: "Generation an IRI using the term type IRI"

+

Description: "Tests the generation of triples with a IRI term type in the subject"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Zoë Krüger"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/Person/Zoë%20Krüger> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

64. RMLTC0028a-JSON

+

Title: "Generation of the right datatype for a constant in the mapping"

+

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{$.id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object true ; # datatype is boolean
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

65. RMLTC0028b-JSON

+

Title: "Generation of all named graphs when rml:defaultGraph is involved"

+

Description: "Test if the default graph is also generated correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "name": "Alice"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix s: <http://schema.org/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{$.id}";
+      rml:class s:Person ;
+      rml:graph <graph:1> ;
+    ];
+    rml:predicateObjectMap [
+      rml:predicate s:givenName ;
+      rml:objectMap [ rml:reference "name" ] ;
+      rml:graph rml:defaultGraph ;
+    ].
+
+

Output

+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
+<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
+<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
+
+
+

66. RMLTC0028c-JSON

+

Title: "Generation of the right language tag for a constant in the mapping"

+

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{$.id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object "train"@en ;
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
+
+
+ + + + + \ No newline at end of file diff --git a/test-cases/docs/index.html b/test-cases/docs/index.html index 846ed2d6..bbb9743f 100644 --- a/test-cases/docs/index.html +++ b/test-cases/docs/index.html @@ -244,17 +244,17 @@ "copyrightStart": "2024", "doJsonLd": true, "group": "kg-construct", - "publishISODate": "2025-10-10T00:00:00.000Z", - "generatedSubtitle": "Draft Community Group Report 10 October 2025" + "publishISODate": "2025-11-10T00:00:00.000Z", + "generatedSubtitle": "Draft Community Group Report 10 November 2025" } -
+

RML-Core: Test Cases

Draft Community Group Report - +

@@ -1727,7 +1727,7 @@

RML-Core: Test Cases

rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}" + rml:template "http://example.com/{$['Country Code']}" ] .

Output

@@ -1779,7 +1779,7 @@

RML-Core: Test Cases

rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] .

Output

@@ -1827,12 +1827,12 @@

RML-Core: Test Cases

rml:predicateObjectMap [ rml:predicate ex:code; rml:objectMap [ - rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; + rml:template "\\{\\{\\{ {$['ISO 3166']} \\}\\}\\}"; rml:termType rml:Literal ] ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + rml:template "http://example.com/{$['Country Code']}/{$.Name}" ] .

Output

@@ -2875,7 +2875,7 @@

RML-Core: Test Cases

] ]; rml:subjectMap [ - rml:template "http://example.com/{\\{Name\\}}"; + rml:template "http://example.com/{$['\\{Name\\}']}"; rml:class foaf:Person; ] . @@ -3458,7 +3458,7 @@

RML-Core: Test Cases

] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate <http://example.org/ns/p> ; @@ -3491,7 +3491,7 @@

RML-Core: Test Cases

] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; rml:class s:Person ; rml:graph <graph:1> ; ]; @@ -3528,7 +3528,7 @@

RML-Core: Test Cases

] ]; rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; + rml:template "https://example.org/instances/{$.id}"; ]; rml:predicateObjectMap [ rml:predicate <http://example.org/ns/p> ; @@ -3864,4 +3864,4 @@

RML-Core: Test Cases

panel.hidden = true; panel.classList.remove("docked"); } -})() \ No newline at end of file +})() \ No newline at end of file