+ Draft Community Group Report + +
++ Copyright + © + 2024-2025 + + the Contributors to the RML-LV: Test Cases + Specification, published by the + Knowledge Graph Construction Community Group under the + W3C Community Contributor License Agreement (CLA). A human-readable + summary + is available. + +
+This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.
++ 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. + + +
This document defines the RML-LV 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-LV specification.
+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.This section describes the RML-LV 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:
mapping.ttl
, in the Turtle format.Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item.type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item_type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:innerJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item_type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:innerJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "item_{#}_{item_type.#}" ;
+ rml:termType rml:BlankNode ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
+_:item_0_0 <http://example.org/hasType> "sword" .
+_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:item_0_1 <http://example.org/hasType> "shield" .
+_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
+_:item_1_0 <http://example.org/hasType> "flower" .
+_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+ rml:viewOn :mixedCSVSource ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "items" ;
+ rml:reference "items" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$[*]" ;
+ rml:fieldName "item" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedCSVView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{items.item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "items.item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "items.item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+ rml:viewOn :mixedCSVSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item" ;
+ rml:reference "item" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$[*]" ;
+ rml:fieldName "itemJson" ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ; ] ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedCSVView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item.itemJson.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item.itemJson.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": "type,weight\nsword,1500\nshield,2500"
+ },
+ {
+ "name": "bob",
+ "items": "type,weight\nflower,15"
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+ rml:viewOn :mixedJSONSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "items" ;
+ rml:reference "$.items" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:CSV ;
+ rml:fieldName "item";
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "type" ;
+ ] ;
+ rml:field [
+ a rml:expressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "weight" ;
+ ] ;
+ ] ;
+ ].
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedJSONView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{items.item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "items.item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "items.item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Input 2
+name,id
+alice,123
+bob,456
+tobias,789
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [ a
+ rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+ :additionalCsvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people2.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+ :additionalCsvView a rml:LogicalView ;
+ rml:viewOn :additionalCsvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "id" ;
+ rml:reference "id" ;
+ ] ;
+ .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :additionalCsvView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "id" ;
+ rml:reference "id" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{id}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{item_type.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/123> <http://example.org/hasName> "alice" .
+<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/456> <http://example.org/hasName> "bob" .
+<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/789> <http://example.org/hasName> "tobias" .
+<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
++ Draft Community Group Report + +
++ Copyright + © + 2024-2025 + + the Contributors to the RML-LV: Test Cases + Specification, published by the + Knowledge Graph Construction Community Group under the + W3C Community Contributor License Agreement (CLA). A human-readable + summary + is available. + +
+This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.
++ 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. + + +
This document defines the RML-LV 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-LV specification.
+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.This section describes the RML-LV 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:
mapping.ttl
, in the Turtle format.Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :jsonView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item.type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item_type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:innerJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/person/{name}/item/{item_type}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:innerJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{name}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "item_{#}_{item_type.#}" ;
+ rml:termType rml:BlankNode ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
+_:item_0_0 <http://example.org/hasType> "sword" .
+_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:item_0_1 <http://example.org/hasType> "shield" .
+_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
+_:item_1_0 <http://example.org/hasType> "flower" .
+_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+ rml:viewOn :mixedCSVSource ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "items" ;
+ rml:reference "items" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$[*]" ;
+ rml:fieldName "item" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedCSVView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{items.item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "items.item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "items.item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+ rml:viewOn :mixedCSVSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item" ;
+ rml:reference "item" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$[*]" ;
+ rml:fieldName "itemJson" ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ; ] ;
+ rml:field [
+ a rml:ExpressionField;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedCSVView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item.itemJson.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item.itemJson.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": "type,weight\nsword,1500\nshield,2500"
+ },
+ {
+ "name": "bob",
+ "items": "type,weight\nflower,15"
+ }
+ ]
+}
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+ rml:viewOn :mixedJSONSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "items" ;
+ rml:reference "$.items" ;
+ rml:field [
+ a rml:IterableField ;
+ rml:referenceFormulation rml:CSV ;
+ rml:fieldName "item";
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "type" ;
+ ] ;
+ rml:field [
+ a rml:expressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "weight" ;
+ ] ;
+ ] ;
+ ].
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :mixedJSONView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{items.item.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "items.item.type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "items.item.weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+Title:
+Description:
+Error expected? No
+Input
+{
+ "people": [
+ {
+ "name": "alice",
+ "items": [
+ {
+ "type": "sword",
+ "weight": 1500
+ },
+ {
+ "type": "shield",
+ "weight": 2500
+ }
+ ]
+ },
+ {
+ "name": "bob",
+ "items": [
+ {
+ "type": "flower",
+ "weight": 15
+ }
+ ]
+ }
+ ]
+}
+
+Input 1
+name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+Input 2
+name,id
+alice,123
+bob,456
+tobias,789
+
+Mapping
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.json" ;
+ ] ;
+ rml:referenceFormulation rml:JSONPath ;
+ rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+ rml:viewOn :jsonSource ;
+ rml:field [ a
+ rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "$.name" ;
+ ] ;
+ rml:field [
+ a rml:IterableField ;
+ rml:fieldName "item" ;
+ rml:iterator "$.items[*]" ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "type" ;
+ rml:reference "$.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "weight" ;
+ rml:reference "$.weight" ;
+ ] ;
+ ] .
+
+ :additionalCsvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people2.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+ :additionalCsvView a rml:LogicalView ;
+ rml:viewOn :additionalCsvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "id" ;
+ rml:reference "id" ;
+ ] ;
+ .
+
+:csvSource a rml:LogicalSource ;
+ rml:source [
+ a rml:RelativePathSource , rml:Source ;
+ rml:root rml:MappingDirectory ;
+ rml:path "people.csv" ;
+ ] ;
+ rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+ rml:viewOn :csvSource ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "name" ;
+ rml:reference "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "birthyear" ;
+ rml:reference "birthyear" ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :jsonView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_type" ;
+ rml:reference "item.type" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "item_weight" ;
+ rml:reference "item.weight" ;
+ ] ;
+ ] ;
+ rml:leftJoin [
+ rml:parentLogicalView :additionalCsvView ;
+ rml:joinCondition [
+ rml:parent "name" ;
+ rml:child "name" ;
+ ] ;
+ rml:field [
+ a rml:ExpressionField ;
+ rml:fieldName "id" ;
+ rml:reference "id" ;
+ ] ;
+ ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/people/{id}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasName ;
+ rml:objectMap [
+ rml:reference "name" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasBirthyear ;
+ rml:objectMap [
+ rml:reference "birthyear" ;
+ rml:datatype xsd:gYear ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasItem ;
+ rml:objectMap [
+ rml:parentTriplesMap :triplesMapItem ;
+ ] ;
+ ] .
+
+:triplesMapItem a rml:TriplesMap ;
+ rml:logicalSource :csvView ;
+ rml:subjectMap [
+ rml:template "http://example.org/item_{#}_{item_type.#}" ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasType ;
+ rml:objectMap [
+ rml:reference "item_type" ;
+ ] ;
+ ] ;
+ rml:predicateObjectMap [
+ rml:predicate :hasWeight ;
+ rml:objectMap [
+ rml:reference "item_weight" ;
+ rml:datatype xsd:integer ;
+ ] ;
+ ] .
+
+Output
+<http://example.org/people/123> <http://example.org/hasName> "alice" .
+<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/456> <http://example.org/hasName> "bob" .
+<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/789> <http://example.org/hasName> "tobias" .
+<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+