-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdfhash.ttl
375 lines (330 loc) · 13 KB
/
rdfhash.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
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix gist: <https://ontologies.semanticarts.com/gist/> .
@prefix hash: <http://rdfhash.com/ontology/> .
@prefix hashid: <http://rdfhash.com/id/> .
hash: a owl:Ontology ;
rdfs:label "`rdfhash` Ontology" ;
rdfs:comment "Ontology for `rdfhash` tool." ;
owl:versionInfo "0.0.1" ;
rdfs:seeAlso <http://rdfhash.com/>, <https://github.com/NeilGraham/rdfhash> ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:id a owl:DatatypeProperty ;
rdfs:label "id" ;
rdfs:comment "Main identifier for subject. Can be Literal or URI. A subject can only have 1 instance of this property." ;
rdfs:subPropertyOf sh:property ;
rdfs:domain owl:Thing ;
rdfs:range xsd:string ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:id_shape a sh:PropertyShape ;
sh:path hash:id ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# _____________________________________________________________________________ #
hash:Rule a owl:Class, sh:NodeShape ;
rdfs:label "Rule" ;
rdfs:comment "A rule for selecting subject URI's and hashing a checksum of their source/subset graph definition." ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
sh:property hash:id_shape ;
sh:property [
a sh:PropertyShape ;
sh:path hash:sparql ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
], [
a sh:PropertyShape ;
sh:path hash:insert ;
sh:class hash:Definition ;
], [
a sh:PropertyShape ;
sh:path hash:method ;
sh:class hash:Method ;
sh:maxCount 1 ;
sh:defaultValue hash:sha256 ;
], [
a sh:PropertyShape ;
sh:path hash:template ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:defaultValue "{method}:{value}" ;
], [
a sh:PropertyShape ;
sh:path hash:include ;
], [
a sh:PropertyShape ;
sh:path hash:exclude ;
sh:class hash:Triples ;
], [
a sh:PropertyShape ;
sh:path hash:inputTemplate ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:defaultValue "{p} {o}.\\n" ;
], [
a sh:PropertyShape ;
sh:path hash:bitSize ;
sh:datatype xsd:integer ;
sh:maxCount 1 ;
] .
# __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ #
hash:sparql a owl:DatatypeProperty ;
rdfs:label "sparql" ;
rdfs:comment "SPARQL query used to select instances to be hashed. SELECT returns Subject URIs to replace with a checksum of their source graph definition. CONSTRUCT allows you to return a subset of the graph to hash; All Subject URIs are replaced in the source graph with a checksum of the CONSTRUCTed graph definition." ;
rdfs:subPropertyOf sh:property ;
rdfs:domain hash:Rule ;
rdfs:range xsd:string ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:insert a owl:ObjectProperty ;
rdfs:label "insert" ;
rdfs:comment "A nested set of triples that are inserted on selected instances. Look at `hash:Triples` for more information on handling dynamic values." ;
rdfs:domain hash:Rule ;
rdfs:range hash:Definition ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:inherit a owl:ObjectProperty ;
rdfs:label "inherit" ;
rdfs:comment "Inherit all properties from another `hash:Rule` instance. " ;
rdfs:domain hash:Rule ;
rdfs:range hash:Rule ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:method a owl:ObjectProperty ;
rdfs:label "method" ;
rdfs:comment "The hash method used to generate the hash value. (e.g. `hash:sha256`)" ;
rdfs:domain hash:Rule ;
rdfs:range hash:Method ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:template a owl:DatatypeProperty ;
rdfs:label "template" ;
rdfs:comment "URI template generated from hash value. The template can contain the following variables: {method} (e.g. `md5`), {value} (e.g. `a6be11c879133def33fdb767be80056f`)" ;
rdfs:domain hash:Rule ;
rdfs:range xsd:string ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:include a owl:ObjectProperty ;
rdfs:label "include" ;
rdfs:comment "The list of properties to include in the hash input. If none specified, all properties are included." ;
rdfs:domain hash:Rule ;
rdfs:range owl:Thing ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:exclude a owl:ObjectProperty ;
rdfs:label "exclude" ;
rdfs:comment "The list of properties to exclude from the hash input." ;
rdfs:domain hash:Rule ;
rdfs:range owl:Thing ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:inputTemplate a owl:DatatypeProperty ;
rdfs:label "input template" ;
rdfs:comment "Input triple statement used to generate hash value. The generated template is sorted among a list of all other triples on the subject, then joined together with an empty string. The template can contain the following variables: {p} (predicate), {o} (object)." ;
rdfs:domain hash:Rule ;
rdfs:range xsd:string ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:bitSize a owl:DatatypeProperty ;
rdfs:label "Bit Size" ;
rdfs:comment "Size of the hash value in bits." ;
rdfs:subPropertyOf sh:property ;
rdfs:domain hash:Rule ;
rdfs:range xsd:integer ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# _____________________________________________________________________________ #
# hash:Option & hash:SaltForm
hash:Option a owl:Class, sh:NodeShape ;
rdfs:subClassOf gist:Category ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:SaltForm a owl:Class, sh:NodeShape ;
rdfs:subClassOf gist:Option ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ #
hash:option a owl:ObjectProperty ;
rdfs:subPropertyOf gist:isCategorizedBy ;
rdfs:label "option" ;
rdfs:comment "An option for a hash method." ;
rdfs:domain hash:Rule ;
rdfs:range hash:Option ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ #
hash:saltPrefixTriples a hash:SaltForm, owl:NamedIndividual ;
rdfs:label "prefix triples" ;
rdfs:comment "Insert salt before each triple in the input hash string." ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:saltSuffixTriples a hash:SaltForm, owl:NamedIndividual ;
rdfs:label "suffix triples" ;
rdfs:comment "Insert salt after each triple in the input hash string." ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# _____________________________________________________________________________ #
hash:Method a owl:Class, sh:NodeShape ;
rdfs:subClassOf gist:Category ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
sh:property [
a sh:PropertyShape ;
sh:path hash:requiresBitSize ;
sh:datatype xsd:boolean ;
sh:defaultValue false ;
] ;
sh:property [
a sh:PropertyShape ;
sh:path hash:isDeterministic ;
sh:datatype xsd:boolean ;
sh:defaultValue false ;
] ;
.
# __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ #
hash:isDeterministic a gist:Category, owl:NamedIndividual ;
rdfs:label "is deterministic" ;
rdfs:comment "Whether the hash method is deterministic." ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:requiresBitSize a gist:Category, owl:NamedIndividual ;
rdfs:label "requires bit size" ;
rdfs:comment "Whether the hash method requires a bit size." ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:md5 a hash:Method, owl:NamedIndividual ;
hash:id "md5" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha1 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha1" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha224 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha224" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha256 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha256" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha384 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha384" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha512 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha512" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha3-224 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha3-224" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha3-256 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha3-256" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha3-384 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha3-384" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:sha3-512 a hash:Method, owl:NamedIndividual ;
rdfs:label "sha3-512" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:blake2b a hash:Method, owl:NamedIndividual ;
rdfs:label "blake2b" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:blake2s a hash:Method, owl:NamedIndividual ;
rdfs:label "blake2s" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:uuid1 a hash:Method, owl:NamedIndividual ;
rdfs:label "uuid1" ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:uuid3 a hash:Method, owl:NamedIndividual ;
rdfs:label "uuid3" ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:uuid4 a hash:Method, owl:NamedIndividual ;
rdfs:label "uuid4" ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:uuid5 a hash:Method, owl:NamedIndividual ;
rdfs:label "uuid5" ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:shake-128 a hash:Method, owl:NamedIndividual ;
rdfs:label "shake-128" ;
gist:isCategorizedBy hash:requiresBitSize ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
hash:shake-256 a hash:Method, owl:NamedIndividual ;
rdfs:label "shake-256" ;
gist:isCategorizedBy hash:requiresBitSize ;
gist:isCategorizedBy hash:isDeterministic ;
dcterms:creator <https://github.com/NeilGraham> ;
dcterms:created "2023-06-22"^^xsd:date ;
.
# _____________________________________________________________________________ #