-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping.rml.ttl
175 lines (161 loc) · 5.6 KB
/
mapping.rml.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@prefix rml: <http://w3id.org/rml/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix ex: <http://example.com/>.
@prefix voc: <http://example.com/voc/>.
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix formats: <http://www.w3.org/ns/formats/>.
@prefix rmle: <https://rml.io/ns/extensions#>.
@prefix htv: <http://www.w3.org/2011/http#>.
@prefix : <http://knows.com/base/>.
@base <http://knows.com/base/>.
# authentication
:authentication a rmle:CssClientCredentialsAuthentication;
rmle:authEmail "[email protected]";
rmle:authPassword "abc123";
rmle:authOidcIssuer <http://localhost:3000/>;
rmle:authWebId <http://localhost:3000/manufacturer2/profile/card#me>.
# logical sources
:ls_articles a rml:LogicalSource;
rml:source "./data/articles.xml";
rml:iterator "/articles/article";
rml:referenceFormulation rml:XPath.
:ls_acl a rml:LogicalSource;
rml:source "./data/read_access.csv";
rml:referenceFormulation rml:CSV.
# static logical targets
:lt_articles a rml:LogicalTarget;
rml:serialization formats:Turtle;
rml:target [ a rmle:DirectHttpRequest;
htv:absoluteURI "http://localhost:3000/manufacturer2/articles";
rmle:userAuthentication :authentication;
].
# triples maps
:tm_articles a rml:TriplesMap;
rml:logicalSource :ls_articles;
rml:subjectMap [ a rml:SubjectMap;
rml:template "http://example.com/manufacturer2/manufacturer2/article-{articlenumber}";
rml:class voc:Product;
rml:logicalTarget :lt_articles;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate voc:firstProperty;
rml:objectMap [ a rml:ObjectMap;
rml:reference "propertyone";
];
], [ a rml:PredicateObjectMap;
rml:predicate voc:secondProperty;
rml:objectMap [ a rml:ObjectMap;
rml:reference "propertytwo";
];
], [ a rml:PredicateObjectMap;
rml:predicate voc:thirdProperty;
rml:objectMap [ a rml:ObjectMap;
rml:reference "propertythree";
];
], [ a rml:PredicateObjectMap;
rml:predicate voc:fourthProperty;
rml:objectMap [ a rml:ObjectMap;
rml:reference "propertyfour";
];
], [ a rml:PredicateObjectMap;
rml:predicate voc:fifthProperty;
rml:objectMap [ a rml:ObjectMap;
rml:reference "propertyfive";
];
];
.
:tm_acl a rml:TriplesMap;
rml:logicalSource :ls_acl;
rml:subjectMap [ a rml:SubjectMap;
rml:constant ex:selected_user_access;
rmle:logicalTargetMap :ltm_acl_access_to;
rml:class acl:Authorization;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate acl:agentClass;
rml:objectMap [ a rml:ObjectMap;
rml:reference "agent_class";
rml:termType rml:IRI;
];
], [ a rml:PredicateObjectMap;
rml:predicate acl:accessTo;
rml:objectMap [ a rml:ObjectMap;
rml:template "http://localhost:3000/manufacturer2/{access_to}";
rml:termType rml:IRI;
];
], [ a rml:PredicateObjectMap;
rml:predicate acl:mode;
rml:object acl:Read;
];
.
:tm_acl_owner a rml:TriplesMap;
rml:logicalSource :ls_acl;
rml:subjectMap [ a rml:SubjectMap;
rml:constant ex:owner_access;
rmle:logicalTargetMap :ltm_acl_access_to;
rml:class acl:Authorization;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate acl:agent;
rml:object <http://localhost:3000/manufacturer2/profile/card#me>;
], [ a rml:PredicateObjectMap;
rml:predicate acl:accessTo;
rml:objectMap [ a rml:ObjectMap;
rml:template "http://localhost:3000/manufacturer2/{access_to}";
rml:termType rml:IRI;
];
], [ a rml:PredicateObjectMap;
rml:predicate acl:mode;
rml:object acl:Read;
], [ a rml:PredicateObjectMap;
rml:predicate acl:mode;
rml:object acl:Write;
], [ a rml:PredicateObjectMap;
rml:predicate acl:mode;
rml:object acl:Control;
];
.
# dynamic logical targets
:tm_lt-access_to-acl a rml:TriplesMap;
rml:logicalSource :ls_acl;
rml:subjectMap [ a rml:SubjectMap;
rml:template "lt/{access_to}-acl";
rml:logicalTarget rmle:ThisMapping;
rml:class rml:LogicalTarget;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate rml:serialization;
rml:object formats:Turtle;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate rml:target;
rml:objectMap [ a rml:ObjectMap;
rml:template "t/{access_to}-acl";
rml:termType rml:IRI;
];
];
.
:tm_t-access_to-acl a rml:TriplesMap;
rml:logicalSource :ls_acl;
rml:subjectMap [ a rml:SubjectMap;
rml:template "t/{access_to}-acl";
rml:logicalTarget rmle:ThisMapping;
rml:class rml:Target, rmle:LinkedHttpRequest;
];
rml:predicateObjectMap [ a rml:PredicateObjectMap;
rml:predicate rmle:linkingAbsoluteURI;
rml:objectMap [ a rml:ObjectMap;
rml:template "http://localhost:3000/manufacturer2/{access_to}";
rml:termType rml:Literal;
];
], [ a rml:PredicateObjectMap;
rml:predicate rmle:linkRelation;
rml:object "acl";
], [ a rml:PredicateObjectMap;
rml:predicate rmle:userAuthentication;
rml:object :authentication;
];
.
:ltm_acl_access_to a rmle:LogicalTargetMap;
rml:template "lt/{access_to}-acl".