chinmaytq

added a spin select template to retrieve DDR triples for a given date range.

...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
2 # imports: http://spinrdf.org/spin 2 # imports: http://spinrdf.org/spin
3 # imports: http://www.reportinghub.no/system/schema/reporting 3 # imports: http://www.reportinghub.no/system/schema/reporting
4 4
5 -# c14n-version: 3
6 @prefix arg: <http://spinrdf.org/arg#> . 5 @prefix arg: <http://spinrdf.org/arg#> .
7 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . 6 @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
8 @prefix owl: <http://www.w3.org/2002/07/owl#> . 7 @prefix owl: <http://www.w3.org/2002/07/owl#> .
...@@ -14,846 +13,749 @@ ...@@ -14,846 +13,749 @@
14 @prefix spin: <http://spinrdf.org/spin#> . 13 @prefix spin: <http://spinrdf.org/spin#> .
15 @prefix spl: <http://spinrdf.org/spl#> . 14 @prefix spl: <http://spinrdf.org/spl#> .
16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . 15 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
16 +
17 arg:date 17 arg:date
18 rdf:type rdf:Property ; 18 rdf:type rdf:Property ;
19 rdfs:label "date"^^xsd:string ; 19 rdfs:label "date"^^xsd:string ;
20 - rdfs:subPropertyOf sp:arg ; 20 + rdfs:subPropertyOf sp:arg .
21 -. 21 +
22 +arg:endDate
23 + rdf:type rdf:Property ;
24 + rdfs:subPropertyOf sp:arg .
25 +
22 arg:fieldName 26 arg:fieldName
23 rdf:type rdf:Property ; 27 rdf:type rdf:Property ;
24 rdfs:label "field name"^^xsd:string ; 28 rdfs:label "field name"^^xsd:string ;
25 - rdfs:subPropertyOf sp:arg ; 29 + rdfs:subPropertyOf sp:arg .
26 -. 30 +
27 arg:id 31 arg:id
28 rdf:type rdf:Property ; 32 rdf:type rdf:Property ;
29 rdfs:label "id"^^xsd:string ; 33 rdfs:label "id"^^xsd:string ;
30 - rdfs:subPropertyOf sp:arg ; 34 + rdfs:subPropertyOf sp:arg .
31 -. 35 +
32 arg:month 36 arg:month
33 rdf:type rdf:Property ; 37 rdf:type rdf:Property ;
34 rdfs:label "month"^^xsd:string ; 38 rdfs:label "month"^^xsd:string ;
35 - rdfs:subPropertyOf sp:arg ; 39 + rdfs:subPropertyOf sp:arg .
36 -. 40 +
37 arg:owner 41 arg:owner
38 rdf:type rdf:Property ; 42 rdf:type rdf:Property ;
39 rdfs:label "owner"^^xsd:string ; 43 rdfs:label "owner"^^xsd:string ;
40 - rdfs:subPropertyOf sp:arg ; 44 + rdfs:subPropertyOf sp:arg .
41 -. 45 +
42 arg:parts 46 arg:parts
43 rdf:type rdf:Property ; 47 rdf:type rdf:Property ;
44 rdfs:label "parts"^^xsd:string ; 48 rdfs:label "parts"^^xsd:string ;
45 - rdfs:subPropertyOf sp:arg ; 49 + rdfs:subPropertyOf sp:arg .
46 -. 50 +
51 +arg:startDate
52 + rdf:type rdf:Property ;
53 + rdfs:subPropertyOf sp:arg .
54 +
47 arg:wellBoreId 55 arg:wellBoreId
48 rdf:type rdf:Property ; 56 rdf:type rdf:Property ;
49 rdfs:label "well bore id"^^xsd:string ; 57 rdfs:label "well bore id"^^xsd:string ;
50 - rdfs:subPropertyOf sp:arg ; 58 + rdfs:subPropertyOf sp:arg .
51 -. 59 +
60 +arg:wellboreId
61 + rdf:type rdf:Property ;
62 + rdfs:subPropertyOf sp:arg .
63 +
52 <http://www.reportinghub.no/system/spin/reporting> 64 <http://www.reportinghub.no/system/spin/reporting>
53 rdf:type owl:Ontology ; 65 rdf:type owl:Ontology ;
54 rdfs:comment "SPIN functions and templates to support querying report metadata."^^xsd:string ; 66 rdfs:comment "SPIN functions and templates to support querying report metadata."^^xsd:string ;
55 - owl:imports <http://spinrdf.org/spin> ; 67 + owl:imports <http://www.reportinghub.no/system/schema/reporting> , <http://spinrdf.org/spin> ;
56 - owl:imports <http://www.reportinghub.no/system/schema/reporting> ; 68 + owl:versionInfo "0.1.0"^^xsd:string .
57 - owl:versionInfo "0.1.0"^^xsd:string ; 69 +
58 -.
59 reportspin:DDRsOverview 70 reportspin:DDRsOverview
60 rdf:type spin:SelectTemplate ; 71 rdf:type spin:SelectTemplate ;
61 - spin:body [ 72 + rdfs:label "DDRs overview"^^xsd:string ;
62 - rdf:type sp:Select ; 73 + rdfs:subClassOf spin:SelectTemplates ;
63 - sp:orderBy ( 74 + spin:body
64 - [ 75 + [ rdf:type sp:Select ;
65 - sp:varName "wellBoreName"^^xsd:string ; 76 + sp:orderBy ([ sp:varName "wellBoreName"^^xsd:string
66 - ] 77 + ] [ sp:varName "date"^^xsd:string
67 - [ 78 + ] [ sp:varName "created"^^xsd:string
68 - sp:varName "date"^^xsd:string ; 79 + ]) ;
69 - ] 80 + sp:resultVariables ([ sp:varName "wellBoreName"^^xsd:string
70 - [ 81 + ] [ sp:varName "date"^^xsd:string
71 - sp:varName "created"^^xsd:string ; 82 + ] [ sp:varName "created"^^xsd:string
72 - ] 83 + ] [ sp:varName "id"^^xsd:string
73 - ) ; 84 + ]) ;
74 - sp:resultVariables ( 85 + sp:where ([ sp:object
75 - [ 86 + [ sp:varName "wellBoreId"^^xsd:string
76 - sp:varName "wellBoreName"^^xsd:string ;
77 - ]
78 - [
79 - sp:varName "date"^^xsd:string ;
80 - ]
81 - [
82 - sp:varName "created"^^xsd:string ;
83 - ]
84 - [
85 - sp:varName "id"^^xsd:string ;
86 - ]
87 - ) ;
88 - sp:where (
89 - [
90 - sp:object [
91 - sp:varName "wellBoreId"^^xsd:string ;
92 ] ; 87 ] ;
93 sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ; 88 sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ;
94 - sp:subject [ 89 + sp:subject
95 - sp:varName "ddr"^^xsd:string ; 90 + [ sp:varName "ddr"^^xsd:string
96 - ] ;
97 ] 91 ]
98 - [ 92 + ] [ sp:object
99 - sp:object [ 93 + [ sp:varName "created"^^xsd:string
100 - sp:varName "created"^^xsd:string ;
101 ] ; 94 ] ;
102 sp:predicate <http://purl.org/dc/terms/created> ; 95 sp:predicate <http://purl.org/dc/terms/created> ;
103 - sp:subject [ 96 + sp:subject
104 - sp:varName "ddr"^^xsd:string ; 97 + [ sp:varName "ddr"^^xsd:string
105 - ] ;
106 ] 98 ]
107 - [ 99 + ] [ sp:object
108 - sp:object [ 100 + [ sp:varName "date"^^xsd:string
109 - sp:varName "date"^^xsd:string ;
110 ] ; 101 ] ;
111 sp:predicate <http://purl.org/dc/terms/date> ; 102 sp:predicate <http://purl.org/dc/terms/date> ;
112 - sp:subject [ 103 + sp:subject
113 - sp:varName "ddr"^^xsd:string ; 104 + [ sp:varName "ddr"^^xsd:string
114 - ] ;
115 ] 105 ]
116 - [ 106 + ] [ sp:object
117 - sp:object [ 107 + [ sp:varName "id"^^xsd:string
118 - sp:varName "id"^^xsd:string ;
119 ] ; 108 ] ;
120 sp:predicate <http://rdfs.org/sioc/ns#id> ; 109 sp:predicate <http://rdfs.org/sioc/ns#id> ;
121 - sp:subject [ 110 + sp:subject
122 - sp:varName "ddr"^^xsd:string ; 111 + [ sp:varName "ddr"^^xsd:string
123 - ] ;
124 ] 112 ]
125 - [ 113 + ] [ rdf:type sp:Bind ;
126 - rdf:type sp:Bind ; 114 + sp:expression
127 - sp:expression [ 115 + [ rdf:type rhspin:wellBoreById ;
128 - rdf:type rhspin:wellBoreById ; 116 + sp:arg1 [ sp:varName "wellBoreId"^^xsd:string
129 - sp:arg1 [
130 - sp:varName "wellBoreId"^^xsd:string ;
131 - ] ;
132 - ] ;
133 - sp:variable [
134 - sp:varName "wellBore"^^xsd:string ;
135 - ] ;
136 ] 117 ]
137 - [
138 - rdf:type sp:Bind ;
139 - sp:expression [
140 - rdf:type rhspin:npdName ;
141 - sp:arg1 [
142 - sp:varName "wellBore"^^xsd:string ;
143 - ] ;
144 - ] ;
145 - sp:variable [
146 - sp:varName "wellBoreName"^^xsd:string ;
147 ] ; 118 ] ;
119 + sp:variable
120 + [ sp:varName "wellBore"^^xsd:string
121 + ]
122 + ] [ rdf:type sp:Bind ;
123 + sp:expression
124 + [ rdf:type rhspin:npdName ;
125 + sp:arg1 [ sp:varName "wellBore"^^xsd:string
148 ] 126 ]
149 - ) ;
150 ] ; 127 ] ;
151 - rdfs:label "DDRs overview"^^xsd:string ; 128 + sp:variable
152 - rdfs:subClassOf spin:SelectTemplates ; 129 + [ sp:varName "wellBoreName"^^xsd:string
153 -. 130 + ]
131 + ])
132 + ] .
133 +
154 reportspin:DPRsOverview 134 reportspin:DPRsOverview
155 rdf:type spin:SelectTemplate ; 135 rdf:type spin:SelectTemplate ;
156 - spin:body [ 136 + rdfs:label "DPRs overview"^^xsd:string ;
157 - rdf:type sp:Select ; 137 + rdfs:subClassOf spin:SelectTemplates ;
158 - sp:orderBy ( 138 + spin:body
159 - [ 139 + [ rdf:type sp:Select ;
160 - sp:varName "ownerName"^^xsd:string ; 140 + sp:orderBy ([ sp:varName "ownerName"^^xsd:string
161 - ] 141 + ] [ sp:varName "date"^^xsd:string
162 - [ 142 + ] [ sp:varName "created"^^xsd:string
163 - sp:varName "date"^^xsd:string ; 143 + ]) ;
164 - ] 144 + sp:resultVariables ([ sp:varName "ownerName"^^xsd:string
165 - [ 145 + ] [ sp:varName "date"^^xsd:string
166 - sp:varName "created"^^xsd:string ; 146 + ] [ sp:varName "created"^^xsd:string
167 - ] 147 + ] [ sp:varName "id"^^xsd:string
168 - ) ; 148 + ]) ;
169 - sp:resultVariables ( 149 + sp:where ([ sp:object
170 - [ 150 + [ sp:varName "id"^^xsd:string
171 - sp:varName "ownerName"^^xsd:string ;
172 - ]
173 - [
174 - sp:varName "date"^^xsd:string ;
175 - ]
176 - [
177 - sp:varName "created"^^xsd:string ;
178 - ]
179 - [
180 - sp:varName "id"^^xsd:string ;
181 - ]
182 - ) ;
183 - sp:where (
184 - [
185 - sp:object [
186 - sp:varName "id"^^xsd:string ;
187 ] ; 151 ] ;
188 sp:predicate <http://rdfs.org/sioc/ns#id> ; 152 sp:predicate <http://rdfs.org/sioc/ns#id> ;
189 - sp:subject [ 153 + sp:subject
190 - sp:varName "dpr"^^xsd:string ; 154 + [ sp:varName "dpr"^^xsd:string
191 - ] ;
192 ] 155 ]
193 - [ 156 + ] [ sp:object
194 - sp:object [ 157 + [ sp:varName "created"^^xsd:string
195 - sp:varName "created"^^xsd:string ;
196 ] ; 158 ] ;
197 sp:predicate <http://purl.org/dc/terms/created> ; 159 sp:predicate <http://purl.org/dc/terms/created> ;
198 - sp:subject [ 160 + sp:subject
199 - sp:varName "dpr"^^xsd:string ; 161 + [ sp:varName "dpr"^^xsd:string
200 - ] ;
201 ] 162 ]
202 - [ 163 + ] [ sp:object
203 - sp:object [ 164 + [ sp:varName "date"^^xsd:string
204 - sp:varName "date"^^xsd:string ;
205 ] ; 165 ] ;
206 sp:predicate <http://purl.org/dc/terms/date> ; 166 sp:predicate <http://purl.org/dc/terms/date> ;
207 - sp:subject [ 167 + sp:subject
208 - sp:varName "dpr"^^xsd:string ; 168 + [ sp:varName "dpr"^^xsd:string
209 - ] ;
210 ] 169 ]
211 - [ 170 + ] [ sp:object
212 - sp:object [ 171 + [ sp:varName "owner"^^xsd:string
213 - sp:varName "owner"^^xsd:string ;
214 ] ; 172 ] ;
215 sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ; 173 sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ;
216 - sp:subject [ 174 + sp:subject
217 - sp:varName "dpr"^^xsd:string ; 175 + [ sp:varName "dpr"^^xsd:string
218 - ] ;
219 ] 176 ]
220 - [ 177 + ] [ rdf:type sp:Bind ;
221 - rdf:type sp:Bind ; 178 + sp:expression
222 - sp:expression [ 179 + [ rdf:type rhspin:npdName ;
223 - rdf:type rhspin:npdName ; 180 + sp:arg1 [ sp:varName "owner"^^xsd:string
224 - sp:arg1 [
225 - sp:varName "owner"^^xsd:string ;
226 - ] ;
227 - ] ;
228 - sp:variable [
229 - sp:varName "ownerName"^^xsd:string ;
230 - ] ;
231 ] 181 ]
232 - ) ;
233 ] ; 182 ] ;
234 - rdfs:label "DPRs overview"^^xsd:string ; 183 + sp:variable
235 - rdfs:subClassOf spin:SelectTemplates ; 184 + [ sp:varName "ownerName"^^xsd:string
236 -. 185 + ]
186 + ])
187 + ] .
188 +
237 reportspin:graphByDDRId 189 reportspin:graphByDDRId
238 rdf:type spin:Function ; 190 rdf:type spin:Function ;
239 - spin:body [ 191 + rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DDR (metadata) with a given id."^^xsd:string ;
240 - rdf:type sp:Select ; 192 + rdfs:label "graph by DDR id"^^xsd:string ;
241 - sp:resultVariables ( 193 + rdfs:subClassOf spin:Functions ;
242 - [ 194 + spin:body
243 - rdf:type sp:iri ; 195 + [ rdf:type sp:Select ;
244 - sp:arg1 [ 196 + sp:resultVariables ([ rdf:type sp:iri ;
245 - sp:varName "uri"^^xsd:string ; 197 + sp:arg1 [ sp:varName "uri"^^xsd:string
246 - ] ; 198 + ]
247 - ] 199 + ]) ;
248 - ) ; 200 + sp:where ([ rdf:type sp:Bind ;
249 - sp:where ( 201 + sp:expression
250 - [ 202 + [ rdf:type fn:concat ;
251 - rdf:type sp:Bind ;
252 - sp:expression [
253 - rdf:type fn:concat ;
254 sp:arg1 "http://www.reportinghub.no/system/ddr/" ; 203 sp:arg1 "http://www.reportinghub.no/system/ddr/" ;
255 - sp:arg2 [ 204 + sp:arg2 [ sp:varName "id"^^xsd:string
256 - sp:varName "id"^^xsd:string ; 205 + ]
257 - ] ;
258 - ] ;
259 - sp:variable [
260 - sp:varName "uri"^^xsd:string ;
261 ] ; 206 ] ;
207 + sp:variable
208 + [ sp:varName "uri"^^xsd:string
262 ] 209 ]
263 - ) ; 210 + ])
264 ] ; 211 ] ;
265 - spin:constraint [ 212 + spin:constraint
266 - rdf:type spl:Argument ; 213 + [ rdf:type spl:Argument ;
267 - spl:predicate arg:id ;
268 - spl:valueType xsd:string ;
269 rdfs:comment "The id of the DDR metadata."^^xsd:string ; 214 rdfs:comment "The id of the DDR metadata."^^xsd:string ;
215 + spl:predicate arg:id ;
216 + spl:valueType xsd:string
270 ] ; 217 ] ;
271 - spin:returnType rdfs:Resource ; 218 + spin:returnType rdfs:Resource .
272 - rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DDR (metadata) with a given id."^^xsd:string ; 219 +
273 - rdfs:label "graph by DDR id"^^xsd:string ;
274 - rdfs:subClassOf spin:Functions ;
275 -.
276 reportspin:graphByDPRId 220 reportspin:graphByDPRId
277 rdf:type spin:Function ; 221 rdf:type spin:Function ;
278 - spin:body [ 222 + rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DPR (metadata) with a given id."^^xsd:string ;
279 - rdf:type sp:Select ; 223 + rdfs:label "graph by DPR id"^^xsd:string ;
280 - sp:resultVariables ( 224 + rdfs:subClassOf spin:Functions ;
281 - [ 225 + spin:body
282 - rdf:type sp:iri ; 226 + [ rdf:type sp:Select ;
283 - sp:arg1 [ 227 + sp:resultVariables ([ rdf:type sp:iri ;
284 - sp:varName "uri"^^xsd:string ; 228 + sp:arg1 [ sp:varName "uri"^^xsd:string
285 - ] ; 229 + ]
286 - ] 230 + ]) ;
287 - ) ; 231 + sp:where ([ rdf:type sp:Bind ;
288 - sp:where ( 232 + sp:expression
289 - [ 233 + [ rdf:type fn:concat ;
290 - rdf:type sp:Bind ;
291 - sp:expression [
292 - rdf:type fn:concat ;
293 sp:arg1 "http://www.reportinghub.no/system/dpr/" ; 234 sp:arg1 "http://www.reportinghub.no/system/dpr/" ;
294 - sp:arg2 [ 235 + sp:arg2 [ sp:varName "id"^^xsd:string
295 - sp:varName "id"^^xsd:string ; 236 + ]
296 - ] ;
297 - ] ;
298 - sp:variable [
299 - sp:varName "uri"^^xsd:string ;
300 ] ; 237 ] ;
238 + sp:variable
239 + [ sp:varName "uri"^^xsd:string
301 ] 240 ]
302 - ) ; 241 + ])
303 ] ; 242 ] ;
304 - spin:constraint [ 243 + spin:constraint
305 - rdf:type spl:Argument ; 244 + [ rdf:type spl:Argument ;
306 - spl:predicate arg:id ;
307 - spl:valueType xsd:string ;
308 rdfs:comment "The id of the DPR metadata."^^xsd:string ; 245 rdfs:comment "The id of the DPR metadata."^^xsd:string ;
246 + spl:predicate arg:id ;
247 + spl:valueType xsd:string
309 ] ; 248 ] ;
310 - spin:returnType rdfs:Resource ; 249 + spin:returnType rdfs:Resource .
311 - rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DPR (metadata) with a given id."^^xsd:string ; 250 +
312 - rdfs:label "graph by DPR id"^^xsd:string ;
313 - rdfs:subClassOf spin:Functions ;
314 -.
315 reportspin:graphByReportId 251 reportspin:graphByReportId
316 rdf:type spin:Function ; 252 rdf:type spin:Function ;
317 - spin:body [ 253 + rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report with a given id."^^xsd:string ;
318 - rdf:type sp:Select ; 254 + rdfs:label "graph by report id"^^xsd:string ;
319 - sp:resultVariables ( 255 + rdfs:subClassOf spin:Functions ;
320 - [ 256 + spin:body
321 - rdf:type sp:iri ; 257 + [ rdf:type sp:Select ;
322 - sp:arg1 [ 258 + sp:resultVariables ([ rdf:type sp:iri ;
323 - sp:varName "uri"^^xsd:string ; 259 + sp:arg1 [ sp:varName "uri"^^xsd:string
324 - ] ; 260 + ]
325 - ] 261 + ]) ;
326 - ) ; 262 + sp:where ([ rdf:type sp:Bind ;
327 - sp:where ( 263 + sp:expression
328 - [ 264 + [ rdf:type fn:concat ;
329 - rdf:type sp:Bind ;
330 - sp:expression [
331 - rdf:type fn:concat ;
332 sp:arg1 "http://www.reportinghub.no/system/report/" ; 265 sp:arg1 "http://www.reportinghub.no/system/report/" ;
333 - sp:arg2 [ 266 + sp:arg2 [ sp:varName "id"^^xsd:string
334 - sp:varName "id"^^xsd:string ; 267 + ]
335 - ] ;
336 - ] ;
337 - sp:variable [
338 - sp:varName "uri"^^xsd:string ;
339 ] ; 268 ] ;
269 + sp:variable
270 + [ sp:varName "uri"^^xsd:string
340 ] 271 ]
341 - ) ; 272 + ])
342 ] ; 273 ] ;
343 - spin:constraint [ 274 + spin:constraint
344 - rdf:type spl:Argument ; 275 + [ rdf:type spl:Argument ;
345 - spl:predicate arg:id ;
346 - spl:valueType xsd:string ;
347 rdfs:comment "The id of the DDR metadata."^^xsd:string ; 276 rdfs:comment "The id of the DDR metadata."^^xsd:string ;
277 + spl:predicate arg:id ;
278 + spl:valueType xsd:string
348 ] ; 279 ] ;
349 - spin:returnType rdfs:Resource ; 280 + spin:returnType rdfs:Resource .
350 - rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report with a given id."^^xsd:string ; 281 +
351 - rdfs:label "graph by report id"^^xsd:string ;
352 - rdfs:subClassOf spin:Functions ;
353 -.
354 reportspin:idOfDDRByDateAndWellBoreId 282 reportspin:idOfDDRByDateAndWellBoreId
355 rdf:type spin:Function ; 283 rdf:type spin:Function ;
356 - spin:body [ 284 + rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ;
357 - rdf:type sp:Select ; 285 + rdfs:label "id of DDR by date and well bore id"^^xsd:string ;
358 - sp:orderBy ( 286 + rdfs:subClassOf spin:Functions ;
359 - [ 287 + spin:body
360 - rdf:type sp:Desc ; 288 + [ rdf:type sp:Select ;
361 - sp:expression [ 289 + sp:orderBy ([ rdf:type sp:Desc ;
362 - sp:varName "created"^^xsd:string ; 290 + sp:expression
363 - ] ; 291 + [ sp:varName "created"^^xsd:string
364 - ] 292 + ]
365 - ) ; 293 + ]) ;
366 - sp:resultVariables ( 294 + sp:resultVariables ([ sp:varName "id"^^xsd:string
367 - [ 295 + ]) ;
368 - sp:varName "id"^^xsd:string ; 296 + sp:where ([ sp:object
369 - ] 297 + [ sp:varName "wellBoreId"^^xsd:string
370 - ) ;
371 - sp:where (
372 - [
373 - sp:object [
374 - sp:varName "wellBoreId"^^xsd:string ;
375 ] ; 298 ] ;
376 sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ; 299 sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ;
377 - sp:subject [ 300 + sp:subject
378 - sp:varName "report"^^xsd:string ; 301 + [ sp:varName "report"^^xsd:string
379 - ] ;
380 ] 302 ]
381 - [ 303 + ] [ sp:object
382 - sp:object [ 304 + [ sp:varName "date"^^xsd:string
383 - sp:varName "date"^^xsd:string ;
384 ] ; 305 ] ;
385 sp:predicate <http://purl.org/dc/terms/date> ; 306 sp:predicate <http://purl.org/dc/terms/date> ;
386 - sp:subject [ 307 + sp:subject
387 - sp:varName "report"^^xsd:string ; 308 + [ sp:varName "report"^^xsd:string
388 - ] ;
389 ] 309 ]
390 - [ 310 + ] [ sp:object
391 - sp:object [ 311 + [ sp:varName "created"^^xsd:string
392 - sp:varName "created"^^xsd:string ;
393 ] ; 312 ] ;
394 sp:predicate <http://purl.org/dc/terms/created> ; 313 sp:predicate <http://purl.org/dc/terms/created> ;
395 - sp:subject [ 314 + sp:subject
396 - sp:varName "report"^^xsd:string ; 315 + [ sp:varName "report"^^xsd:string
397 - ] ;
398 ] 316 ]
399 - [ 317 + ] [ sp:object
400 - sp:object [ 318 + [ sp:varName "id"^^xsd:string
401 - sp:varName "id"^^xsd:string ;
402 ] ; 319 ] ;
403 sp:predicate <http://rdfs.org/sioc/ns#id> ; 320 sp:predicate <http://rdfs.org/sioc/ns#id> ;
404 - sp:subject [ 321 + sp:subject
405 - sp:varName "report"^^xsd:string ; 322 + [ sp:varName "report"^^xsd:string
406 - ] ;
407 ] 323 ]
408 - ) ; 324 + ])
409 ] ; 325 ] ;
410 - spin:constraint [ 326 + spin:constraint
411 - rdf:type spl:Argument ; 327 + [ rdf:type spl:Argument ;
412 - spl:predicate arg:date ;
413 - spl:valueType xsd:date ;
414 - rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
415 - ] ;
416 - spin:constraint [
417 - rdf:type spl:Argument ;
418 - spl:predicate arg:wellBoreId ;
419 - spl:valueType xsd:string ;
420 rdfs:comment "The id of the well bore."^^xsd:string ; 328 rdfs:comment "The id of the well bore."^^xsd:string ;
329 + spl:predicate arg:wellBoreId ;
330 + spl:valueType xsd:string
421 ] ; 331 ] ;
422 - spin:returnType xsd:string ; 332 + spin:constraint
423 - rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ; 333 + [ rdf:type spl:Argument ;
424 - rdfs:label "id of DDR by date and well bore id"^^xsd:string ; 334 + rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
425 - rdfs:subClassOf spin:Functions ; 335 + spl:predicate arg:date ;
426 -. 336 + spl:valueType xsd:date
337 + ] ;
338 + spin:returnType xsd:string .
339 +
427 reportspin:idOfDPR2ByDateAndFieldName 340 reportspin:idOfDPR2ByDateAndFieldName
428 rdf:type spin:Function ; 341 rdf:type spin:Function ;
429 - spin:body [ 342 + rdfs:label "id of DPR2By date and field name"^^xsd:string ;
430 - rdf:type sp:Select ; 343 + rdfs:subClassOf spin:Functions ;
344 + spin:body
345 + [ rdf:type sp:Select ;
431 sp:limit "1"^^xsd:long ; 346 sp:limit "1"^^xsd:long ;
432 - sp:orderBy ( 347 + sp:orderBy ([ rdf:type sp:Desc ;
433 - [ 348 + sp:expression
434 - rdf:type sp:Desc ; 349 + [ sp:varName "created"^^xsd:string
435 - sp:expression [
436 - sp:varName "created"^^xsd:string ;
437 - ] ;
438 - ]
439 - ) ;
440 - sp:resultVariables (
441 - [
442 - sp:varName "id"^^xsd:string ;
443 ] 350 ]
444 - ) ; 351 + ]) ;
445 - sp:where ( 352 + sp:resultVariables ([ sp:varName "id"^^xsd:string
446 - [ 353 + ]) ;
447 - sp:object [ 354 + sp:where ([ sp:object
448 - sp:varName "fieldName"^^xsd:string ; 355 + [ sp:varName "fieldName"^^xsd:string
449 ] ; 356 ] ;
450 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ; 357 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
451 - sp:subject [ 358 + sp:subject
452 - sp:varName "report"^^xsd:string ; 359 + [ sp:varName "report"^^xsd:string
453 - ] ;
454 ] 360 ]
455 - [ 361 + ] [ sp:object
456 - sp:object [ 362 + [ sp:varName "date"^^xsd:string
457 - sp:varName "date"^^xsd:string ;
458 ] ; 363 ] ;
459 sp:predicate <http://purl.org/dc/terms/date> ; 364 sp:predicate <http://purl.org/dc/terms/date> ;
460 - sp:subject [ 365 + sp:subject
461 - sp:varName "report"^^xsd:string ; 366 + [ sp:varName "report"^^xsd:string
462 - ] ;
463 ] 367 ]
464 - [ 368 + ] [ sp:object
465 - sp:object [ 369 + [ sp:varName "created"^^xsd:string
466 - sp:varName "created"^^xsd:string ;
467 ] ; 370 ] ;
468 sp:predicate <http://purl.org/dc/terms/created> ; 371 sp:predicate <http://purl.org/dc/terms/created> ;
469 - sp:subject [ 372 + sp:subject
470 - sp:varName "report"^^xsd:string ; 373 + [ sp:varName "report"^^xsd:string
471 - ] ;
472 ] 374 ]
473 - [ 375 + ] [ sp:object
474 - sp:object [ 376 + [ sp:varName "id"^^xsd:string
475 - sp:varName "id"^^xsd:string ;
476 ] ; 377 ] ;
477 sp:predicate <http://rdfs.org/sioc/ns#id> ; 378 sp:predicate <http://rdfs.org/sioc/ns#id> ;
478 - sp:subject [ 379 + sp:subject
479 - sp:varName "report"^^xsd:string ; 380 + [ sp:varName "report"^^xsd:string
480 - ] ;
481 ] 381 ]
482 - ) ; 382 + ])
483 - ] ;
484 - spin:constraint [
485 - rdf:type spl:Argument ;
486 - spl:predicate arg:date ;
487 - spl:valueType xsd:date ;
488 - rdfs:comment "The xsd:date of the DPR2 to get."^^xsd:string ;
489 ] ; 383 ] ;
490 - spin:constraint [ 384 + spin:constraint
491 - rdf:type spl:Argument ; 385 + [ rdf:type spl:Argument ;
492 - spl:predicate arg:fieldName ;
493 - spl:valueType xsd:string ;
494 rdfs:comment "The registered name of the Field."^^xsd:string ; 386 rdfs:comment "The registered name of the Field."^^xsd:string ;
387 + spl:predicate arg:fieldName ;
388 + spl:valueType xsd:string
495 ] ; 389 ] ;
496 - spin:returnType xsd:string ; 390 + spin:constraint
497 - rdfs:label "id of DPR2By date and field name"^^xsd:string ; 391 + [ rdf:type spl:Argument ;
498 - rdfs:subClassOf spin:Functions ; 392 + rdfs:comment "The xsd:date of the DPR2 to get."^^xsd:string ;
499 -. 393 + spl:predicate arg:date ;
394 + spl:valueType xsd:date
395 + ] ;
396 + spin:returnType xsd:string .
397 +
500 reportspin:idOfDPRByDateAndOwner 398 reportspin:idOfDPRByDateAndOwner
501 rdf:type spin:Function ; 399 rdf:type spin:Function ;
502 - spin:body [ 400 + rdfs:comment "Gets the id of a DPR defined by date and licence or BAA. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ;
503 - rdf:type sp:Select ; 401 + rdfs:label "id of DPR by date and owner"^^xsd:string ;
504 - sp:orderBy ( 402 + rdfs:subClassOf spin:Functions ;
505 - [ 403 + spin:body
506 - rdf:type sp:Desc ; 404 + [ rdf:type sp:Select ;
507 - sp:expression [ 405 + sp:orderBy ([ rdf:type sp:Desc ;
508 - sp:varName "created"^^xsd:string ; 406 + sp:expression
509 - ] ; 407 + [ sp:varName "created"^^xsd:string
510 - ] 408 + ]
511 - ) ; 409 + ]) ;
512 - sp:resultVariables ( 410 + sp:resultVariables ([ sp:varName "id"^^xsd:string
513 - [ 411 + ]) ;
514 - sp:varName "id"^^xsd:string ; 412 + sp:where ([ sp:object
515 - ] 413 + [ sp:varName "owner"^^xsd:string
516 - ) ;
517 - sp:where (
518 - [
519 - sp:object [
520 - sp:varName "owner"^^xsd:string ;
521 ] ; 414 ] ;
522 sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ; 415 sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ;
523 - sp:subject [ 416 + sp:subject
524 - sp:varName "report"^^xsd:string ; 417 + [ sp:varName "report"^^xsd:string
525 - ] ;
526 ] 418 ]
527 - [ 419 + ] [ sp:object
528 - sp:object [ 420 + [ sp:varName "date"^^xsd:string
529 - sp:varName "date"^^xsd:string ;
530 ] ; 421 ] ;
531 sp:predicate <http://purl.org/dc/terms/date> ; 422 sp:predicate <http://purl.org/dc/terms/date> ;
532 - sp:subject [ 423 + sp:subject
533 - sp:varName "report"^^xsd:string ; 424 + [ sp:varName "report"^^xsd:string
534 - ] ;
535 ] 425 ]
536 - [ 426 + ] [ sp:object
537 - sp:object [ 427 + [ sp:varName "created"^^xsd:string
538 - sp:varName "created"^^xsd:string ;
539 ] ; 428 ] ;
540 sp:predicate <http://purl.org/dc/terms/created> ; 429 sp:predicate <http://purl.org/dc/terms/created> ;
541 - sp:subject [ 430 + sp:subject
542 - sp:varName "report"^^xsd:string ; 431 + [ sp:varName "report"^^xsd:string
543 - ] ;
544 ] 432 ]
545 - [ 433 + ] [ sp:object
546 - sp:object [ 434 + [ sp:varName "id"^^xsd:string
547 - sp:varName "id"^^xsd:string ;
548 ] ; 435 ] ;
549 sp:predicate <http://rdfs.org/sioc/ns#id> ; 436 sp:predicate <http://rdfs.org/sioc/ns#id> ;
550 - sp:subject [ 437 + sp:subject
551 - sp:varName "report"^^xsd:string ; 438 + [ sp:varName "report"^^xsd:string
552 - ] ;
553 ] 439 ]
554 - ) ; 440 + ])
555 ] ; 441 ] ;
556 - spin:constraint [ 442 + spin:constraint
557 - rdf:type spl:Argument ; 443 + [ rdf:type spl:Argument ;
558 - spl:predicate arg:date ;
559 - spl:valueType xsd:date ;
560 - rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
561 - ] ;
562 - spin:constraint [
563 - rdf:type spl:Argument ;
564 - spl:predicate arg:owner ;
565 - spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner> ;
566 rdfs:comment "The Licence or BAA."^^xsd:string ; 444 rdfs:comment "The Licence or BAA."^^xsd:string ;
445 + spl:predicate arg:owner ;
446 + spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner>
567 ] ; 447 ] ;
568 - spin:returnType xsd:string ; 448 + spin:constraint
569 - rdfs:comment "Gets the id of a DPR defined by date and licence or BAA. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ; 449 + [ rdf:type spl:Argument ;
570 - rdfs:label "id of DPR by date and owner"^^xsd:string ; 450 + rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
571 - rdfs:subClassOf spin:Functions ; 451 + spl:predicate arg:date ;
572 -. 452 + spl:valueType xsd:date
453 + ] ;
454 + spin:returnType xsd:string .
455 +
573 reportspin:idOfMPRGByFieldMonthAndParts 456 reportspin:idOfMPRGByFieldMonthAndParts
574 rdf:type spin:Function ; 457 rdf:type spin:Function ;
575 - spin:body [ 458 + rdfs:label "id of MPRG by field, month and parts"^^xsd:string ;
576 - rdf:type sp:Select ; 459 + rdfs:subClassOf spin:Functions ;
577 - sp:orderBy ( 460 + spin:body
578 - [ 461 + [ rdf:type sp:Select ;
579 - rdf:type sp:Desc ; 462 + sp:orderBy ([ rdf:type sp:Desc ;
580 - sp:expression [ 463 + sp:expression
581 - sp:varName "created"^^xsd:string ; 464 + [ sp:varName "created"^^xsd:string
582 - ] ; 465 + ]
583 - ] 466 + ]) ;
584 - ) ; 467 + sp:resultVariables ([ sp:varName "id"^^xsd:string
585 - sp:resultVariables ( 468 + ]) ;
586 - [ 469 + sp:where ([ sp:object
587 - sp:varName "id"^^xsd:string ; 470 + [ sp:varName "fieldName"^^xsd:string
588 - ]
589 - ) ;
590 - sp:where (
591 - [
592 - sp:object [
593 - sp:varName "fieldName"^^xsd:string ;
594 ] ; 471 ] ;
595 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ; 472 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
596 - sp:subject [ 473 + sp:subject
597 - sp:varName "report"^^xsd:string ; 474 + [ sp:varName "report"^^xsd:string
598 - ] ;
599 ] 475 ]
600 - [ 476 + ] [ sp:object
601 - sp:object [ 477 + [ sp:varName "month"^^xsd:string
602 - sp:varName "month"^^xsd:string ;
603 ] ; 478 ] ;
604 sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ; 479 sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ;
605 - sp:subject [ 480 + sp:subject
606 - sp:varName "report"^^xsd:string ; 481 + [ sp:varName "report"^^xsd:string
607 - ] ;
608 ] 482 ]
609 - [ 483 + ] [ sp:object
610 - sp:object [ 484 + [ sp:varName "parts"^^xsd:string
611 - sp:varName "parts"^^xsd:string ;
612 ] ; 485 ] ;
613 sp:predicate <http://www.reportinghub.no/system/schema/reporting#containsParts> ; 486 sp:predicate <http://www.reportinghub.no/system/schema/reporting#containsParts> ;
614 - sp:subject [ 487 + sp:subject
615 - sp:varName "report"^^xsd:string ; 488 + [ sp:varName "report"^^xsd:string
616 - ] ;
617 ] 489 ]
618 - [ 490 + ] [ sp:object
619 - sp:object [ 491 + [ sp:varName "created"^^xsd:string
620 - sp:varName "created"^^xsd:string ;
621 ] ; 492 ] ;
622 sp:predicate <http://purl.org/dc/terms/created> ; 493 sp:predicate <http://purl.org/dc/terms/created> ;
623 - sp:subject [ 494 + sp:subject
624 - sp:varName "report"^^xsd:string ; 495 + [ sp:varName "report"^^xsd:string
625 - ] ;
626 ] 496 ]
627 - [ 497 + ] [ sp:object
628 - sp:object [ 498 + [ sp:varName "id"^^xsd:string
629 - sp:varName "id"^^xsd:string ;
630 ] ; 499 ] ;
631 sp:predicate <http://rdfs.org/sioc/ns#id> ; 500 sp:predicate <http://rdfs.org/sioc/ns#id> ;
632 - sp:subject [ 501 + sp:subject
633 - sp:varName "report"^^xsd:string ; 502 + [ sp:varName "report"^^xsd:string
634 - ] ;
635 ] 503 ]
636 - ) ; 504 + ])
637 ] ; 505 ] ;
638 - spin:constraint [ 506 + spin:constraint
639 - rdf:type spl:Argument ; 507 + [ rdf:type spl:Argument ;
640 - spl:predicate arg:fieldName ; 508 + rdfs:comment "The parts value that the report must have (at report:containsParts)."^^xsd:string ;
641 - spl:valueType xsd:string ; 509 + spl:predicate arg:parts ;
642 - rdfs:comment "The field name."^^xsd:string ; 510 + spl:valueType xsd:string
643 ] ; 511 ] ;
644 - spin:constraint [ 512 + spin:constraint
645 - rdf:type spl:Argument ; 513 + [ rdf:type spl:Argument ;
646 - spl:predicate arg:month ;
647 - spl:valueType xsd:string ;
648 rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ; 514 rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ;
515 + spl:predicate arg:month ;
516 + spl:valueType xsd:string
649 ] ; 517 ] ;
650 - spin:constraint [ 518 + spin:constraint
651 - rdf:type spl:Argument ; 519 + [ rdf:type spl:Argument ;
652 - spl:predicate arg:parts ; 520 + rdfs:comment "The field name."^^xsd:string ;
653 - spl:valueType xsd:string ; 521 + spl:predicate arg:fieldName ;
654 - rdfs:comment "The parts value that the report must have (at report:containsParts)."^^xsd:string ; 522 + spl:valueType xsd:string
655 ] ; 523 ] ;
656 - spin:returnType xsd:string ; 524 + spin:returnType xsd:string .
657 - rdfs:label "id of MPRG by field, month and parts"^^xsd:string ; 525 +
658 - rdfs:subClassOf spin:Functions ;
659 -.
660 reportspin:idOfMPRPByFieldMonth 526 reportspin:idOfMPRPByFieldMonth
661 rdf:type spin:Function ; 527 rdf:type spin:Function ;
662 - spin:body [ 528 + rdfs:label "id of MPRG by field, month and parts"^^xsd:string ;
663 - rdf:type sp:Select ; 529 + rdfs:subClassOf spin:Functions ;
530 + spin:body
531 + [ rdf:type sp:Select ;
664 sp:limit "1"^^xsd:long ; 532 sp:limit "1"^^xsd:long ;
665 - sp:orderBy ( 533 + sp:orderBy ([ rdf:type sp:Desc ;
666 - [ 534 + sp:expression
667 - rdf:type sp:Desc ; 535 + [ sp:varName "created"^^xsd:string
668 - sp:expression [ 536 + ]
669 - sp:varName "created"^^xsd:string ; 537 + ]) ;
538 + sp:resultVariables ([ sp:varName "id"^^xsd:string
539 + ]) ;
540 + sp:where ([ sp:object
541 + [ sp:varName "fieldName"^^xsd:string
670 ] ; 542 ] ;
543 + sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
544 + sp:subject
545 + [ sp:varName "report"^^xsd:string
671 ] 546 ]
672 - ) ; 547 + ] [ sp:object
673 - sp:resultVariables ( 548 + [ sp:varName "month"^^xsd:string
674 - [ 549 + ] ;
675 - sp:varName "id"^^xsd:string ; 550 + sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ;
551 + sp:subject
552 + [ sp:varName "report"^^xsd:string
676 ] 553 ]
677 - ) ; 554 + ] [ sp:object
678 - sp:where ( 555 + [ sp:varName "created"^^xsd:string
679 - [
680 - sp:object [
681 - sp:varName "fieldName"^^xsd:string ;
682 ] ; 556 ] ;
683 - sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ; 557 + sp:predicate <http://purl.org/dc/terms/created> ;
684 - sp:subject [ 558 + sp:subject
685 - sp:varName "report"^^xsd:string ; 559 + [ sp:varName "report"^^xsd:string
560 + ]
561 + ] [ sp:object
562 + [ sp:varName "id"^^xsd:string
686 ] ; 563 ] ;
564 + sp:predicate <http://rdfs.org/sioc/ns#id> ;
565 + sp:subject
566 + [ sp:varName "report"^^xsd:string
687 ] 567 ]
688 - [ 568 + ])
689 - sp:object [
690 - sp:varName "month"^^xsd:string ;
691 ] ; 569 ] ;
692 - sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ; 570 + spin:constraint
693 - sp:subject [ 571 + [ rdf:type spl:Argument ;
694 - sp:varName "report"^^xsd:string ; 572 + rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ;
573 + spl:predicate arg:month ;
574 + spl:valueType xsd:string
695 ] ; 575 ] ;
576 + spin:constraint
577 + [ rdf:type spl:Argument ;
578 + rdfs:comment "The field name."^^xsd:string ;
579 + spl:predicate arg:fieldName ;
580 + spl:valueType xsd:string
581 + ] ;
582 + spin:returnType xsd:string .
583 +
584 +reportspin:idsOfDDRsbyDateAndWellboreId
585 + rdf:type spin:SelectTemplate ;
586 + rdfs:subClassOf spin:SelectTemplates ;
587 + spin:body
588 + [ rdf:type sp:Select ;
589 + sp:orderBy ([ rdf:type sp:Desc ;
590 + sp:expression
591 + [ sp:varName "created"^^xsd:string
592 + ]
593 + ]) ;
594 + sp:resultVariables ([ sp:varName "id"^^xsd:string
595 + ] [ sp:varName "date"^^xsd:string
596 + ]) ;
597 + sp:where ([ sp:object
598 + [ sp:varName "wellBoreId"^^xsd:string
599 + ] ;
600 + sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ;
601 + sp:subject
602 + [ sp:varName "report"^^xsd:string
696 ] 603 ]
697 - [ 604 + ] [ sp:object
698 - sp:object [ 605 + [ sp:varName "date"^^xsd:string
699 - sp:varName "created"^^xsd:string ;
700 ] ; 606 ] ;
701 - sp:predicate <http://purl.org/dc/terms/created> ; 607 + sp:predicate <http://purl.org/dc/terms/date> ;
702 - sp:subject [ 608 + sp:subject
703 - sp:varName "report"^^xsd:string ; 609 + [ sp:varName "report"^^xsd:string
610 + ]
611 + ] [ sp:object
612 + [ sp:varName "created"^^xsd:string
704 ] ; 613 ] ;
614 + sp:predicate <http://purl.org/dc/terms/created> ;
615 + sp:subject
616 + [ sp:varName "report"^^xsd:string
705 ] 617 ]
706 - [ 618 + ] [ sp:object
707 - sp:object [ 619 + [ sp:varName "id"^^xsd:string
708 - sp:varName "id"^^xsd:string ;
709 ] ; 620 ] ;
710 sp:predicate <http://rdfs.org/sioc/ns#id> ; 621 sp:predicate <http://rdfs.org/sioc/ns#id> ;
711 - sp:subject [ 622 + sp:subject
712 - sp:varName "report"^^xsd:string ; 623 + [ sp:varName "report"^^xsd:string
624 + ]
625 + ] [ rdf:type sp:Filter ;
626 + sp:expression
627 + [ rdf:type sp:and ;
628 + sp:arg1 [ rdf:type sp:ge ;
629 + sp:arg1 [ sp:varName "date"^^xsd:string
713 ] ; 630 ] ;
631 + sp:arg2 [ sp:varName "startDate"^^xsd:string
714 ] 632 ]
715 - ) ;
716 ] ; 633 ] ;
717 - spin:constraint [ 634 + sp:arg2 [ rdf:type sp:le ;
718 - rdf:type spl:Argument ; 635 + sp:arg1 [ sp:varName "date"^^xsd:string
719 - spl:predicate arg:fieldName ;
720 - spl:valueType xsd:string ;
721 - rdfs:comment "The field name."^^xsd:string ;
722 ] ; 636 ] ;
723 - spin:constraint [ 637 + sp:arg2 [ sp:varName "endDate"^^xsd:string
724 - rdf:type spl:Argument ; 638 + ]
725 - spl:predicate arg:month ; 639 + ]
726 - spl:valueType xsd:string ; 640 + ]
727 - rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ; 641 + ])
728 ] ; 642 ] ;
729 - spin:returnType xsd:string ; 643 + spin:constraint
730 - rdfs:label "id of MPRG by field, month and parts"^^xsd:string ; 644 + [ rdf:type spl:Argument ;
731 - rdfs:subClassOf spin:Functions ; 645 + rdfs:comment "end date for which DDR reports are to be searched."^^xsd:string ;
732 -. 646 + spl:predicate arg:endDate ;
647 + spl:valueType xsd:date
648 + ] ;
649 + spin:constraint
650 + [ rdf:type spl:Argument ;
651 + rdfs:comment "Start date for which DDR reports are to be searched."^^xsd:string ;
652 + spl:predicate arg:startDate ;
653 + spl:valueType xsd:date
654 + ] ;
655 + spin:constraint
656 + [ rdf:type spl:Argument ;
657 + rdfs:comment "Wellbore id for which DDR report is to be searched."^^xsd:string ;
658 + spl:predicate arg:wellboreId ;
659 + spl:valueType xsd:string
660 + ] .
661 +
733 reportspin:idsOfMPRGsByFieldAndMonth 662 reportspin:idsOfMPRGsByFieldAndMonth
734 rdf:type spin:MagicProperty ; 663 rdf:type spin:MagicProperty ;
735 - spin:body [ 664 + rdfs:comment "Gets the ids of all MPRGs for a given field/month combination, iterating through all used parts combinations."^^xsd:string ;
736 - rdf:type sp:Select ; 665 + rdfs:label "ids of MPRGs by field and month"^^xsd:string ;
737 - sp:resultVariables ( 666 + rdfs:subClassOf spin:MagicProperties ;
738 - [ 667 + spin:body
739 - sp:varName "id"^^xsd:string ; 668 + [ rdf:type sp:Select ;
740 - ] 669 + sp:resultVariables ([ sp:varName "id"^^xsd:string
741 - ) ; 670 + ]) ;
742 - sp:where ( 671 + sp:where ([ rdf:type sp:SubQuery ;
743 - [ 672 + sp:query
744 - rdf:type sp:SubQuery ; 673 + [ rdf:type sp:Select ;
745 - sp:query [
746 - rdf:type sp:Select ;
747 sp:distinct "true"^^xsd:boolean ; 674 sp:distinct "true"^^xsd:boolean ;
748 - sp:resultVariables ( 675 + sp:resultVariables ([ sp:varName "parts"^^xsd:string
749 - [ 676 + ]) ;
750 - sp:varName "parts"^^xsd:string ; 677 + sp:where ([ sp:object
751 - ] 678 + [ sp:varName "fieldName"^^xsd:string
752 - ) ;
753 - sp:where (
754 - [
755 - sp:object [
756 - sp:varName "fieldName"^^xsd:string ;
757 ] ; 679 ] ;
758 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ; 680 sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
759 - sp:subject [ 681 + sp:subject
760 - sp:varName "report"^^xsd:string ; 682 + [ sp:varName "report"^^xsd:string
761 - ] ;
762 ] 683 ]
763 - [ 684 + ] [ sp:object
764 - sp:object [ 685 + [ sp:varName "month"^^xsd:string
765 - sp:varName "month"^^xsd:string ;
766 ] ; 686 ] ;
767 sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ; 687 sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ;
768 - sp:subject [ 688 + sp:subject
769 - sp:varName "report"^^xsd:string ; 689 + [ sp:varName "report"^^xsd:string
770 - ] ;
771 ] 690 ]
772 - [ 691 + ] [ sp:object
773 - sp:object [ 692 + [ sp:varName "parts"^^xsd:string
774 - sp:varName "parts"^^xsd:string ;
775 ] ; 693 ] ;
776 sp:predicate <http://www.reportinghub.no/system/schema/reporting#containsParts> ; 694 sp:predicate <http://www.reportinghub.no/system/schema/reporting#containsParts> ;
777 - sp:subject [ 695 + sp:subject
778 - sp:varName "report"^^xsd:string ; 696 + [ sp:varName "report"^^xsd:string
779 - ] ;
780 ] 697 ]
781 - ) ; 698 + ])
782 - ] ;
783 ] 699 ]
784 - [ 700 + ] [ rdf:type sp:Bind ;
785 - rdf:type sp:Bind ; 701 + sp:expression
786 - sp:expression [ 702 + [ rdf:type reportspin:idOfMPRGByFieldMonthAndParts ;
787 - rdf:type reportspin:idOfMPRGByFieldMonthAndParts ; 703 + arg:fieldName
788 - arg:fieldName [ 704 + [ sp:varName "fieldName"^^xsd:string
789 - sp:varName "fieldName"^^xsd:string ;
790 - ] ;
791 - arg:month [
792 - sp:varName "month"^^xsd:string ;
793 ] ; 705 ] ;
794 - arg:parts [ 706 + arg:month
795 - sp:varName "parts"^^xsd:string ; 707 + [ sp:varName "month"^^xsd:string
796 - ] ;
797 - ] ;
798 - sp:variable [
799 - sp:varName "id"^^xsd:string ;
800 ] ; 708 ] ;
709 + arg:parts
710 + [ sp:varName "parts"^^xsd:string
801 ] 711 ]
802 - ) ;
803 ] ; 712 ] ;
804 - spin:constraint [ 713 + sp:variable
805 - rdf:type spl:Argument ; 714 + [ sp:varName "id"^^xsd:string
806 - spl:predicate arg:fieldName ; 715 + ]
807 - spl:valueType xsd:string ; 716 + ])
808 - rdfs:comment "The field name."^^xsd:string ;
809 ] ; 717 ] ;
810 - spin:constraint [ 718 + spin:constraint
811 - rdf:type spl:Argument ; 719 + [ rdf:type spl:Argument ;
812 - spl:predicate arg:month ;
813 - spl:valueType xsd:string ;
814 rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ; 720 rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ;
721 + spl:predicate arg:month ;
722 + spl:valueType xsd:string
815 ] ; 723 ] ;
816 - rdfs:comment "Gets the ids of all MPRGs for a given field/month combination, iterating through all used parts combinations."^^xsd:string ; 724 + spin:constraint
817 - rdfs:label "ids of MPRGs by field and month"^^xsd:string ; 725 + [ rdf:type spl:Argument ;
818 - rdfs:subClassOf spin:MagicProperties ; 726 + rdfs:comment "The field name."^^xsd:string ;
819 -. 727 + spl:predicate arg:fieldName ;
728 + spl:valueType xsd:string
729 + ] .
730 +
820 reportspin:isPreliminaryById 731 reportspin:isPreliminaryById
821 rdf:type spin:Function ; 732 rdf:type spin:Function ;
822 - spin:body [ 733 + rdfs:label "is preliminary by id"^^xsd:string ;
823 - rdf:type sp:Select ; 734 + rdfs:subClassOf spin:Functions ;
824 - sp:resultVariables ( 735 + spin:body
825 - [ 736 + [ rdf:type sp:Select ;
826 - sp:varName "result"^^xsd:string ; 737 + sp:resultVariables ([ sp:varName "result"^^xsd:string
827 - ] 738 + ]) ;
828 - ) ; 739 + sp:where ([ sp:object
829 - sp:where ( 740 + [ sp:varName "id"^^xsd:string
830 - [
831 - sp:object [
832 - sp:varName "id"^^xsd:string ;
833 ] ; 741 ] ;
834 sp:predicate <http://rdfs.org/sioc/ns#id> ; 742 sp:predicate <http://rdfs.org/sioc/ns#id> ;
835 - sp:subject [ 743 + sp:subject
836 - sp:varName "report"^^xsd:string ; 744 + [ sp:varName "report"^^xsd:string
837 - ] ;
838 ] 745 ]
839 - [ 746 + ] [ sp:object
840 - sp:object [ 747 + [ sp:varName "result"^^xsd:string
841 - sp:varName "result"^^xsd:string ;
842 ] ; 748 ] ;
843 sp:predicate <http://www.reportinghub.no/system/schema/reporting#preliminary> ; 749 sp:predicate <http://www.reportinghub.no/system/schema/reporting#preliminary> ;
844 - sp:subject [ 750 + sp:subject
845 - sp:varName "report"^^xsd:string ; 751 + [ sp:varName "report"^^xsd:string
846 - ] ;
847 ] 752 ]
848 - ) ; 753 + ])
849 ] ; 754 ] ;
850 - spin:constraint [ 755 + spin:constraint
851 - rdf:type spl:Argument ; 756 + [ rdf:type spl:Argument ;
852 - spl:predicate arg:id ;
853 - spl:valueType xsd:string ;
854 rdfs:comment "The of the report to check."^^xsd:string ; 757 rdfs:comment "The of the report to check."^^xsd:string ;
758 + spl:predicate arg:id ;
759 + spl:valueType xsd:string
855 ] ; 760 ] ;
856 - spin:returnType xsd:boolean ; 761 + spin:returnType xsd:boolean .
857 - rdfs:label "is preliminary by id"^^xsd:string ;
858 - rdfs:subClassOf spin:Functions ;
859 -.
......