David Price

Got productFlowMass, productFlowDensity and productFlowVolume magic properties working

......@@ -2551,111 +2551,31 @@ mpr-tables:ProductionSales
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowInMonthMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
sp:subject
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterial> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowInMonthMaterial"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowInMonthMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "quantityofmaterialinaspecifiedstate"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterialInASpecifiedState> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "quantityofmaterialinaspecifiedstate"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "materialMass"^^xsd:string
[ sp:varName "massValueString"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowInMonthMaterial"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Mass> ;
sp:predicate rdf:type ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#productFlowMass> ;
sp:subject
[ sp:varName "materialMass"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "materialMass"^^xsd:string
]
] ;
sp:variable
[ sp:varName "massValueString"^^xsd:string
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "quantityofmaterialinaspecifiedstate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "stateOfMaterialThatFlowsInPeriodVolume"^^xsd:string
]
] [ sp:object
[ sp:varName "stateVolume"^^xsd:string
[ sp:varName "volumeValueString"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "stateOfMaterialThatFlowsInPeriodVolume"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Volume> ;
sp:predicate rdf:type ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#productFlowVolume> ;
sp:subject
[ sp:varName "stateVolume"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "stateVolume"^^xsd:string
]
] ;
sp:variable
[ sp:varName "volumeValueString"^^xsd:string
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
])
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "productFlowInMonthMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "stateOfMaterialThatFlowsInPeriodDensity"^^xsd:string
]
] [ sp:object
[ sp:varName "stateDensity"^^xsd:string
[ sp:varName "densityValueString"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "stateOfMaterialThatFlowsInPeriodDensity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Density> ;
sp:predicate rdf:type ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#productFlowDensity> ;
sp:subject
[ sp:varName "stateDensity"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "stateDensity"^^xsd:string
]
] ;
sp:variable
[ sp:varName "densityValueString"^^xsd:string
[ sp:varName "productionFlowMixedPart"^^xsd:string
]
])
] [ sp:object
......
......@@ -4,6 +4,7 @@
# imports: http://www.reportinghub.no/ep/schema/1.0/production
@prefix ep-report: <http://www.reportinghub.no/ep/schema/report#> .
@prefix ep-spin-lib: <http://www.reportinghub.no/ep/spin/lib#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix prod-property: <http://www.reportinghub.no/ep/spin/prod-property#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
......@@ -104,6 +105,185 @@
] ;
spin:returnType xsd:string .
<http://www.reportinghub.no/ep/schema/flow#productFlowDensity>
rdf:type spin:MagicProperty , owl:DatatypeProperty ;
rdfs:domain <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
rdfs:label "product flow density"^^xsd:string ;
rdfs:range xsd:string ;
rdfs:subClassOf spin:MagicProperties ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "densityValueString"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "productFlowMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
sp:subject spin:_arg1
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterial> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterial"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "materialWithDensity"^^xsd:string
]
] [ sp:object
[ sp:varName "density"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialWithDensity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Density> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "density"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "density"^^xsd:string
]
] ;
sp:variable
[ sp:varName "densityValueString"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "the product flow that has mass"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType <http://www.reportinghub.no/ep/schema/flow#ProductFlow>
] ;
spin:returnType xsd:string .
<http://www.reportinghub.no/ep/schema/flow#productFlowMass>
rdf:type spin:MagicProperty , owl:DatatypeProperty ;
rdfs:domain <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
rdfs:label "product flow mass"^^xsd:string ;
rdfs:range xsd:string ;
rdfs:subClassOf spin:MagicProperties ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "massValueString"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "productFlowMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
sp:subject spin:_arg1
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterial> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterial"^^xsd:string
]
] [ sp:object
[ sp:varName "materialMass"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterial"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Mass> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialMass"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "materialMass"^^xsd:string
]
] ;
sp:variable
[ sp:varName "massValueString"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "the product flow that has mass"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType <http://www.reportinghub.no/ep/schema/flow#ProductFlow>
] ;
spin:returnType xsd:string .
<http://www.reportinghub.no/ep/schema/flow#productFlowVolume>
rdf:type spin:MagicProperty , owl:DatatypeProperty ;
rdfs:domain <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
rdfs:label "product flow volume"^^xsd:string ;
rdfs:range xsd:string ;
rdfs:subClassOf spin:MagicProperties ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "volumeValueString"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "productFlowMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
sp:subject spin:_arg1
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterial> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productFlowMaterial"^^xsd:string
]
] [ sp:object
[ sp:varName "productFlowMaterial"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "materialInState"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/material#QuantityOfMaterialInASpecifiedState> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialInState"^^xsd:string
]
] [ sp:object
[ sp:varName "materialInState"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "materialWithVolume"^^xsd:string
]
] [ sp:object
[ sp:varName "volume"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "materialWithVolume"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Volume> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "volume"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizePropertyUnitAndValue ;
sp:arg1 [ sp:varName "volume"^^xsd:string
]
] ;
sp:variable
[ sp:varName "volumeValueString"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "the product flow that has mass"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType <http://www.reportinghub.no/ep/schema/flow#ProductFlow>
] ;
spin:returnType xsd:string .
<http://www.reportinghub.no/ep/schema/flow#reportedFlowMaterial>
rdf:type spin:MagicProperty , owl:ObjectProperty ;
rdfs:domain <http://www.reportinghub.no/ep/schema/flow#ProductionFlow> ;
......