-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.yml
194 lines (194 loc) · 4.44 KB
/
schema.yml
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
definitions:
payload:
type: object
required: [_id,metadata,topic]
additionalProperties: false
properties:
_id:
type: string
_rev:
type: string
_deleted:
type: boolean
enum: [true]
metadata:
$ref: "#/definitions/topicMetadata"
topic:
$ref: "#/definitions/topic"
requiredFields:
allOf:
- anyOf:
- required: [title]
- required: [text]
- required: [link]
- anyOf:
- required: [title]
- required: [broader]
- required: [actionOn]
- required: [link]
- required: [src]
topicMetadata:
type: object
additionalProperties: false
required: [id,created_at]
properties:
id:
allOf:
- $ref: "#/definitions/validIdentifier"
created_at:
type: number
minimum: 1
stale_at:
type: number
nextAction:
$ref: "#/definitions/namedRef"
firstAction:
type: boolean
topic:
type: object
additionalProperties: false
allOf:
- $ref: "#/definitions/requiredFields"
properties: &topicProperties
title:
type: string
pattern: "^[^/:]+$"
link:
type: string
format: uri
aka:
type: array
uniqueItems: true
minItems: 1
items:
type: string
links:
type: array
uniqueItems: true
minItems: 1
items:
oneOf:
- $ref: "#/definitions/namedRef"
- type: string
format: uri
- type: object
additionalProperties: false
required:
- search
properties:
search:
type: string
src:
oneOf:
- type: string
format: uri
- $ref: "#/definitions/namedRef"
text:
$ref: "#/definitions/plainText"
props:
type: object
additionalProperties: false
properties:
twitter:
$ref: "#/definitions/plainText"
quantity:
$ref: "#/definitions/plainText"
date:
type: string
pattern: "^20\\d{2}-\\d{2}-\\d{2}$"
type:
$ref: "#/definitions/namedRef"
broader:
$ref: "#/definitions/namedRefList"
actionOn:
allOf:
- $ref: "#/definitions/namedRefList"
- maxItems: 1
narrower:
$ref: "#/definitions/namedRefList"
collection:
$ref: "#/definitions/namedRefList"
related:
$ref: "#/definitions/namedRefList"
dependencies:
collection:
properties:
narrower: false
type: false
narrower:
properties:
collection: false
type:
properties:
collection: false
editor:
propertyNames:
$ref: "#/definitions/validIdentifier"
additionalProperties:
$ref: "#/definitions/editorNode"
editorNode:
type: object
additionalProperties: false
allOf:
- $ref: "#/definitions/requiredFields"
properties:
<<: *topicProperties
stale:
type: boolean
enum: [true]
collection: #skos:collection/member
$ref: "#/definitions/namedRefListInput"
notes:
$ref: "#/definitions/namedRefListInput"
tasks:
$ref: "#/definitions/namedRefListInput"
quotes:
$ref: "#/definitions/namedRefList"
backrefs:
$ref: "#/definitions/namedRefList"
editorInputNode:
type: object
allOf:
- $ref: "#/definitions/editorNode"
properties:
tasks: false
broader: false
stale: false
namedRefListInput:
type: array
minItems: 1
items:
oneOf:
- $ref: "#/definitions/editorInputNode"
- $ref: "#/definitions/plainText"
- $ref: "#/definitions/namedRef"
namedRefList:
type: array
uniqueItems: true
minItems: 1
items:
$ref: "#/definitions/namedRef"
namedRef:
type: object
required:
- ref
additionalProperties: false
properties:
stale:
type: boolean
enum: [true]
label:
type: string
ref:
$ref: "#/definitions/validIdentifier"
validIdentifier:
type: string
pattern: "^[a-zA-Z0-9-.]+$"
maxLength: 32
plainText:
type: string
allOf:
- not:
pattern: '^/'
- not:
pattern: 'https?://'