Holger Knublauch

Formatting XML broke white space handling, removed Platform constraints

Showing 16 changed files with 4854 additions and 4711 deletions
......@@ -3,501 +3,633 @@
# imports: http://www.epim.no/schemas/mprml/1
# imports: http://www.reportinghub.no/spin/rh
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix mpr-proxy-constraints: <http://www.reportinghub.no/ep/spin/mpr-proxy-constraints#> .
@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 spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
arg:kindRef
rdf:type rdf:Property ;
rdfs:label "kind ref"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://www.epim.no/schemas/mprml/1#Cs_businessAssociate>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#name> ;
sp:subject spin:_this
] [ rdf:type sp:TriplePath ;
sp:object "Operating Company" ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.epim.no/schemas/mprml/1#roleRef> ;
sp:path2 <http://www.linkedmodel.org/schema/dtype#value>
] ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyWithName ;
arg:name
[ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "company"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "company"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Invalid company name " ;
sp:arg2 [ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] .
<http://www.epim.no/schemas/mprml/1#FacilityIdentifierStruct>
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Platform>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Platform>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Platform>
] ;
spin:constraint
[ rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore>
] .
<http://www.epim.no/schemas/mprml/1#Obj_productVolume>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b2
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.epim.no/schemas/mprml/1#nameRef> ;
sp:path2 <http://www.linkedmodel.org/schema/dtype#value>
] ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualByName ;
arg:name
[ sp:varName "name"^^xsd:string
] ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field>
] ;
sp:variable
[ sp:varName "field"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "field"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Invalid Field name " ;
sp:arg2 [ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] .
<http://www.epim.no/schemas/mprml/1#Obj_report>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b3
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b3
]) ;
sp:where ([ sp:object
[ sp:varName "installation"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:subject spin:_this
] [ 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 "installation"^^xsd:string
]
] [ sp:object
[ sp:varName "fieldName"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject
[ sp:varName "installation"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type rhspin:currentUserIsOperatorOfFieldWithName ;
arg:fieldName
[ sp:varName "fieldName"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Your company is not the operator of field with name " ;
sp:arg2 [ sp:varName "fieldName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] .
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Collection of constraints that are executed on the SXML proxy ontology for MPR schema based reports."^^xsd:string ;
owl:imports <http://spinrdf.org/spin> , <http://www.epim.no/schemas/mprml/1> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string .
mpr-proxy-constraints:CheckId
rdf:type spin:ConstructTemplate ;
rdfs:label "Check id"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
spin:body
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b4
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b4
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this
] [ sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#uidRefValue> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualById ;
arg:id [ sp:varName "id"^^xsd:string
] ;
arg:type
[ sp:varName "type"^^xsd:string
]
] ;
sp:variable
[ sp:varName "npd"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "npd"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "[RH-19] Invalid " ;
sp:arg2 [ rdf:type afn:localname ;
sp:arg1 [ sp:varName "type"^^xsd:string
]
] ;
sp:arg3 " id " ;
sp:arg4 [ sp:varName "id"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] ;
spin:labelTemplate "Must be NPD id of {?type}/{?kindRef}"^^xsd:string .
mpr-proxy-constraints:CheckIdAndNameMatch
rdf:type spin:ConstructTemplate ;
rdfs:label "NPD id and name must match"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
spin:body
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b5
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b5
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this
] [ sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#uidRefValue> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualById ;
arg:id [ sp:varName "id"^^xsd:string
] ;
arg:type
[ sp:varName "type"^^xsd:string
]
] ;
sp:variable
[ sp:varName "byId"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualByName ;
arg:name
[ sp:varName "name"^^xsd:string
] ;
arg:type
[ sp:varName "type"^^xsd:string
]
] ;
sp:variable
[ sp:varName "byName"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:and ;
sp:arg1 [ rdf:type sp:or ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "byId"^^xsd:string
]
] ;
sp:arg2 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "byName"^^xsd:string
]
]
] ;
sp:arg2 [ rdf:type sp:ne ;
sp:arg1 [ sp:varName "byId"^^xsd:string
] ;
sp:arg2 [ sp:varName "byName"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "[RH-19] Mismatching " ;
sp:arg2 [ rdf:type afn:localname ;
sp:arg1 [ sp:varName "type"^^xsd:string
]
] ;
sp:arg3 " id: " ;
sp:arg4 [ sp:varName "id"^^xsd:string
] ;
sp:arg5 " is not the NPD id of " ;
sp:arg6 [ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] ;
spin:labelTemplate "NPD name and id of {?type}/{?kindRef} must match"^^xsd:string .
mpr-proxy-constraints:CheckName
rdf:type spin:ConstructTemplate ;
rdfs:label "Check name"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
spin:body
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b6
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b6
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this
] [ sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualByName ;
arg:name
[ sp:varName "name"^^xsd:string
] ;
arg:type
[ sp:varName "type"^^xsd:string
]
] ;
sp:variable
[ sp:varName "npd"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "npd"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 [ rdf:type sp:add ;
sp:arg1 "[RH-19] Invalid " ;
sp:arg2 [ rdf:type afn:localname ;
sp:arg1 [ sp:varName "type"^^xsd:string
]
]
] ;
sp:arg2 " name " ;
sp:arg3 [ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] ;
spin:labelTemplate "Must be NPD name of {?type}/{?kindRef}"^^xsd:string .
mpr-proxy-constraints:ConstraintTemplates
rdf:type spin:ConstructTemplate ;
rdfs:label "Constraint templates"^^xsd:string ;
rdfs:subClassOf spin:ConstructTemplates ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The kind reference value."^^xsd:string ;
spl:predicate arg:kindRef ;
spl:valueType <http://www.epim.no/schemas/mprml/1#ReportingFacility>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD type that the individual needs to have."^^xsd:string ;
spl:predicate arg:type ;
spl:valueType rdfs:Class
] .
# c14n-version: 3
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix mpr-proxy-constraints: <http://www.reportinghub.no/ep/spin/mpr-proxy-constraints#> .
@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 spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
arg:kindRef
rdf:type rdf:Property ;
rdfs:label "kind ref"^^xsd:string ;
rdfs:subPropertyOf sp:arg ;
.
<http://www.epim.no/schemas/mprml/1#Cs_businessAssociate>
spin:constraint [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b46474 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b46474 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "name"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#name> ;
sp:subject spin:_this ;
]
[
rdf:type sp:TriplePath ;
sp:object "Operating Company" ;
sp:path [
rdf:type sp:SeqPath ;
sp:path1 <http://www.epim.no/schemas/mprml/1#roleRef> ;
sp:path2 <http://www.linkedmodel.org/schema/dtype#value> ;
] ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:companyWithName ;
arg:name [
sp:varName "name"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "company"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:not ;
sp:arg1 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "company"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 "Invalid company name " ;
sp:arg2 [
sp:varName "name"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
.
<http://www.epim.no/schemas/mprml/1#FacilityIdentifierStruct>
spin:constraint [
rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Platform> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckIdAndNameMatch ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_field> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_terminal> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Facility> ;
] ;
spin:constraint [
rdf:type mpr-proxy-constraints:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_wellbore> ;
arg:type <http://www.reportinghub.no/ep/schema/well#WellBore> ;
] ;
.
<http://www.epim.no/schemas/mprml/1#Obj_productVolume>
spin:constraint [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b3901 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b3901 ;
]
) ;
sp:where (
[
rdf:type sp:TriplePath ;
sp:object [
sp:varName "name"^^xsd:string ;
] ;
sp:path [
rdf:type sp:SeqPath ;
sp:path1 <http://www.epim.no/schemas/mprml/1#nameRef> ;
sp:path2 <http://www.linkedmodel.org/schema/dtype#value> ;
] ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualByName ;
arg:name [
sp:varName "name"^^xsd:string ;
] ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field> ;
] ;
sp:variable [
sp:varName "field"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:not ;
sp:arg1 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "field"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 "Invalid Field name " ;
sp:arg2 [
sp:varName "name"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
.
<http://www.epim.no/schemas/mprml/1#Obj_report>
spin:constraint [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b384 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b384 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "installation"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#installationRef> ;
sp:subject spin:_this ;
]
[
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 "installation"^^xsd:string ;
] ;
]
[
sp:object [
sp:varName "fieldName"^^xsd:string ;
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject [
sp:varName "installation"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:not ;
sp:arg1 [
rdf:type rhspin:currentUserIsOperatorOfFieldWithName ;
arg:fieldName [
sp:varName "fieldName"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 "Your company is not the operator of field with name " ;
sp:arg2 [
sp:varName "fieldName"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
.
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Collection of constraints that are executed on the SXML proxy ontology for MPR schema based reports."^^xsd:string ;
owl:imports <http://spinrdf.org/spin> ;
owl:imports <http://www.epim.no/schemas/mprml/1> ;
owl:imports <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string ;
.
mpr-proxy-constraints:CheckId
rdf:type spin:ConstructTemplate ;
spin:body [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b63838 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b63838 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "kindRef"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this ;
]
[
sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this ;
]
[
sp:object [
sp:varName "id"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#uidRefValue> ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualById ;
arg:id [
sp:varName "id"^^xsd:string ;
] ;
arg:type [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "npd"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:not ;
sp:arg1 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "npd"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 "[RH-19] Invalid " ;
sp:arg2 [
rdf:type afn:localname ;
sp:arg1 [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:arg3 " id " ;
sp:arg4 [
sp:varName "id"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
spin:labelTemplate "Must be NPD id of {?type}/{?kindRef}"^^xsd:string ;
rdfs:label "Check id"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
.
mpr-proxy-constraints:CheckIdAndNameMatch
rdf:type spin:ConstructTemplate ;
spin:body [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b30672 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b30672 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "kindRef"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this ;
]
[
sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this ;
]
[
sp:object [
sp:varName "name"^^xsd:string ;
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this ;
]
[
sp:object [
sp:varName "id"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#uidRefValue> ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualById ;
arg:id [
sp:varName "id"^^xsd:string ;
] ;
arg:type [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "byId"^^xsd:string ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualByName ;
arg:name [
sp:varName "name"^^xsd:string ;
] ;
arg:type [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "byName"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:and ;
sp:arg1 [
rdf:type sp:or ;
sp:arg1 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "byId"^^xsd:string ;
] ;
] ;
sp:arg2 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "byName"^^xsd:string ;
] ;
] ;
] ;
sp:arg2 [
rdf:type sp:ne ;
sp:arg1 [
sp:varName "byId"^^xsd:string ;
] ;
sp:arg2 [
sp:varName "byName"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 "[RH-19] Mismatching " ;
sp:arg2 [
rdf:type afn:localname ;
sp:arg1 [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:arg3 " id: " ;
sp:arg4 [
sp:varName "id"^^xsd:string ;
] ;
sp:arg5 " is not the NPD id of " ;
sp:arg6 [
sp:varName "name"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
spin:labelTemplate "NPD name and id of {?type}/{?kindRef} must match"^^xsd:string ;
rdfs:label "NPD id and name must match"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
.
mpr-proxy-constraints:CheckName
rdf:type spin:ConstructTemplate ;
spin:body [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b81462 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b81462 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "kindRef"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this ;
]
[
sp:object "NPD" ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject spin:_this ;
]
[
sp:object [
sp:varName "name"^^xsd:string ;
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualByName ;
arg:name [
sp:varName "name"^^xsd:string ;
] ;
arg:type [
sp:varName "type"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "npd"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:not ;
sp:arg1 [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "npd"^^xsd:string ;
] ;
] ;
] ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type fn:concat ;
sp:arg1 [
rdf:type sp:add ;
sp:arg1 "[RH-19] Invalid " ;
sp:arg2 [
rdf:type afn:localname ;
sp:arg1 [
sp:varName "type"^^xsd:string ;
] ;
] ;
] ;
sp:arg2 " name " ;
sp:arg3 [
sp:varName "name"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
spin:labelTemplate "Must be NPD name of {?type}/{?kindRef}"^^xsd:string ;
rdfs:label "Check name"^^xsd:string ;
rdfs:subClassOf mpr-proxy-constraints:ConstraintTemplates ;
.
mpr-proxy-constraints:ConstraintTemplates
rdf:type spin:ConstructTemplate ;
spin:constraint [
rdf:type spl:Argument ;
spl:predicate arg:kindRef ;
spl:valueType <http://www.epim.no/schemas/mprml/1#ReportingFacility> ;
rdfs:comment "The kind reference value."^^xsd:string ;
] ;
spin:constraint [
rdf:type spl:Argument ;
spl:predicate arg:type ;
spl:valueType rdfs:Class ;
rdfs:comment "The NPD type that the individual needs to have."^^xsd:string ;
] ;
rdfs:label "Constraint templates"^^xsd:string ;
rdfs:subClassOf spin:ConstructTemplates ;
.
......
<objects version="1.0(MPRML)" xmlns="http://www.epim.no/schemas/mprml/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<documentInfo>
<DocumentName namingSystem="EC">ÅSGARD July 2012</DocumentName>
<DocumentAlias namingSystem="EC">ÅSGARD Copex Report</DocumentAlias>
<DocumentDate>2012-08-05T00:00:00.0Z</DocumentDate>
<documentClass namingSystem="EC">STATOIL</documentClass>
<documentClass namingSystem="EC">Copex</documentClass>
<FileCreationInformation>
<FileCreationDate>2012-08-15T00:00:00.0Z</FileCreationDate>
<SoftwareName>Energy Components</SoftwareName>
<FileCreator>STATOIL</FileCreator>
<Comment>NA</Comment>
</FileCreationInformation>
<Owner>STATOIL</Owner>
</documentInfo>
<context xsi:type="obj_report">
<kind>Copex</kind>
<title>ÅSGARD stock,cargo</title>
<date>2012-07-01</date>
<dateEnd>2012-07-31</dateEnd>
<month>2012-07</month>
<year>2012</year>
<reportVersion>1.0</reportVersion>
<reportStatus>final</reportStatus>
<installation kind="field" namingSystem="NPD" uidRef="43765">ÅSGARD</installation>
<operator>
<name>STATOIL</name>
<role>Operating company</role>
</operator>
</context>
<object xsi:type="obj_productVolume">
<name>KRISTIN</name>
<installation kind="field" namingSystem="NPD" uidRef="1854729">KRISTIN</installation>
<facility>
<name kind="field" namingSystem="NPD" uidRef="1854729">KRISTIN</name>
<flow>
<name>KRISTIN allocated inventory</name>
<kind>inventory</kind>
<qualifier>allocated</qualifier>
<product>
<kind>oil - net</kind>
<period>
<kind>month</kind>
<dateStart>2012-07-01</dateStart>
<dateEnd>2012-07-31</dateEnd>
<volumeValue>
<volume uom="m3">102230.95</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">89775316.91</mass>
<densityValue>
<density uom="kg/m3">788.76</density>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</densityValue>
<balanceSet>
<kind>closing balance</kind>
<balanceDetail>
<owner>PETORO</owner>
<volumeValue>
<volume uom="m3">31599.586645</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">27749550.4569</mass>
</balanceDetail>
<balanceDetail>
<owner>TOTAL</owner>
<volumeValue>
<volume uom="m3">22010.323535</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">19328625.7307</mass>
</balanceDetail>
<balanceDetail>
<owner>STATOIL</owner>
<volumeValue>
<volume uom="m3">12962.88446</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">11383510.1842</mass>
</balanceDetail>
<balanceDetail>
<owner>EXXONMOBIL PROD</owner>
<volumeValue>
<volume uom="m3">7738.882915</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">6795991.49009</mass>
</balanceDetail>
<balanceDetail>
<owner>ENI NORGE</owner>
<volumeValue>
<volume uom="m3">27919.272445</volume>
<temp uom="degC">15</temp>
<pres uom="atm">1</pres>
</volumeValue>
<mass uom="kg">24517639.0481</mass>
</balanceDetail>
</balanceSet>
</period>
</product>
</flow>
</facility>
</object>
</objects>