-
Notifications
You must be signed in to change notification settings - Fork 1
/
fields.js
281 lines (268 loc) · 9.88 KB
/
fields.js
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
// This file is to store all fields that we want to list
// If we add hidden parameter to a field
// the hidden fields would be only render in the field selection dropdown menu
// :Param collapse: true -> close , false or default undefined -> open
// :Param hidden: true -> hide the field, false or default undefined-> show the field
// For the solr faceted search variables
// ----------------------------------------------------------------------------------------
const MIN_YEAR = 1800;
const MAX_YEAR = new Date().getFullYear();
const fields = [
{ field: "curation_accessContraints", type: "non-search", hidden: true },
{ field: "curation_description_text", type: "non-search", hidden: true },
{ field: "curation_label", type: "non-search", hidden: true },
{ field: "curation_location", type: "non-search", hidden: true },
{ field: "curation_responsibility", type: "non-search", hidden: true },
{ field: "description_text", type: "non-search", hidden: true },
{ label: "Context", field: "hasContextCategory", type: "hierarchy-facet", collapse: true },
{ label: "Material", field: "hasMaterialCategory", type: "hierarchy-facet", collapse: true },
{ label: "Sample Object Type", field: "hasSpecimenCategory", type: "hierarchy-facet", collapse: true },
{ label: "Identifier", field: "id", type: "text" },
{ field: "informalClassification", type: "non-search", hidden: true },
{ field: "keywords", type: "text" },
{ field: "label", type: "non-search" },
{ field: "producedBy_description_text", type: "non-search", hidden: true },
{ field: "producedBy_hasFeatureOfInterest", type: "non-search", hidden: true },
{ field: "producedBy_label", type: "non-search", hidden: true },
{ field: "producedBy_responsibility", type: "non-search", hidden: true },
{ field: "producedBy_resultTime", type: "non-search" },
{ label: "Collection Date", field: "producedBy_resultTimeRange", type: "date-range-facet", minValue: MIN_YEAR, maxValue: MAX_YEAR , value:[MIN_YEAR, MAX_YEAR]},
{ field: "producedBy_samplingSite_description_text", type: "non-search", hidden: true },
{ field: "producedBy_samplingSite_label", type: "non-search", hidden: true },
{ field: "producedBy_samplingSite_location_elevationInMeters", type: "non-search", hidden: true },
{ field: "producedBy_samplingSite_location_latitude", type: "non-search", hidden: true },
{ field: "producedBy_samplingSite_location_longitude", type: "non-search", hidden: true },
{ field: "producedBy_samplingSite_placeName", type: "non-search" },
{ field: "registrant", type: "list-facet", facetSort: "count", collapse: true },
{ field: "samplingPurpose", type: "non-search", hidden: true },
{ label: "All text fields", field: "searchText", type: "text" },
{ field: "source", type: "list-facet", facetSort: "index", collapse: true },
{ field: "sourceUpdatedTime", type: "non-search", collapse: true },
{ field: "authorizedBy", type: "list-facet", collapse: true , hidden: true},
// for spatial query
{ label: "Spatial Query", field: "producedBy_samplingSite_location_rpt", type: "spatialquery" },
];
// The sortable fields you want
const sortFields = [
{ label: "Identifier", field: "id" },
{ label: "Source", field: "source" },
{ label: "Context", field: "hasContextCategory" },
{ label: "Registrant", field: "registrant" },
{ label: "Collection Time", field: "producedBy_resultTime" }
];
// ----------------------------------------------------------------------------------------
// For the Cesium Map
// ----------------------------------------------------------------------------------------
// moorea position
const INITIAL_LONGITUDE = -149.8169236266867;
const INITIAL_LATITUDE = -17.451466233002286;
const INITIAL_HEIGHT = 2004.7347996772614;
const INITIAL_HEADING = 201.84408760864753;
const INITIAL_PITCH = -20.853642866175978;
// the initial camera position, moorea
const initialCamera = {
facet: "List",
longitude: INITIAL_LONGITUDE,
latitude: INITIAL_LATITUDE,
height: INITIAL_HEIGHT,
heading: INITIAL_HEADING,
pitch: INITIAL_PITCH
}
// color bind schema Wong
const colorbind = ["#D55E00", "#E69F00", "#009E73", "#56B4E9", "#CC79A7", "#F0E442"];
// The default source if the solr cannot return faceted
const source = ["GEOME", "OPENCONTEXT", "SESAR", "SMITHSONIAN"];
// ----------------------------------------------------------------------------------------
// For the DOIs
// Rules:
// Object key is the field name
// Property:
// type: the field type
// items: the value of field (array || string)
// description: a string to describe the field
// -------------------------s---------------------------------------------------------------
const DOIFIELDS_REQUIRED = {
'prefix': {
'type': 'string',
'items': window.config.datacite_prefix,
},
'suffix': {
'type': 'null'
},
'creators': {
'type': 'array'
},
'titles': {
'type': 'array'
},
'publisher': {
'type': 'array',
'items': window.config.datacite_publisher,
},
'publicationYear': {
'type': 'number',
'items': 0
}
};
// DOIs schema:
// https://support.datacite.org/docs/api-create-dois
const DOIFIELDS_RECOMMENDED = {
"subject": {
"type": "string",
"description": "Subject, keyword, classification code, or key phrase describing the resource"
},
"contributor": {
"type": "string",
"description": "The institution or person responsible for collection, managing, distributing, or otherwise contributing to the development of the resource"
},
"date": {
"type": 'number',
"description": "Different dates relevant to the work"
},
"relatedIdentifier": {
"type": "array",
"description": "Identifiers of related resources, These must be globally unique identifiers."
},
"geolocation": {
"type": "string",
"description": "Spatial region or named place where the data was gathered or about which the data is focused."
},
"language": {
"type": "string"
},
"alternateIdentifier": {
"type": "string"
},
"size": {
"type": "string"
},
"format": {
"type": "string"
},
"rights": {
"type": "string"
},
"fundingReference": {
"type": "string"
}
}
// iSamples Schema:
// https://github.com/isamplesorg/metadata/blob/main/iSamplesSchemaBasic0.3.2.json
const ISAMPLES_RECOMMENDED = {
"curation": {
"type": "string",
"description": "information about any post-collection processing of the sample, and about its current location and stewadship."
},
"description": {
"description": "free text description of the subject of a triple.",
"type": "string"
},
"hasContextCategory": {
"description": "top level context, based on the kind of feature sampled. Specific identification of the sampled feature of interest is done through the SamplingEvent/Feature of Interest property.",
"items": [
"Active human occupation site",
"Atmosphere",
"Earth interior",
"Experiment setting",
"Extraterrestrial environment",
"Glacier environment",
"Site of past human activities",
"Laboratory environment",
"Lake, river or stream bottom",
"Marine biome",
"Marine water body",
"Marine water body bottom",
"Subaerial surface environment",
"Subaerial terrestrial biome",
"Subaqueous terrestrial biome",
"Subsurface fluid reservoir",
"Terrestrial water body",
"Not Provided"
],
"type": "array"
},
"hasMaterialCategory": {
"description": "specify the kind of material that constitutes the sample",
"items": [
"anthropogenicmaterial",
"Anthropogenic metal",
"Biogenic non-organic material",
"Gaseous material",
"Ice",
"Mineral",
"Non-aqueous liquid material",
"Not Provided",
"Organic material",
"Particulate",
"Rock",
"Sediment",
"Soil",
"Water"
],
"type": "array"
},
"hasSpecimenCategory": {
"description": "specify the kind of object that the specimen is",
"items": [
"Aggregation",
"Analytical preparation",
"Anthropogenic aggregation",
"Artifact",
"Biome aggregation",
"Experiment product",
"Fossil",
"Liquid or gas sample",
"Organism part",
"Organism product",
"Other solid object",
"Whole organism",
"Not Provided"
],
"type": "array"
},
"informalClassification": {
"description": "free text classification terms, not from a controlled vocabulary; generally terms applied by collector",
"type": "array"
},
"keywords": {
"description": "free text categorization of sample to support discovery",
"type": "array"
},
"label": {
"description": "a human intelligible string used to identify a thing, i.e. the name to use for the thing; should be unique in the scope of a sample collection or dataset.",
"type": "string"
},
"producedBy": {
"description": "object that documents the sampling event--who, where, when the specimen was obtained",
"type": "string"
},
"registrant": {
"description": "identification of the agent that registered the sample, with contact information. Should include person name and affiliation, or position name and affiliation, or just organization name. e-mail address is preferred contact information.",
"type": "string"
},
"relatedResource": {
"description": "link to related resource with relationship property to indicate nature of connection. Target should be identifier for a resource.",
"type": "array"
},
"sampleidentifier": {
"description": "URI that identifies the physical sample described by this record",
"type": "string"
},
"samplingPurpose": {
"description": "term to specify why a sample was collection.",
"type": "string"
}
}
// ----------------------------------------------------------------------------------------
export {
fields,
sortFields,
initialCamera,
colorbind,
source,
DOIFIELDS_REQUIRED,
DOIFIELDS_RECOMMENDED,
ISAMPLES_RECOMMENDED,
MIN_YEAR,
MAX_YEAR
}