David Price

Fixed header depth and report type and datetime form

......@@ -31,141 +31,6 @@
ddr:Obj_drillReport
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 106 Create Well Part"^^xsd:string ;
sp:templates ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "well"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b1
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject
[ sp:varName "well"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "nameWellBore"^^xsd:string
] ;
sp:predicate ep-spin-lib:nameWellbore ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "nameWell"^^xsd:string
] ;
sp:predicate ep-spin-lib:nameWell ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimStart"^^xsd:string
] ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "well"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedWellBoreName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "dTimStart"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 104 Transfer dTimEnd"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "dTimEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "nameWellBore"^^xsd:string
] ;
sp:predicate ep-spin-lib:nameWellbore ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimStart"^^xsd:string
] ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimEnd"^^xsd:string
] ;
sp:predicate ddr:dTimEnd ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedWellBoreName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "dTimStart"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 105
Classify a DailyDrillingReport"""^^xsd:string ;
sp:templates ([ sp:object
......@@ -259,6 +124,13 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "dTimEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ;
sp:predicate rdf:type ;
sp:subject
......@@ -278,24 +150,24 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object _:b2 ;
] [ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ;
sp:predicate rdf:type ;
sp:subject _:b2
sp:subject _:b1
] [ sp:object
[ sp:varName "extendedReportContent"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ;
sp:subject _:b2
sp:subject _:b1
] [ sp:object
[ sp:varName "dTimExtendedReport"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject _:b2
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "nameWellBore"^^xsd:string
......@@ -397,4 +269,91 @@ replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore)
[ sp:varName "wellBore"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 106 Create Well Part"^^xsd:string ;
sp:templates ([ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "well"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject
[ sp:varName "well"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "nameWellBore"^^xsd:string
] ;
sp:predicate ep-spin-lib:nameWellbore ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "nameWell"^^xsd:string
] ;
sp:predicate ep-spin-lib:nameWell ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimStart"^^xsd:string
] ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "well"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedWellBoreName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "dTimStart"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
])
] .
......
......@@ -17,19 +17,21 @@
>
<h1>Summary report Wellbore: {= rhspin:npdName(?wb) }</h1>
<div>End time: <ui:if ui:condition="{= bound(?activityEnd) }">{= spif:dateFormat(?activityEnd, 'yyyy-MM-dd HH:mm') }</ui:if></div>
<div>End time: {= ?activityEnd}</div>
<hr />
<table>
<tr>
<td class="ddrSummaryLeft">
<rhswp:NameValuePair arg:name="Report Number:" arg:value="{# SELECT ?repNum WHERE {?report ep-report:dailyDrillingReportNumber ?repNum}}" />
<rhswp:NameValuePair arg:name="Wellbore:" arg:value="{= rhspin:npdName(?wb) }" />
<rhswp:NameValuePair arg:name="Status:" arg:value="{# SELECT ?repTypeName WHERE {?report a ?repType . ?repType rdfs:label ?repTypeName}}" />
<rhswp:NameValuePair arg:name="Status:" arg:value="{# SELECT ?repTypeName WHERE {?report a ?repType . ?repType a ep-report:DailyDrillingReportFinalisationType . ?repType rdfs:label ?repTypeName}}" />
<rhswp:NameValuePair arg:name="Operator:" arg:value="{# SELECT ?operatorName WHERE {?activity ep-activity:drillingOperator ?operator . ?operator ep-core:name ?operatorName }}" />
<rhswp:NameValuePair arg:name="Rig name:" arg:value="{= rhspin:npdName(?rig) }" />
<rhswp:NameValuePair arg:name="Spud date:" arg:value="{= IF(bound(?spudDate), spif:dateFormat(?spudDate, 'yyyy-MM-dd'), ?unbound) }" />
<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}}" />
<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}}" />
<rhswp:NameValuePair arg:name="Tight well:" arg:value="{# SELECT ?wbTightTypeLabel WHERE { ?statusActivityWb a ?wbTightType . ?wbTightType a ep-well:WellBoreTightnessType . ?wbTightType rdfs:label ?wbTightTypeLabel} }" />
<rhswp:NameValuePair arg:name="Pressure psig:" arg:value="{# SELECT ?buttHolePresVal WHERE {?statusActivityWb ep-well:averageBottomHolePressure ?buttHolePres . ?buttHolePres ep-core:psig ?buttHolePresVal}}" />
<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 @@
</td>
<td class="ddrSummaryRight">
<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')) }" />
<rhswp:NameValuePair arg:name="Period:" arg:value="{= fn:concat(?activityStart, ' - ', ?activityEnd) }" />
<rhswp:NameValuePair arg:name="Wellbore Id:" arg:value="{= rhspin:npdId(?wb) }" />
<rhswp:NameValuePair arg:name="Created date:" arg:value="{= IF(bound(?createdAt), spif:dateFormat(?createdAt, 'yyyy-MM-dd HH:mm'), ?unbound) }" />
<rhswp:NameValuePair arg:name="Created date:" arg:value="{= ?createdAt }" />
<rhswp:NameValuePair arg:name="Drilling contractor:" arg:value="{# SELECT ?contractorName WHERE {?activity ep-activity:drillingContractor ?contractor . ?contractor ep-core:name ?contractorName}}" />
<rhswp:NameValuePair arg:name="NPD Rig Id:" arg:value="{= rhspin:npdId(?rig) }" />
<rhswp:NameValuePair arg:name="Date Well Complete:" arg:value="{= IF(bound(?completeDate), spif:dateFormat(?completeDate, 'yyyy-MM-dd'), ?unbound) }" />
......