Skip to content
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
4 changes: 2 additions & 2 deletions test-cases/RMLTC0022c-JSON/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## RMLTC0022c-JSON

**Title**: "Generating of triples with datatypeMap with custom datatype"
**Title**: "Generating of triples with a template-valued datatypeMap"

**Description**: "Test triples with a custom datype from the data"
**Description**: "Test triples with a template-valued datatypeMap"

**Default Base IRI**: http://example.com/

Expand Down
54 changes: 54 additions & 0 deletions test-cases/RMLTC0022d-JSON/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## RMLTC0022d-JSON

**Title**: "Generating of triples with a constant-valued datatypeMap"

**Description**: "Test triples with a constant-valued datatypeMap"

**Default Base IRI**: http://example.com/

**Error expected?** No

**Input**
```
[
{ "FOO": 1, "BAR": "string"},
{ "FOO": 2, "BAR": "int"}
]

```

**Mapping**
```
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:datatypeMap [
rml:constant xsd:integer
];
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subjectMap [
rml:template "http://example.com/{$.FOO}"
] .
```

**Output**
```
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
```

4 changes: 4 additions & 0 deletions test-cases/RMLTC0022d-JSON/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "FOO": 1, "BAR": "string"},
{ "FOO": 2, "BAR": "int"}
]
25 changes: 25 additions & 0 deletions test-cases/RMLTC0022d-JSON/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:datatypeMap [
rml:constant xsd:integer
];
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subjectMap [
rml:template "http://example.com/{$.FOO}"
] .
2 changes: 2 additions & 0 deletions test-cases/RMLTC0022d-JSON/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
54 changes: 54 additions & 0 deletions test-cases/RMLTC0022e-JSON/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## RMLTC0022e-JSON

**Title**: "Generating of triples with a reference-valued datatypeMap"

**Description**: "Test triples with a reference-valued datatypeMap"

**Default Base IRI**: http://example.com/

**Error expected?** No

**Input**
```
[
{ "FOO": 1, "BAR": "http://www.w3.org/2001/XMLSchema#string"},
{ "FOO": 2, "BAR": "http://www.w3.org/2001/XMLSchema#int"}
]

```

**Mapping**
```
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:datatypeMap [
rml:reference "BAR";
rml:termType rml:IRI
];
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subjectMap [
rml:template "http://example.com/{$.FOO}"
] .
```

**Output**
```
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
```

4 changes: 4 additions & 0 deletions test-cases/RMLTC0022e-JSON/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "FOO": 1, "BAR": "http://www.w3.org/2001/XMLSchema#string"},
{ "FOO": 2, "BAR": "http://www.w3.org/2001/XMLSchema#int"}
]
25 changes: 25 additions & 0 deletions test-cases/RMLTC0022e-JSON/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:datatypeMap [
rml:reference "BAR";
rml:termType rml:IRI
];
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subjectMap [
rml:template "http://example.com/{$.FOO}"
] .
2 changes: 2 additions & 0 deletions test-cases/RMLTC0022e-JSON/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
48 changes: 48 additions & 0 deletions test-cases/RMLTC0029a-JSON/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## RMLTC0029a-JSON

**Title**: "Generating of triples with constant shortcut subject"

**Description**: "Test triples with a constant shortcut subject from the data"

**Default Base IRI**: http://example.com/

**Error expected?** No

**Input**
```
[
{ "FOO": "one", "BAR": "string"},
{ "FOO": "two", "BAR": "int"}
]

```

**Mapping**
```
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subject ex:example .
```

**Output**
```
<http://example.com/example> <http://example.com/x> "one" .
<http://example.com/example> <http://example.com/x> "two" .
```

4 changes: 4 additions & 0 deletions test-cases/RMLTC0029a-JSON/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "FOO": "one", "BAR": "string"},
{ "FOO": "two", "BAR": "int"}
]
19 changes: 19 additions & 0 deletions test-cases/RMLTC0029a-JSON/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@prefix ex: <http://example.com/> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:referenceFormulation rml:JSONPath;
rml:iterator "$[*]";
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "data.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:reference "$.FOO"
];
rml:predicate ex:x
];
rml:subject ex:example .
2 changes: 2 additions & 0 deletions test-cases/RMLTC0029a-JSON/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<http://example.com/example> <http://example.com/x> "one" .
<http://example.com/example> <http://example.com/x> "two" .
115 changes: 115 additions & 0 deletions test-cases/RMLTC0030a-JSON/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
## RMLTC0030a-JSON

**Title**: "Generation of triples from a join with reference-valued parentMap and childMap"

**Description**: "Test the results from a join with reference-valued parentMap and childMap"

**Default Base IRI**: http://example.com/

**Error expected?** No

**Input**
```
{
"students" : [
{
"ID": 10,
"Sport": 100,
"Name": "Venus Williams"
},
{
"ID": 20,
"Sport": 300,
"Name": "Demi Moore"
}
]
}
```

**Input 1**
```
{
"sports": [
{
"ID": 100,
"Name": "Tennis"
},
{
"ID": 200,
"Name": "Football"
}
]
}
```

**Mapping**
```
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:iterator "$.students[*]";
rml:referenceFormulation rml:JSONPath;
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "student.json"
]
];
rml:predicateObjectMap [
rml:graph <http://example.com/graph/students>;
rml:objectMap [
rml:reference "$.Name"
];
rml:predicate foaf:name
], [
rml:graph <http://example.com/graph/practise>;
rml:objectMap [ a rml:RefObjectMap;
rml:joinCondition [
rml:parentMap [ rml:reference "$.ID" ];
rml:childMap [ rml:reference "$.Sport" ];
];
rml:parentTriplesMap <http://example.com/base/TriplesMap2>
];
rml:predicate <http://example.com/ontology/practises>
];
rml:subjectMap [
rml:class <http://example.com/ontology/Student>;
rml:template "http://example.com/resource/student_{$.ID}"
] .

<http://example.com/base/TriplesMap2> a rml:TriplesMap;
rml:logicalSource [ a rml:LogicalSource;
rml:iterator "$.sports[*]";
rml:referenceFormulation rml:JSONPath;
rml:source [ a rml:RelativePathSource;
rml:root rml:MappingDirectory;
rml:path "sport.json"
]
];
rml:predicateObjectMap [
rml:objectMap [
rml:reference "$.Name"
];
rml:predicate rdfs:label
];
rml:subjectMap [
rml:class <http://example.com/ontology/Sport>;
rml:template "http://example.com/resource/sport_{$.ID}"
] .
```

**Output**
```
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> .
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> .
<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore".
<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> .
<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> .
<http://example.com/resource/sport_200> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> .
<http://example.com/resource/sport_200> <http://www.w3.org/2000/01/rdf-schema#label> "Football" .
```

Loading
Loading