-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdatacatalog-constraint.ttl
174 lines (169 loc) · 5.19 KB
/
datacatalog-constraint.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
@prefix : <https://cube.link/shape/datacatalog-constraint#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix cube: <https://cube.link/> .
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dcterms: <http://purl.org/dc/terms/>
#
# This is the bare minimal SHACL shape for validating a datacatalog.
# All datacatlogs should pass this validation.
#
:DataCatalogShape
a sh:NodeShape ;
sh:targetClass schema:DataCatalog ;
#sh:targetClass ;
sh:or(
sh:property [
sh:path schema:name;
sh:minCount 1;
sh:datatype xsd:string;
sh:message "schema:DataCatalog needs a schema:name"
]
sh:property [
sh:path schema:name;
sh:minCount 1;
sh:datatype rdf:langString;
sh:message "schema:DataCatalog needs a schema:name"
]
);
sh:property [
# optional, but recommended
sh:path schema:dataset;
sh:minCount 1;
sh:node :DataSetShape ;
sh:message "schema:DataCatalog needs at least one dataset"
] .
:DataSetShape
a sh:NodeShape ;
sh:targetClass schema:Dataset;
sh:or(
sh:property [
sh:path schema:name;
sh:minCount 1;
sh:datatype xsd:string;
sh:message "schema:Dataset needs a schema:name"
]
sh:property [
sh:path schema:name;
sh:minCount 1;
sh:datatype rdf:langString;
sh:message "schema:Dataset needs a schema:name"
]
);
sh:or(
sh:property [
sh:path schema:description;
sh:minCount 1;
sh:datatype xsd:string;
sh:message "schema:Dataset needs a schema:description"
]
sh:property [
sh:path schema:description;
sh:minCount 1;
sh:datatype rdf:langString;
sh:message "schema:Dataset needs a schema:description"
]
);
sh:property [
sh:path schema:identifier;
sh:minCount 1;
sh:maxCount 1;
sh:datatype xsd:string;
sh:message "schema:Dataset needs a schema:identifier"
] ;
sh:property [
sh:path schema:publisher ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs an schema:publisher"
] ;
sh:property [
sh:path schema:contactPoint ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs an schema:contactpoint"
] ;
sh:property [
sh:path schema:contributor ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs an schema:contributor"
] ;
sh:property [
sh:path schema:dateCreated ;
sh:minCount 1 ;
sh:datatype xsd:date;
sh:message "schema:Dataset needs a valid schema:dateCreated"
] ;
sh:property [
sh:path schema:dateModified ;
sh:minCount 1 ;
sh:datatype xsd:date;
sh:message "schema:Dataset needs a valid schema:dateModified"
] ;
sh:property [
sh:path schema:hasPart ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs a schema:hasPart"
] ;
sh:property [
sh:path void:sparqlEndpoint ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs a void:sparqlEndpoint"
] ;
sh:property [
sh:path void:rootResource ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs a void:rootResource"
] ;
sh:property [
sh:path void:exampleResource ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "schema:Dataset needs a void:exampleResource"
] ;
sh:property [
sh:path dcat:distribution ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:node :DCATDistributionShape;
sh:message "schema:Dataset needs a valid dcat:Distribution"
] ;
.
:DCATDistributionShape
a sh:NodeShape ;
sh:targetClass dcat:Distribution;
sh:property [
sh:path dcterms:issued ;
sh:minCount 1 ;
sh:datatype xsd:date;
sh:message "dcat:Distribution needs a valid dcterms:issues"
] ;
sh:property [
sh:path dcterms:publisher ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "dcat:Distribution needs a valid dcterms:publisher"
] ;
sh:property [
sh:path dcterms:identifier ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string;
sh:message "dcat:Distribution needs a valid dcterms:identifier"
] ;
sh:property [
sh:path dcat:downloadURL;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "dcat:Distribution needs a valid dcat:downloadURL"
] ;
.