-
Notifications
You must be signed in to change notification settings - Fork 0
/
cold_api.yaml
87 lines (87 loc) · 5.01 KB
/
cold_api.yaml
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
#
# cold_api.yaml defines the controlled object list with Dataset JSON API.
#
# @author: R. S. Doiel <[email protected]>
#
host: localhost:8112
# This htdocs directory is provided by cold_ui so we don't enable it.
#htdocs: htdocs
collections:
# Each collection is an object. The path prefix is
# /api/<dataset_name>/...
- dataset: people.ds
query:
people_names: select json_object('clpid', src->'clpid', 'family_name', src->'family_name', 'given_name', src->'given_name') as src from people order by src->'family_name' ASC, src->'given_name' ASC;
missing_bios: select json_object('clpid', json_extract(src, '$.clpid'), 'ims_uid', json_extract(src, '$.directory_user_id')) as src from people where json_extract(src, '$.directory_user_id') != '' and json_extract(src, '$.bio') == '';
directory_people: select json_object('clpid', json_extract(src, '$.clpid'), 'imss_uid', json_extract(src, '$.directory_user_id'), 'caltech', json_extract(src, '$.caltech')) as src from people where json_extract(src, '$.directory_user_id') != '';
# family_name,given_name,cl_people_id,thesis_id,advisor_id,authors_id,archivesspace_id,directory_id,viaf_id,lcnaf,isni,wikidata,snac,orcid,image,educated_at,caltech,jpl,faculty,alumn,status,directory_person_type,title,bio,division,authors_count,thesis_count,data_count,advisor_count,editor_count,updated
people_csv: select json_object( 'family_name', src->'family_name', 'given_name', src->'given_name', 'cl_people_id', src->'clpid', 'thesis_id', src->'thesis_id', 'advisor_id', src->'advisor_id', 'authors_id', src->'authors_id', 'archivesspace_id', src->'archivesspace_id', 'directory_id', src->'directory_user_id', 'viaf_id', src->'viaf', 'lcnaf', src->'lcnaf', 'isni', src->'isni', 'wikidata', src->'wikidata', 'orcid', src->'orcid', 'image', '', 'educated_at', src->'educated_at', 'caltech', src->'caltech', 'jpl', src->'jpl', 'faculty', src->'faculty', 'alumn', src->'alumn', 'status', src->'status', 'directory_person_type', src->'directory_person_type', 'title', src->'title', 'bio', src->'bio', 'division', src->'division', 'authors_count', '', 'thesis_count', '', 'data_count', '', 'advisor_count', '', 'editor_count', '', 'updated', '', 'include_in_feeds', src->'include_in_feeds') as src from people order by src->'family_name', src->'given_name'
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: groups.ds
query:
group_names: select json_object('clgid', src->'clgid', 'group_name', src->'name') as src from groups order by src->'name' ASC;
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: funders.ds
query:
funder_names: select json_object('clfid', src->'clfid', 'name', src->'name') as src from funders order by src->'name';
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: subjects.ds
query:
subject_names: select json_object('clsid', src->'clsid', 'name', src->'name') as src from subjects order by src->'name';
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: issn.ds
query:
issn_names: select json_object('issn', src->'issn', 'name', src->'name') as src from issn order by src->'name';
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: doi_prefix.ds
query:
doi_prefix_names: select json_object('doi_prefix', src->'doi_prefix', 'name', src->'name') as src from doi_prefix order by src->'name';
# What follows are object level permissions
keys: true
create: true
read: true
update: true
# This sets versioning behavior
versions: true
- dataset: reports.ds
query:
# report_list shows the report requests in a stack view, most recently changed at the time regardless of status
report_list: select json_object('id', src->'id', 'link', src->'link', 'content_type', src->'content_type', 'report_name', src->'report_name', 'emails', src->'emails', 'status', src->'status', 'requested', src->'requested', 'updated', src->'updated') as src from reports order by src->>'updated' desc;
# next request implements the FIFO, i.e. a queue
next_request: select json_object('id', src->'id', 'link', src->'link', 'content_type', src->'content_type', 'report_name', src->'report_name', 'emails', src->'emails', 'status', src->'status', 'requested', src->'requested', 'updated', src->'updated') as src from reports where src->>'status' = 'requested' order by src->>'updated' asc;
keys: true
read: true
create: true
update: true
# This sets versioning behavior
versions: true