Holger Knublauch

Added rig facility name constraint

......@@ -25,29 +25,126 @@
owl:imports <http://spinrdf.org/spin> , <http://topbraid.org/sxml> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/spin/rh> , <http://www.witsml.org/schemas/1series> ;
owl:versionInfo "0.2.0"^^xsd:string .
ddr:Obj_drillReport
ddr:Cs_drillReportWellboreInfo
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 "nameRef"^^xsd:string
] ;
sp:predicate ddr:rigAliasRef ;
sp:subject spin:_this
] [ sp:object "NPD Name" ;
sp:predicate ddr:namingSystem ;
sp:subject
[ sp:varName "nameRef"^^xsd:string
]
] [ sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:predicate ddr:name ;
sp:subject
[ sp:varName "nameRef"^^xsd:string
]
] [ sp:object
[ sp:varName "codeRef"^^xsd:string
] ;
sp:predicate ddr:rigAliasRef ;
sp:subject spin:_this
] [ sp:object "NPD code" ;
sp:predicate ddr:namingSystem ;
sp:subject
[ sp:varName "codeRef"^^xsd:string
]
] [ sp:object
[ sp:varName "code"^^xsd:string
] ;
sp:predicate ddr:name ;
sp:subject
[ sp:varName "codeRef"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:facilityById ;
arg:id [ sp:varName "code"^^xsd:string
]
] ;
sp:variable
[ sp:varName "facility"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdName ;
arg:resource
[ sp:varName "facility"^^xsd:string
]
] ;
sp:variable
[ sp:varName "npdName"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:ne ;
sp:arg1 [ sp:varName "npdName"^^xsd:string
] ;
sp:arg2 [ sp:varName "name"^^xsd:string
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Mismatch for rig code " ;
sp:arg2 [ sp:varName "code"^^xsd:string
] ;
sp:arg3 ": The NPD name is " ;
sp:arg4 [ sp:varName "npdName"^^xsd:string
] ;
sp:arg5 " not " ;
sp:arg6 [ sp:varName "name"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] .
ddr:Obj_drillReport
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
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 ;
......@@ -58,19 +155,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 ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
]
[ 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
......@@ -102,29 +211,24 @@ ddr:Obj_drillReport
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b2
sp:subject _:b3
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b2
sp:subject _:b3
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b2
sp:subject _:b3
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b2
sp:subject _:b3
]) ;
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 ;
......@@ -135,31 +239,19 @@ 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:ne ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
] ;
sp:arg2 [ sp:varName "wellBore2"^^xsd:string
[ 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 "Well bore number " ;
sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:arg3 "mismatches well bore name " ;
sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
......