Newer
Older
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
import {siteSettings} from './defaults'
/**
* Enum of Classes that should generate pages
* @readonly
* @enum {array}
*/
export const publicDocumentTypes = [
'HumanMadeObject',
'Actor',
'Group',
'Concept',
'ObjectType',
'Place',
]
export const actorsQuery = `
{
"items": *[_type in ["Actor", "Group"]] | order(label, desc){
_id,
_type,
label,
hasType[]-> {
_id,
label
},
image,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
export const alertQuery = `
*[_type == "Alert"][0] | order(_createdAt desc) {
...
}
`
export const conceptsQuery = `
{
"items": *[_type in ["Concept", "ObjectType"]] | order(label.nor desc){
_id,
_type,
label,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
export const registryQuery = `
{
"items": *[_type in ["Concept", "ObjectType", "Actor", "Group"]] | order(label, label.nor){
_id,
_type,
label,
"count": count(*[references(^._id)]),
},
${siteSettings}
}
`
export const frontpageQuery = `
{
"frontpage": *[ _id == "frontpage" ][0] {
_id,
...,
navMenu-> {
...,
items[] {
...,
"route": landingPageRoute->.slug.current
}
},
content[] {
disabled != true => {
...
},
_type == 'MiradorGallery' && disabled != true => @{
...,
items[] {
"manifest": coalesce(manifestRef->.subjectOfManifest, manifestUrl),
canvasUrl,
},
},
_type == 'SingleObject' && disabled != true => @{
...,
item-> {
"manifest": coalesce(subjectOfManifest, manifestUrl),
canvasUrl,
}
}
}
},
"latest": *[ _type == "HumanMadeObject"][0..10] {
_id,
label,
hasType[]-> {
...
},
image,
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
}
`
export const idsQuery = `
*[_type in [...$publicDocumentTypes]] {
_id
}
`
export const routesQuery = `
*[ _type == "Route" ] {
_id,
_type,
slug
}
`
export const routeQuery = `
{
"route": *[ _type == "Route" && slug.current == $joinID ][0] {
...,
page->{
...,
navMenu->{
...,
items[]{
...,
"route": landingPageRoute->.slug.current
}
},
content[] {
...,
_type == 'PageHeader' => @{
...,
"palette": illustration.image.asset->.metadata.palette{
darkMuted,
darkVibrant,
dominant,
lightMuted,
vibrantMuted,
muted,
vibrant
}
},
_type == 'MiradorGallery' => @{
...,
items[] {
"manifest": coalesce(manifestRef->.subjectOfManifest, manifestUrl),
canvasUrl,
},
},
_type == 'SingleObject' => @{
...,
item-> {
"manifest": coalesce(subjectOfManifest, manifestUrl),
canvasUrl,
}
}
}
}
},
${siteSettings}
}
`
export const humanMadeObjectsQuery = `{
"items": *[_type == "HumanMadeObject"] | order(preferredIdentifier){
_id,
_type,
label,
preferredIdentifier,
hasType[]-> {
_id,
label
},
image,
"description": referredToBy[]{
...
},
hasCurrentOwner[0]->{
_id,
label
},
"creation": activityStream[]{
_type in ["Production", "BeginningOfExistence"] => @{
"creators": contributionAssignedBy[]{
"name": assignedActor->.label,
"_id": assignedActor->._id
},
timespan
}
},
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
"aspectRatio": image.asset->.metadata.dimensions.aspectRatio,
},
${siteSettings}
}`
export const typeQuery = `
*[_id == $id][0] {
_type
}
`
// Fields
export const humanMadeObjectFields = `
_id,
_type,
depicts[]-> {
_id,
label,
image
},
label,
hasType[]-> {
...
},
subjectOfManifest,
image{
...,
"palette": asset->.metadata.palette{
darkMuted,
darkVibrant,
dominant,
lightMuted,
vibrantMuted,
muted,
vibrant
}
},
"manifest": coalesce(subjectOfManifest, "/api/manifest/" + _id),
preferredIdentifier,
identifiedBy[] {
...,
hasType[]-> {
...
},
language[]-> {
...
}
},
activityStream[]{
_type == 'reference' => @->{
...,
contributionAssignedBy[]{
_id,
label,
image{
asset->
}
}
}
},
...,
hasType[]-> {
...
},
tookPlaceAt[]->,
movedFrom->{
_id,
label,
geoJSON
},
movedTo->{
_id,
label,
geoJSON
},
contributionAssignedBy[]{
_id,
label,
image{
asset->
}
}
},
...,
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
_id,
label,
image{
asset->
}
}
},
target->{
_id,
label,
image{
asset->
}
}
},
referredToBy[] {
...,
body[] {
...,
_type == 'reference' => @->{
_id,
_type,
preferredIdentifier,
label,
subjectOfManifest,
image{
...,
asset->
}
}
},
hasType[]-> {
...
},
language-> {
...
}
},
hasCurrentOwner[]-> {
_id,
label
},
subject[]-> {
...
},
`
export const groupFields = `
_id,
_type,
label,
hasType[]-> {
...
},
image {
...
},
referredToBy[] {
...
},
"hasMember": *[_type in ["Actor", "Group"] && references(^._id)]{
_id,
_type,
label
},
"mentionedIn": *[_type in ["HumanMadeObject"] && references(^._id)]{
_id,
_type,
label,
preferredIdentifier,
hasType[]-> {
_id,
label
},
image,
"description": referredToBy[]{
...
},
hasCurrentOwner[0]->{
_id,
label
},
"creation": activityStream[]{
_type in ["Production", "BeginningOfExistence"] => @{
"creators": contributionAssignedBy[]{
"name": assignedActor->.label,
"_id": assignedActor->._id
},
timespan
}
},
"aspectRatio": image.asset->.metadata.dimensions.aspectRatio,
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
}
`
export const pageFields = `
...,
navMenu->{
...,
items[]{
...,
"route": landingPageRoute->.slug.current
}
},
content[] {
...,
_type == 'MiradorGallery' => @{
...,
items[] {
"manifest": coalesce(manifestRef->.subjectOfManifest, manifestUrl),
canvasUrl,
},
},
_type == 'SingleObject' => @{
...,
item-> {
"manifest": coalesce(subjectOfManifest, manifestUrl),
canvasUrl,
}
}
}
`