David Price

Added to Flow All table

......@@ -4,12 +4,15 @@
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.reportinghub.no/ep/transform/transform-helper-schema
@prefix arg: <http://spinrdf.org/arg#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix mpr-tables: <http://www.reportinghub.no/ep/spin/mpr-tables#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rhspin: <http://www.reportinghub.no/spin/rh#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
......@@ -405,15 +408,18 @@ mpr-tables:ProductionFlowsAll
rdfs:subClassOf rhspin:MPRGTableTemplates ;
spin:body
[ rdf:type sp:Select ;
sp:orderBy ([ sp:varName "productionFlowFacilityName"^^xsd:string
] [ sp:varName "productionFlowPurposeTypeName"^^xsd:string
sp:orderBy ([ sp:varName "facilityName"^^xsd:string
] [ sp:varName "purposeTypeName"^^xsd:string
]) ;
sp:resultVariables ([ sp:varName "productionFlowFacilityName"^^xsd:string
] [ sp:varName "productionFlowPurposeTypeName"^^xsd:string
] [ sp:varName "productFlowMaterialTypeName"^^xsd:string
] [ sp:varName "productionFlowDefinitionTypeName"^^xsd:string
] [ sp:varName "productionFlowDefinitionSubTypeName"^^xsd:string
] [ sp:varName "productionFlowPartGrossOrNetTypeName"^^xsd:string
sp:resultVariables ([ sp:varName "facilityName"^^xsd:string
] [ sp:varName "purposeTypeName"^^xsd:string
] [ sp:varName "materialTypeName"^^xsd:string
] [ sp:varName "massValueString"^^xsd:string
] [ sp:varName "volumeValueString"^^xsd:string
] [ sp:varName "temperatureInCelcius"^^xsd:string
] [ sp:varName "definitionTypeName"^^xsd:string
] [ sp:varName "definitionSubTypeName"^^xsd:string
] [ sp:varName "grossOrNet"^^xsd:string
]) ;
sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
......@@ -457,7 +463,7 @@ mpr-tables:ProductionFlowsAll
[ sp:varName "productionFlowInReportingPeriod"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlow"^^xsd:string
[ sp:varName "productionFlowWhole"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
......@@ -466,17 +472,24 @@ mpr-tables:ProductionFlowsAll
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#WholeLifeProductionFlow> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlow"^^xsd:string
[ sp:varName "productionFlowWhole"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowMixedPart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
sp:subject
[ sp:varName "productionFlowWhole"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#flowIntoOrOutOf> ;
sp:subject
[ sp:varName "productionFlow"^^xsd:string
[ sp:varName "productionFlowWhole"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowFacilityName"^^xsd:string
[ sp:varName "facilityName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
......@@ -484,121 +497,278 @@ mpr-tables:ProductionFlowsAll
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowPurposeType"^^xsd:string
[ sp:varName "productionFlowMixedPart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "productFlowMixedPart"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowMixedPart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
sp:subject
[ sp:varName "productionFlowInReportingPeriod"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlow"^^xsd:string
[ sp:varName "productFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowPurposeType> ;
] [ sp:object
[ sp:varName "productFlowMixedPart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "flowDuringMonth"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#FlowDuringMonth> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPurposeType"^^xsd:string
[ sp:varName "flowDuringMonth"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowPurposeTypeName"^^xsd:string
[ sp:varName "flowDuringMonthMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
sp:subject
[ sp:varName "flowDuringMonth"^^xsd:string
]
] [ sp:object
[ sp:varName "materialQuantityValue"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "flowDuringMonthMaterial"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Mass> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialQuantityValue"^^xsd:string
]
] [ sp:object
[ sp:varName "materialValue"^^xsd:string
] ;
sp:predicate
[ sp:varName "materialProperty"^^xsd:string
] ;
sp:subject
[ sp:varName "materialQuantityValue"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialProperty"^^xsd:string
]
] [ sp:object
[ sp:varName "materialPropertyName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowPurposeType"^^xsd:string
[ sp:varName "materialProperty"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowPart"^^xsd:string
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 [ rdf:type spif:decimalFormat ;
arg:number
[ sp:varName "materialValue"^^xsd:string
] ;
arg:pattern "#.##"
] ;
sp:arg2 " " ;
sp:arg3 [ sp:varName "materialPropertyName"^^xsd:string
]
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
sp:variable
[ sp:varName "massValueString"^^xsd:string
]
] [ sp:object
[ sp:varName "flowDuringMonthMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "productionFlow"^^xsd:string
[ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowPartGrossOrNetTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productFlowMaterialType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterialType"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowMaterialTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productFlowMaterialType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowDefinitionType"^^xsd:string
[ sp:varName "temperature"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPart"^^xsd:string
[ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ;
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Temperature> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowDefinitionType"^^xsd:string
[ sp:varName "temperature"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowDefinitionTypeName"^^xsd:string
[ sp:varName "temperatureInCelcius"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#celsius> ;
sp:subject
[ sp:varName "productionFlowDefinitionType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFlowDefinitionSubTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
[ sp:varName "temperature"^^xsd:string
]
])
] [ sp:object
[ sp:varName "volume"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Volume> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "volume"^^xsd:string
]
] [ sp:object
[ sp:varName "volumeValue"^^xsd:string
] ;
sp:predicate
[ sp:varName "volumePredicate"^^xsd:string
] ;
sp:subject
[ sp:varName "volume"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "volumePredicate"^^xsd:string
]
] [ sp:object
[ sp:varName "volumeUnit"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "volumePredicate"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 [ rdf:type spif:decimalFormat ;
arg:number
[ sp:varName "volumeValue"^^xsd:string
] ;
arg:pattern "#.##"
] ;
sp:arg2 " " ;
sp:arg3 [ sp:varName "volumeUnit"^^xsd:string
]
] ;
sp:variable
[ sp:varName "volumeValueString"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowPurposeType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowWhole"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowPurposeType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPurposeType"^^xsd:string
]
] [ sp:object
[ sp:varName "purposeTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowPurposeType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
]
] [ sp:object
[ sp:varName "grossOrNet"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productFlowMaterialType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterialType"^^xsd:string
]
] [ sp:object
[ sp:varName "materialTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productFlowMaterialType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowDefinitionType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowDefinitionType"^^xsd:string
]
] [ sp:object
[ sp:varName "definitionTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowDefinitionType"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
]
] [ sp:object
[ sp:varName "definitionSubTypeName"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "productionFlowDefinitionSubType"^^xsd:string
]
])
])
] ;
rhspin:tableHeaders ("Facility"^^xsd:string "Purpose"^^xsd:string "Material"^^xsd:string "Flow type"^^xsd:string "Flow subtype"^^xsd:string "Gross/Net"^^xsd:string) .
rhspin:tableHeaders ("Facility"^^xsd:string "Purpose"^^xsd:string "Material"^^xsd:string "Mass"^^xsd:string "Volume"^^xsd:string "Temperature C"^^xsd:string "Flow type"^^xsd:string "Flow subtype"^^xsd:string "Gross/Net"^^xsd:string) .
mpr-tables:ProductionInventory
rdf:type rhspin:TableTemplate ;
......