-
Notifications
You must be signed in to change notification settings - Fork 3
/
property-template.json
252 lines (252 loc) · 8.35 KB
/
property-template.json
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://ld4p.github.io/sinopia/schemas/0.2.1/property-template.json",
"title": "Sinopia Property Template Schema",
"description": "Property template for property associated with the entity described by a resource template.",
"version": "0.2.1",
"type": "object",
"required": [
"propertyURI",
"propertyLabel",
"type"
],
"additionalProperties": false,
"properties": {
"mandatory": {
"type": ["boolean", "string"],
"enum": ["true", "false"],
"title": "Mandatory",
"description": "Indication that a value for the property is required. If unspecified, defaults to false.",
"default": false
},
"propertyLabel": {
"type": "string",
"title": "Property Label",
"description": "Preferred, human readable label associated with the property.",
"minLength": 3,
"example": [
"Search LCNAF/LCSH",
"Place of Origin of the Work (RDA 6.5)",
"Contents (LC-PCC PS 25.1)",
"Related Manifestation",
"Has Item"
]
},
"propertyURI": {
"type": "string",
"format": "uri",
"title": "Property URI",
"description": "URI of the RDF property to be used.",
"minLength": 8,
"example": [
"http://id.loc.gov/ontologies/bibframe/AdminMetadata"
]
},
"remark": {
"type": "string",
"title": "Remark",
"description": "Comment or guiding statement intended to be presented as supplementary information in user display.",
"minLength": 3,
"example": [
"http://access.rdatoolkit.org/6.17.html",
"http://www.loc.gov/mads/rdf/v1#",
"https://www.loc.gov/standards/mods/userguide/recordinfo.html#recordidentifier"
]
},
"repeatable": {
"type": ["boolean","string"],
"enum": ["true", "false"],
"title": "Repeatable",
"description": "Indication that the property is repeatable. If unspecified, defaults to true.",
"default": true
},
"resourceTemplates": {
"type": "array",
"title": "Always empty array of Resource Template References",
"description": "This is not currently used, but should/could replace valueConstraint.valueTemplateRefs",
"maxItems": 0
},
"subtype": {
"type": "string",
"title": "A subtype of the property",
"description": "Used for supporting extended context in QA",
"maxItems": 0
},
"type": {
"type": "string",
"enum": ["literal", "literal-lang", "target", "list", "lookup", "resource"],
"title": "Type",
"description": "Type of value (literal / resource / lookup) that is allowed by this property."
},
"valueConstraint": {
"type": "object",
"title": "Value Constraint",
"description": "Constraint associated with the value.",
"additionalProperties": false,
"properties": {
"valueTemplateRefs": {
"type": "array",
"title": "Array of Resource Template References (for property type resource)",
"description": "Array of identifiers (eventually URIs) of Resource Templates used by property type resource.",
"items": {
"type": "string"
},
"minItems": 1,
"example": [
"['sinopia:resourceTemplate:bf2:Agent:Person', 'sinopia:resourceTemplate:bf2:Identifiers:Barcode', 'sinopia:resourceTemplate:bflc:Agents:PrimaryContribution']"
]
},
"useValuesFrom": {
"type": "array",
"title": "Use Values From (these URIs for property type lookup)",
"description": "Array of Authority URIs or Vocabulary Lookup API identifiers to perform a lookup against (used by property type lookup)",
"items": {
"type": "string"
},
"minItems": 1,
"example": [
"['http://id.loc.gov/authorities/names', 'http://mlvlp04.loc.gov:8230/resources/works', 'http://id.loc.gov/authorities/genreForms']"
]
},
"valueDataType": {
"type": "object",
"title": "Value Data Types",
"description": "Data Type information: Type URI.",
"additionalProperties": false,
"required": ["dataTypeURI"],
"properties": {
"dataTypeURI": {
"type": "string",
"format": "uri",
"title": "Data Type URI",
"description": "URI for the Data Type of the Lookup Value default.",
"minLength": 5,
"example": [
"http://id.loc.gov/ontologies/bibframe/Work",
"http://id.loc.gov/ontologies/bflc/PrimaryContribution",
"http://www.loc.gov/mads/rdf/v1#Affiliation"
]
}
}
},
"defaults": {
"type": "array",
"title": "array of default values",
"description": "array of default values each comprised of default literal and URI",
"items": {
"type": "object",
"title": "default Literal + URI",
"description": "a default value is specified with a literal and a URI",
"anyOf": [
{ "required": ["defaultURI"] },
{ "required": [ "defaultLiteral"] }
],
"additionalProperties": false,
"properties": {
"defaultURI": {
"type": "string",
"format": "uri",
"title": "Default URI",
"description": "default value URI",
"minLength": 5,
"examples": [
"http://id.loc.gov/vocabulary/contentTypes/prm",
"http://id.loc.gov/vocabulary/subjectSchemes/lcsh"
]
},
"defaultLiteral": {
"type": "string",
"title": "Default Literal",
"description": "default literal value",
"minLength": 1,
"examples": [
"performed music",
"LCSH"
]
}
}
}
}
},
"$comment": "Use at most one of useValuesFrom, valueTemplateRefs",
"dependencies": {
"valueTemplateRefs": { "not": { "required": ["useValuesFrom"] } },
"useValuesFrom": { "not": { "required": ["valueTemplateRefs"] } }
}
}
},
"allOf": [
{
"if": {
"properties": {
"type": { "const": "lookup" }
}
},
"then": {
"$comment": "forbid resourceTemplates and require valueConstraint.useValuesFrom",
"allOf": [
{ "not": { "required": ["resourceTemplates"] } },
{ "$ref": "#/definitions/requires-valueConstraint-useValuesFrom" }
]
}
},
{
"if": {
"properties": {
"type": { "const": "resource" }
}
},
"then": {
"$comment": "require valueConstraint.valueTemplateRefs and forbid defaults",
"allOf": [
{ "$ref": "#/definitions/requires-valueConstraint-valueTemplateRefs-forbids-defaults" }
]
}
},
{
"if": {
"properties": {
"type": { "const": "literal" }
}
},
"then": {
"$comment": "forbid resourceTemplates, valueConstraint.useValuesFrom and valueConstraint.valueTemplateRefs",
"allOf": [
{ "not": { "required": ["resourceTemplates"] } },
{ "$ref": "#/definitions/valueConstraint-requires-neither-templateRefs-nor-valuesFrom" }
]
}
}
],
"definitions": {
"requires-valueConstraint-useValuesFrom": {
"required": ["valueConstraint"],
"properties": {
"valueConstraint" : {
"required": ["useValuesFrom"]
}
}
},
"requires-valueConstraint-valueTemplateRefs-forbids-defaults": {
"required": ["valueConstraint"],
"properties": {
"valueConstraint" : {
"allOf": [
{ "required": ["valueTemplateRefs"] },
{ "not": { "required": [ "defaults" ] } }
]
}
}
},
"valueConstraint-requires-neither-templateRefs-nor-valuesFrom": {
"properties": {
"valueConstraint" : {
"allOf": [
{ "not": { "required": [ "useValuesFrom" ] } },
{ "not": { "required": [ "valueTemplateRefs" ] } }
]
}
}
}
}
}