-
Notifications
You must be signed in to change notification settings - Fork 1
/
local.ttl
406 lines (368 loc) · 13.7 KB
/
local.ttl
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# imports: http://example.org/shapes/case-corpora
@prefix case-investigation: <https://ontology.caseontology.org/case/investigation/> .
@prefix drafting: <http://example.org/ontology/drafting/> .
@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 sh: <http://www.w3.org/ns/shacl#> .
@prefix sh-case-corpora-local: <http://example.org/shapes/case-corpora-local/> .
@prefix sh-dcterms: <http://example.org/shapes/dcterms/> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix uco-action: <https://ontology.unifiedcyberontology.org/uco/action/> .
@prefix uco-core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix uco-observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix uco-types: <https://ontology.unifiedcyberontology.org/uco/types/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/shapes/case-corpora-local>
a owl:Ontology ;
rdfs:comment "This file contains adjustments to upstream shapes graphs for CASE-Corpora. This graph is not intended be re-used outside of CASE-Corpora. Those interested in re-consuming CASE-Corpora shapes can generate and import the shapes.ttl file in this directory."@en ;
owl:imports <http://example.org/shapes/case-corpora> ;
.
sh-case-corpora-local:Actuation-actsOnProperty-shape
a sh:NodeShape ;
sh:description "This shape defines and implements a CASE-Corpora requirement that an Actuation describe a linked Quality."@en ;
sh:property [
a sh:PropertyShape ;
sh:minCount "1"^^xsd:integer ;
sh:path sosa:actsOnProperty ;
] ;
sh:sparql [
sh:message "Actuation's hasFeatureOfInterest and actsOnProperty object are not associated."@en ;
sh:select """
SELECT $this
WHERE {
$this
sosa:hasFeatureOfInterest ?nThing ;
sosa:actsOnProperty ?nProperty ;
.
FILTER NOT EXISTS {
?nThing ssn:hasProperty ?nProperty .
}
}
""" ;
] ;
sh:targetClass sosa:Actuation ;
.
sh-case-corpora-local:ContentDataFacet-mismatching-hash-shape
a sh:NodeShape ;
sh:description "In CASE-Corpora, Hashes must match between Facets and (SOSA) Observations, if recorded in both. If an Observation conflicts, the Facet-housed Hash reference is to be removed."@en ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "Conflict found between a Hash recorded in a Facet and as a result of an Observation on the same Observable Object. Please remove the Hash reference that is this result's Value node from the Focus node."@en ;
sh:select """
SELECT $this ?value
WHERE {
?nObservableObject
uco-core:hasFacet $this ;
.
$this
uco-observable:hash ?value ;
.
?nObservation
sosa:hasFeatureOfInterest ?nObservableObject ;
sosa:hasResult ?nHashFromObservation ;
.
?value
uco-types:hashMethod ?lMethod ;
uco-types:hashValue ?lValueInFacet ;
.
?nHashFromObservation
uco-types:hashMethod ?lMethod ;
uco-types:hashValue ?lValueFromObservation ;
.
FILTER ( ?lValueInFacet != ?lValueFromObservation )
}
""" ;
] ;
sh:targetClass uco-observable:ContentDataFacet ;
.
sh-case-corpora-local:Facet-inherence-shape
a sh:NodeShape ;
sh:message "In CASE-Corpora, Facets must be linked to at least one UcoObject."@en ;
sh:property [
sh:minCount "1"^^xsd:integer ;
sh:path [
sh:inversePath uco-core:hasFacet ;
] ;
] ;
sh:targetClass uco-core:Facet ;
.
sh-case-corpora-local:Hash-inherence-shape
a sh:NodeShape ;
sh:message "In CASE-Corpora, Hashes must be linked to at least one Facet or Observation."@en ;
sh:property [
sh:minCount "1"^^xsd:integer ;
sh:path [
sh:alternativePath (
[
sh:inversePath sosa:hasResult ;
]
[
sh:inversePath uco-observable:hash ;
]
) ;
] ;
] ;
sh:targetClass uco-types:Hash ;
.
sh-case-corpora-local:InvestigativeAction-Provenance-accompaniment-shape
a sh:NodeShape ;
sh:description "This shape defines and implements a CASE-Corpora requirement that when an InvestigativeAction uses an object, the object must be accompanied by a corresponding ProvenanceRecord."@en ;
sh:sparql [
sh:message "Input to investigative action does not include accompanying provenance record." ;
sh:select """
PREFIX case-investigation: <https://ontology.caseontology.org/case/investigation/>
PREFIX uco-action: <https://ontology.unifiedcyberontology.org/uco/action/>
PREFIX uco-core: <https://ontology.unifiedcyberontology.org/uco/core/>
SELECT $this ?value
WHERE {
$this uco-action:object ?value .
FILTER NOT EXISTS {
?value
a case-investigation:ProvenanceRecord ;
.
}
FILTER NOT EXISTS {
$this
uco-action:object ?nProvenanceRecord ;
.
?nProvenanceRecord
a case-investigation:ProvenanceRecord ;
uco-core:object ?value ;
.
}
}
""" ;
] ;
sh:targetClass case-investigation:InvestigativeAction ;
.
sh-case-corpora-local:InvestigativeAction-latest-ProvenanceRecord-usage-shape
a sh:NodeShape ;
rdfs:comment "This shape is deactivated, pending resolution of RDFLib Issue 709."@en ;
rdfs:seeAlso <https://github.com/RDFLib/rdflib/issues/709> ;
sh:deactivated "true"^^xsd:boolean ;
sh:description "This shape defines and implements a CASE-Corpora requirement that when an InvestigativeAction uses multiple provenance records containing the same object that is also input to the action, only the latest provenance record shall be linked if the earlier one contains no descriptive value of other objects that are also inputs to the action."@en ;
sh:sparql [
sh:message "Focus node uses value node, but value node contributes no additional provenance information over provenance record {$nLatterProvenanceRecord}."@en ;
sh:select """
SELECT $this ?value ?nLatterProvenanceRecord
WHERE {
$this
prov:used
?nObject1 ,
?value ,
?nLatterProvenanceRecord
;
.
?value
a case-investigation:ProvenanceRecord ;
prov:hadMember ?nObject1 ;
.
?nLatterProvenanceRecord
prov:wasDerivedFrom+ ?value ;
prov:hadMember ?nObject1 ;
.
FILTER NOT EXISTS {
$this prov:used ?nObject2 .
?value prov:hadMember ?nObject2 .
FILTER ( ?nObject1 != ?nObject2 )
FILTER NOT EXISTS {
?nLatterProvenanceRecord
prov:hadMember ?nObject2 ;
.
}
}
}
""" ;
] ;
sh:targetClass case-investigation:InvestigativeAction ;
.
sh-case-corpora-local:InvestigativeAction-shape
a sh:NodeShape ;
sh:description "This shape defines and implements a CASE-Corpora requirement that any InvestigativeAction must generate a ProvenanceRecord."@en ;
sh:property [
a sh:PropertyShape ;
sh:path uco-action:result ;
sh:qualifiedMinCount "1"^^xsd:integer ;
sh:qualifiedValueShape [
a sh:NodeShape ;
sh:class case-investigation:ProvenanceRecord ;
] ;
] ;
sh:targetClass case-investigation:InvestigativeAction ;
.
sh-case-corpora-local:Observation-observedProperty-shape
a sh:NodeShape ;
sh:description "This shape defines and implements a CASE-Corpora requirement that an Observation describe a linked Quality."@en ;
sh:property [
a sh:PropertyShape ;
sh:minCount "1"^^xsd:integer ;
sh:path sosa:observedProperty ;
] ;
sh:sparql [
sh:message "Observation's hasFeatureOfInterest and observedProperty objects are not associated."@en ;
sh:select """
SELECT $this
WHERE {
$this
sosa:hasFeatureOfInterest ?nThing ;
sosa:observedProperty ?nProperty ;
.
FILTER NOT EXISTS {
?nThing ssn:hasProperty ?nProperty .
}
}
""" ;
] ;
sh:targetClass sosa:Observation ;
.
sh-case-corpora-local:Quality-inherence-shape
a sh:NodeShape ;
sh:description "This shape defines and implements a CASE-Corpora requirement that a Quality must be attached to exactly one UcoObject."@en ;
sh:or (
[
a sh:NodeShape ;
sh:property [
a sh:PropertyShape ;
sh:minCount "1"^^xsd:integer ;
sh:path [
sh:inversePath drafting:hasQuality ;
] ;
] ;
]
[
a sh:NodeShape ;
sh:property [
a sh:PropertyShape ;
sh:minCount "1"^^xsd:integer ;
sh:path drafting:isQualityOf ;
] ;
]
) ;
sh:targetClass drafting:Quality ;
.
sh-case-corpora-local:rdf-Statement-shape
a sh:NodeShape ;
rdfs:comment "A citation of any portion of the OWL 2 specification on the appropriateness or inappropriateness of rdf:Statement in OWL would be welcome. At the time of this writing, a reference was believed to exist, but could not be found. The sh:description of this node houses an independent opinion on applicability."@en ;
sh:description """This (no-op) shape serves as an anchor for describing that rdf:Statements are disallowed in CASE-Corpora due to a believed incompatibility with OWL 2 DL. The belief stems in the property definition of rdf:object, as well as a scope of definition responsibility.
First, assuming authority to cast the property into OWL, that property cannot be either an owl:ObjectProperty or owl:DatatypeProperty, due to being general enough to support Identified Nodes (IRIs and BNodes) and Literals. An AnnotationProperty would be most appropriate. But then, for symmetry, rdf:subject and rdf:predicate should also be an AnnotationProperty. This leaves the inferential value of rdf:Statement in question - neither a Statement, nor any subclass (for example, some ex:ContradictionStatement), could apply reasoning across the rdf: properties.
Second, if casting authority is not assumed, for maximal compatibility it would be the responsibility of the OWL specification to interpret the property types of rdf:object et al. Otherwise, use of a base RDF property would become an OWL-level incompatibility if two knowledge bases were merged with different OWL property type assignments.
For all these reasons, CASE-Corpora disallows rdf:Statement."""@en ;
sh:targetClass rdf:Statement ;
.
sh-case-corpora-local:rdf-object-shape
a sh:PropertyShape ;
rdfs:seeAlso sh-case-corpora-local:rdf-Statement-shape ;
sh:maxCount "0"^^xsd:integer ;
sh:message "rdf:Statements are believed not compatible with OWL 2 DL."@en ;
sh:path rdf:object ;
sh:targetSubjectsOf rdf:object ;
.
sh-case-corpora-local:rdf-predicate-shape
a sh:PropertyShape ;
rdfs:seeAlso sh-case-corpora-local:rdf-Statement-shape ;
sh:maxCount "0"^^xsd:integer ;
sh:message "rdf:Statements are believed not compatible with OWL 2 DL."@en ;
sh:path rdf:predicate ;
sh:targetSubjectsOf rdf:predicate ;
.
sh-case-corpora-local:rdf-subject-shape
a sh:PropertyShape ;
rdfs:seeAlso sh-case-corpora-local:rdf-Statement-shape ;
sh:maxCount "0"^^xsd:integer ;
sh:message "rdf:Statements are believed not compatible with OWL 2 DL."@en ;
sh:path rdf:subject ;
sh:targetSubjectsOf rdf:subject ;
.
sh-case-corpora-local:time-inXSDDate-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:inXSDDate ;
.
sh-case-corpora-local:time-inXSDDateTime-deprecation-shape
a sh:PropertyShape ;
sh:maxCount "0"^^xsd:integer ;
sh:path time:inXSDDateTime ;
sh:targetSubjectsOf time:inXSDDateTime ;
.
sh-case-corpora-local:time-inXSDDateTimeStamp-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:inXSDDateTimeStamp ;
.
sh-case-corpora-local:time-inside-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:inside ;
.
sh-case-corpora-local:time-inside-range-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetObjectsOf time:inside ;
.
sh-case-corpora-local:time-intervalContains-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:intervalContains ;
.
sh-case-corpora-local:time-intervalContains-range-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetObjectsOf time:intervalContains ;
.
sh-case-corpora-local:time-intervalDuring-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:intervalDuring ;
.
sh-case-corpora-local:time-intervalDuring-range-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetObjectsOf time:intervalDuring ;
.
sh-case-corpora-local:time-intervalEquals-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:intervalEquals ;
.
sh-case-corpora-local:time-intervalEquals-range-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetObjectsOf time:intervalEquals ;
.
sh-case-corpora-local:time-intervalIn-domain-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetSubjectsOf time:intervalIn ;
.
sh-case-corpora-local:time-intervalIn-range-shape
a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:targetObjectsOf time:intervalIn ;
.
sh-dcterms:contributor-suggested-range-shape
rdfs:comment "Deactivated due to requiring RDFS inferencing enabled to work with metadata attached to several upstream ontologies."@en ;
sh:deactivated "true"^^xsd:boolean ;
.
sh-dcterms:creator-suggested-range-shape
rdfs:comment "Deactivated due to requiring RDFS inferencing enabled to work with metadata attached to several upstream ontologies."@en ;
sh:deactivated "true"^^xsd:boolean ;
.
sh-dcterms:license-suggested-range-shape
rdfs:comment "Deactivated due to usage pattern of property in upstream ontologies."@en ;
sh:deactivated "true"^^xsd:boolean ;
.
sh-dcterms:publisher-suggested-range-shape
rdfs:comment "Deactivated due to requiring RDFS inferencing enabled to work with metadata attached to several upstream ontologies."@en ;
sh:deactivated "true"^^xsd:boolean ;
.
sh-dcterms:rights-suggested-range-shape
rdfs:comment "Deactivated due to usage pattern of property in upstream ontologies."@en ;
sh:deactivated "true"^^xsd:boolean ;
.
uco-core:UcoThing-identifier-regex-shape
sh:deactivated "true"^^xsd:boolean ;
sh:description "This shape is deactivated for CASE-Corpora due to a data management decision to extend external IRIs as UCO concepts." ;
.