Holger Knublauch

Added constraint to compare well bore number with name

...@@ -27,6 +27,58 @@ ...@@ -27,6 +27,58 @@
27 27
28 ddr:Obj_drillReport 28 ddr:Obj_drillReport
29 spin:constraint 29 spin:constraint
30 + [ rdf:type sp:Construct ;
31 + sp:templates ([ sp:object spin:ConstraintViolation ;
32 + sp:predicate rdf:type ;
33 + sp:subject _:b1
34 + ] [ sp:object spin:_this ;
35 + sp:predicate spin:violationRoot ;
36 + sp:subject _:b1
37 + ] [ sp:object ddr:nameWellbore ;
38 + sp:predicate spin:violationPath ;
39 + sp:subject _:b1
40 + ] [ sp:object
41 + [ sp:varName "message"^^xsd:string
42 + ] ;
43 + sp:predicate rdfs:label ;
44 + sp:subject _:b1
45 + ]) ;
46 + sp:where ([ sp:object
47 + [ sp:varName "wellBoreName"^^xsd:string
48 + ] ;
49 + sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
50 + sp:subject spin:_this
51 + ] [ rdf:type sp:Bind ;
52 + sp:expression
53 + [ rdf:type rhspin:wellBoreByName ;
54 + arg:wellBoreName
55 + [ sp:varName "wellBoreName"^^xsd:string
56 + ]
57 + ] ;
58 + sp:variable
59 + [ sp:varName "wellBore"^^xsd:string
60 + ]
61 + ] [ rdf:type sp:Filter ;
62 + sp:expression
63 + [ rdf:type sp:not ;
64 + sp:arg1 [ rdf:type sp:bound ;
65 + sp:arg1 [ sp:varName "wellBore"^^xsd:string
66 + ]
67 + ]
68 + ]
69 + ] [ rdf:type sp:Bind ;
70 + sp:expression
71 + [ rdf:type fn:concat ;
72 + sp:arg1 "Unregistered well bore name " ;
73 + sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
74 + ]
75 + ] ;
76 + sp:variable
77 + [ sp:varName "message"^^xsd:string
78 + ]
79 + ])
80 + ] ;
81 + spin:constraint
30 [ rdf:type sp:Ask ; 82 [ rdf:type sp:Ask ;
31 rdfs:comment "DDRs can only be submitted if a user is logged in"^^xsd:string ; 83 rdfs:comment "DDRs can only be submitted if a user is logged in"^^xsd:string ;
32 sp:where ([ rdf:type sp:Bind ; 84 sp:where ([ rdf:type sp:Bind ;
...@@ -50,24 +102,29 @@ ddr:Obj_drillReport ...@@ -50,24 +102,29 @@ ddr:Obj_drillReport
50 [ rdf:type sp:Construct ; 102 [ rdf:type sp:Construct ;
51 sp:templates ([ sp:object spin:ConstraintViolation ; 103 sp:templates ([ sp:object spin:ConstraintViolation ;
52 sp:predicate rdf:type ; 104 sp:predicate rdf:type ;
53 - sp:subject _:b1 105 + sp:subject _:b2
54 ] [ sp:object spin:_this ; 106 ] [ sp:object spin:_this ;
55 sp:predicate spin:violationRoot ; 107 sp:predicate spin:violationRoot ;
56 - sp:subject _:b1 108 + sp:subject _:b2
57 ] [ sp:object ddr:nameWellbore ; 109 ] [ sp:object ddr:nameWellbore ;
58 sp:predicate spin:violationPath ; 110 sp:predicate spin:violationPath ;
59 - sp:subject _:b1 111 + sp:subject _:b2
60 ] [ sp:object 112 ] [ sp:object
61 [ sp:varName "message"^^xsd:string 113 [ sp:varName "message"^^xsd:string
62 ] ; 114 ] ;
63 sp:predicate rdfs:label ; 115 sp:predicate rdfs:label ;
64 - sp:subject _:b1 116 + sp:subject _:b2
65 ]) ; 117 ]) ;
66 sp:where ([ sp:object 118 sp:where ([ sp:object
67 [ sp:varName "wellBoreName"^^xsd:string 119 [ sp:varName "wellBoreName"^^xsd:string
68 ] ; 120 ] ;
69 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ; 121 sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
70 sp:subject spin:_this 122 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
71 ] [ rdf:type sp:Bind ; 128 ] [ rdf:type sp:Bind ;
72 sp:expression 129 sp:expression
73 [ rdf:type rhspin:wellBoreByName ; 130 [ rdf:type rhspin:wellBoreByName ;
...@@ -78,19 +135,31 @@ ddr:Obj_drillReport ...@@ -78,19 +135,31 @@ ddr:Obj_drillReport
78 sp:variable 135 sp:variable
79 [ sp:varName "wellBore"^^xsd:string 136 [ sp:varName "wellBore"^^xsd:string
80 ] 137 ]
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 + ]
81 ] [ rdf:type sp:Filter ; 147 ] [ rdf:type sp:Filter ;
82 sp:expression 148 sp:expression
83 - [ rdf:type sp:not ; 149 + [ rdf:type sp:ne ;
84 - sp:arg1 [ rdf:type sp:bound ; 150 + sp:arg1 [ sp:varName "wellBore"^^xsd:string
85 - sp:arg1 [ sp:varName "wellBore"^^xsd:string 151 + ] ;
86 - ] 152 + sp:arg2 [ sp:varName "wellBore2"^^xsd:string
87 ] 153 ]
88 ] 154 ]
89 ] [ rdf:type sp:Bind ; 155 ] [ rdf:type sp:Bind ;
90 sp:expression 156 sp:expression
91 [ rdf:type fn:concat ; 157 [ rdf:type fn:concat ;
92 - sp:arg1 "Unregistered well bore name " ; 158 + sp:arg1 "Well bore number " ;
93 - sp:arg2 [ sp:varName "wellBoreName"^^xsd:string 159 + sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
160 + ] ;
161 + sp:arg3 "mismatches well bore name " ;
162 + sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
94 ] 163 ]
95 ] ; 164 ] ;
96 sp:variable 165 sp:variable
......
This diff could not be displayed because it is too large.