Skip to content

Commit

Permalink
Merge pull request #43 from kg-construct/fix-test-cases
Browse files Browse the repository at this point in the history
Test cases for generating collections from referencing object maps
  • Loading branch information
frmichel authored Mar 11, 2024
2 parents edd4ef4 + cc14f5b commit 37eb3a0
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
- RMLTC-CC-0006-IT1: named lists generated across multiple iterations
- RMLTC-CC-0006-IT2: named lists generated across multiple iterations with multi-valued gather map
- RMLTC-CC-0007-NES: list of bags (nested containers and collections)
- RMLTC-CC-0008-ROMa: RDF list whose members are generated by a referencing object-map
- RMLTC-CC-0008-ROMb: RDF list whose members are generated by a referencing object-map with default join condition
13 changes: 13 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMa/default.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
27 changes: 27 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMa/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

_:b273446 a rml:RelativePathSource ;
rml:path "student.csv" .

<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
rml:logicalSource [ a rml:LogicalSource ;
rml:referenceFormulation rml:CSV ;
rml:source _:b273446 ] ;

rml:predicateObjectMap [
rml:objectMap [
rml:reference "ID" ; rml:termType rml:BlankNode ;
rml:gather (
[
rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
]
) ;
rml:gatherAs rdf:List;
] ;
rml:predicate ex:sameSportAs
] ;

rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
4 changes: 4 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMa/student.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ID,Name,Sport
10,Venus Williams,Tennis
20,Serena Williams,Tennis
30,Loena Hendrickx,Figure skating
9 changes: 9 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMb/default.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
27 changes: 27 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMb/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

_:b273446 a rml:RelativePathSource ;
rml:path "student.csv" .

<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
rml:logicalSource [ a rml:LogicalSource ;
rml:referenceFormulation rml:CSV ;
rml:source _:b273446 ] ;

rml:predicateObjectMap [
rml:objectMap [
rml:reference "ID" ; rml:termType rml:BlankNode ;
rml:gather (
[
rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
]
) ;
rml:gatherAs rdf:List;
] ;
rml:predicate ex:sameSportAs
] ;

rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .

4 changes: 4 additions & 0 deletions test-cases/RMLTC-CC-0008-ROMb/student.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ID,Name,Sport
10,Venus Williams,Tennis
20,Serena Williams,Tennis
30,Loena Hendrickx,Figure skating

0 comments on commit 37eb3a0

Please sign in to comment.