Holger Knublauch

Added rig facility name constraint

...@@ -25,29 +25,126 @@ ...@@ -25,29 +25,126 @@
25 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> ; 25 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> ;
26 owl:versionInfo "0.2.0"^^xsd:string . 26 owl:versionInfo "0.2.0"^^xsd:string .
27 27
28 -ddr:Obj_drillReport 28 +ddr:Cs_drillReportWellboreInfo
29 spin:constraint 29 spin:constraint
30 [ rdf:type sp:Construct ; 30 [ rdf:type sp:Construct ;
31 sp:templates ([ sp:object spin:ConstraintViolation ; 31 sp:templates ([ sp:object spin:ConstraintViolation ;
32 sp:predicate rdf:type ; 32 sp:predicate rdf:type ;
33 sp:subject _:b1 33 sp:subject _:b1
34 + ] [ sp:object
35 + [ sp:varName "message"^^xsd:string
36 + ] ;
37 + sp:predicate rdfs:label ;
38 + sp:subject _:b1
39 + ]) ;
40 + sp:where ([ sp:object
41 + [ sp:varName "nameRef"^^xsd:string
42 + ] ;
43 + sp:predicate ddr:rigAliasRef ;
44 + sp:subject spin:_this
45 + ] [ sp:object "NPD Name" ;
46 + sp:predicate ddr:namingSystem ;
47 + sp:subject
48 + [ sp:varName "nameRef"^^xsd:string
49 + ]
50 + ] [ sp:object
51 + [ sp:varName "name"^^xsd:string
52 + ] ;
53 + sp:predicate ddr:name ;
54 + sp:subject
55 + [ sp:varName "nameRef"^^xsd:string
56 + ]
57 + ] [ sp:object
58 + [ sp:varName "codeRef"^^xsd:string
59 + ] ;
60 + sp:predicate ddr:rigAliasRef ;
61 + sp:subject spin:_this
62 + ] [ sp:object "NPD code" ;
63 + sp:predicate ddr:namingSystem ;
64 + sp:subject
65 + [ sp:varName "codeRef"^^xsd:string
66 + ]
67 + ] [ sp:object
68 + [ sp:varName "code"^^xsd:string
69 + ] ;
70 + sp:predicate ddr:name ;
71 + sp:subject
72 + [ sp:varName "codeRef"^^xsd:string
73 + ]
74 + ] [ rdf:type sp:Bind ;
75 + sp:expression
76 + [ rdf:type rhspin:facilityById ;
77 + arg:id [ sp:varName "code"^^xsd:string
78 + ]
79 + ] ;
80 + sp:variable
81 + [ sp:varName "facility"^^xsd:string
82 + ]
83 + ] [ rdf:type sp:Bind ;
84 + sp:expression
85 + [ rdf:type rhspin:npdName ;
86 + arg:resource
87 + [ sp:varName "facility"^^xsd:string
88 + ]
89 + ] ;
90 + sp:variable
91 + [ sp:varName "npdName"^^xsd:string
92 + ]
93 + ] [ rdf:type sp:Filter ;
94 + sp:expression
95 + [ rdf:type sp:ne ;
96 + sp:arg1 [ sp:varName "npdName"^^xsd:string
97 + ] ;
98 + sp:arg2 [ sp:varName "name"^^xsd:string
99 + ]
100 + ]
101 + ] [ rdf:type sp:Bind ;
102 + sp:expression
103 + [ rdf:type fn:concat ;
104 + sp:arg1 "Mismatch for rig code " ;
105 + sp:arg2 [ sp:varName "code"^^xsd:string
106 + ] ;
107 + sp:arg3 ": The NPD name is " ;
108 + sp:arg4 [ sp:varName "npdName"^^xsd:string
109 + ] ;
110 + sp:arg5 " not " ;
111 + sp:arg6 [ sp:varName "name"^^xsd:string
112 + ]
113 + ] ;
114 + sp:variable
115 + [ sp:varName "message"^^xsd:string
116 + ]
117 + ])
118 + ] .
119 +
120 +ddr:Obj_drillReport
121 + spin:constraint
122 + [ rdf:type sp:Construct ;
123 + sp:templates ([ sp:object spin:ConstraintViolation ;
124 + sp:predicate rdf:type ;
125 + sp:subject _:b2
34 ] [ sp:object spin:_this ; 126 ] [ sp:object spin:_this ;
35 sp:predicate spin:violationRoot ; 127 sp:predicate spin:violationRoot ;
36 - sp:subject _:b1 128 + sp:subject _:b2
37 ] [ sp:object ddr:nameWellbore ; 129 ] [ sp:object ddr:nameWellbore ;
38 sp:predicate spin:violationPath ; 130 sp:predicate spin:violationPath ;
39 - sp:subject _:b1 131 + sp:subject _:b2
40 ] [ sp:object 132 ] [ sp:object
41 [ sp:varName "message"^^xsd:string 133 [ sp:varName "message"^^xsd:string
42 ] ; 134 ] ;
43 sp:predicate rdfs:label ; 135 sp:predicate rdfs:label ;
44 - sp:subject _:b1 136 + sp:subject _:b2
45 ]) ; 137 ]) ;
46 sp:where ([ sp:object 138 sp:where ([ sp:object
47 [ sp:varName "wellBoreName"^^xsd:string 139 [ sp:varName "wellBoreName"^^xsd:string
48 ] ; 140 ] ;
49 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ; 141 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
50 sp:subject spin:_this 142 sp:subject spin:_this
143 + ] [ sp:object
144 + [ sp:varName "wellBoreNumber"^^xsd:string
145 + ] ;
146 + sp:predicate <http://www.reportinghub.no/ep/spin/lib#numberWellbore> ;
147 + sp:subject spin:_this
51 ] [ rdf:type sp:Bind ; 148 ] [ rdf:type sp:Bind ;
52 sp:expression 149 sp:expression
53 [ rdf:type rhspin:wellBoreByName ; 150 [ rdf:type rhspin:wellBoreByName ;
...@@ -58,19 +155,31 @@ ddr:Obj_drillReport ...@@ -58,19 +155,31 @@ ddr:Obj_drillReport
58 sp:variable 155 sp:variable
59 [ sp:varName "wellBore"^^xsd:string 156 [ sp:varName "wellBore"^^xsd:string
60 ] 157 ]
158 + ] [ rdf:type sp:Bind ;
159 + sp:expression
160 + [ rdf:type rhspin:wellBoreById ;
161 + arg:id [ sp:varName "wellBoreNumber"^^xsd:string
162 + ]
163 + ] ;
164 + sp:variable
165 + [ sp:varName "wellBore2"^^xsd:string
166 + ]
61 ] [ rdf:type sp:Filter ; 167 ] [ rdf:type sp:Filter ;
62 sp:expression 168 sp:expression
63 - [ rdf:type sp:not ; 169 + [ rdf:type sp:ne ;
64 - sp:arg1 [ rdf:type sp:bound ;
65 sp:arg1 [ sp:varName "wellBore"^^xsd:string 170 sp:arg1 [ sp:varName "wellBore"^^xsd:string
66 - ] 171 + ] ;
172 + sp:arg2 [ sp:varName "wellBore2"^^xsd:string
67 ] 173 ]
68 ] 174 ]
69 ] [ rdf:type sp:Bind ; 175 ] [ rdf:type sp:Bind ;
70 sp:expression 176 sp:expression
71 [ rdf:type fn:concat ; 177 [ rdf:type fn:concat ;
72 - sp:arg1 "Unregistered well bore name " ; 178 + sp:arg1 "Well bore number " ;
73 - sp:arg2 [ sp:varName "wellBoreName"^^xsd:string 179 + sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
180 + ] ;
181 + sp:arg3 "mismatches well bore name " ;
182 + sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
74 ] 183 ]
75 ] ; 184 ] ;
76 sp:variable 185 sp:variable
...@@ -102,29 +211,24 @@ ddr:Obj_drillReport ...@@ -102,29 +211,24 @@ ddr:Obj_drillReport
102 [ rdf:type sp:Construct ; 211 [ rdf:type sp:Construct ;
103 sp:templates ([ sp:object spin:ConstraintViolation ; 212 sp:templates ([ sp:object spin:ConstraintViolation ;
104 sp:predicate rdf:type ; 213 sp:predicate rdf:type ;
105 - sp:subject _:b2 214 + sp:subject _:b3
106 ] [ sp:object spin:_this ; 215 ] [ sp:object spin:_this ;
107 sp:predicate spin:violationRoot ; 216 sp:predicate spin:violationRoot ;
108 - sp:subject _:b2 217 + sp:subject _:b3
109 ] [ sp:object ddr:nameWellbore ; 218 ] [ sp:object ddr:nameWellbore ;
110 sp:predicate spin:violationPath ; 219 sp:predicate spin:violationPath ;
111 - sp:subject _:b2 220 + sp:subject _:b3
112 ] [ sp:object 221 ] [ sp:object
113 [ sp:varName "message"^^xsd:string 222 [ sp:varName "message"^^xsd:string
114 ] ; 223 ] ;
115 sp:predicate rdfs:label ; 224 sp:predicate rdfs:label ;
116 - sp:subject _:b2 225 + sp:subject _:b3
117 ]) ; 226 ]) ;
118 sp:where ([ sp:object 227 sp:where ([ sp:object
119 [ sp:varName "wellBoreName"^^xsd:string 228 [ sp:varName "wellBoreName"^^xsd:string
120 ] ; 229 ] ;
121 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ; 230 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
122 sp:subject spin:_this 231 sp:subject spin:_this
123 - ] [ sp:object
124 - [ sp:varName "wellBoreNumber"^^xsd:string
125 - ] ;
126 - sp:predicate <http://www.reportinghub.no/ep/spin/lib#numberWellbore> ;
127 - sp:subject spin:_this
128 ] [ rdf:type sp:Bind ; 232 ] [ rdf:type sp:Bind ;
129 sp:expression 233 sp:expression
130 [ rdf:type rhspin:wellBoreByName ; 234 [ rdf:type rhspin:wellBoreByName ;
...@@ -135,31 +239,19 @@ ddr:Obj_drillReport ...@@ -135,31 +239,19 @@ ddr:Obj_drillReport
135 sp:variable 239 sp:variable
136 [ sp:varName "wellBore"^^xsd:string 240 [ sp:varName "wellBore"^^xsd:string
137 ] 241 ]
138 - ] [ rdf:type sp:Bind ;
139 - sp:expression
140 - [ rdf:type rhspin:wellBoreById ;
141 - arg:id [ sp:varName "wellBoreNumber"^^xsd:string
142 - ]
143 - ] ;
144 - sp:variable
145 - [ sp:varName "wellBore2"^^xsd:string
146 - ]
147 ] [ rdf:type sp:Filter ; 242 ] [ rdf:type sp:Filter ;
148 sp:expression 243 sp:expression
149 - [ rdf:type sp:ne ; 244 + [ rdf:type sp:not ;
245 + sp:arg1 [ rdf:type sp:bound ;
150 sp:arg1 [ sp:varName "wellBore"^^xsd:string 246 sp:arg1 [ sp:varName "wellBore"^^xsd:string
151 - ] ; 247 + ]
152 - sp:arg2 [ sp:varName "wellBore2"^^xsd:string
153 ] 248 ]
154 ] 249 ]
155 ] [ rdf:type sp:Bind ; 250 ] [ rdf:type sp:Bind ;
156 sp:expression 251 sp:expression
157 [ rdf:type fn:concat ; 252 [ rdf:type fn:concat ;
158 - sp:arg1 "Well bore number " ; 253 + sp:arg1 "Unregistered well bore name " ;
159 - sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string 254 + sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
160 - ] ;
161 - sp:arg3 "mismatches well bore name " ;
162 - sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
163 ] 255 ]
164 ] ; 256 ] ;
165 sp:variable 257 sp:variable
......