-
Notifications
You must be signed in to change notification settings - Fork 2
/
skohub.shacl.ttl
285 lines (281 loc) · 9.72 KB
/
skohub.shacl.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
@prefix : <http://skohub.io/skohub-shacl> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix sdo: <https://schema.org> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
# rdfs:comment holds info with what file under ./tests/invalid/skohub.shacl.ttl
# the constraint is tested
# ConceptScheme
:ConceptSchemeShape
a sh:NodeShape ;
sh:targetClass skos:ConceptScheme ;
sh:or (
[
sh:path dct:title ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no dct:title with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
[
sh:path skos:prefLabel ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no skos:prefLabel with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
[
sh:path dc:title ;
sh:minCount 1;
sh:datatype rdf:langString ;
sh:message "Concept Scheme has no dc:title with a language tag!" ;
sh:severity sh:Violation ;
rdfs:comment "Tested with 01_cs_no_title.ttl" ;
]
);
sh:property [
sh:path skos:hasTopConcept ;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "A SKOS Concept Scheme should at least have one top Concept" ;
rdfs:comment "Tested with 02_cs_one_top_concept.ttl" ;
] ;
sh:property [
sh:path skos:hasTopConcept ;
sh:class skos:Concept ;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "The target class for hasTopConcept should be skos:Concept" ;
rdfs:comment "Tested with 03_cs_target_class_hasTopConcept.ttl" ;
] ;
sh:or (
[
sh:path dct:description ;
sh:datatype rdf:langString ;
sh:severity sh:Warning ;
sh:minCount 1 ;
sh:message: "A description of the Concept Scheme should be provided." ;
rdfs:comment "Tested with 04_cs_no_description.ttl" ;
rdfs:comment "Tested with 05_cs_description_no_langstring.ttl" ;
]
[
sh:path dc:description ;
sh:datatype rdf:langString ;
sh:severity sh:Warning ;
sh:minCount 1 ;
sh:message: "A description of the Concept Scheme should be provided." ;
rdfs:comment "Tested with 04_cs_no_description.ttl" ;
rdfs:comment "Tested with 05_cs_description_no_langstring.ttl" ;
]
) ;
sh:property [
sh:path dct:license ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:severity sh:Warning ;
sh:message "A provided license increases reusability of a vocabulary. Should be an URI." ;
rdfs:comment "Tested with 06_cs_no_license.ttl" ;
rdfs:comment "Tested with 07_cs_license_wrong_nodekind.ttl" ;
] ;
sh:property [
sh:path vann:preferredNamespaceUri ;
sh:minCount 1 ;
sh:datatype xsd:string ;
sh:severity sh:Warning ;
sh:message "A preferred Namespace URI should be given as a string, especially if you want to use your vocabulary in reconciliation services." ;
rdfs:comment "Tested with 08_cs_no_prefNamespaceUri.ttl" ;
rdfs:comment "Tested with 09_cs_prefNamespace_wrong_datatype.ttl" ;
] ;
.
# Concept
:ConceptShape
a sh:NodeShape ;
sh:targetClass skos:Concept ;
sh:property [
sh:path skos:prefLabel ;
sh:minCount 1 ;
sh:datatype rdf:langString ;
sh:uniqueLang true ;
sh:message "Each skos:Concept has to provide a skos:prefLabel in a unique language" ;
sh:severity: sh:Violation ;
rdfs:comment "Tested with 10_c_no_prefLabel.ttl" ;
] ;
sh:property [
sh:path skos:prefLabel ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Preferred label should be provided with a language tag." ;
rdfs:comment "Tested with 11_c_no_language.ttl" ;
] ;
sh:property [
sh:path skos:altLabel ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Alternative label should be provided with a language tag." ;
rdfs:comment "Tested with 12_c_altLabel_no_language.ttl" ;
] ;
sh:property [
sh:path skos:hiddenLabel ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Hidden label should be provided with a language tag." ;
rdfs:comment "Tested with 13_c_hiddenLabel_no_language.ttl" ;
] ;
sh:property [
sh:path skos:definition ;
sh:severity sh:Violation ;
sh:uniqueLang true ;
sh:datatype rdf:langString ;
sh:message "Definition should be provided with a unique language tag." ;
rdfs:comment "Tested with 14_c_definition_no_language.ttl" ;
rdfs:comment "Tested with 15_c_definition_no_unique_language.ttl" ;
] ;
sh:property [
sh:path skos:scopeNote ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Scope Note should be provided with a language tag." ;
rdfs:comment "Tested with 16_c_scopeNote_no_language.ttl" ;
] ;
sh:property [
sh:path skos:note ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Note should be provided with a language tag." ;
rdfs:comment "Tested with 17_c_note_no_language.ttl" ;
] ;
sh:property [
sh:path skos:notation ;
sh:severity sh:Violation ;
sh:datatype xsd:string ;
sh:message "Notation should be provided as a string." ;
rdfs:comment "Tested with 18_c_notation_no_string.ttl" ;
] ;
sh:property [
sh:path skos:example ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Example should be provided with a language tag." ;
rdfs:comment "Tested with 19_c_example_no_language.ttl" ;
] ;
sh:property [
sh:path skos:narrower ;
sh:class skos:Concept ;
sh:severity sh:Violation ;
sh:message "Target class of skos:narrower should be a skos:Concept" ;
rdfs:comment "Tested with 20_c_narrower_target_no_concept.ttl" ;
] ;
sh:property [
sh:class skos:Concept ;
sh:path skos:narrowerTransitive ;
sh:severity sh:Violation ;
sh:message "Target class of skos:narrowerTransitive should be a skos:Concept" ;
rdfs:comment "Tested with 21_c_narrowerTransitive_target_no_concept.ttl" ;
] ;
sh:property [
sh:path skos:narrowMatch ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "Target class of skos:narrowMatch should be a URI" ;
rdfs:comment "Tested with 22_c_narrowMatch_target_no_iri.ttl" ;
] ;
sh:property [
sh:path skos:broader ;
sh:class skos:Concept ;
sh:severity sh:Violation ;
sh:message "Target class of skos:broader should be a skos:Concept" ;
rdfs:comment "Tested with 23_c_broader_no_concept.ttl" ;
] ;
sh:property [
sh:path skos:broaderTransitive ;
sh:class skos:Concept ;
sh:severity sh:Violation ;
sh:message "Target class of skos:broaderTransitive should be a skos:Concept" ;
rdfs:comment "Tested with 24_c_broaderTransitive_no_concept.ttl" ;
] ;
sh:property [
sh:path skos:broadMatch ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "Target class of skos:broadMatch should be a URI" ;
rdfs:comment "Tested with 25_c_broadMatch_no_iri.ttl" ;
] ;
sh:property [
sh:path skos:related ;
sh:class skos:Concept ;
sh:severity sh:Violation ;
sh:message "Target class of skos:related should be a skos:Concept" ;
rdfs:comment "Tested with 26_c_related_no_concept.ttl" ;
] ;
sh:property [
sh:path skos:relatedMatch ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "Target class of skos:relatedMatch should be a URI" ;
rdfs:comment "Tested with 27_c_relatedMatch_no_iri.ttl" ;
] ;
sh:property [
sh:path skos:closeMatch ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "Target class of skos:closeMatch should be a URI" ;
rdfs:comment "Tested with 28_c_closeMatch_no_iri.ttl" ;
] ;
sh:property [
sh:path skos:exactMatch ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "Target class of skos:exactMatch should be a URI" ;
rdfs:comment "Tested with 29_c_exactMatch_no_iri.ttl" ;
] ;
sh:property [
sh:path skos:inScheme ;
sh:class skos:ConceptScheme ;
sh:severity sh:Violation ;
sh:message "Target class of skos:inScheme should be a skos:ConceptScheme" ;
rdfs:comment "Tested with 30_c_inScheme_target_no_cs.ttl" ;
] ;
sh:property [
sh:path skos:topConceptOf ;
sh:class skos:ConceptScheme ;
sh:severity sh:Violation ;
sh:message "Target class of skos:topConceptOf should be a skos:ConceptScheme" ;
rdfs:comment "Tested with 31_c_topConceptOf_target_no_conceptScheme.ttl" ;
] ;
.
:CollectionShape
a sh:NodeShape ;
sh:targetClass skos:Collection ;
sh:property [
sh:path skos:prefLabel ;
sh:severity sh:Violation ;
sh:datatype rdf:langString ;
sh:message "Preferred label should be provided with a language tag." ;
rdfs:comment "Tested with 33_collection_prefLabel_no_language.ttl" ;
] ;
sh:property [
sh:path skos:prefLabel ;
sh:minCount 1 ;
sh:datatype rdf:langString ;
sh:uniqueLang true ;
sh:message "Each skos:Collection has to provide a skos:prefLabel in a unique language" ;
sh:severity: sh:Warning ;
rdfs:comment "Tested with 34_collection_prefLabel_no_unique_language.ttl" ;
] ;
sh:property [
sh:path skos:member ;
sh:class skos:Concept ;
sh:severity sh:Violation ;
sh:message "The object of skos:member should be a skos:Concept" ;
rdfs:comment "Tested with 35_collection_member_no_concept.ttl" ;
]
.