David Leal

New function in DPR-lib.

......@@ -20,7 +20,7 @@
<http://www.reportinghub.no/ep/dpr/spin/1.1/lib>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/production-core> , <http://www.witsml.org/schemas/131/addendum/combo> , <http://www.reportinghub.no/ep/schema/1.0/production> , <http://spinrdf.org/spin> ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/production> , <http://www.witsml.org/schemas/131/addendum/combo> , <http://www.reportinghub.no/ep/schema/1.0/production-core> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
ep-dpr-spin-lib:BuildDailyProductionReportURI
......@@ -197,6 +197,29 @@ arg3 is end date"""^^xsd:string ;
])
] .
ep-dpr-spin-lib:buildDailyProductionReportURI
rdf:type spin:Function ;
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
rdfs:comment """arg1 is the name of the report
arg2 is the report date"""^^xsd:string ;
sp:resultVariables ([ sp:varName "uri"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildURI ;
sp:arg1 "https://www.reportinghub.no/ep/data/dailyProductionReport/" ;
sp:arg2 spin:_arg1 ;
sp:arg3 "$" ;
sp:arg4 spin:_arg2
] ;
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] .
ep-dpr-spin-lib:buildFacilityURI
rdf:type spin:Function ;
rdfs:subClassOf ep-dpr-spin-lib:Function ;
......@@ -4001,6 +4024,78 @@ ep-dpr-spin-lib:selectProductType
])
] .
ep-dpr-spin-lib:selectProductionActivityType
rdf:type spin:Function ;
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "productionActivityType"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_production>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/activity#ProductionActivity> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_maintenance>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#MaintenanceActivity> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_powerstationfailure>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#PowerStationFailure> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_deviations>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#Deviation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_airtraffic>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#AirTrafficOperation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_construction>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#ConstructionOperation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_well>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/activity#WellOperation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_other>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#OtherProductionActivity> ;
sp:arg3 <http://www.reportinghub.no/ep/schema/activity#ProductionActivity>
]
]
]
]
]
]
]
] ;
sp:variable
[ sp:varName "productionActivityType"^^xsd:string
]
])
] .
ep-dpr-spin-lib:selectProductionFacilityType
rdf:type spin:Function ;
rdfs:label "select ProductionFacilityType"^^xsd:string ;
......@@ -4477,68 +4572,6 @@ ep-dpr-spin-lib:selectProductionFlowPurposeType
])
] .
ep-dpr-spin-lib:selectProductionOperationPartType
rdf:type spin:Function ;
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b28) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_production>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/activity#ProductionActivity> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_maintenance>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#MaintenanceActivity> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_powerstationfailure>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#PowerStationFailure> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_deviations>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#Deviation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_airtraffic>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#AirTrafficOperation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#OK_construction>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/production-activity#ConstructionOperation> ;
sp:arg3 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 spin:_arg1 ;
sp:arg2 <http://www.witsml.org/schemas/131/addendum/combo#TU_s>
] ;
sp:arg2 <http://www.reportinghub.no/ep/schema/core#second> ;
sp:arg3 <http://www.reportinghub.no/ep/schema/production-activity#PartOfProductionActivity>
]
]
]
]
]
]
] ;
sp:variable _:b28
])
] .
ep-dpr-spin-lib:selectProductivityIndexScale
rdf:type spin:Function ;
rdfs:subClassOf ep-dpr-spin-lib:Function ;
......@@ -4638,7 +4671,7 @@ ep-dpr-spin-lib:selectRelationshipToMeasure
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b29) ;
sp:resultVariables (_:b28) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -4712,7 +4745,7 @@ ep-dpr-spin-lib:selectRelationshipToMeasure
]
]
] ;
sp:variable _:b29
sp:variable _:b28
])
] .
......@@ -4721,7 +4754,7 @@ ep-dpr-spin-lib:selectSafetyActivityType
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b30) ;
sp:resultVariables (_:b29) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -4865,7 +4898,7 @@ ep-dpr-spin-lib:selectSafetyActivityType
]
]
] ;
sp:variable _:b30
sp:variable _:b29
])
] .
......@@ -4875,7 +4908,7 @@ ep-dpr-spin-lib:selectSpecificVolumeScale
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b31) ;
sp:resultVariables (_:b30) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -4886,7 +4919,7 @@ ep-dpr-spin-lib:selectSpecificVolumeScale
sp:arg2 <http://www.reportinghub.no/ep/schema/core#fractionByVolume> ;
sp:arg3 <http://www.reportinghub.no/ep/schema/core#undefinedScale>
] ;
sp:variable _:b31
sp:variable _:b30
])
] .
......@@ -4896,7 +4929,7 @@ ep-dpr-spin-lib:selectTemperatureScale
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b32) ;
sp:resultVariables (_:b31) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -4914,7 +4947,7 @@ ep-dpr-spin-lib:selectTemperatureScale
sp:arg3 <http://www.reportinghub.no/ep/schema/core#undefinedScale>
]
] ;
sp:variable _:b32
sp:variable _:b31
])
] .
......@@ -4924,7 +4957,7 @@ ep-dpr-spin-lib:selectTemporalPartOfAFlowDurationType
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b33) ;
sp:resultVariables (_:b32) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -4998,7 +5031,7 @@ ep-dpr-spin-lib:selectTemporalPartOfAFlowDurationType
]
]
] ;
sp:variable _:b33
sp:variable _:b32
])
] .
......@@ -5007,7 +5040,7 @@ ep-dpr-spin-lib:selectTemporalPartOfActivityDurationType
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b34) ;
sp:resultVariables (_:b33) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -5081,7 +5114,7 @@ ep-dpr-spin-lib:selectTemporalPartOfActivityDurationType
]
]
] ;
sp:variable _:b34
sp:variable _:b33
])
] .
......@@ -5091,7 +5124,7 @@ ep-dpr-spin-lib:selectVolumeAtStandardTemperaturePressureType
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b35) ;
sp:resultVariables (_:b34) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -5116,7 +5149,7 @@ ep-dpr-spin-lib:selectVolumeAtStandardTemperaturePressureType
]
]
] ;
sp:variable _:b35
sp:variable _:b34
])
] .
......@@ -5126,7 +5159,7 @@ ep-dpr-spin-lib:selectVolumeFlowRateAtStandardTemperaturePressureType
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b36) ;
sp:resultVariables (_:b35) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -5151,7 +5184,7 @@ ep-dpr-spin-lib:selectVolumeFlowRateAtStandardTemperaturePressureType
]
]
] ;
sp:variable _:b36
sp:variable _:b35
])
] .
......@@ -5161,7 +5194,7 @@ ep-dpr-spin-lib:selectVolumeFlowRateScale
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b37) ;
sp:resultVariables (_:b36) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -5186,7 +5219,7 @@ ep-dpr-spin-lib:selectVolumeFlowRateScale
]
]
] ;
sp:variable _:b37
sp:variable _:b36
])
] .
......@@ -5196,7 +5229,7 @@ ep-dpr-spin-lib:selectVolumeScale
rdfs:subClassOf ep-dpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b38) ;
sp:resultVariables (_:b37) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -5424,7 +5457,7 @@ ep-dpr-spin-lib:selectVolumeScale
]
]
] ;
sp:variable _:b38
sp:variable _:b37
])
] .
......@@ -5480,54 +5513,6 @@ ep-dpr-spin-lib:selectWellTestReasonType
])
] .
_:b38
sp:varName "volumeScale"^^xsd:string .
_:b37
sp:varName "volumeFlowRateScale"^^xsd:string .
_:b36
sp:varName "volumeFlowRateAtStdType"^^xsd:string .
_:b35
sp:varName "volumeAtStdType"^^xsd:string .
_:b34
sp:varName "prodActType"^^xsd:string .
_:b33
sp:varName "temporalPartOfAFlowDurationType"^^xsd:string .
_:b32
sp:varName "temperatureScale"^^xsd:string .
_:b31
sp:varName "specificVolumeScale"^^xsd:string .
_:b30
sp:varName "safetyActivityType"^^xsd:string .
_:b29
sp:varName "relationshipToMeasure"^^xsd:string .
_:b28
sp:varName "popType"^^xsd:string .
_:b27
sp:varName "productionFlowPurposeType"^^xsd:string .
_:b26
sp:varName "productionFlowDirectionRelationshipType"^^xsd:string .
_:b25
sp:varName "productionFlowDirectionRelationshipType"^^xsd:string .
_:b24
sp:varName "productionFlowDefinitionType"^^xsd:string .
_:b23
sp:varName "productionFacilityType"^^xsd:string .
_:b22
sp:varName "productType"^^xsd:string .
......@@ -5584,3 +5569,48 @@ _:b3 sp:varName "UUID"^^xsd:string .
_:b2 sp:varName "uri"^^xsd:string .
_:b1 sp:varName "uri"^^xsd:string .
_:b27
sp:varName "productionFlowPurposeType"^^xsd:string .
_:b26
sp:varName "productionFlowDirectionRelationshipType"^^xsd:string .
_:b25
sp:varName "productionFlowDirectionRelationshipType"^^xsd:string .
_:b24
sp:varName "productionFlowDefinitionType"^^xsd:string .
_:b28
sp:varName "relationshipToMeasure"^^xsd:string .
_:b23
sp:varName "productionFacilityType"^^xsd:string .
_:b29
sp:varName "safetyActivityType"^^xsd:string .
_:b30
sp:varName "specificVolumeScale"^^xsd:string .
_:b31
sp:varName "temperatureScale"^^xsd:string .
_:b32
sp:varName "temporalPartOfAFlowDurationType"^^xsd:string .
_:b33
sp:varName "prodActType"^^xsd:string .
_:b34
sp:varName "volumeAtStdType"^^xsd:string .
_:b35
sp:varName "volumeFlowRateAtStdType"^^xsd:string .
_:b36
sp:varName "volumeFlowRateScale"^^xsd:string .
_:b37
sp:varName "volumeScale"^^xsd:string .
......
......@@ -21,152 +21,112 @@
<http://www.reportinghub.no/ep/transform/1.0/dpr/dailyProductionActivity>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/production-well> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/production-core> , <http://www.witsml.org/schemas/131/addendum/combo> , <http://spinrdf.org/spin> ;
owl:imports <http://spinrdf.org/spin> , <http://www.witsml.org/schemas/131/addendum/combo> , <http://www.reportinghub.no/ep/schema/1.0/production-core> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://www.reportinghub.no/ep/schema/1.0/production-well> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
<http://www.witsml.org/schemas/131/addendum/combo#A_Global-WITSMLComposite>
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10003 Set the overall daily activity installation and its operator"^^xsd:string ;
sp:templates ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-activity#productionOperator> ;
rdfs:comment "STEP 10001 Create the DailyProductionReport"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/organization#Company> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object <http://www.reportinghub.no/np/schema/npd#OperatingCompany> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "operatorName"^^xsd:string
[ sp:varName "docName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-activity#onProductionFacility> ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object
[ sp:varName "productionInstallation"^^xsd:string
[ sp:varName "docDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#ProductionFacility> ;
sp:predicate rdf:type ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-report#dateCoveredByReport> ;
sp:subject
[ sp:varName "productionInstallation"^^xsd:string
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "productionInstallationType"^^xsd:string
[ sp:varName "fileCreationDate"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionInstallation"^^xsd:string
]
]) ;
sp:where ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "dailyProductionActivity"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "productionOperationSetRef"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "documentInfoRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productionOperationSetRef> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentInfoRef> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "productionOperationRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productionOperationRef> ;
sp:subject
[ sp:varName "productionOperationSetRef"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "installationRef"^^xsd:string
[ sp:varName "documentNameRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#installationRef> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentNameRef> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
[ sp:varName "documentInfoRef"^^xsd:string
]
] [ sp:object
[ sp:varName "installationName"^^xsd:string
[ sp:varName "documentName"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject
[ sp:varName "installationRef"^^xsd:string
[ sp:varName "documentNameRef"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "installationKind"^^xsd:string
] [ sp:object
[ sp:varName "documentDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentDate> ;
sp:subject
[ sp:varName "installationRef"^^xsd:string
[ sp:varName "documentInfoRef"^^xsd:string
]
])
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "operator"^^xsd:string
[ sp:varName "fileCreationInformationRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#operatorRef> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#fileCreationInformationRef> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
[ sp:varName "documentInfoRe"^^xsd:string
]
] [ sp:object
[ sp:varName "operatorName"^^xsd:string
[ sp:varName "fileCreationDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#fileCreationDate> ;
sp:subject
[ sp:varName "operator"^^xsd:string
[ sp:varName "fileCreationInformationRef"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "installationName"^^xsd:string
sp:arg1 [ sp:varName "documentName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedInstallationName"^^xsd:string
[ sp:varName "normalizedDocumentName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-dpr-spin-lib:buildProductionFacilityURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
]
[ rdf:type ep-dpr-spin-lib:buildDailyProductionReportURI ;
sp:arg1 [ sp:varName "normalizedDocumentName"^^xsd:string
] ;
sp:variable
[ sp:varName "productionInstallation"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-dpr-spin-lib:selectProductionFacilityType ;
sp:arg1 [ sp:varName "installationKind"^^xsd:string
sp:arg2 [ sp:varName "documentDate"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionInstallationType"^^xsd:string
[ sp:varName "dailyProductionReport"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 10002b Create the DailyProductionActivity - start and end dates
rdfs:comment """STEP 10002a Create the DailyProductionActivity - start and end date-times
The DPR transform will fall in a heap unless productionOperation/installationRef is supplied. The XML schema says it is optional."""^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "dailyProductionActivity"^^xsd:string
......@@ -181,14 +141,14 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "startDate"^^xsd:string
[ sp:varName "startDateTime"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "endDate"^^xsd:string
[ sp:varName "endDateTime"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -200,7 +160,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "annualProductionActivityToDate"^^xsd:string
]
] [ sp:object
[ sp:varName "endDate"^^xsd:string
[ sp:varName "endDateTime"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -219,7 +179,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "endDate"^^xsd:string
[ sp:varName "endDateTime"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -272,16 +232,16 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "installationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "startDate"^^xsd:string
[ sp:varName "startDateTime"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dateStart> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dTimStart> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "endDate"^^xsd:string
[ sp:varName "endDateTime"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dateEnd> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dTimEnd> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
......@@ -301,7 +261,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
] ;
sp:arg2 [ sp:varName "startDateTime"^^xsd:string
] ;
sp:arg3 [ sp:varName "endDate"^^xsd:string
sp:arg3 [ sp:varName "endDateTime"^^xsd:string
]
] ;
sp:variable
......@@ -312,7 +272,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ rdf:type ep-dpr-spin-lib:buildAnnualProductionActivityToEndOfPeriodURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
] ;
sp:arg2 [ sp:varName "endDate"^^xsd:string
sp:arg2 [ sp:varName "endDateTime"^^xsd:string
]
] ;
sp:variable
......@@ -323,7 +283,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ rdf:type ep-dpr-spin-lib:buildProductionActivityToDateURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
] ;
sp:arg2 [ sp:varName "endDate"^^xsd:string
sp:arg2 [ sp:varName "endDateTime"^^xsd:string
]
] ;
sp:variable
......@@ -333,106 +293,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001 Create the DailyProductionReport"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "docName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "docDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-report#dateCoveredByReport> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "fileCreationDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "documentInfoRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentInfoRef> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "documentNameRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentNameRef> ;
sp:subject
[ sp:varName "documentInfoRef"^^xsd:string
]
] [ sp:object
[ sp:varName "documentName"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject
[ sp:varName "documentNameRef"^^xsd:string
]
] [ sp:object
[ sp:varName "documentDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#documentDate> ;
sp:subject
[ sp:varName "documentInfoRef"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "fileCreationInformationRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#fileCreationInformationRef> ;
sp:subject
[ sp:varName "documentInfoRe"^^xsd:string
]
] [ sp:object
[ sp:varName "fileCreationDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#fileCreationDate> ;
sp:subject
[ sp:varName "fileCreationInformationRef"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "documentName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedDocumentName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyProductionReportURI ;
sp:arg1 [ sp:varName "normalizedDocumentName"^^xsd:string
] ;
sp:arg2 [ sp:varName "documentDate"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyProductionReport"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 10002a Create the DailyProductionActivity - start and end date-times
rdfs:comment """STEP 10002b Create the DailyProductionActivity - start and end dates
The DPR transform will fall in a heap unless productionOperation/installationRef is supplied. The XML schema says it is optional."""^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "dailyProductionActivity"^^xsd:string
......@@ -447,14 +308,14 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "startDateTime"^^xsd:string
[ sp:varName "startDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "endDateTime"^^xsd:string
[ sp:varName "endDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -466,7 +327,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "annualProductionActivityToDate"^^xsd:string
]
] [ sp:object
[ sp:varName "endDateTime"^^xsd:string
[ sp:varName "endDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -485,7 +346,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "endDateTime"^^xsd:string
[ sp:varName "endDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject
......@@ -538,16 +399,16 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ sp:varName "installationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "startDateTime"^^xsd:string
[ sp:varName "startDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dTimStart> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dateStart> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "endDateTime"^^xsd:string
[ sp:varName "endDate"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dTimEnd> ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dateEnd> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
......@@ -567,7 +428,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
] ;
sp:arg2 [ sp:varName "startDateTime"^^xsd:string
] ;
sp:arg3 [ sp:varName "endDateTime"^^xsd:string
sp:arg3 [ sp:varName "endDate"^^xsd:string
]
] ;
sp:variable
......@@ -578,7 +439,7 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ rdf:type ep-dpr-spin-lib:buildAnnualProductionActivityToEndOfPeriodURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
] ;
sp:arg2 [ sp:varName "endDateTime"^^xsd:string
sp:arg2 [ sp:varName "endDate"^^xsd:string
]
] ;
sp:variable
......@@ -589,11 +450,150 @@ The DPR transform will fall in a heap unless productionOperation/installationRef
[ rdf:type ep-dpr-spin-lib:buildProductionActivityToDateURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
] ;
sp:arg2 [ sp:varName "endDateTime"^^xsd:string
sp:arg2 [ sp:varName "endDate"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionActivityToDate"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10003 Set the overall daily activity installation and its operator"^^xsd:string ;
sp:templates ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-activity#productionOperator> ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/organization#Company> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object <http://www.reportinghub.no/np/schema/npd#OperatingCompany> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "operatorName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-activity#onProductionFacility> ;
sp:subject
[ sp:varName "dailyProductionActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object
[ sp:varName "productionInstallation"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#ProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionInstallation"^^xsd:string
]
] [ sp:object
[ sp:varName "productionInstallationType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionInstallation"^^xsd:string
]
]) ;
sp:where ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "dailyProductionActivity"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "dailyProductionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "productionOperationSetRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productionOperationSetRef> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "productionOperationRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productionOperationRef> ;
sp:subject
[ sp:varName "productionOperationSetRef"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#installationRef> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "installationName"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject
[ sp:varName "installationRef"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "installationKind"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
sp:subject
[ sp:varName "installationRef"^^xsd:string
]
])
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "operator"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#operatorRef> ;
sp:subject
[ sp:varName "productionOperationRef"^^xsd:string
]
] [ sp:object
[ sp:varName "operatorName"^^xsd:string
] ;
sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
sp:subject
[ sp:varName "operator"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "installationName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedInstallationName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-dpr-spin-lib:buildProductionFacilityURI ;
sp:arg1 [ sp:varName "normalizedInstallationName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionInstallation"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-dpr-spin-lib:selectProductionFacilityType ;
sp:arg1 [ sp:varName "installationKind"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionInstallationType"^^xsd:string
]
])
] .
......