-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mapper_WoT_Test: add iRail test case
Test redirection
- Loading branch information
1 parent
ef4f6bf
commit a1f99b2
Showing
6 changed files
with
2,854 additions
and
1 deletion.
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
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
65 changes: 65 additions & 0 deletions
65
src/test/resources/web-of-things/irail-stations/mapping.ttl
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,65 @@ | ||
@prefix rml: <http://semweb.mmlab.be/ns/rml#> . | ||
@prefix rr: <http://www.w3.org/ns/r2rml#> . | ||
@prefix ql: <http://semweb.mmlab.be/ns/ql#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix td: <https://www.w3.org/2019/wot/td#> . | ||
@prefix htv: <http://www.w3.org/2011/http#> . | ||
@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix gtfs: <http://vocab.gtfs.org/terms#> . | ||
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@base <http://example.org/rules/> . | ||
|
||
<#WoTWebAPISource> a td:PropertyAffordance; | ||
td:hasForm [ | ||
# URL and content type | ||
hctl:hasTarget "http://localhost:8000/redirect"; | ||
hctl:forContentType "application/json"; | ||
# Read only | ||
hctl:hasOperationType td:readproperty; | ||
# Set HTTP method and headers | ||
htv:methodName "GET"; | ||
htv:headers ([ | ||
htv:fieldName "User-Agent"; | ||
htv:fieldValue "RMLMapper"; | ||
]); | ||
]; | ||
. | ||
|
||
<#WoTWebAPI> a td:Thing; | ||
td:hasPropertyAffordance <#WoTWebResource>; | ||
. | ||
|
||
<#TriplesMap> a rr:TriplesMap; | ||
rml:logicalSource [ a rml:LogicalSource; | ||
rml:source <#WoTWebAPISource>; | ||
rml:referenceFormulation ql:JSONPath; | ||
rml:iterator "$.station.[*]"; | ||
]; | ||
rr:subjectMap [ | ||
rml:reference "@id"; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate rdf:type; | ||
rr:object gtfs:Station; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate schema:name; | ||
rr:objectMap [ | ||
rml:reference "name"; | ||
]; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate geo:latitude; | ||
rr:objectMap [ | ||
rml:reference "locationY"; | ||
]; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate geo:longitude; | ||
rr:objectMap [ | ||
rml:reference "locationX"; | ||
]; | ||
]; | ||
. |
Oops, something went wrong.