Skip to content

Commit

Permalink
add multiple sources test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRazorace authored and DylanVanAssche committed Feb 4, 2025
1 parent e729c45 commit bf53275
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test-cases/RMLSTC0008a/Friends.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"id": 0,
"name": "Monica Geller",
"age": 33
},
{
"id": 1,
"name": "Rachel Green",
"age": 34
},
{
"id": 2,
"name": "Joey Tribbiani",
"age": 35
},
{
"id": 3,
"name": "Chandler Bing",
"age": 36
},
{
"id": 4,
"name": "Ross Geller",
"age": 37
}
]
7 changes: 7 additions & 0 deletions test-cases/RMLSTC0008a/Friends2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"id": 6,
"name": "Phoebe Buffay",
"age": 37
}
]
12 changes: 12 additions & 0 deletions test-cases/RMLSTC0008a/default.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
68 changes: 68 additions & 0 deletions test-cases/RMLSTC0008a/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@prefix rml: <http://w3id.org/rml/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@base <http://example.com/rules/> .

<#DCATSourceAccess> a rml:Source, dcat:Distribution;
dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends.json>;
rml:encoding rml:UTF-8;
.

<#DCATSourceAccess2> a rml:Source, dcat:Distribution;
dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends2.json>;
rml:encoding rml:UTF-8;
.

<#TriplesMap> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:source <#DCATSourceAccess>;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
];
rml:subjectMap [ a rml:SubjectMap;
rml:template "http://example.org/{$.id}";
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:name;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.name";
];
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:age;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.age";
];
];
.

<#TriplesMap2> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:source <#DCATSourceAccess2>;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
];
rml:subjectMap [ a rml:SubjectMap;
rml:template "http://example.org/{$.id}";
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:name;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.name";
];
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:age;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.age";
];
];
.
2 changes: 2 additions & 0 deletions test-cases/RMLSTC0008b/Friends.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,age
6,Phoebe Buffay,37
27 changes: 27 additions & 0 deletions test-cases/RMLSTC0008b/Friends.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"id": 0,
"name": "Monica Geller",
"age": 33
},
{
"id": 1,
"name": "Rachel Green",
"age": 34
},
{
"id": 2,
"name": "Joey Tribbiani",
"age": 35
},
{
"id": 3,
"name": "Chandler Bing",
"age": 36
},
{
"id": 4,
"name": "Ross Geller",
"age": 37
}
]
12 changes: 12 additions & 0 deletions test-cases/RMLSTC0008b/default.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
67 changes: 67 additions & 0 deletions test-cases/RMLSTC0008b/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@prefix rml: <http://w3id.org/rml/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@base <http://example.com/rules/> .

<#DCATSourceAccessJSON> a rml:Source, dcat:Distribution;
dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.json>;
rml:encoding rml:UTF-8;
.

<#DCATSourceAccessCSV> a rml:Source, dcat:Distribution;
dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.csv>;
rml:encoding rml:UTF-8;
.

<#TriplesMap> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:source <#DCATSourceAccessJSON>;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
];
rml:subjectMap [ a rml:SubjectMap;
rml:template "http://example.org/{$.id}";
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:name;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.name";
];
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:age;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "$.age";
];
];
.

<#TriplesMap2> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:source <#DCATSourceAccessCSV>;
rml:referenceFormulation rml:CSV;
];
rml:subjectMap [ a rml:SubjectMap;
rml:template "http://example.org/{id}";
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:name;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "name";
];
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicateMap [ a rml:PredicateMap;
rml:constant foaf:age;
];
rml:objectMap [ a rml:ObjectMap;
rml:reference "age";
];
];
.

0 comments on commit bf53275

Please sign in to comment.