Holger Knublauch

Added constraint to check field names on wellTest

......@@ -22,62 +22,7 @@ arg:kindRef
rdfs:label "kind ref"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://www.epim.no/schemas/mprml/1#FacilityIdentifierStruct>
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#Facility>
] ;
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: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: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: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: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: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:CheckId ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
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_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_platform> ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Platform>
] ;
<http://www.epim.no/schemas/mprml/1#Cs_wellContext>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
......@@ -89,34 +34,65 @@ arg:kindRef
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ sp:object <http://www.epim.no/schemas/mprml/1#RF_field> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:where ([ sp:object
[ sp:varName "struct"^^xsd:string
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#fieldRef> ;
sp:subject spin:_this
] [ sp:object "NPD"^^xsd:string ;
sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
sp:subject
[ sp:varName "struct"^^xsd:string
]
] [ sp:object
[ sp:varName "fieldName"^^xsd:string
[ sp:varName "name"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this
sp:subject
[ sp:varName "struct"^^xsd:string
]
] [ 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 "npd"^^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
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 "Your company is not the operator of field with name " ;
sp:arg2 [ sp:varName "fieldName"^^xsd:string
sp:arg1 "[RH-19] Invalid Field 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: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: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 sp:Construct ;
......@@ -175,9 +151,94 @@ arg:kindRef
])
] ;
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 <http://www.epim.no/schemas/mprml/1#RF_field> ;
sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "fieldName"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject spin:_this
] [ 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
]
])
] ;
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:CheckName ;
arg:kindRef <http://www.epim.no/schemas/mprml/1#RF_platform> ;
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_platform> ;
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>
] ;
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: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: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: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>
......@@ -185,12 +246,12 @@ arg:kindRef
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b3
sp:subject _:b4
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b3
sp:subject _:b4
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
......@@ -236,7 +297,7 @@ arg:kindRef
<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://www.reportinghub.no/spin/rh> , <http://www.epim.no/schemas/mprml/1> , <http://spinrdf.org/spin> ;
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
......@@ -247,12 +308,12 @@ mpr-proxy-constraints:CheckId
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b4
sp:subject _:b5
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b4
sp:subject _:b5
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
......@@ -314,12 +375,12 @@ mpr-proxy-constraints:CheckIdAndNameMatch
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b5
sp:subject _:b6
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b5
sp:subject _:b6
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
......@@ -414,12 +475,12 @@ mpr-proxy-constraints:CheckName
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b6
sp:subject _:b7
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b6
sp:subject _:b7
]) ;
sp:where ([ sp:object
[ sp:varName "kindRef"^^xsd:string
......@@ -482,13 +543,13 @@ mpr-proxy-constraints:ConstraintTemplates
rdfs:subClassOf spin:ConstructTemplates ;
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
] ;
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
] .
......