David Leal

Minor fix

......@@ -20,24 +20,16 @@
<http://www.epim.no/schemas/mprml/1#A_Global-Objects>
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001m Create the ProductionReport - extract the report name from context/contextFacility"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
rdfs:comment "STEP 10010 Add the contextFacility - unless the contextFacility is the production facility"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "contextFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/geography#locatedWithin> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
[ sp:varName "productionFacility"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
......@@ -54,49 +46,79 @@
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spl:object ;
sp:arg1 [ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:arg2 <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText>
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:variable
[ sp:varName "normalizedContextFacilityName"^^xsd:string
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextFacility"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-mpr-spin-lib:buildProductionReportURI ;
sp:arg1 [ sp:varName "normalizedContextFacilityName"^^xsd:string
] ;
sp:arg2 [ sp:varName "intervalIdentifier"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextFacility"^^xsd:string
]
])
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
] ;
sp:variable
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001b Create the interval identifier - date and dateEnd from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
rdfs:comment "STEP 10020 Add the operator"^^xsd:string ;
sp:templates ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/facility#facilityOperator> ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/organization#Organization> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
[ sp:varName "operator"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
sp:where ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
......@@ -107,151 +129,102 @@
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "date"^^xsd:string
[ sp:varName "operatorRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#operatorRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
[ sp:varName "operatorRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
[ sp:varName "operator"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-mpr-spin-lib:buildIntervalIdentifier ;
sp:arg1 [ sp:varName "date"^^xsd:string
] ;
sp:arg2 [ sp:varName "dateEnd"^^xsd:string
]
] [ sp:object
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
] ;
sp:variable
[ sp:varName "intervalIdentifier"^^xsd:string
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001c Create the interval identifier - date from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
rdfs:comment "STEP 10001p Create the ProductionReport - unable to find an identifier"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
[ sp:varName "productionReport"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object <http://www.epim.no/schemas/mprml/1#RF_field> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject
[ sp:varName "contextFacilityRef"^^xsd:string
]
])
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001d Create the interval identifier - dateEnd from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "date"^^xsd:string
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
] [ sp:object
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
[ sp:varName "reportingFacility"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-mpr-spin-lib:buildProductionReportURI ;
sp:arg1 "" ;
sp:arg2 [ sp:varName "intervalIdentifier"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionReport"^^xsd:string
]
])
] ;
spin:rule
......@@ -321,54 +294,147 @@
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001r Set the submitting installation"^^xsd:string ;
sp:templates ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
rdfs:comment "STEP 10001e Create the interval identifier - no date"^^xsd:string ;
sp:templates ([ sp:object "noDate" ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001o Set the default production facility from context/contextFacility"^^xsd:string ;
sp:templates ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#ProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object
[ sp:varName "installation"^^xsd:string
[ sp:varName "productionFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
sp:subject _:b2
] [ sp:object
[ sp:varName "intervalStart"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject _:b2
] [ sp:object
[ sp:varName "intervalEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject _:b2
] [ sp:object
[ sp:varName "normalizedProductionFacilityName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText> ;
sp:subject spin:_this
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
]) ;
sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "intervalStart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "intervalEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
])
] [ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "installationRef"^^xsd:string
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "installationRef"^^xsd:string
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "installation"^^xsd:string
[ sp:varName "productionFacility"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spl:object ;
sp:arg1 [ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:arg2 <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText>
] ;
sp:variable
[ sp:varName "normalizedProductionFacilityName"^^xsd:string
]
])
] ;
......@@ -428,20 +494,22 @@
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10020 Add the operator"^^xsd:string ;
sp:templates ([ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/facility#facilityOperator> ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/organization#Organization> ;
sp:predicate rdf:type ;
sp:subject _:b2
rdfs:comment "STEP 10001c Create the interval identifier - date from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "operator"^^xsd:string
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b2
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
......@@ -454,49 +522,109 @@
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "operatorRef"^^xsd:string
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#operatorRef> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "operatorRef"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001m Create the ProductionReport - extract the report name from context/contextFacility"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "operator"^^xsd:string
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
]) ;
sp:where ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spl:object ;
sp:arg1 [ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:arg2 <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText>
] ;
sp:variable
[ sp:varName "normalizedContextFacilityName"^^xsd:string
]
] [ sp:object
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-mpr-spin-lib:buildProductionReportURI ;
sp:arg1 [ sp:varName "normalizedContextFacilityName"^^xsd:string
] ;
sp:arg2 [ sp:varName "intervalIdentifier"^^xsd:string
]
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
sp:subject
sp:variable
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001e Create the interval identifier - no date"^^xsd:string ;
sp:templates ([ sp:object "noDate" ;
rdfs:comment "STEP 10001d Create the interval identifier - dateEnd from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
......@@ -508,15 +636,13 @@
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "date"^^xsd:string
......@@ -539,21 +665,21 @@
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001o Set the default production facility from context/contextFacility"^^xsd:string ;
sp:templates ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#ProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
rdfs:comment "STEP 10001b Create the interval identifier - date and dateEnd from context"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "normalizedProductionFacilityName"^^xsd:string
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText> ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
]) ;
sp:where ([ sp:object
......@@ -567,74 +693,69 @@
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#date> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "dateStart"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateStart> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
])
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
[ sp:varName "dateEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#dateEnd> ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spl:object ;
sp:arg1 [ sp:varName "contextFacilityRef"^^xsd:string
[ rdf:type ep-mpr-spin-lib:buildIntervalIdentifier ;
sp:arg1 [ sp:varName "date"^^xsd:string
] ;
sp:arg2 <http://www.reportinghub.no/ep/transform/transform-helper-schema#hasDerivedText>
sp:arg2 [ sp:varName "dateEnd"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedProductionFacilityName"^^xsd:string
[ sp:varName "intervalIdentifier"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10010 Add the contextFacility - unless the contextFacility is the production facility"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "contextFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/geography#locatedWithin> ;
rdfs:comment "STEP 10001r Set the submitting installation"^^xsd:string ;
sp:templates ([ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
[ sp:varName "productionReport"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
sp:subject _:b3
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
[ sp:varName "installation"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b3
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
[ sp:varName "intervalStart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextFacility"^^xsd:string
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "contextFacility"^^xsd:string
]
])
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject _:b3
] [ sp:object
[ sp:varName "intervalEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject _:b3
]) ;
sp:where ([ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
......@@ -644,24 +765,41 @@
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "intervalStart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalStart> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "intervalEnd"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalEnd> ;
sp:subject spin:_this
])
] [ sp:object
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportSubmittedBy> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#TemporalPartOfAProductionFacility> ;
sp:predicate rdf:type ;
] [ sp:object
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFacility"^^xsd:string
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "temporalPartOfAProductionFacility"^^xsd:string
[ sp:varName "installation"^^xsd:string
]
])
] ;
......@@ -720,80 +858,9 @@
[ sp:varName "intervalIdentifier"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 10001p Create the ProductionReport - unable to find an identifier"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "intervalIdentifier"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#intervalIdentifier> ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "contextRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextRef> ;
sp:subject spin:_this
] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_report> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "contextFacilityRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#contextFacilityRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object <http://www.epim.no/schemas/mprml/1#RF_field> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject
[ sp:varName "contextFacilityRef"^^xsd:string
]
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:subject
[ sp:varName "contextRef"^^xsd:string
]
] [ sp:object
[ sp:varName "installationRef"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "reportingFacility"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-mpr-spin-lib:buildProductionReportURI ;
sp:arg1 "" ;
sp:arg2 [ sp:varName "intervalIdentifier"^^xsd:string
]
] ;
sp:variable
[ sp:varName "productionReport"^^xsd:string
]
])
] .
<http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-productionReport-v1.0>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/mpr/spin/1.1/lib> , <http://www.epim.no/schemas/mprml/1> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://www.reportinghub.no/ep/transform/transform-helper-schema> ;
owl:imports <http://www.reportinghub.no/ep/transform/transform-helper-schema> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://spinrdf.org/spin> , <http://www.epim.no/schemas/mprml/1> , <http://www.reportinghub.no/ep/mpr/spin/1.1/lib> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
......