facts-ss-to-erhf-facts.ttl
12.8 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# baseURI: http://www.reportinghub.no/test/flow_facts/transform/facts-ss-to-erhf-facts
# imports: file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema
# imports: file:///www.reportinghub.no/test/flow_facts/data/trym-flow-facts.xls
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/erhf/data/erh/facts
# imports: http://www.reportinghub.no/erhf/schema/1.0/erh-facts
# imports: http://www.reportinghub.no/np/data/npd
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix facts-ss-to-erhf-facts: <http://www.reportinghub.no/test/flow_facts/transform/facts-ss-to-erhf-facts#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix smf: <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flow-facts>
spin:rule
[ rdf:type sp:Construct ;
sp:templates ([ sp:object <http://www.reportinghub.no/erhf/schema/erh-facts#Flow> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
] [ sp:object
[ sp:varName "npdfield"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/erhf/schema/erh-facts#flowPartOfField> ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
] [ sp:object
[ sp:varName "flowuid"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/erhf/schema/erh-facts#erhid> ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
] [ sp:object
[ sp:varName "flowname"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/erhf/schema/erh-facts#erhname> ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
] [ sp:object
[ sp:varName "flowkinduri"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/erhf/schema/erh-facts#hasFlowKind> ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
] [ sp:object
[ sp:varName "flowqualuri"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/erhf/schema/erh-facts#hasFlowQualifier> ;
sp:subject
[ sp:varName "flowuri"^^xsd:string
]
]) ;
sp:where ([ sp:object <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flow-facts> ;
sp:predicate rdf:type ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "kind"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flowKind> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "fieldname"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#FieldNPDName> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "fieldname"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "npdfield"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#Field> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "npdfield"^^xsd:string
]
] [ sp:object
[ sp:varName "fieldid"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "npdfield"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "flowuid"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flowUID> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "flowname"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flowName> ;
sp:subject spin:_this
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "flowkind"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flowKind> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type afn:substr ;
sp:arg1 [ sp:varName "flowkind"^^xsd:string
] ;
sp:arg2 [ rdf:type sp:add ;
sp:arg1 [ rdf:type spif:indexOf ;
sp:arg1 [ sp:varName "flowkind"^^xsd:string
] ;
sp:arg2 ":"
] ;
sp:arg2 1
]
] ;
sp:variable
[ sp:varName "flowkindname"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type smf:buildURI ;
sp:arg1 "erhf:{?flowkindname}" ;
sp:arg2 [ sp:varName "flowkindname"^^xsd:string
]
] ;
sp:variable
[ sp:varName "flowkinduri"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "flowqual"^^xsd:string
] ;
sp:predicate <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema#flowQualifier> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type afn:substr ;
sp:arg1 [ sp:varName "flowqual"^^xsd:string
] ;
sp:arg2 [ rdf:type sp:add ;
sp:arg1 [ rdf:type spif:indexOf ;
sp:arg1 [ sp:varName "flowqual"^^xsd:string
] ;
sp:arg2 ":"
] ;
sp:arg2 1
]
] ;
sp:variable
[ sp:varName "flowqualname"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type smf:buildURI ;
sp:arg1 "erhf:{?flowqualname}" ;
sp:arg2 [ sp:varName "flowqualname"^^xsd:string
]
] ;
sp:variable
[ sp:varName "flowqualuri"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Field-" ;
sp:arg2 [ sp:varName "fieldid"^^xsd:string
] ;
sp:arg3 "-Flow-" ;
sp:arg4 [ sp:varName "flowuid"^^xsd:string
]
] ;
sp:variable
[ sp:varName "flowlocalname"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type smf:buildURI ;
sp:arg1 "http://www.reportinghub.no/erhf/data/erh/facts/{?flowlocalname}" ;
sp:arg2 [ sp:varName "flowlocalname"^^xsd:string
]
] ;
sp:variable
[ sp:varName "flowuri"^^xsd:string
]
])
] .
<http://www.reportinghub.no/test/flow_facts/transform/facts-ss-to-erhf-facts>
rdf:type owl:Ontology ;
owl:imports <file:///www.reportinghub.no/test/flow_facts/data/flow-facts-ss-schema> , <file:///www.reportinghub.no/test/flow_facts/data/trym-flow-facts.xls> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/erhf/data/erh/facts> , <http://www.reportinghub.no/erhf/schema/1.0/erh-facts> , <http://www.reportinghub.no/np/data/npd> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .