This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapes.ttl
191 lines (165 loc) · 4.94 KB
/
shapes.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
@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 xsd: <http://www.w3.org/2001/XMLSchema#>
@prefix owl: <http://www.w3.org/2002/07/owl#>
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
@prefix obo: <http://purl.obolibrary.org/obo/>
@prefix qc: <http://purl.obolibrary.org/tools/qc-shapes/shapes#>
qc:AllObjects
rdf:type qc:AllObjectsScope ;
rdfs:comment "A reusable instance of qc:AllObjectsScope." ;
rdfs:label "All objects" .
qc:AllObjectsScope
rdf:type sh:SPARQLScopeType ;
rdfs:comment "A scope containing all objects in the data graph as focus nodes." ;
rdfs:label "All objects scope" ;
rdfs:subClassOf sh:Scope ;
sh:labelTemplate "All objects" ;
sh:select """SELECT DISTINCT ?this WHERE { ?anyS ?anyP ?this . }""" .
qc:TextValuesShouldNotContainDoubleSpaces
rdfs:label "Text values should not contain double spaces." ;
a sh:Shape ;
sh:scope qc:AllObjects ;
sh:filterShape [
sh:constraint [
sh:nodeKind sh:Literal ;
sh:datatype xsd:string
]
] ;
sh:constraint [
sh:not [
sh:constraint [
sh:pattern " "
]
]
] .
qc:NoSynonymShouldEqualLabel
rdfs:label "A synonym should not be the same as the label of a term." ;
a sh:Shape ;
sh:scopeProperty rdfs:label ;
sh:property [
sh:predicate rdfs:label ;
sh:disjoint oboInOwl:hasRelatedSynonym
] ;
sh:property [
sh:predicate rdfs:label ;
sh:disjoint oboInOwl:hasExactSynonym
] ;
sh:property [
sh:predicate rdfs:label ;
sh:disjoint oboInOwl:hasNarrowSynonym
] ;
sh:property [
sh:predicate rdfs:label ;
sh:disjoint oboInOwl:hasBroadSynonym
] .
qc:ShouldNotHaveLeadingOrTrailingSpaces
rdfs:label "Text values should not have leading or trailing spaces." ;
a sh:Shape ;
sh:scope qc:AllObjects ;
sh:filterShape [
sh:constraint [
sh:nodeKind sh:Literal ;
sh:datatype xsd:string
]
] ;
sh:constraint [
sh:not [
sh:constraint [
sh:pattern "^ "
]
]
] ;
sh:constraint [
sh:not [
sh:constraint [
sh:pattern " $"
]
]
] .
qc:LabelsShouldBeUnique
rdfs:label "A given label should only be used for one non-obsolete term in the ontology." ;
a sh:Shape ;
sh:scopeInverseProperty rdfs:label ;
sh:property [
sh:path [
sh:inversePath rdfs:label
] ;
sh:qualifiedMaxCount 1 ;
sh:qualifiedValueShape qc:NotObsoleteNamedClass
] .
qc:ExactSynonymsShouldBeUnique
rdfs:label "A given exact synonym should only be used for one term in the ontology." ;
a sh:Shape ;
sh:scopeInverseProperty oboInOwl:hasExactSynonym ;
sh:property [
sh:path [
sh:inversePath oboInOwl:hasExactSynonym
] ;
sh:maxCount 1
] .
qc:NamedClass
a sh:Shape ;
sh:constraint [
sh:class owl:Class ;
sh:nodeKind sh:IRI
] .
qc:NotObsoleteNamedClass
a sh:Shape ;
sh:constraint [
sh:and (
qc:NamedClass
[
sh:constraint [
sh:not [
sh:property [
sh:predicate owl:deprecated ;
sh:hasValue true
]
]
]
]
)
] .
qc:EveryClassShouldHaveALabel
rdfs:label "Every class should have a label." ;
a sh:Shape ;
sh:scopeClass owl:Class ;
sh:filterShape qc:NamedClass ;
sh:property [
sh:predicate rdfs:label ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
] .
qc:EveryClassShouldHaveADefinition
rdfs:label "Every class should have a definition." ;
a sh:Shape ;
sh:scopeClass owl:Class ;
sh:filterShape qc:NotObsoleteNamedClass ;
sh:property [
sh:predicate obo:IAO_0000115 ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1
] .
qc:ValueNotShortFormForObsoleteTerm
a sh:SPARQLConstraint ;
sh:message "Value must not be obsolete." ;
sh:select """
SELECT $this ($this AS ?subject) (<http://www.w3.org/2002/07/owl#deprecated> AS ?predicate) (true AS ?object)
WHERE {
BIND(IRI(CONCAT("http://purl.obolibrary.org/obo/", REPLACE($this, ":", "_"))) AS ?alt)
?alt <http://www.w3.org/2002/07/owl#deprecated> true .
}
""" .
qc:AltIDsShouldNotPointToObsoleteTerms
a sh:Shape ;
sh:scopeProperty oboInOwl:hasAlternativeId ;
sh:property [
sh:predicate oboInOwl:hasAlternativeId ;
sh:shape [
sh:sparql qc:ValueNotShortFormForObsoleteTerm
]
] .