SPIN_EP-REPORT-constraints.spin.ttl
7.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# baseURI: http://www.reportinghub.no/ep/spin/report-constraints
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/facility
# imports: http://www.reportinghub.no/ep/schema/1.0/organization
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/np/schema/1.0/npd
# imports: http://www.reportinghub.no/spin/rh
@prefix : <http://www.reportinghub.no/ep/spin/report-constraints#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rhspin: <http://www.reportinghub.no/spin/rh#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/ep/schema/report#FinalDailyDrillingReport>
rdfs:subClassOf :DDRSuperclass .
<http://www.reportinghub.no/ep/schema/report#NormalDailyDrillingReport>
rdfs:subClassOf :DDRSuperclass .
<http://www.reportinghub.no/ep/schema/report#PreliminaryDailyDrillingReport>
rdfs:subClassOf :DDRSuperclass .
<http://www.reportinghub.no/ep/spin/report-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Constraints that need to be executed after ep-report:Report generation (without SXML triples)."^^xsd:string ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string .
:DDRSuperclass
rdf:type owl:Class ;
rdfs:comment "Abstract superclass to make sure that constraints are only reported on the subclasses of DDR."^^xsd:string ;
rdfs:label "DDRSuperclass"^^xsd:string ;
rdfs:subClassOf owl:Thing ;
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
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore>
] ;
sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf>
] ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
] ;
sp:variable
[ sp:varName "companyName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyWithName ;
arg:name
[ sp:varName "companyName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "company"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:bound ;
sp:arg1 [ sp:varName "company"^^xsd:string
]
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate rhspin:companyHasLicenceForWellBore ;
sp:subject
[ sp:varName "company"^^xsd:string
]
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:coalesce ;
sp:arg1 [ rdf:type rhspin:npdName ;
arg:resource
[ sp:varName "wellBore"^^xsd:string
]
] ;
sp:arg2 "Unknown well bore"
] ;
sp:variable
[ sp:varName "displayName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Your company (" ;
sp:arg2 [ sp:varName "companyName"^^xsd:string
] ;
sp:arg3 ") does not hold a licence for well bore " ;
sp:arg4 [ sp:varName "displayName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] .