Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases for generating collections from referencing object maps #43

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading