This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcustodial_history_property_shapes.ttl
407 lines (368 loc) · 11.5 KB
/
custodial_history_property_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
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
@prefix activity: <https://w3id.org/arm/activity/ontology/0.1/> .
@prefix arm: <https://w3id.org/arm/core/ontology/0.1/> .
@prefix bf: <http://id.loc.gov/ontologies/bibframe/> .
@prefix ch: <https://w3id.org/arm/custodial_history/ontology/0.1/> .
@prefix crm: <http://www.cidoc-crm.org/Property/P2-has-type/Version-6.2/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@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 seq: <http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <https://w3id.org/arm/custodial_history/validation/shacl/custodial_history_property_shapes/> .
#
# ///// CUSTODIAL HISTORY VALIDATION PROPERTY SHAPES - MAY BE EXTENDED BY UI SHAPES ///// #
#
#
# Not requiring edtf:EDTF typing of dates - indicate on forms that it is
# recommended.
#
# TODO Do we really want to specify sh:nodeKind sh:IRI? We should probably
# leave the option open to sh:BlankNodeOrIRI. Then we can't specify it
# here because the form shapes can't override it to specify sh:IRI. From the
# SHACL doc: "A shape has at most one value for sh:nodeKind."
#
# These are only preliminary validation shapes. Add more constraints later.
#
# Links a resource to its Activity.
:activity_hasActivity
a sh:PropertyShape ;
sh:path activity:hasActivity ;
sh:nodeKind sh:IRI ;
sh:class activity:Activity ;
.
# Links an Activity to a resource.
:activity_isActivityOf
a sh:PropertyShape ;
sh:path activity:isActivityOf ;
sh:targetClass activity:Activity ;
sh:nodeKind sh:IRI ;
# Not always true. E.g., in the ARM model, BinderActivity links to both
# Item and Binding.
# sh:maxCount 1 ;
.
# Links a resource to its location.
:arm_atLocation
a sh:PropertyShape ;
sh:path arm:atLocation ;
sh:nodeKind sh:IRI ;
.
# Links an agent to a resource (generally an Activity or Contribution, but
# open to others).
:arm_isAgentOf
a sh:PropertyShape ;
sh:path arm:isAgentOf ;
sh:targetClass bf:Agent ;
sh:nodeKind sh:IRI ;
.
# Links a location to the resource located there.
:arm_isLocationOf
a sh:PropertyShape ;
sh:path arm:isLocationOf ;
sh:nodeKind sh:IRI ;
.
# Links a resource to its agent. Generally an Activity, but open to others.
:bf_agent
a sh:PropertyShape ;
sh:path bf:agent ;
sh:class bf:Agent ;
sh:nodeKind sh:IRI ;
# An Activity always has a unique agent. But might we use bf:agent with
# other subject types, where it wouldn't be unique?
# sh:maxCount 1 ;
.
# Date of an event, condition, or other resource.
:bf_date
a sh:PropertyShape ;
sh:path bf:date ;
sh:nodeKind sh:Literal ;
# Recommended but not required.
# sh:datatype edtf:EDTF ;
.
# Generic shape linking a resource to one of its parts.
:bf_hasPart
a sh:PropertyShape ;
sh:path bf:hasPart ;
sh:nodeKind sh:IRI ;
.
# The CustodialHistory has a CustodialEvent, OR the aggregate CustodialEvent
# has a CustodialEvent part.
:bf_hasPart_ch_CustodialEvent
a sh:PropertyShape ;
sh:node :bf_hasPart ;
sh:targetClass ch:CustodialHistory ;
sh:class ch:CustodialEvent ;
.
# Links a resource to an Identifier.
:bf_identifiedBy
a sh:PropertyShape ;
sh:path bf:identifiedBy ;
sh:nodeKind sh:IRI ;
sh:class bf:Identifier ;
.
# Links a resource to its CustodialEvent via AccessionNumber
:bf_identifiedBy_ch_accessions
a sh:PropertyShape ;
sh:path ( bf:identifiedBy ch:accessions ) ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
.
# Links an Identifier to the resource it identifies.
:bf_identifies
a sh:PropertyShape ;
sh:path bf:identifies ;
sh:nodeKind sh:IRI ;
.
# Links a resource to a Note about the resource.
:bf_note
a sh:PropertyShape ;
sh:path bf:note ;
sh:nodeKind sh:IRI ;
sh:class bf:Note ;
.
# Generic shape linking a resource to a resource it is a part of.
:bf_partOf
a sh:PropertyShape ;
sh:path bf:partOf ;
sh:nodeKind sh:IRI ;
.
# The CustodialEvent is part of an aggregate CustodialEvent
:bf_partOf_ch_CustodialEvent
a sh:PropertyShape ;
sh:node :bf_partOf ;
sh:class ch:CustodialEvent ;
sh:maxCount 1 ;
.
# The CustodialEvent is part of the CustodialHistory
:bf_partOf_ch_CustodialHistory
a sh:PropertyShape ;
sh:node :bf_partOf ;
sh:class ch:CustodialHistory ;
sh:maxCount 1 ;
.
# CustodialEvent to resource via CustodialHistory
:bf_partOf_ch_isCustodialHistoryOf
sh:path ( bf:partOf ch:isCustodialHistoryOf ) ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
# NB Don't include sh:class bf:Item, since the ontology and validation
# shapes can be used outside the bibliographic context.
sh:maxCount 1 ;
.
# Links a resource to its status.
:bf_status
a sh:PropertyShape ;
sh:path bf:status ;
sh:nodeKind sh:IRI ;
# Range is specified in the ontology; a validator implementation
# *should* factor in ontology axioms, but add here for implementations
# that don't.
sh:class bf:Status ;
.
# Links certain types of CustodialEvents to an AccessionNumber.
:ch_accessionedBy
a sh:PropertyShape ;
sh:path ch:accessionedBy ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
sh:class arm:AccessionNumber ;
.
# Links a CustodialEvent to the associated resource via AccessionNumber.
:ch_accessionedBy_bf_identifies
a sh:PropertyShape ;
sh:path ( ch:accessionedBy bf:identifies ) ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
# NB Don't include sh:class bf:Item, since the ontology and validation
# shapes can be used outside the bibliographic context.
.
# Links an AccessionNumber to the CustodialEvent.
:ch_accessions
a sh:PropertyShape ;
sh:path ch:accessions ;
sh:targetClass arm:AccessionNumber ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
.
# Links a CustodialEvent to its specific rdf:type.
:ch_CustodialEvent_rdf_type
a sh:PropertyShape ;
sh:node :rdf_type ;
sh:targetClass ch:CustodialEvent ;
sh:in (
ch:Accessioning
ch:Auction
ch:Bequest
ch:ClaimOfOwnership
ch:Deaccessioning
ch:Deposit
ch:Destruction
ch:Discarding
ch:Donation
ch:Inheritance
ch:Loan
ch:Loss
ch:Offer
ch:Ownership
ch:Recovery
ch:Repatriation
ch:Sale
ch:Theft
ch:Transfer
ch:CustodialEvent
) ;
.
# Links a CustodialEvent to the rdf:type of an associated Activity.
# TODO Specific Activity types can be linked only to specific CustodialEvent
# types. For example, a BuyerActivity is relevant to a Sale but not to a
# Theft.
:ch_CustodialEvent_activity_Activity_rdf_type
a sh:PropertyShape ;
sh:node :rdf_type ;
sh:targetClass ch:CustodialEvent ;
sh:in (
ch:AccessionerActivity
ch:AcquisitionActivity
ch:BorrowerActivity
ch:BuyerActivity
ch:ClaimantActivity
activity:ContributorActivity
ch:DeaccessionerActivity
ch:DealerActivity
ch:DepositorActivity
ch:DestructionActivity
ch:DiscarderActivity
ch:DisputantActivity
ch:DonorActivity
ch:InheritorActivity
ch:LenderActivity
ch:LossActivity
ch:OfferActivity
ch:OwnerActivity
activity:PatronActivity
ch:RecipientActivity
ch:RecovererActivity
ch:RepatriatorActivity
ch:SellerActivity
ch:TestatorActivity
ch:ThiefActivity
ch:TransfererActivity
ch:WitnessActivity
activity:Activity
) ;
.
# Resource to CustodialHistory
:ch_hasCustodialHistory
a sh:PropertyShape ;
sh:path ch:hasCustodialHistory ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialHistory ;
sh:maxCount 1 ;
.
# Resource to CustodialEvent via CustodialHistory
:ch_hasCustodialHistory_bf_hasPart
a sh:PropertyShape ;
sh:path ( ch:hasCustodialHistory bf:hasPart ) ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
.
# CustodialHistory to resource
:ch_isCustodialHistoryOf
a sh:PropertyShape ;
sh:path ch:isCustodialHistoryOf ;
sh:targetClass ch:CustodialHistory ;
sh:nodeKind sh:IRI ;
# NB Don't include sh:class bf:Item, since the ontology and validation
# shapes can be used outside the bibliographic context.
sh:maxCount 1 ;
.
# Links a resource to its rdf:type.
:rdf_type
a sh:PropertyShape ;
sh:path rdf:type ;
sh:nodeKind sh:IRI ;
.
# Links a resource to its rdf:value, either a Literal or non-Literal.
:rdf_value
a sh:PropertyShape ;
sh:path rdf:value ;
# Do not specify sh:nodeKind; leave for implementations to define
# according to context.
.
# Links a resource to its rdfs:label.
:rdfs_label
a sh:PropertyShape ;
sh:path rdfs:label ;
sh:nodeKind sh:Literal ;
.
# Links a PriceSpecification to the amount.
:schema_price
a sh:PropertyShape ;
sh:path schema:price ;
sh:targetClass schema:PriceSpecification ;
sh:nodeKind sh:Literal ;
sh:datatype xsd:decimal ;
# A resource can have multiple prices (PriceSpecifications), either in
# the same or different currencies, but each PriceSpecification has only
# one value (price) and currency.
sh:maxCount 1 ;
.
# Links a PriceSpecification to a currency.
:schema_priceCurrency
a sh:PropertyShape ;
sh:path schema:priceCurrency ;
sh:targetClass schema:PriceSpecification ;
sh:nodeKind sh:Literal ;
sh:datatype xsd:string ;
# Schema defines the value as "The currency (in 3-letter ISO 4217
# format) of the price."
sh:pattern "^[A-Z]{3}$" ;
# A resource can have multiple prices (PriceSpecifications) with
# different values, but each PriceSpecification has only one value
# (price) and currency.
sh:maxCount 1 ;
.
# Links certain types of CustodialEvents, such as Sale, to price paid.
:schema_priceSpecification
a sh:PropertyShape ;
sh:path schema:priceSpecification ;
sh:targetClass schema:PriceSpecification ;
sh:nodeKind sh:IRI ;
sh:class schema:PriceSpecification ;
.
# Links a CustodialEvent to a directly preceding one.
:seq_directlyFollows
a sh:PropertyShape ;
sh:path seq:directlyFollows ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
sh:maxCount 1 ;
.
# Links a CustodialEvent to a directly following one.
:seq_directlyPrecedes
a sh:PropertyShape ;
sh:path seq:directlyPrecedes ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
sh:maxCount 1 ;
.
# Links a CustodialEvent to a directly or indirectly preceding one.
:seq_follows
a sh:PropertyShape ;
sh:path seq:follows ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
.
# Links CustodialEvent to a directly or indirectly following one.
:seq_precedes
a sh:PropertyShape ;
sh:path seq:precede ;
sh:targetClass ch:CustodialEvent ;
sh:nodeKind sh:IRI ;
sh:class ch:CustodialEvent ;
.