David Price

Fixed header depth and report type and datetime form

...@@ -31,141 +31,6 @@ ...@@ -31,141 +31,6 @@
31 ddr:Obj_drillReport 31 ddr:Obj_drillReport
32 spin:rule 32 spin:rule
33 [ rdf:type sp:Construct ; 33 [ rdf:type sp:Construct ;
34 - rdfs:comment "STEP 106 Create Well Part"^^xsd:string ;
35 - sp:templates ([ sp:object _:b1 ;
36 - sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
37 - sp:subject
38 - [ sp:varName "dailyDrillingActivity"^^xsd:string
39 - ]
40 - ] [ sp:object
41 - [ sp:varName "well"^^xsd:string
42 - ] ;
43 - sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
44 - sp:subject _:b1
45 - ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
46 - sp:predicate rdf:type ;
47 - sp:subject _:b1
48 - ] [ sp:object
49 - [ sp:varName "wellBore"^^xsd:string
50 - ] ;
51 - sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
52 - sp:subject
53 - [ sp:varName "well"^^xsd:string
54 - ]
55 - ]) ;
56 - sp:where ([ sp:object
57 - [ sp:varName "nameWellBore"^^xsd:string
58 - ] ;
59 - sp:predicate ep-spin-lib:nameWellbore ;
60 - sp:subject spin:_this
61 - ] [ sp:object
62 - [ sp:varName "nameWell"^^xsd:string
63 - ] ;
64 - sp:predicate ep-spin-lib:nameWell ;
65 - sp:subject spin:_this
66 - ] [ sp:object
67 - [ sp:varName "dTimStart"^^xsd:string
68 - ] ;
69 - sp:predicate ddr:dTimStart ;
70 - sp:subject spin:_this
71 - ] [ sp:object
72 - [ sp:varName "temporalPartOfAWellBore"^^xsd:string
73 - ] ;
74 - sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
75 - sp:subject
76 - [ sp:varName "dailyDrillingActivity"^^xsd:string
77 - ]
78 - ] [ sp:object
79 - [ sp:varName "wellBore"^^xsd:string
80 - ] ;
81 - sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
82 - sp:subject
83 - [ sp:varName "temporalPartOfAWellBore"^^xsd:string
84 - ]
85 - ] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
86 - sp:predicate rdf:type ;
87 - sp:subject
88 - [ sp:varName "wellBore"^^xsd:string
89 - ]
90 - ] [ sp:object
91 - [ sp:varName "well"^^xsd:string
92 - ] ;
93 - sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
94 - sp:subject
95 - [ sp:varName "wellBore"^^xsd:string
96 - ]
97 - ] [ rdf:type sp:Bind ;
98 - sp:expression
99 - [ rdf:type ep-spin-lib:normalizeString ;
100 - sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
101 - ]
102 - ] ;
103 - sp:variable
104 - [ sp:varName "normalizedWellBoreName"^^xsd:string
105 - ]
106 - ] [ rdf:type sp:Bind ;
107 - sp:expression
108 - [ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
109 - sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
110 - ] ;
111 - sp:arg2 [ sp:varName "dTimStart"^^xsd:string
112 - ]
113 - ] ;
114 - sp:variable
115 - [ sp:varName "dailyDrillingActivity"^^xsd:string
116 - ]
117 - ])
118 - ] ;
119 - spin:rule
120 - [ rdf:type sp:Construct ;
121 - rdfs:comment "STEP 104 Transfer dTimEnd"^^xsd:string ;
122 - sp:templates ([ sp:object
123 - [ sp:varName "dTimEnd"^^xsd:string
124 - ] ;
125 - sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
126 - sp:subject
127 - [ sp:varName "dailyDrillingActivity"^^xsd:string
128 - ]
129 - ]) ;
130 - sp:where ([ sp:object
131 - [ sp:varName "nameWellBore"^^xsd:string
132 - ] ;
133 - sp:predicate ep-spin-lib:nameWellbore ;
134 - sp:subject spin:_this
135 - ] [ sp:object
136 - [ sp:varName "dTimStart"^^xsd:string
137 - ] ;
138 - sp:predicate ddr:dTimStart ;
139 - sp:subject spin:_this
140 - ] [ sp:object
141 - [ sp:varName "dTimEnd"^^xsd:string
142 - ] ;
143 - sp:predicate ddr:dTimEnd ;
144 - sp:subject spin:_this
145 - ] [ rdf:type sp:Bind ;
146 - sp:expression
147 - [ rdf:type ep-spin-lib:normalizeString ;
148 - sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
149 - ]
150 - ] ;
151 - sp:variable
152 - [ sp:varName "normalizedWellBoreName"^^xsd:string
153 - ]
154 - ] [ rdf:type sp:Bind ;
155 - sp:expression
156 - [ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
157 - sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
158 - ] ;
159 - sp:arg2 [ sp:varName "dTimStart"^^xsd:string
160 - ]
161 - ] ;
162 - sp:variable
163 - [ sp:varName "dailyDrillingActivity"^^xsd:string
164 - ]
165 - ])
166 - ] ;
167 - spin:rule
168 - [ rdf:type sp:Construct ;
169 rdfs:comment """STEP 105 34 rdfs:comment """STEP 105
170 Classify a DailyDrillingReport"""^^xsd:string ; 35 Classify a DailyDrillingReport"""^^xsd:string ;
171 sp:templates ([ sp:object 36 sp:templates ([ sp:object
...@@ -259,6 +124,13 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ...@@ -259,6 +124,13 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
259 sp:subject 124 sp:subject
260 [ sp:varName "dailyDrillingActivity"^^xsd:string 125 [ sp:varName "dailyDrillingActivity"^^xsd:string
261 ] 126 ]
127 + ] [ sp:object
128 + [ sp:varName "dTimEnd"^^xsd:string
129 + ] ;
130 + sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
131 + sp:subject
132 + [ sp:varName "dailyDrillingActivity"^^xsd:string
133 + ]
262 ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ; 134 ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ;
263 sp:predicate rdf:type ; 135 sp:predicate rdf:type ;
264 sp:subject 136 sp:subject
...@@ -278,24 +150,24 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ...@@ -278,24 +150,24 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
278 sp:subject 150 sp:subject
279 [ sp:varName "dailyDrillingActivity"^^xsd:string 151 [ sp:varName "dailyDrillingActivity"^^xsd:string
280 ] 152 ]
281 - ] [ sp:object _:b2 ; 153 + ] [ sp:object _:b1 ;
282 sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ; 154 sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ;
283 sp:subject 155 sp:subject
284 [ sp:varName "dailyDrillingActivity"^^xsd:string 156 [ sp:varName "dailyDrillingActivity"^^xsd:string
285 ] 157 ]
286 ] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ; 158 ] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ;
287 sp:predicate rdf:type ; 159 sp:predicate rdf:type ;
288 - sp:subject _:b2 160 + sp:subject _:b1
289 ] [ sp:object 161 ] [ sp:object
290 [ sp:varName "extendedReportContent"^^xsd:string 162 [ sp:varName "extendedReportContent"^^xsd:string
291 ] ; 163 ] ;
292 sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ; 164 sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ;
293 - sp:subject _:b2 165 + sp:subject _:b1
294 ] [ sp:object 166 ] [ sp:object
295 [ sp:varName "dTimExtendedReport"^^xsd:string 167 [ sp:varName "dTimExtendedReport"^^xsd:string
296 ] ; 168 ] ;
297 sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ; 169 sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
298 - sp:subject _:b2 170 + sp:subject _:b1
299 ]) ; 171 ]) ;
300 sp:where ([ sp:object 172 sp:where ([ sp:object
301 [ sp:varName "nameWellBore"^^xsd:string 173 [ sp:varName "nameWellBore"^^xsd:string
...@@ -397,4 +269,91 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ...@@ -397,4 +269,91 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
397 [ sp:varName "wellBore"^^xsd:string 269 [ sp:varName "wellBore"^^xsd:string
398 ] 270 ]
399 ]) 271 ])
272 + ] ;
273 + spin:rule
274 + [ rdf:type sp:Construct ;
275 + rdfs:comment "STEP 106 Create Well Part"^^xsd:string ;
276 + sp:templates ([ sp:object _:b2 ;
277 + sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
278 + sp:subject
279 + [ sp:varName "dailyDrillingActivity"^^xsd:string
280 + ]
281 + ] [ sp:object
282 + [ sp:varName "well"^^xsd:string
283 + ] ;
284 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
285 + sp:subject _:b2
286 + ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
287 + sp:predicate rdf:type ;
288 + sp:subject _:b2
289 + ] [ sp:object
290 + [ sp:varName "wellBore"^^xsd:string
291 + ] ;
292 + sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
293 + sp:subject
294 + [ sp:varName "well"^^xsd:string
295 + ]
296 + ]) ;
297 + sp:where ([ sp:object
298 + [ sp:varName "nameWellBore"^^xsd:string
299 + ] ;
300 + sp:predicate ep-spin-lib:nameWellbore ;
301 + sp:subject spin:_this
302 + ] [ sp:object
303 + [ sp:varName "nameWell"^^xsd:string
304 + ] ;
305 + sp:predicate ep-spin-lib:nameWell ;
306 + sp:subject spin:_this
307 + ] [ sp:object
308 + [ sp:varName "dTimStart"^^xsd:string
309 + ] ;
310 + sp:predicate ddr:dTimStart ;
311 + sp:subject spin:_this
312 + ] [ sp:object
313 + [ sp:varName "temporalPartOfAWellBore"^^xsd:string
314 + ] ;
315 + sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
316 + sp:subject
317 + [ sp:varName "dailyDrillingActivity"^^xsd:string
318 + ]
319 + ] [ sp:object
320 + [ sp:varName "wellBore"^^xsd:string
321 + ] ;
322 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
323 + sp:subject
324 + [ sp:varName "temporalPartOfAWellBore"^^xsd:string
325 + ]
326 + ] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
327 + sp:predicate rdf:type ;
328 + sp:subject
329 + [ sp:varName "wellBore"^^xsd:string
330 + ]
331 + ] [ sp:object
332 + [ sp:varName "well"^^xsd:string
333 + ] ;
334 + sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
335 + sp:subject
336 + [ sp:varName "wellBore"^^xsd:string
337 + ]
338 + ] [ rdf:type sp:Bind ;
339 + sp:expression
340 + [ rdf:type ep-spin-lib:normalizeString ;
341 + sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
342 + ]
343 + ] ;
344 + sp:variable
345 + [ sp:varName "normalizedWellBoreName"^^xsd:string
346 + ]
347 + ] [ rdf:type sp:Bind ;
348 + sp:expression
349 + [ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
350 + sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
351 + ] ;
352 + sp:arg2 [ sp:varName "dTimStart"^^xsd:string
353 + ]
354 + ] ;
355 + sp:variable
356 + [ sp:varName "dailyDrillingActivity"^^xsd:string
357 + ]
358 + ])
400 ] . 359 ] .
......
...@@ -17,19 +17,21 @@ ...@@ -17,19 +17,21 @@
17 > 17 >
18 18
19 <h1>Summary report Wellbore: {= rhspin:npdName(?wb) }</h1> 19 <h1>Summary report Wellbore: {= rhspin:npdName(?wb) }</h1>
20 - <div>End time: <ui:if ui:condition="{= bound(?activityEnd) }">{= spif:dateFormat(?activityEnd, 'yyyy-MM-dd HH:mm') }</ui:if></div> 20 + <div>End time: {= ?activityEnd}</div>
21 <hr /> 21 <hr />
22 +
23 +
22 <table> 24 <table>
23 25
24 <tr> 26 <tr>
25 <td class="ddrSummaryLeft"> 27 <td class="ddrSummaryLeft">
26 <rhswp:NameValuePair arg:name="Report Number:" arg:value="{# SELECT ?repNum WHERE {?report ep-report:dailyDrillingReportNumber ?repNum}}" /> 28 <rhswp:NameValuePair arg:name="Report Number:" arg:value="{# SELECT ?repNum WHERE {?report ep-report:dailyDrillingReportNumber ?repNum}}" />
27 <rhswp:NameValuePair arg:name="Wellbore:" arg:value="{= rhspin:npdName(?wb) }" /> 29 <rhswp:NameValuePair arg:name="Wellbore:" arg:value="{= rhspin:npdName(?wb) }" />
28 - <rhswp:NameValuePair arg:name="Status:" arg:value="{# SELECT ?repTypeName WHERE {?report a ?repType . ?repType rdfs:label ?repTypeName}}" /> 30 + <rhswp:NameValuePair arg:name="Status:" arg:value="{# SELECT ?repTypeName WHERE {?report a ?repType . ?repType a ep-report:DailyDrillingReportFinalisationType . ?repType rdfs:label ?repTypeName}}" />
29 <rhswp:NameValuePair arg:name="Operator:" arg:value="{# SELECT ?operatorName WHERE {?activity ep-activity:drillingOperator ?operator . ?operator ep-core:name ?operatorName }}" /> 31 <rhswp:NameValuePair arg:name="Operator:" arg:value="{# SELECT ?operatorName WHERE {?activity ep-activity:drillingOperator ?operator . ?operator ep-core:name ?operatorName }}" />
30 <rhswp:NameValuePair arg:name="Rig name:" arg:value="{= rhspin:npdName(?rig) }" /> 32 <rhswp:NameValuePair arg:name="Rig name:" arg:value="{= rhspin:npdName(?rig) }" />
31 <rhswp:NameValuePair arg:name="Spud date:" arg:value="{= IF(bound(?spudDate), spif:dateFormat(?spudDate, 'yyyy-MM-dd'), ?unbound) }" /> 33 <rhswp:NameValuePair arg:name="Spud date:" arg:value="{= IF(bound(?spudDate), spif:dateFormat(?spudDate, 'yyyy-MM-dd'), ?unbound) }" />
32 - <rhswp:NameValuePair arg:name="Elevation RKB-MSL m:" arg:value="{# SELECT ?kellyElevVMeas WHERE {?activity ep-activity:onRig ?rigState . ?rigState ep-core:hasPart ?kellyBushing . ?kellyBushing a ep-eqt:KellyBushing . ?kellyBushing ep-eqt:elevationOfKellyBushing ?kellyElev . ?kellyElev ep-core:metre ?kellyElevMeas}}" /> 34 + <rhswp:NameValuePair arg:name="Elevation RKB-MSL m:" arg:value="{# SELECT ?kellyElevMeas WHERE {?activity ep-activity:onRig ?rigState . ?rigState ep-core:hasPart ?kellyBushing . ?kellyBushing a ep-eqt:KellyBushing . ?kellyBushing ep-eqt:elevationOfKellyBushing ?kellyElev . ?kellyElev ep-core:metre ?kellyElevMeas}}" />
33 <rhswp:NameValuePair arg:name="Tight well:" arg:value="{# SELECT ?wbTightTypeLabel WHERE { ?statusActivityWb a ?wbTightType . ?wbTightType a ep-well:WellBoreTightnessType . ?wbTightType rdfs:label ?wbTightTypeLabel} }" /> 35 <rhswp:NameValuePair arg:name="Tight well:" arg:value="{# SELECT ?wbTightTypeLabel WHERE { ?statusActivityWb a ?wbTightType . ?wbTightType a ep-well:WellBoreTightnessType . ?wbTightType rdfs:label ?wbTightTypeLabel} }" />
34 <rhswp:NameValuePair arg:name="Pressure psig:" arg:value="{# SELECT ?buttHolePresVal WHERE {?statusActivityWb ep-well:averageBottomHolePressure ?buttHolePres . ?buttHolePres ep-core:psig ?buttHolePresVal}}" /> 36 <rhswp:NameValuePair arg:name="Pressure psig:" arg:value="{# SELECT ?buttHolePresVal WHERE {?statusActivityWb ep-well:averageBottomHolePressure ?buttHolePres . ?buttHolePres ep-core:psig ?buttHolePresVal}}" />
35 <rhswp:NameValuePair arg:name="Fixed rig:" arg:value="{# SELECT ?rigTypeName WHERE {?rig a ?rigType . ?rigType rdfs:label ?rigTypeName . ?rigType rdfs:subClassOf ep-fac:Rig}}" /> 37 <rhswp:NameValuePair arg:name="Fixed rig:" arg:value="{# SELECT ?rigTypeName WHERE {?rig a ?rigType . ?rigType rdfs:label ?rigTypeName . ?rigType rdfs:subClassOf ep-fac:Rig}}" />
...@@ -43,11 +45,11 @@ ...@@ -43,11 +45,11 @@
43 </td> 45 </td>
44 <td class="ddrSummaryRight"> 46 <td class="ddrSummaryRight">
45 47
46 - <rhswp:NameValuePair arg:name="Period:" arg:value="{= fn:concat(spif:dateFormat(?activityStart, 'yyyy-MM-dd HH:mm'), ' - ', spif:dateFormat(?activityEnd, 'yyyy-MM-dd HH:mm')) }" /> 48 + <rhswp:NameValuePair arg:name="Period:" arg:value="{= fn:concat(?activityStart, ' - ', ?activityEnd) }" />
47 49
48 50
49 <rhswp:NameValuePair arg:name="Wellbore Id:" arg:value="{= rhspin:npdId(?wb) }" /> 51 <rhswp:NameValuePair arg:name="Wellbore Id:" arg:value="{= rhspin:npdId(?wb) }" />
50 - <rhswp:NameValuePair arg:name="Created date:" arg:value="{= IF(bound(?createdAt), spif:dateFormat(?createdAt, 'yyyy-MM-dd HH:mm'), ?unbound) }" /> 52 + <rhswp:NameValuePair arg:name="Created date:" arg:value="{= ?createdAt }" />
51 <rhswp:NameValuePair arg:name="Drilling contractor:" arg:value="{# SELECT ?contractorName WHERE {?activity ep-activity:drillingContractor ?contractor . ?contractor ep-core:name ?contractorName}}" /> 53 <rhswp:NameValuePair arg:name="Drilling contractor:" arg:value="{# SELECT ?contractorName WHERE {?activity ep-activity:drillingContractor ?contractor . ?contractor ep-core:name ?contractorName}}" />
52 <rhswp:NameValuePair arg:name="NPD Rig Id:" arg:value="{= rhspin:npdId(?rig) }" /> 54 <rhswp:NameValuePair arg:name="NPD Rig Id:" arg:value="{= rhspin:npdId(?rig) }" />
53 <rhswp:NameValuePair arg:name="Date Well Complete:" arg:value="{= IF(bound(?completeDate), spif:dateFormat(?completeDate, 'yyyy-MM-dd'), ?unbound) }" /> 55 <rhswp:NameValuePair arg:name="Date Well Complete:" arg:value="{= IF(bound(?completeDate), spif:dateFormat(?completeDate, 'yyyy-MM-dd'), ?unbound) }" />
......