-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cb7923
commit 9cf70de
Showing
23 changed files
with
5,583 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
## RMLLVTC0001 | ||
|
||
**Title**: | ||
|
||
**Description**: | ||
|
||
**Error expected?** No | ||
|
||
**Input** | ||
``` | ||
{ | ||
"people": [ | ||
{ | ||
"name": "alice", | ||
"items": [ | ||
{ | ||
"type": "sword", | ||
"weight": 1500 | ||
}, | ||
{ | ||
"type": "shield", | ||
"weight": 2500 | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "bob", | ||
"items": [ | ||
{ | ||
"type": "flower", | ||
"weight": 15 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
**Mapping** | ||
``` | ||
@prefix rml: <http://w3id.org/rml/> . | ||
@prefix : <http://example.org/> . | ||
:jsonSource a rml:LogicalSource ; | ||
rml:source [ | ||
a rml:RelativePathSource , rml:Source ; | ||
rml:root rml:MappingDirectory ; | ||
rml:path "people.json" ; | ||
] ; | ||
rml:referenceFormulation rml:JSONPath ; | ||
rml:iterator "$.people[*]" . | ||
:jsonView a rml:LogicalView ; | ||
rml:viewOn :jsonSource ; | ||
rml:field [ | ||
a rml:ExpressionField ; | ||
rml:fieldName "name" ; | ||
rml:reference "$.name" ; | ||
] . | ||
:triplesMapPerson a rml:TriplesMap ; | ||
rml:logicalSource :jsonView ; | ||
rml:subjectMap [ | ||
rml:template "http://example.org/people/{name}" ; | ||
] ; | ||
rml:predicateObjectMap [ | ||
rml:predicate :hasName ; | ||
rml:objectMap [ | ||
rml:reference "name" ; | ||
] ; | ||
] . | ||
``` | ||
|
||
**Output** | ||
``` | ||
<http://example.org/people/alice> <http://example.org/hasName> "alice" . | ||
<http://example.org/people/bob> <http://example.org/hasName> "bob" . | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
## RMLLVTC0002 | ||
|
||
**Title**: | ||
|
||
**Description**: | ||
|
||
**Error expected?** No | ||
|
||
**Input** | ||
``` | ||
{ | ||
"people": [ | ||
{ | ||
"name": "alice", | ||
"items": [ | ||
{ | ||
"type": "sword", | ||
"weight": 1500 | ||
}, | ||
{ | ||
"type": "shield", | ||
"weight": 2500 | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "bob", | ||
"items": [ | ||
{ | ||
"type": "flower", | ||
"weight": 15 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
**Mapping** | ||
``` | ||
@prefix rml: <http://w3id.org/rml/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <http://example.org/> . | ||
:jsonSource a rml:LogicalSource ; | ||
rml:source [ | ||
a rml:RelativePathSource , rml:Source ; | ||
rml:root rml:MappingDirectory ; | ||
rml:path "people.json" ; | ||
] ; | ||
rml:referenceFormulation rml:JSONPath ; | ||
rml:iterator "$.people[*]" . | ||
:jsonView a rml:LogicalView ; | ||
rml:viewOn :jsonSource ; | ||
rml:field [ | ||
a rml:ExpressionField ; | ||
rml:fieldName "name" ; | ||
rml:reference "$.name" ; | ||
] ; | ||
rml:field [ | ||
a rml:IterableField ; | ||
rml:fieldName "item" ; | ||
rml:iterator "$.items[*]" ; | ||
rml:field [ | ||
a rml:ExpressionField ; | ||
rml:fieldName "type" ; | ||
rml:reference "$.type" ; | ||
] ; | ||
rml:field [ | ||
a rml:ExpressionField ; | ||
rml:fieldName "weight" ; | ||
rml:reference "$.weight" ; | ||
] ; | ||
] . | ||
:triplesMapPerson a rml:TriplesMap ; | ||
rml:logicalSource :jsonView ; | ||
rml:subjectMap [ | ||
rml:template "http://example.org/person/{name}" ; | ||
] ; | ||
rml:predicateObjectMap [ | ||
rml:predicate :hasName ; | ||
rml:objectMap [ | ||
rml:reference "name" ; | ||
] ; | ||
] ; | ||
rml:predicateObjectMap [ | ||
rml:predicate :hasItem ; | ||
rml:objectMap [ | ||
rml:parentTriplesMap :triplesMapItem ; | ||
] ; | ||
] . | ||
:triplesMapItem a rml:TriplesMap ; | ||
rml:logicalSource :jsonView ; | ||
rml:subjectMap [ | ||
rml:template "http://example.org/person/{name}/item/{item.type}" ; | ||
] ; | ||
rml:predicateObjectMap [ | ||
rml:predicate :hasName ; | ||
rml:objectMap [ | ||
rml:reference "item.type" ; | ||
] ; | ||
] ; | ||
rml:predicateObjectMap [ | ||
rml:predicate :hasWeight ; | ||
rml:objectMap [ | ||
rml:reference "item.weight" ; | ||
rml:datatype xsd:integer ; | ||
] ; | ||
] . | ||
``` | ||
|
||
**Output** | ||
``` | ||
<http://example.org/person/alice> <http://example.org/hasName> "alice" . | ||
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> . | ||
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> . | ||
<http://example.org/person/bob> <http://example.org/hasName> "bob" . | ||
<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> . | ||
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" . | ||
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> . | ||
<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" . | ||
<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> . | ||
<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" . | ||
<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> . | ||
``` | ||
|
Oops, something went wrong.