Skip to content

Commit e641c79

Browse files
GQL-110: Fix fields in the umm-viz schema (#162)
GQL-110: Update the values for `temporalExtents` and `science keywords` needs to be mapped to the umm field
1 parent 15a1d07 commit e641c79

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

src/resolvers/__tests__/visualization.test.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ describe('Visualization', () => {
9898
Category: 'EARTH SCIENCE',
9999
Topic: 'SPECTRAL/ENGINEERING',
100100
Term: 'VISIBLE WAVELENGTHS',
101-
VariableLevel1: 'REFLECTANCE'
101+
VariableLevel1: 'REFLECTANCE',
102+
DetailedVariable: 'foo'
102103
},
103104
{
104105
Category: 'EARTH SCIENCE',
@@ -277,7 +278,7 @@ describe('Visualization', () => {
277278
spatialExtent
278279
specification
279280
subtitle
280-
temporalExtent
281+
temporalExtents
281282
title
282283
ummMetadata
283284
visualizationType
@@ -326,7 +327,21 @@ describe('Visualization', () => {
326327
count: 2,
327328
items: [{ revisionId: '2' }, { revisionId: '1' }]
328329
},
329-
scienceKeywords: null,
330+
scienceKeywords: [
331+
{
332+
category: 'EARTH SCIENCE',
333+
topic: 'SPECTRAL/ENGINEERING',
334+
term: 'VISIBLE WAVELENGTHS',
335+
variableLevel1: 'REFLECTANCE',
336+
detailedVariable: 'foo'
337+
},
338+
{
339+
category: 'EARTH SCIENCE',
340+
topic: 'ATMOSPHERIC OPTICS',
341+
term: 'ATMOSPHERIC TRANSMITTANCE',
342+
variableLevel1: 'ATMOSPHERIC TRANSPARENCY'
343+
}
344+
],
330345
spatialExtent: {
331346
granuleSpatialRepresentation: 'GEODETIC',
332347
horizontalSpatialDomain: {
@@ -391,7 +406,13 @@ describe('Visualization', () => {
391406
}
392407
},
393408
subtitle: 'Terra / MODIS',
394-
temporalExtent: null,
409+
temporalExtents: [{
410+
rangeDateTimes: [{
411+
beginningDateTime: '2002-05-01T00:00:00Z',
412+
endingDateTime: '2023-12-31T23:59:59Z'
413+
}],
414+
endsAtPresentFlag: true
415+
}],
395416
title: 'FOO UPDATE MODIS Terra Corrected Reflectance (True Color)',
396417
ummMetadata: {
397418
ConceptIds: [{
@@ -422,7 +443,8 @@ describe('Visualization', () => {
422443
Category: 'EARTH SCIENCE',
423444
Topic: 'SPECTRAL/ENGINEERING',
424445
Term: 'VISIBLE WAVELENGTHS',
425-
VariableLevel1: 'REFLECTANCE'
446+
VariableLevel1: 'REFLECTANCE',
447+
DetailedVariable: 'foo'
426448
}, {
427449
Category: 'EARTH SCIENCE',
428450
Topic: 'ATMOSPHERIC OPTICS',

src/types/visualization.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Visualization {
4545
subtitle: String
4646

4747
"This class contains attributes which describe the temporal range of a specific layer. Temporal Extent includes a specification of the Temporal Range Type of the collection, which is one of Range Date Time, Single Date Time, or Periodic Date Time"
48-
temporalExtent: JSON
48+
temporalExtents: JSON
4949

5050
"A short descriptive title of the visualization."
5151
title: String

src/utils/umm/visualizationKeyMap.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"provider": "meta.provider",
1717
"revisionDate": "meta.revision-date",
1818
"revisionId": "meta.revision-id",
19+
"scienceKeywords": "umm.ScienceKeywords",
1920
"spatialExtent": "umm.SpatialExtent",
2021
"specification": "umm.Specification",
2122
"subtitle": "umm.Subtitle",
22-
"temporalExtent": "umm.TemporalExtent",
23+
"temporalExtents": "umm.TemporalExtents",
2324
"title": "umm.Title",
2425
"ummMetadata": "umm",
2526
"userId": "meta.user-id",

0 commit comments

Comments
 (0)