Skip to content

Commit 4c8dae3

Browse files
test: resources: test-cases: MapperJSONTest: add RMLTC1024 and RMLTC1025
See #252 and #251
1 parent 978aa81 commit 4c8dae3

File tree

10 files changed

+84
-0
lines changed

10 files changed

+84
-0
lines changed

src/test/java/be/ugent/rml/MapperJSONTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,19 @@ public void evaluate_1028_JSON() {
290290
public void evaluate_1028b_JSON() {
291291
doMapping("./test-cases/RMLTC1028b-JSON/mapping.ttl", "./test-cases/RMLTC1028b-JSON/output.nq");
292292
}
293+
294+
@Test
295+
public void evaluate_1045_JSON() {
296+
doMapping("./test-cases/RMLTC1045-JSON/mapping.ttl", "./test-cases/RMLTC1045-JSON/output.nq");
297+
}
298+
299+
@Test
300+
public void evaluate_1046_JSON() {
301+
doMapping("./test-cases/RMLTC1046-JSON/mapping.ttl", "./test-cases/RMLTC1046-JSON/output.nq");
302+
}
303+
304+
@Test
305+
public void evaluate_1047_JSON() {
306+
doMapping("./test-cases/RMLTC1047-JSON/mapping.ttl", "./test-cases/RMLTC1047-JSON/output.nq");
307+
}
293308
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ { "id": "0", "foo": "bar" } ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
2+
@prefix rr: <http://www.w3.org/ns/r2rml#> .
3+
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
4+
5+
[
6+
a rr:TriplesMap;
7+
rml:logicalSource [
8+
rml:source "data.json" ;
9+
rml:referenceFormulation ql:JSONPath ;
10+
rml:iterator "$[*]";
11+
];
12+
rr:subjectMap [
13+
rr:template "https://example.org/instances/{id}";
14+
];
15+
rr:predicateObjectMap [
16+
rr:predicate <http://example.org/ns/p> ;
17+
rr:object true ; # datatype is boolean
18+
];
19+
] .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ { "id": "0", "name": "Alice" } ]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
2+
@prefix rr: <http://www.w3.org/ns/r2rml#> .
3+
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
4+
@prefix s: <http://schema.org/> .
5+
6+
[
7+
a rr:TriplesMap;
8+
rml:logicalSource [
9+
rml:source "data.json" ;
10+
rml:referenceFormulation ql:JSONPath ;
11+
rml:iterator "$[*]";
12+
];
13+
rr:subjectMap [
14+
rr:template "https://example.org/instances/{id}";
15+
rr:class s:Person ;
16+
rr:graph <graph:1> ;
17+
];
18+
rr:predicateObjectMap [
19+
rr:predicate s:givenName ;
20+
rr:objectMap [ rml:reference "name" ] ;
21+
rr:graph rr:defaultGraph ;
22+
];
23+
] .
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
2+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
3+
<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ { "id": "0", "foo": "bar" } ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
2+
@prefix rr: <http://www.w3.org/ns/r2rml#> .
3+
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
4+
5+
[
6+
a rr:TriplesMap;
7+
rml:logicalSource [
8+
rml:source "data.json" ;
9+
rml:referenceFormulation ql:JSONPath ;
10+
rml:iterator "$[*]";
11+
];
12+
rr:subjectMap [
13+
rr:template "https://example.org/instances/{id}";
14+
];
15+
rr:predicateObjectMap [
16+
rr:predicate <http://example.org/ns/p> ;
17+
rr:object "train"@en ;
18+
];
19+
] .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .

0 commit comments

Comments
 (0)