Holger Knublauch

More MPRG support infrastructure

...@@ -1517,6 +1517,62 @@ rhspin:graphForDDR ...@@ -1517,6 +1517,62 @@ rhspin:graphForDDR
1517 ] ; 1517 ] ;
1518 spin:returnType rdfs:Resource . 1518 spin:returnType rdfs:Resource .
1519 1519
1520 +rhspin:graphForFieldWithName
1521 + rdf:type spin:Function ;
1522 + rdfs:comment "Gets the graph that holds the MPRG triples for a Field with a given name."^^xsd:string ;
1523 + rdfs:label "graph for field with name"^^xsd:string ;
1524 + rdfs:subClassOf spin:Functions ;
1525 + spin:body
1526 + [ rdf:type sp:Select ;
1527 + sp:resultVariables ([ sp:expression
1528 + [ rdf:type sp:iri ;
1529 + sp:arg1 [ sp:varName "uri"^^xsd:string
1530 + ]
1531 + ] ;
1532 + sp:varName "result"^^xsd:string
1533 + ]) ;
1534 + sp:where ([ rdf:type sp:NamedGraph ;
1535 + sp:elements ([ sp:object
1536 + [ sp:varName "fieldName"^^xsd:string
1537 + ] ;
1538 + sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
1539 + sp:subject
1540 + [ sp:varName "field"^^xsd:string
1541 + ]
1542 + ] [ sp:object <http://www.reportinghub.no/ep/schema/facility#Field> ;
1543 + sp:predicate rdf:type ;
1544 + sp:subject
1545 + [ sp:varName "field"^^xsd:string
1546 + ]
1547 + ] [ sp:object
1548 + [ sp:varName "id"^^xsd:string
1549 + ] ;
1550 + sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
1551 + sp:subject
1552 + [ sp:varName "field"^^xsd:string
1553 + ]
1554 + ]) ;
1555 + sp:graphNameNode npdata:npd
1556 + ] [ rdf:type sp:Bind ;
1557 + sp:expression
1558 + [ rdf:type fn:concat ;
1559 + sp:arg1 "https://www.reportinghub.no/ep/graph/field-" ;
1560 + sp:arg2 [ sp:varName "id"^^xsd:string
1561 + ]
1562 + ] ;
1563 + sp:variable
1564 + [ sp:varName "uri"^^xsd:string
1565 + ]
1566 + ])
1567 + ] ;
1568 + spin:constraint
1569 + [ rdf:type spl:Argument ;
1570 + rdfs:comment "The field name."^^xsd:string ;
1571 + spl:predicate arg:fieldName ;
1572 + spl:valueType xsd:string
1573 + ] ;
1574 + spin:returnType rdfs:Resource .
1575 +
1520 rhspin:graphForLicence 1576 rhspin:graphForLicence
1521 rdf:type spin:Function ; 1577 rdf:type spin:Function ;
1522 rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given licence."^^xsd:string ; 1578 rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given licence."^^xsd:string ;
...@@ -2589,12 +2645,12 @@ _:b13 ...@@ -2589,12 +2645,12 @@ _:b13
2589 2645
2590 _:b6 sp:varName "well"^^xsd:string . 2646 _:b6 sp:varName "well"^^xsd:string .
2591 2647
2592 -_:b8 sp:varName "wellBore"^^xsd:string . 2648 +_:b4 sp:varName "wellBore"^^xsd:string .
2593 2649
2594 _:b12 2650 _:b12
2595 sp:varName "wellBore"^^xsd:string . 2651 sp:varName "wellBore"^^xsd:string .
2596 2652
2597 -_:b4 sp:varName "wellBore"^^xsd:string . 2653 +_:b8 sp:varName "wellBore"^^xsd:string .
2598 2654
2599 _:b3 sp:varName "wellBoreId"^^xsd:string . 2655 _:b3 sp:varName "wellBoreId"^^xsd:string .
2600 2656
......
...@@ -24,7 +24,7 @@ report:AbstractDR ...@@ -24,7 +24,7 @@ report:AbstractDR
24 rdf:type report:ReportClass ; 24 rdf:type report:ReportClass ;
25 rdfs:comment "Abstract base class for various types of daily reports."^^xsd:string ; 25 rdfs:comment "Abstract base class for various types of daily reports."^^xsd:string ;
26 rdfs:label "Daily report"^^xsd:string ; 26 rdfs:label "Daily report"^^xsd:string ;
27 - rdfs:subClassOf foaf:Document ; 27 + rdfs:subClassOf report:AbstractReport ;
28 rdfs:subClassOf 28 rdfs:subClassOf
29 [ rdf:type owl:Restriction ; 29 [ rdf:type owl:Restriction ;
30 owl:cardinality "1"^^xsd:nonNegativeInteger ; 30 owl:cardinality "1"^^xsd:nonNegativeInteger ;
...@@ -58,7 +58,12 @@ report:AbstractDR ...@@ -58,7 +58,12 @@ report:AbstractDR
58 58
59 report:AbstractMPR 59 report:AbstractMPR
60 rdf:type report:ReportClass ; 60 rdf:type report:ReportClass ;
61 - rdfs:label "Abstract MPR"^^xsd:string ; 61 + rdfs:label "Monthly Production Report"^^xsd:string ;
62 + rdfs:subClassOf report:AbstractReport .
63 +
64 +report:AbstractReport
65 + rdf:type owl:Class ;
66 + rdfs:label "Any report"^^xsd:string ;
62 rdfs:subClassOf foaf:Document . 67 rdfs:subClassOf foaf:Document .
63 68
64 report:DDR 69 report:DDR
...@@ -104,7 +109,7 @@ report:MPRD ...@@ -104,7 +109,7 @@ report:MPRD
104 109
105 report:MPRG 110 report:MPRG
106 rdf:type report:ReportClass ; 111 rdf:type report:ReportClass ;
107 - rdfs:label "MPRG"^^xsd:string ; 112 + rdfs:label "MPR Gov"^^xsd:string ;
108 rdfs:subClassOf report:AbstractMPR . 113 rdfs:subClassOf report:AbstractMPR .
109 114
110 report:MPRP 115 report:MPRP
...@@ -142,10 +147,22 @@ report:ZipFormat ...@@ -142,10 +147,22 @@ report:ZipFormat
142 rdf:type report:Format ; 147 rdf:type report:Format ;
143 rdfs:label "Zip format"^^xsd:string . 148 rdfs:label "Zip format"^^xsd:string .
144 149
150 +report:fieldName
151 + rdf:type owl:DatatypeProperty ;
152 + rdfs:domain report:AbstractMPR ;
153 + rdfs:label "field name"^^xsd:string ;
154 + rdfs:range xsd:string .
155 +
145 report:format 156 report:format
146 rdf:type owl:ObjectProperty ; 157 rdf:type owl:ObjectProperty ;
147 rdfs:label "format"^^xsd:string . 158 rdfs:label "format"^^xsd:string .
148 159
160 +report:month
161 + rdf:type owl:DatatypeProperty ;
162 + rdfs:domain report:MPRG ;
163 + rdfs:label "month"^^xsd:string ;
164 + rdfs:range xsd:string .
165 +
149 report:owner 166 report:owner
150 rdf:type owl:ObjectProperty ; 167 rdf:type owl:ObjectProperty ;
151 rdfs:label "owner"^^xsd:string ; 168 rdfs:label "owner"^^xsd:string ;
......
...@@ -18,11 +18,21 @@ ...@@ -18,11 +18,21 @@
18 rdfs:label "date"^^xsd:string ; 18 rdfs:label "date"^^xsd:string ;
19 rdfs:subPropertyOf sp:arg . 19 rdfs:subPropertyOf sp:arg .
20 20
21 +<http://spinrdf.org/arg#fieldName>
22 + rdf:type rdf:Property ;
23 + rdfs:label "field name"^^xsd:string ;
24 + rdfs:subPropertyOf sp:arg .
25 +
21 <http://spinrdf.org/arg#id> 26 <http://spinrdf.org/arg#id>
22 rdf:type rdf:Property ; 27 rdf:type rdf:Property ;
23 rdfs:label "id"^^xsd:string ; 28 rdfs:label "id"^^xsd:string ;
24 rdfs:subPropertyOf sp:arg . 29 rdfs:subPropertyOf sp:arg .
25 30
31 +<http://spinrdf.org/arg#month>
32 + rdf:type rdf:Property ;
33 + rdfs:label "month"^^xsd:string ;
34 + rdfs:subPropertyOf sp:arg .
35 +
26 <http://spinrdf.org/arg#owner> 36 <http://spinrdf.org/arg#owner>
27 rdf:type rdf:Property ; 37 rdf:type rdf:Property ;
28 rdfs:label "owner"^^xsd:string ; 38 rdfs:label "owner"^^xsd:string ;
...@@ -220,6 +230,37 @@ reportspin:graphByDPRId ...@@ -220,6 +230,37 @@ reportspin:graphByDPRId
220 ] ; 230 ] ;
221 spin:returnType rdfs:Resource . 231 spin:returnType rdfs:Resource .
222 232
233 +reportspin:graphByReportId
234 + rdf:type spin:Function ;
235 + rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report with a given id."^^xsd:string ;
236 + rdfs:label "graph by report id"^^xsd:string ;
237 + rdfs:subClassOf spin:Functions ;
238 + spin:body
239 + [ rdf:type sp:Select ;
240 + sp:resultVariables ([ rdf:type sp:iri ;
241 + sp:arg1 [ sp:varName "uri"^^xsd:string
242 + ]
243 + ]) ;
244 + sp:where ([ rdf:type sp:Bind ;
245 + sp:expression
246 + [ rdf:type fn:concat ;
247 + sp:arg1 "http://www.reportinghub.no/system/report/" ;
248 + sp:arg2 [ sp:varName "id"^^xsd:string
249 + ]
250 + ] ;
251 + sp:variable
252 + [ sp:varName "uri"^^xsd:string
253 + ]
254 + ])
255 + ] ;
256 + spin:constraint
257 + [ rdf:type spl:Argument ;
258 + rdfs:comment "The id of the DDR metadata."^^xsd:string ;
259 + spl:predicate <http://spinrdf.org/arg#id> ;
260 + spl:valueType xsd:string
261 + ] ;
262 + spin:returnType rdfs:Resource .
263 +
223 reportspin:idOfDDRByDateAndWellBoreId 264 reportspin:idOfDDRByDateAndWellBoreId
224 rdf:type spin:Function ; 265 rdf:type spin:Function ;
225 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 ; 266 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 ;
...@@ -266,16 +307,16 @@ reportspin:idOfDDRByDateAndWellBoreId ...@@ -266,16 +307,16 @@ reportspin:idOfDDRByDateAndWellBoreId
266 ] ; 307 ] ;
267 spin:constraint 308 spin:constraint
268 [ rdf:type spl:Argument ; 309 [ rdf:type spl:Argument ;
269 - rdfs:comment "The id of the well bore."^^xsd:string ;
270 - spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
271 - spl:valueType xsd:string
272 - ] ;
273 - spin:constraint
274 - [ rdf:type spl:Argument ;
275 rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ; 310 rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
276 spl:predicate <http://spinrdf.org/arg#date> ; 311 spl:predicate <http://spinrdf.org/arg#date> ;
277 spl:valueType xsd:date 312 spl:valueType xsd:date
278 ] ; 313 ] ;
314 + spin:constraint
315 + [ rdf:type spl:Argument ;
316 + rdfs:comment "The id of the well bore."^^xsd:string ;
317 + spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
318 + spl:valueType xsd:string
319 + ] ;
279 spin:returnType xsd:string . 320 spin:returnType xsd:string .
280 321
281 reportspin:idOfDPRByDateAndOwner 322 reportspin:idOfDPRByDateAndOwner
...@@ -335,3 +376,60 @@ reportspin:idOfDPRByDateAndOwner ...@@ -335,3 +376,60 @@ reportspin:idOfDPRByDateAndOwner
335 spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner> 376 spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner>
336 ] ; 377 ] ;
337 spin:returnType xsd:string . 378 spin:returnType xsd:string .
379 +
380 +reportspin:idOfMPRGByFieldAndMonth
381 + rdf:type spin:Function ;
382 + rdfs:label "id of MPRG by field and month"^^xsd:string ;
383 + rdfs:subClassOf spin:Functions ;
384 + spin:body
385 + [ rdf:type sp:Select ;
386 + sp:orderBy ([ rdf:type sp:Desc ;
387 + sp:expression
388 + [ sp:varName "created"^^xsd:string
389 + ]
390 + ]) ;
391 + sp:resultVariables ([ sp:varName "id"^^xsd:string
392 + ]) ;
393 + sp:where ([ sp:object
394 + [ sp:varName "fieldName"^^xsd:string
395 + ] ;
396 + sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
397 + sp:subject
398 + [ sp:varName "report"^^xsd:string
399 + ]
400 + ] [ sp:object
401 + [ sp:varName "month"^^xsd:string
402 + ] ;
403 + sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ;
404 + sp:subject
405 + [ sp:varName "report"^^xsd:string
406 + ]
407 + ] [ sp:object
408 + [ sp:varName "created"^^xsd:string
409 + ] ;
410 + sp:predicate <http://purl.org/dc/terms/created> ;
411 + sp:subject
412 + [ sp:varName "report"^^xsd:string
413 + ]
414 + ] [ sp:object
415 + [ sp:varName "id"^^xsd:string
416 + ] ;
417 + sp:predicate <http://rdfs.org/sioc/ns#id> ;
418 + sp:subject
419 + [ sp:varName "report"^^xsd:string
420 + ]
421 + ])
422 + ] ;
423 + spin:constraint
424 + [ rdf:type spl:Argument ;
425 + rdfs:comment "The field name."^^xsd:string ;
426 + spl:predicate <http://spinrdf.org/arg#fieldName> ;
427 + spl:valueType xsd:string
428 + ] ;
429 + spin:constraint
430 + [ rdf:type spl:Argument ;
431 + rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ;
432 + spl:predicate <http://spinrdf.org/arg#month> ;
433 + spl:valueType xsd:string
434 + ] ;
435 + spin:returnType xsd:string .
......
...@@ -19,13 +19,23 @@ ...@@ -19,13 +19,23 @@
19 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . 19 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
20 20
21 report:AbstractDR 21 report:AbstractDR
22 - swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type <http://rdfs.org/sioc/ns#id>) ;
23 ui:instanceView 22 ui:instanceView
24 [ rdf:type report:DRFormBody ; 23 [ rdf:type report:DRFormBody ;
25 arg:resource spin:_this ; 24 arg:resource spin:_this ;
26 ui:id "search"^^xsd:string 25 ui:id "search"^^xsd:string
27 ] . 26 ] .
28 27
28 +report:AbstractMPR
29 + swa:keyProperties (<http://purl.org/dc/terms/created> rdf:type report:fieldName <http://rdfs.org/sioc/ns#id>) ;
30 + ui:instanceView
31 + [ rdf:type report:MPRFormBody ;
32 + arg:resource spin:_this ;
33 + ui:id "search"^^xsd:string
34 + ] .
35 +
36 +report:AbstractReport
37 + swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type <http://rdfs.org/sioc/ns#id>) .
38 +
29 report:DDR 39 report:DDR
30 swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type report:wellBoreId <http://rdfs.org/sioc/ns#id>) ; 40 swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type report:wellBoreId <http://rdfs.org/sioc/ns#id>) ;
31 ui:instanceView 41 ui:instanceView
...@@ -87,6 +97,54 @@ report:DRFormBody ...@@ -87,6 +97,54 @@ report:DRFormBody
87 ] 97 ]
88 ] . 98 ] .
89 99
100 +report:MPRFormBody
101 + rdf:type ui:ResourceViewClass ;
102 + rdfs:label "MPR form body"^^xsd:string ;
103 + rdfs:subClassOf swa:FormBody ;
104 + ui:prototype
105 + [ rdf:type html:Div ;
106 + default:subject
107 + [ sp:varName "resource"^^xsd:string
108 + ] ;
109 + ui:child
110 + [ rdf:type swa:ColumnLayout ;
111 + arg:colWidths "50%,50%"^^xsd:string ;
112 + arg:width "600px"^^xsd:string ;
113 + ui:child
114 + [ rdf:type swa:Object ;
115 + arg:label "Created"^^xsd:string ;
116 + arg:predicate <http://purl.org/dc/terms/created> ;
117 + ui:childIndex 0
118 + ] ;
119 + ui:child
120 + [ rdf:type swa:Object ;
121 + arg:label "Field name"^^xsd:string ;
122 + arg:predicate report:fieldName ;
123 + ui:childIndex 1
124 + ] ;
125 + ui:childIndex 0
126 + ]
127 + ] .
128 +
129 +report:MPRG
130 + swa:keyProperties (<http://purl.org/dc/terms/created> rdf:type report:fieldName report:month <http://rdfs.org/sioc/ns#id>) ;
131 + ui:instanceView
132 + [ rdf:type ui:group ;
133 + default:subject spin:_this ;
134 + ui:child
135 + [ rdf:type report:MPRFormBody ;
136 + arg:resource spin:_this ;
137 + ui:childIndex 0
138 + ] ;
139 + ui:child
140 + [ rdf:type swa:Object ;
141 + arg:label "Month (yyyy-MM)"^^xsd:string ;
142 + arg:predicate report:month ;
143 + ui:childIndex 1
144 + ] ;
145 + ui:id "search"^^xsd:string
146 + ] .
147 +
90 <http://www.reportinghub.no/system/swp/reporting> 148 <http://www.reportinghub.no/system/swp/reporting>
91 rdf:type owl:Ontology ; 149 rdf:type owl:Ontology ;
92 owl:imports <http://www.reportinghub.no/system/schema/reporting> , <http://www.reportinghub.no/system/swp/SWP-logging> ; 150 owl:imports <http://www.reportinghub.no/system/schema/reporting> , <http://www.reportinghub.no/system/swp/SWP-logging> ;
......