-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedaan-shapes.ttl
More file actions
438 lines (376 loc) · 14 KB
/
Copy pathedaan-shapes.ttl
File metadata and controls
438 lines (376 loc) · 14 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
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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
@prefix : <https://w3id.org/AgoraOWL/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix ids: <https://w3id.org/idsa/core/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dqv: <http://www.w3.org/ns/dqv#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix bigdat: <https://w3id.org/BIGOWLData/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix time: <http://www.w3.org/2006/time#> .
#################################################################
### Shapes for IDSA Classes (DataApp, DataResource)
#################################################################
:DataAppShape a sh:NodeShape ;
sh:targetClass ids:DataApp ;
rdfs:label "Data App Shape (v1.2.1)"@en ;
sh:property [
sh:path dct:title ;
sh:minCount 1 ;
sh:nodeKind sh:Literal ;
sh:message "DataApp must have at least one dct:title"@en ;
] ;
sh:property [
sh:path :hasInputProfile ;
sh:minCount 0 ;
sh:class :InputProfile ;
sh:message "DataApp SHOULD have :hasInputProfile for v1.2.1 matchmaking."@en ;
sh:severity sh:Info
] ;
sh:property [
sh:path :hasOutputProfile ;
sh:minCount 0 ;
sh:class :OutputProfile ;
sh:message "DataApp SHOULD have :hasOutputProfile for v1.2.1 symmetric profiling."@en ;
sh:severity sh:Info
] .
:DataResourceShape a sh:NodeShape ;
sh:targetClass ids:DataResource ;
rdfs:label "Data Resource Shape"@en ;
sh:property [
sh:path dct:title ;
sh:minCount 1 ;
sh:nodeKind sh:Literal ;
sh:message "DataResource must have at least one dct:title"@en ;
] ;
sh:property [
sh:path ids:representation ;
sh:minCount 0 ;
sh:class dcat:Distribution ;
sh:message "DataResource should have an ids:representation linking to a Distribution"@en ;
] .
:DataAssetLineageShape a sh:NodeShape ;
sh:targetClass :DataAsset ;
rdfs:label "Data Asset Lineage Shape"@en ;
sh:property [
sh:path :assetWasDerivedFrom ;
sh:class :DataAsset ;
sh:message "assetWasDerivedFrom values must be AgoraOWL DataAssets."@en ;
] .
#################################################################
# SHAPES: Distribution & Field Mapping (v1.2.1)
#################################################################
:TechnicalDataRepresentationShape a sh:NodeShape ;
sh:targetObjectsOf ids:representation ;
rdfs:label "Distribution Shape (v1.2.1)"@en ;
sh:property [
sh:path dct:format ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Distribution MUST have exactly one format."@en ;
] ;
sh:property [
sh:path :hasFieldMapping ;
sh:minCount 1 ;
sh:class :FieldMapping ;
sh:message "v1.2.1 REQUIRES at least one :hasFieldMapping to link atomic specifications."@en ;
sh:severity sh:Violation
] ;
# Technical metadata moved to Distribution
sh:property [
sh:path :declaresDataClass ;
sh:maxCount 1 ;
sh:class bigdat:Data ;
sh:message "Technical data class SHOULD be declared at Distribution level."@en ;
] ;
sh:property [
sh:path dcat:temporalResolution ;
sh:maxCount 1 ;
sh:datatype xsd:duration ;
sh:message "Temporal resolution MUST be an xsd:duration."@en ;
] ;
sh:property [
sh:path dcat:spatialResolutionInMeters ;
sh:maxCount 1 ;
sh:datatype xsd:decimal ;
sh:message "Spatial resolution (meters) MUST be an xsd:decimal."@en ;
] ;
sh:property [
sh:path dcat:spatialResolutionInDegrees ;
sh:maxCount 1 ;
sh:datatype xsd:decimal ;
sh:message "Spatial resolution (degrees) MUST be an xsd:decimal."@en ;
] .
:FieldMappingShape a sh:NodeShape ;
sh:targetClass :FieldMapping ;
rdfs:label "Field Mapping Shape"@en ;
sh:property [
sh:path :mapsToSpecification ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class :DataSpecification ;
sh:message "FieldMapping MUST map to exactly one atomic DataSpecification."@en ;
] ;
sh:property [
sh:path :mapsField ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:message "FieldMapping MUST specify the physical field name (column/JSONPath)."@en ;
] ;
sh:property [
sh:path :hasMetric ;
sh:class :Metric ;
sh:message "FieldMapping SHOULD contain quality metrics for its specific field."@en ;
] .
#################################################################
# SHAPES: DataSpecification & Input Profile
#################################################################
:DataSpecificationShape a sh:NodeShape ;
sh:targetClass :DataSpecification ;
rdfs:label "Atomic Data Specification Shape"@en ;
sh:property [
sh:path :hasFeatureOfInterest ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class :FeatureOfInterest ;
sh:message "Atomic specification MUST define exactly one Feature of Interest."@en ;
] ;
sh:property [
sh:path :hasObservableProperty ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class :ObservableProperty ;
sh:message "Atomic specification MUST define exactly one Observable Property."@en ;
] .
:InputProfileShape a sh:NodeShape ;
sh:targetClass :InputProfile ;
# hasDataSpecification inherited from DataProfileShape
sh:property [
sh:path :hasConstraint ;
sh:class :DataConstraint ;
sh:message "InputProfile can have multiple DataConstraints."@en ;
] .
:OutputProfileShape a sh:NodeShape ;
sh:targetClass :OutputProfile .
# hasDataSpecification inherited from DataProfileShape
:DataConstraintShape a sh:NodeShape ;
sh:targetClass :DataConstraint ;
sh:property [
sh:path :requiresUnit ;
sh:maxCount 1 ;
sh:message "Constraint can specify a required Unit."@en ;
] ;
sh:property [
sh:path :requiresMetric ;
sh:maxCount 1 ;
sh:class :ObservationMetric ;
sh:message "Constraint can specify a required Observation Metric."@en ;
] ;
sh:property [
sh:path :constraintMetricType ;
sh:maxCount 1 ;
sh:class :MetricType ;
sh:message "Constraint can specify a target MetricType."@en ;
] ;
sh:property [
sh:path :constraintOperator ;
sh:maxCount 1 ;
sh:class :ConstraintOperator ;
sh:message "Constraint should specify a formal comparison operator (e.g., :GreaterOrEqual)."@en ;
] ;
sh:property [
sh:path :constraintValue ;
sh:maxCount 1 ;
sh:message "Constraint must specify a target value."@en ;
] ;
sh:property [
sh:path :requiresDataType ;
sh:maxCount 1 ;
sh:message "Constraint can specify a required DataType (matchmaking)."@en ;
] .
#################################################################
# SHAPES: Metrics & Quality (Stable)
#################################################################
:MetricDQVComplianceShape a sh:NodeShape ;
sh:targetClass :Metric ;
sh:property [
sh:path :metricType ;
sh:maxCount 1 ;
sh:class :MetricType ;
sh:message "Metric SHOULD link to a MetricType."@en ;
] ;
sh:property [
sh:path :metricValue ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Metric MUST have exactly one value."@en ;
] .
#################################################################
# SHAPES: Semantic Coherence (v1.2.1)
#################################################################
:ProfileMatchmakingCoherenceShape a sh:NodeShape ;
sh:targetClass :DataApp ;
rdfs:comment "Verifies that each InputProfile's required specification declares an ObservableProperty."@en ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "InputProfile's required specification {?spec} has no ObservableProperty declared."@en ;
sh:prefixes : , ids: ;
sh:select """
SELECT $this ?spec
WHERE {
$this :hasInputProfile ?prof .
?prof :hasDataSpecification ?spec .
FILTER NOT EXISTS {
?spec :hasObservableProperty ?obs .
}
}
""" ;
sh:severity sh:Violation
] .
:DistributionMappingCoherenceShape a sh:NodeShape ;
sh:targetClass dcat:Distribution ;
rdfs:comment "Verifies that mappings exist for all declared properties."@en ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "Distribution lacks a mapping for required semantic property {?spec}"@en ;
sh:prefixes : , dcat: ;
sh:select """
SELECT $this ?spec
WHERE {
$this :hasFieldMapping ?mapping .
?mapping :mapsToSpecification ?spec .
FILTER NOT EXISTS {
?spec :hasObservableProperty ?anyObs .
}
}
""" ;
sh:severity sh:Violation
] .
#################################################################
# SHAPES: Vocabulary Validation (Stable)
#################################################################
:MetricTypeShape a sh:NodeShape ;
sh:targetClass :MetricType ;
sh:property [ sh:path skos:prefLabel ; sh:minCount 1 ] .
:ObservablePropertyShape a sh:NodeShape ;
sh:targetClass :ObservableProperty ;
sh:property [ sh:path skos:prefLabel ; sh:minCount 1 ] .
:FeatureOfInterestShape a sh:NodeShape ;
sh:targetClass :FeatureOfInterest .
#################################################################
# SHAPES: DataProfile (v1.2.1)
#################################################################
:DataProfileShape a sh:NodeShape ;
sh:targetClass :DataProfile ;
rdfs:label "Data Profile Shape"@en ;
sh:property [
sh:path :hasDataSpecification ;
sh:minCount 1 ;
sh:class :DataSpecification ;
sh:message "DataProfile MUST contain at least one DataSpecification."@en ;
sh:severity sh:Violation
] .
#################################################################
# SHAPES: SpatialTemporalAsset (v1.2.1)
#################################################################
:SpatialTemporalAssetShape a sh:NodeShape ;
sh:targetClass :SpatialTemporalAsset ;
rdfs:label "Spatial Temporal Asset Shape"@en ;
sh:property [
sh:path :hasSpatialCoverage ;
sh:minCount 1 ;
sh:message "SpatialTemporalAsset SHOULD have a spatial coverage."@en ;
sh:severity sh:Warning
] ;
sh:property [
sh:path :hasTemporalCoverage ;
sh:minCount 1 ;
sh:message "SpatialTemporalAsset SHOULD have a temporal coverage."@en ;
sh:severity sh:Warning
] .
#################################################################
# SHAPES: QualityReport (v1.2.1)
#################################################################
:QualityReportShape a sh:NodeShape ;
sh:targetClass :QualityReport ;
rdfs:label "Quality Report Shape"@en ;
sh:property [
sh:path :qualityReportURI ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:anyURI ;
sh:message "QualityReport MUST have exactly one qualityReportURI."@en ;
sh:severity sh:Violation
] ;
sh:property [
sh:path :reportDate ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
sh:message "QualityReport reportDate MUST be xsd:dateTime."@en ;
] ;
sh:property [
sh:path :reportingEntity ;
sh:maxCount 1 ;
sh:message "QualityReport SHOULD specify a reporting entity."@en ;
sh:severity sh:Info
] .
#################################################################
# SHAPES: CertificationReport (v1.2.1)
#################################################################
:CertificationReportShape a sh:NodeShape ;
sh:targetClass :CertificationReport ;
rdfs:label "Certification Report Shape"@en ;
sh:property [
sh:path :certificationLevel ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:message "CertificationReport MUST specify a certification level."@en ;
sh:severity sh:Violation
] ;
sh:property [
sh:path :reportDate ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
sh:message "CertificationReport reportDate MUST be xsd:dateTime."@en ;
] ;
sh:property [
sh:path :reportingEntity ;
sh:maxCount 1 ;
sh:message "CertificationReport SHOULD specify a reporting entity."@en ;
sh:severity sh:Info
] .
#################################################################
# SHAPES: Verifiable Credentials
#################################################################
:VerifiableCredentialShape a sh:NodeShape ;
sh:targetClass <https://www.w3.org/2018/credentials#VerifiableCredential> ;
sh:property [
sh:path <https://www.w3.org/2018/credentials#issuer> ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
sh:pattern "^did:" ;
sh:message "Verifiable Credential MUST have exactly one issuer with a DID"@en ;
sh:severity sh:Violation
] ;
sh:property [
sh:path <https://www.w3.org/2018/credentials#credentialSubject> ;
sh:minCount 1 ;
sh:message "Verifiable Credential MUST have at least one credentialSubject"@en ;
sh:severity sh:Violation
] ;
sh:property [
sh:path <https://www.w3.org/2018/credentials#issuanceDate> ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime ;
sh:message "Verifiable Credential MUST have exactly one issuanceDate"@en ;
sh:severity sh:Violation
] .