Holger Knublauch

Added constraint to check that current user is owner of well's field

......@@ -377,14 +377,14 @@ arg:kindRef
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b55110 ;
sp:subject _:b48611 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b55110 ;
sp:subject _:b48611 ;
]
) ;
sp:where (
......@@ -435,6 +435,107 @@ arg:kindRef
]
) ;
] ;
spin:constraint [
rdf:type sp:Construct ;
sp:templates (
[
sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b96757 ;
]
[
sp:object [
sp:varName "message"^^xsd:string ;
] ;
sp:predicate rdfs:label ;
sp:subject _:b96757 ;
]
) ;
sp:where (
[
sp:object [
sp:varName "wellName"^^xsd:string ;
] ;
sp:predicate <http://www.epim.no/schemas/mprml/1#nameWell> ;
sp:subject spin:_this ;
]
[
rdf:type sp:Bind ;
sp:expression [
rdf:type rhspin:npdIndividualByName ;
arg:name [
sp:varName "wellName"^^xsd:string ;
] ;
arg:type <http://www.reportinghub.no/ep/schema/well#Well> ;
] ;
sp:variable [
sp:varName "well"^^xsd:string ;
] ;
]
[
rdf:type sp:Filter ;
sp:expression [
rdf:type sp:bound ;
sp:arg1 [
sp:varName "well"^^xsd:string ;
] ;
] ;
]
[
rdf:type sp:NamedGraph ;
sp:elements (
[
sp:object [
sp:varName "field"^^xsd:string ;
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#wellPartOfField> ;
sp:subject [
sp:varName "well"^^xsd:string ;
] ;
]
[
sp:object [
sp:varName "fieldName"^^xsd:string ;
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject [
sp:varName "field"^^xsd:string ;
] ;
]
) ;
sp:graphNameNode <http://www.reportinghub.no/np/data/npd> ;
]
[
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 the field " ;
sp:arg2 [
sp:varName "fieldName"^^xsd:string ;
] ;
sp:arg3 " that contains the well " ;
sp:arg4 [
sp:varName "wellName"^^xsd:string ;
] ;
] ;
sp:variable [
sp:varName "message"^^xsd:string ;
] ;
]
) ;
] ;
.
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints>
rdf:type owl:Ontology ;
......