Holger Knublauch

Added constraint to compare well bore number with name

......@@ -27,6 +27,58 @@
ddr:Obj_drillReport
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b1
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b1
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
arg:wellBoreName
[ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type sp:Ask ;
rdfs:comment "DDRs can only be submitted if a user is logged in"^^xsd:string ;
sp:where ([ rdf:type sp:Bind ;
......@@ -50,24 +102,29 @@ ddr:Obj_drillReport
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
sp:subject _:b2
]) ;
sp:where ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#numberWellbore> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
......@@ -78,19 +135,31 @@ ddr:Obj_drillReport
sp:variable
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreById ;
arg:id [ sp:varName "wellBoreNumber"^^xsd:string
]
] ;
sp:variable
[ sp:varName "wellBore2"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
[ rdf:type sp:ne ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
]
] ;
sp:arg2 [ sp:varName "wellBore2"^^xsd:string
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
sp:arg1 "Well bore number " ;
sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:arg3 "mismatches well bore name " ;
sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
......