diff --git a/test-cases/RMLSTARTC001a/README.md b/test-cases/RMLSTARTC001a/README.md new file mode 100644 index 0000000..5d5bc20 --- /dev/null +++ b/test-cases/RMLSTARTC001a/README.md @@ -0,0 +1,66 @@ +## RMLSTARTC001a + +**Title**: quoted triple in subject, one source, blank node in quoted subject + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +b0,o,ABC +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3" + ] + ] . + +``` + +**Output** +``` +_:b0 . +<< _:b0 >> "ABC" . + +``` + diff --git a/test-cases/RMLSTARTC001b/README.md b/test-cases/RMLSTARTC001b/README.md new file mode 100644 index 0000000..d75d03d --- /dev/null +++ b/test-cases/RMLSTARTC001b/README.md @@ -0,0 +1,78 @@ +## RMLSTARTC001b + +**Title**: quoted triple in subject, two sources, blank node in quoted subject + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +b0,o,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +ABC,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1-1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" + ] + ] . + +``` + +**Output** +``` +_:b0 . +<< _:b0 >> "ABC" . + +``` + diff --git a/test-cases/RMLSTARTC002a/README.md b/test-cases/RMLSTARTC002a/README.md new file mode 100644 index 0000000..7421560 --- /dev/null +++ b/test-cases/RMLSTARTC002a/README.md @@ -0,0 +1,68 @@ +## RMLSTARTC002a + +**Title**: quoted triple in subject, one source, blank node in quoted object + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,b1,456 +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3"; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + _:b1 . +<< _:b1 >> "456"^^ . + +``` + diff --git a/test-cases/RMLSTARTC002b/README.md b/test-cases/RMLSTARTC002b/README.md new file mode 100644 index 0000000..b59c964 --- /dev/null +++ b/test-cases/RMLSTARTC002b/README.md @@ -0,0 +1,80 @@ +## RMLSTARTC002b + +**Title**: quoted triple in subject, two sources, blank node in quoted object + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,b1,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +456,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c1-2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1"; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + _:b1 . +<< _:b1 >> "456"^^ . + +``` + diff --git a/test-cases/RMLSTARTC003a/README.md b/test-cases/RMLSTARTC003a/README.md new file mode 100644 index 0000000..43f16ae --- /dev/null +++ b/test-cases/RMLSTARTC003a/README.md @@ -0,0 +1,85 @@ +## RMLSTARTC003a + +**Title**: two-level quoted triple in subject, one source + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s,o,z,1 +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c4" ; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + . +<< >> . +<< << >> >> "1"^^ . + +``` + diff --git a/test-cases/RMLSTARTC003b/README.md b/test-cases/RMLSTARTC003b/README.md new file mode 100644 index 0000000..e9fe709 --- /dev/null +++ b/test-cases/RMLSTARTC003b/README.md @@ -0,0 +1,97 @@ +## RMLSTARTC003b + +**Title**: two-level quoted triple in subject, two sources + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4 +s,o,z,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +1,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c1-3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" ; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + . +<< >> . +<< << >> >> "1"^^ . + +``` + diff --git a/test-cases/RMLSTARTC004a/README.md b/test-cases/RMLSTARTC004a/README.md new file mode 100644 index 0000000..5927419 --- /dev/null +++ b/test-cases/RMLSTARTC004a/README.md @@ -0,0 +1,84 @@ +## RMLSTARTC004a + +**Title**: two-level quoted triple in subject and object, one source + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s,o,a,z +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +``` + +**Output** +``` + . + << >> . +<< << >> >> . + +``` + diff --git a/test-cases/RMLSTARTC004b/README.md b/test-cases/RMLSTARTC004b/README.md new file mode 100644 index 0000000..4fbfb2b --- /dev/null +++ b/test-cases/RMLSTARTC004b/README.md @@ -0,0 +1,96 @@ +## RMLSTARTC004b + +**Title**: two-level quoted triple in subject and object, two sources + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4 +s,o,a,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +z,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . + +``` + +**Output** +``` + . + << >> . +<< << >> >> . + +``` + diff --git a/test-cases/RMLSTARTC005a/README.md b/test-cases/RMLSTARTC005a/README.md new file mode 100644 index 0000000..c51def6 --- /dev/null +++ b/test-cases/RMLSTARTC005a/README.md @@ -0,0 +1,65 @@ +## RMLSTARTC005a + +**Title**: non-asserted quoted triple in subject, one source + +**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,o,z +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + +**Output** +``` +<< >> . + +``` + diff --git a/test-cases/RMLSTARTC005b/README.md b/test-cases/RMLSTARTC005b/README.md new file mode 100644 index 0000000..01b7971 --- /dev/null +++ b/test-cases/RMLSTARTC005b/README.md @@ -0,0 +1,77 @@ +## RMLSTARTC005b + +**Title**: non-asserted quoted triple in subject, two sources + +**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,o,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +z,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . + +``` + +**Output** +``` +<< >> . + +``` + diff --git a/test-cases/RMLSTARTC006a/README.md b/test-cases/RMLSTARTC006a/README.md new file mode 100644 index 0000000..ae58fa3 --- /dev/null +++ b/test-cases/RMLSTARTC006a/README.md @@ -0,0 +1,65 @@ +## RMLSTARTC006a + +**Title**: non-asserted quoted triple in object, one source + +**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,o,x +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +``` + +**Output** +``` + << >> . + +``` + diff --git a/test-cases/RMLSTARTC006b/README.md b/test-cases/RMLSTARTC006b/README.md new file mode 100644 index 0000000..5b29746 --- /dev/null +++ b/test-cases/RMLSTARTC006b/README.md @@ -0,0 +1,77 @@ +## RMLSTARTC006b + +**Title**: non-asserted quoted triple in object, two sources + +**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,o,1 + +``` + +**Input 1** +``` +c2-1,c2-2 +x,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ] + ] . + +``` + +**Output** +``` + << >> . + +``` + diff --git a/test-cases/RMLSTARTC007a/README.md b/test-cases/RMLSTARTC007a/README.md new file mode 100644 index 0000000..5c0301e --- /dev/null +++ b/test-cases/RMLSTARTC007a/README.md @@ -0,0 +1,82 @@ +## RMLSTARTC007a + +**Title**: non-asserted quoted triples in subject and object, one source + +**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s1,o1,s2,o2 +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +``` + +**Output** +``` +<< >> << >> . + +``` + diff --git a/test-cases/RMLSTARTC007b/README.md b/test-cases/RMLSTARTC007b/README.md new file mode 100644 index 0000000..942e513 --- /dev/null +++ b/test-cases/RMLSTARTC007b/README.md @@ -0,0 +1,94 @@ +## RMLSTARTC007b + +**Title**: non-asserted quoted triples in subject and object, two sources + +**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s1,o1,1 + +``` + +**Input 1** +``` +c2-1,c2-2,c2-3 +s2,o2,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-3" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +``` + +**Output** +``` +<< >> << >> . + +``` + diff --git a/test-cases/RMLSTARTC008a/README.md b/test-cases/RMLSTARTC008a/README.md new file mode 100644 index 0000000..1b429c5 --- /dev/null +++ b/test-cases/RMLSTARTC008a/README.md @@ -0,0 +1,149 @@ +## RMLSTARTC008a + +**Title**: two-level non-asserted quoted triple in subject and object two-fold, one source + +**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4,c5,c6,c7,c8 +s1,o1,s2,o2,s3,o3,s4,o4 +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c5}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c6}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c7}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c8}" + ] + ] . + +``` + +**Output** +``` +<<<<>><<>>>><<<<>><<>>>>. +``` + diff --git a/test-cases/RMLSTARTC008b/README.md b/test-cases/RMLSTARTC008b/README.md new file mode 100644 index 0000000..8c34670 --- /dev/null +++ b/test-cases/RMLSTARTC008b/README.md @@ -0,0 +1,162 @@ +## RMLSTARTC008b + +**Title**: two-level non-asserted quoted triple in subject and object two-fold, two sources + +**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4,c1-5 +s1,o1,s2,o2,1 + +``` + +**Input 1** +``` +c2-1,c2-2,c2-3,c2-4,c2-5 +s3,o3,s4,o4,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c1-4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM ; + rml:joinCondition [ + rml:child "c2-5" ; + rml:parent "c1-5" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c2-4}" + ] + ] . + +``` + +**Output** +``` +<<<<>><<>>>><<<<>><<>>>>. + +``` + diff --git a/test-cases/RMLSTARTC009/README.md b/test-cases/RMLSTARTC009/README.md new file mode 100644 index 0000000..6d91e68 --- /dev/null +++ b/test-cases/RMLSTARTC009/README.md @@ -0,0 +1,58 @@ +## RMLSTARTC009 + +**Title**: + +**Description**: + +**Error expected?** Yes + +**Input** +``` +c1,c2,c3,c4 +a,s,o,z +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:quotedTriplesMap :secondTM ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + diff --git a/test-cases/RMLSTARTC010/README.md b/test-cases/RMLSTARTC010/README.md new file mode 100644 index 0000000..6d37e94 --- /dev/null +++ b/test-cases/RMLSTARTC010/README.md @@ -0,0 +1,56 @@ +## RMLSTARTC010 + +**Title**: + +**Description**: + +**Error expected?** Yes + +**Input** +``` +c1,c2,c3,c4 +a,s,o,z +``` + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; + rml:quotedTriplesMap :secondTM ; + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + diff --git a/test-cases/config.js b/test-cases/config.js new file mode 100644 index 0000000..a967e7c --- /dev/null +++ b/test-cases/config.js @@ -0,0 +1,72 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/star/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-io", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-Star-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/test-cases/descriptions.csv b/test-cases/descriptions.csv new file mode 100644 index 0000000..a770754 --- /dev/null +++ b/test-cases/descriptions.csv @@ -0,0 +1,19 @@ +RML id,title,purpose,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment +RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",,CSV,CSV,no,data.csv,,, +RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",,CSV,CSV,no,data.csv,,, +RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",,CSV,CSV,no,data.csv,,, +RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC009,,,,,,yes,,,, +RMLSTARTC010,,,,,,yes,,,, \ No newline at end of file diff --git a/test-cases/dev.html b/test-cases/dev.html new file mode 100644 index 0000000..1a97616 --- /dev/null +++ b/test-cases/dev.html @@ -0,0 +1,118 @@ + + + + + RML-Star: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/test-cases/docs/20250130/index.html b/test-cases/docs/20250130/index.html new file mode 100644 index 0000000..d764af7 --- /dev/null +++ b/test-cases/docs/20250130/index.html @@ -0,0 +1,1895 @@ + + + + + + +RML-Star: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Star: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Star-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Star test cases to the determine the RML-Star 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-Star 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-Star 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-Star 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. RMLSTARTC001a

+

Title: quoted triple in subject, one source, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+b0,o,ABC
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

5. RMLSTARTC001b

+

Title: quoted triple in subject, two sources, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+b0,o,1
+
+

Input 1

+
c2-1,c2-2
+ABC,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1-1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

6. RMLSTARTC002a

+

Title: quoted triple in subject, one source, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,b1,456
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

7. RMLSTARTC002b

+

Title: quoted triple in subject, two sources, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,b1,1
+
+

Input 1

+
c2-1,c2-2
+456,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c1-2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLSTARTC003a

+

Title: two-level quoted triple in subject, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c4" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLSTARTC003b

+

Title: two-level quoted triple in subject, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,z,1
+
+

Input 1

+
c2-1,c2-2
+1,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c1-3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLSTARTC004a

+

Title: two-level quoted triple in subject and object, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,a,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

11. RMLSTARTC004b

+

Title: two-level quoted triple in subject and object, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,a,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

12. RMLSTARTC005a

+

Title: non-asserted quoted triple in subject, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

13. RMLSTARTC005b

+

Title: non-asserted quoted triple in subject, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

14. RMLSTARTC006a

+

Title: non-asserted quoted triple in object, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,x
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

15. RMLSTARTC006b

+

Title: non-asserted quoted triple in object, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+x,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

16. RMLSTARTC007a

+

Title: non-asserted quoted triples in subject and object, one source

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s1,o1,s2,o2
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

17. RMLSTARTC007b

+

Title: non-asserted quoted triples in subject and object, two sources

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s1,o1,1
+
+

Input 1

+
c2-1,c2-2,c2-3
+s2,o2,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-3" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

18. RMLSTARTC008a

+

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

+

Error expected? No

+

Input

+
c1,c2,c3,c4,c5,c6,c7,c8
+s1,o1,s2,o2,s3,o3,s4,o4
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c5}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c6}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c7}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c8}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

19. RMLSTARTC008b

+

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4,c1-5
+s1,o1,s2,o2,1
+
+

Input 1

+
c2-1,c2-2,c2-3,c2-4,c2-5
+s3,o3,s4,o4,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM ;
+            rml:joinCondition [
+              rml:child "c2-5" ;
+              rml:parent "c1-5" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-4}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

20. RMLSTARTC009

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:quotedTriplesMap :secondTM ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+

21. RMLSTARTC010

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p;
+        rml:quotedTriplesMap :secondTM ;
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+ + + + + \ No newline at end of file diff --git a/test-cases/docs/index.html b/test-cases/docs/index.html new file mode 100644 index 0000000..d764af7 --- /dev/null +++ b/test-cases/docs/index.html @@ -0,0 +1,1895 @@ + + + + + + +RML-Star: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Star: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Star-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Star test cases to the determine the RML-Star 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-Star 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-Star 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-Star 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. RMLSTARTC001a

+

Title: quoted triple in subject, one source, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+b0,o,ABC
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

5. RMLSTARTC001b

+

Title: quoted triple in subject, two sources, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+b0,o,1
+
+

Input 1

+
c2-1,c2-2
+ABC,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1-1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

6. RMLSTARTC002a

+

Title: quoted triple in subject, one source, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,b1,456
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

7. RMLSTARTC002b

+

Title: quoted triple in subject, two sources, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,b1,1
+
+

Input 1

+
c2-1,c2-2
+456,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c1-2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLSTARTC003a

+

Title: two-level quoted triple in subject, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c4" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLSTARTC003b

+

Title: two-level quoted triple in subject, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,z,1
+
+

Input 1

+
c2-1,c2-2
+1,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c1-3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLSTARTC004a

+

Title: two-level quoted triple in subject and object, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,a,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

11. RMLSTARTC004b

+

Title: two-level quoted triple in subject and object, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,a,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

12. RMLSTARTC005a

+

Title: non-asserted quoted triple in subject, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

13. RMLSTARTC005b

+

Title: non-asserted quoted triple in subject, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

14. RMLSTARTC006a

+

Title: non-asserted quoted triple in object, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,x
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

15. RMLSTARTC006b

+

Title: non-asserted quoted triple in object, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+x,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

16. RMLSTARTC007a

+

Title: non-asserted quoted triples in subject and object, one source

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s1,o1,s2,o2
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

17. RMLSTARTC007b

+

Title: non-asserted quoted triples in subject and object, two sources

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s1,o1,1
+
+

Input 1

+
c2-1,c2-2,c2-3
+s2,o2,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-3" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

18. RMLSTARTC008a

+

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

+

Error expected? No

+

Input

+
c1,c2,c3,c4,c5,c6,c7,c8
+s1,o1,s2,o2,s3,o3,s4,o4
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c5}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c6}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c7}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c8}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

19. RMLSTARTC008b

+

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4,c1-5
+s1,o1,s2,o2,1
+
+

Input 1

+
c2-1,c2-2,c2-3,c2-4,c2-5
+s3,o3,s4,o4,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM ;
+            rml:joinCondition [
+              rml:child "c2-5" ;
+              rml:parent "c1-5" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-4}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

20. RMLSTARTC009

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:quotedTriplesMap :secondTM ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+

21. RMLSTARTC010

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p;
+        rml:quotedTriplesMap :secondTM ;
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+ + + + + \ No newline at end of file diff --git a/test-cases/list.sh b/test-cases/list.sh new file mode 100755 index 0000000..12c3203 --- /dev/null +++ b/test-cases/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/test-cases/make-metadata.py b/test-cases/make-metadata.py new file mode 100755 index 0000000..f3501f4 --- /dev/null +++ b/test-cases/make-metadata.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + print(testcase) + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'data.csv')): + input1 = 'data.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'data1.csv')): + input1 = 'data1.csv' + input_format1 = 'text/csv' + + if os.path.exists(os.path.join(testcase, 'data2.csv')): + input2 = 'data2.csv' + input_format2 = 'text/csv' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'output.nt')): + output1 = 'output.nt' + output_format1 = 'application/n-triples' + else: + error = 'true' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/test-cases/manifest.rml.ttl b/test-cases/manifest.rml.ttl new file mode 100644 index 0000000..871e271 --- /dev/null +++ b/test-cases/manifest.rml.ttl @@ -0,0 +1,277 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}/"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}/"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}/"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}/"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}/"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource [ + rml:source "metadata.csv"; + rml:referenceFormulation rml:CSV; + ]; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}/"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/test-cases/manifest.ttl b/test-cases/manifest.ttl new file mode 100644 index 0000000..4f03f30 --- /dev/null +++ b/test-cases/manifest.ttl @@ -0,0 +1,297 @@ +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@prefix xsd: . + + a test:TestCase; + dcterms:identifier "RMLSTARTC001a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC001b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC002a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC002b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC003a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC003b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC004a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC004b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC005a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC005b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC006a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC006b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC007a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC007b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC008a"; + rmltest:hasError false; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC008b"; + rmltest:hasError false; + rmltest:input , ; + rmltest:mappingDocument "mapping.ttl"; + rmltest:output . + + a rmltest:Input; + rmltest:input "data1.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Input; + rmltest:input "data2.csv"; + rmltest:inputFormat "text/csv" . + + a rmltest:Output; + rmltest:output "output.nt"; + rmltest:outputFormat "application/n-triples" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC009"; + rmltest:hasError true; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl" . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . + + a test:TestCase; + dcterms:identifier "RMLSTARTC010"; + rmltest:hasError true; + rmltest:input ; + rmltest:mappingDocument "mapping.ttl" . + + a rmltest:Input; + rmltest:input "data.csv"; + rmltest:inputFormat "text/csv" . diff --git a/test-cases/metadata.csv b/test-cases/metadata.csv new file mode 100644 index 0000000..d495e1b --- /dev/null +++ b/test-cases/metadata.csv @@ -0,0 +1,19 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLSTARTC009,,,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true +RMLSTARTC010,,,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true +RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false diff --git a/test-cases/section/abstract.md b/test-cases/section/abstract.md new file mode 100644 index 0000000..177fb7a --- /dev/null +++ b/test-cases/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools. diff --git a/test-cases/section/data-model.md b/test-cases/section/data-model.md new file mode 100644 index 0000000..f4c3ad6 --- /dev/null +++ b/test-cases/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-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. diff --git a/test-cases/section/introduction.md b/test-cases/section/introduction.md new file mode 100644 index 0000000..3a3f1e9 --- /dev/null +++ b/test-cases/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-Star 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-Star specification. diff --git a/test-cases/section/test-cases.md b/test-cases/section/test-cases.md new file mode 100644 index 0000000..228143d --- /dev/null +++ b/test-cases/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-Star test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-star/tree/main/test-cases) 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. +