Skip to content

Commit 1459f88

Browse files
committed
HTTP Request Targets: added a test from RMLMapper
1 parent 8f231b1 commit 1459f88

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@prefix rr: <http://www.w3.org/ns/r2rml#> .
2+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4+
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#> .
5+
@prefix fno: <https://w3id.org/function/ontology#> .
6+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
7+
@prefix void: <http://rdfs.org/ns/void#> .
8+
@prefix dc: <http://purl.org/dc/terms/> .
9+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
10+
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
11+
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
12+
@prefix : <http://example.com/base/> .
13+
@prefix o: <http://example.com/ont/> .
14+
@prefix rmle: <https://w3id.org/imec/rml/ns/extensions#> .
15+
@prefix rmlt: <http://semweb.mmlab.be/ns/rml-target#> .
16+
@prefix formats: <http://www.w3.org/ns/formats/> .
17+
@prefix htv: <http://www.w3.org/2011/http#> .
18+
19+
:auth_000 rdf:type rmle:CssClientCredentialsAuthentication ;
20+
rmle:authEmail "user1@pod.playground.solidlab.be" ;
21+
rmle:authPassword "user1" ;
22+
rmle:authOidcIssuer <https://pod.playground.solidlab.be/> ;
23+
rmle:authWebId <https://pod.playground.solidlab.be/user1/profile/card#me> .
24+
25+
:target_000 rdf:type rmlt:LogicalTarget ;
26+
rdfs:label "target1" ;
27+
rmlt:serialization formats:N-Quads ;
28+
rmlt:target :directhttprequest_000 .
29+
30+
:directhttprequest_000 rdf:type rmle:DirectHttpRequest ;
31+
htv:absoluteURI "https://pod.playground.solidlab.be/user1/rmlmapper/building" ;
32+
htv:methodName "PUT" ;
33+
htv:headers :listElement_0 ;
34+
rmle:userAuthentication :auth_000 .
35+
36+
:header-Content-Type_000 rr:class htv:RequestHeader ;
37+
htv:fieldName "Content-Type" ;
38+
htv:fieldValue "text/turtle" .
39+
40+
:listElement_0 rdf:first :header-Content-Type_000 ;
41+
rdf:rest rdf:nil .
42+
43+
:map_TriplesMap1_000 rml:logicalSource :source_000 ;
44+
rdf:type rr:TriplesMap ;
45+
rdfs:label "TriplesMap1" ;
46+
rr:subjectMap :s_000 ;
47+
rr:predicateObjectMap :pom_000 .
48+
49+
:source_000 rdf:type rml:LogicalSource ;
50+
rml:source "src/test/resources/solid-target/solid1/buildings.csv" ;
51+
rml:referenceFormulation ql:CSV .
52+
53+
:s_000 rdf:type rr:SubjectMap ;
54+
rr:template "http://example.com/{BuildingID}" ;
55+
rml:logicalTarget :target_000 .
56+
57+
:pom_000 rdf:type rr:PredicateObjectMap ;
58+
rr:predicateMap :pm_000 ;
59+
rr:objectMap :om_000 .
60+
61+
:pm_000 rdf:type rr:PredicateMap ;
62+
rr:constant o:has-floor-tile .
63+
64+
:om_000 rdf:type rr:ObjectMap ;
65+
rr:template "http://example.com/product-{FloorTileID}" ;
66+
rr:termType rr:IRI .
67+
68+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generates an RML mapping compatible with
2+
# https://github.com/RMLio/rmlmapper-java/blob/b9729131f53a826317eeedc87a5119bb148f0216/src/test/resources/solid-target/solid6/mapping.ttl
3+
base: http://example.com/base/
4+
5+
prefixes:
6+
o: http://example.com/ont/
7+
8+
targets:
9+
target1:
10+
type: directhttprequest
11+
access: https://pod.playground.solidlab.be/user1/rmlmapper/building
12+
methodName: PUT
13+
headers:
14+
Content-Type: text/turtle
15+
authentication: auth
16+
17+
authentications:
18+
auth:
19+
type: cssclientcredentials
20+
email: user1@pod.playground.solidlab.be
21+
password: user1
22+
oidcIssuer: https://pod.playground.solidlab.be/
23+
webId: https://pod.playground.solidlab.be/user1/profile/card#me
24+
25+
mappings:
26+
TriplesMap1:
27+
sources:
28+
- [src/test/resources/solid-target/solid1/buildings.csv~csv]
29+
subjects:
30+
- value: http://example.com/$(BuildingID)
31+
targets: target1
32+
predicateobjects:
33+
- [ o:has-floor-tile, http://example.com/product-$(FloorTileID)~iri ]

0 commit comments

Comments
 (0)