Skip to content

Instantly share code, notes, and snippets.

@allynt
Created May 20, 2021 13:40
Show Gist options
  • Save allynt/72983bb3457278bb6015f482fc1a71e9 to your computer and use it in GitHub Desktop.
Save allynt/72983bb3457278bb6015f482fc1a71e9 to your computer and use it in GitHub Desktop.
{"$schema":"http://json-schema.org/draft-07/schema#","title":"DataSource Schema","description":"JSONSchema defining DataSource metadata","definitions":{"component_object":{"type":"object","properties":{"name":{"type":"string"},"props":{"type":"object"}},"required":["name"]},"orbis_layer_info":{"description":"orbis-specific information to associate w/ the data layer","type":"object","properties":{"orbis":{"type":"object","properties":{"map_component":{"oneOf":[{"type":"array","items":[{"$ref":"#/definitions/component_object"}]},{"$ref":"#/definitions/component_object"}]},"sidebar_component":{"oneOf":[{"type":"array","items":[{"$ref":"#/definitions/component_object"}]},{"$ref":"#/definitions/component_object"}]},"layer":{"oneOf":[{"type":"array","items":[{"$ref":"#/definitions/component_object"}]},{"$ref":"#/definitions/component_object"}]},"categories":{"type":"object","properties":{"name":{"type":"string"},"child":{"type":"object","$ref":"#/definitions/orbis_layer_info/properties/orbis/properties/categories"}}},"filters":{"$comment":"NOT SURE WHAT GOES HERE YET","type":"object"}}}}},"orbis_property_info":{"description":"orbis-specific information to associate w/ the data layer properties","type":"object","properties":{"orbis":{"type":"object","properties":{"label":{"type":"string"},"display":{"type":"object","properties":{"colormap_type":{"type":"string","enum":["neutral_sequential","negative_sequential","diverging","defined_category"]},"colormap_reversed":{"type":"boolean"},"color":{"$comment":"SHOULD THIS BE RENAMED colormap FOR CONSISTENCY?","type":"string"},"icon":{"type":"string"},"radius":{"description":"Cluser radius","type":"number"},"legend":{"description":"The path/to/legend.png","type":"string"}}}}}}}},"type":"object","properties":{"name":{"description":"The name of the data source","type":"string"},"label":{"description":"The display-name of the data source","type":"string"},"description":{"description":"A description of the contents of the data source","type":"string"},"version":{"description":"major.minor.patch version of this data source","type":"string","pattern":"\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*"},"tiles":{"description":"Array of MVT endpoints","type":"array","items":{"type":"string"}},"data":{"description":"Array of GeoJSON endpoints","type":"array","items":{"type":"string"}},"grids":{"$comment":"NOT USED","type":"array","items":{"type":"string"}},"request_strategry":{"description":"Indicates whether data is fetched immediately or only via manual client interaction","type":"string","enum":["manual","automatic"]},"granularity":{"description":"The geometry used by this data source","type":"string","enum":["OA (average population 270)","LSOA (average population 1500)","MSOA (average population 7600)","LAD (average population 170,000)"]},"scheme":{"type":"string","enum":["zxy","xyz","tms"]},"minzoom":{"minimum":0,"maximum":30,"type":"integer"},"maxzoom":{"minimum":0,"maximum":30,"type":"integer"},"bounds":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4},"center":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"crs":{"description":"Coordinate Reference System","type":"string","const":"EPSG: 4326"},"timestamp":{"description":"When was this data generated","type":"string","pattern":"\\d{4}-\\d{2}-\\d{2}(T\\d{2}(:\\d{2}(:[0-9\\.]+)?)?)?"},"provenance":{"type":"object","properties":{"sources":{"description":"Links to input data sources","type":"array","items":{"oneOf":[{"type":"string"},{"type":"object"}]}},"creators":{"description":"Names of staff responsible for creating the data","type":"array","items":{"type":"string"}},"documentation":{"description":"Links to associated documents such as methodology","type":"array","items":{"type":"string"}}},"additionalProperties":true},"index":{"$comment":"CURRENTLY 'uniqueIdProperty' IS USED INSTEAD OF 'index'","description":"Name of property that uniquely identifies a feature","type":"string"},"domain":{"$comment":"THIS INFORMATION IS DUPLICATED BY THE DataSources API; IT SHOULD BE REMOVED","description":"The 'orb' that this data layer should be associated with","type":"string"},"properties":{"description":"All of the properties that are to be displayed on the map","type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"},"details":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"clip_min":{"type":"number"},"clip_max":{"type":"number"},"precision":{"description":"Number of decimal places for floats","type":"number"},"units":{"$comment":"NOT SURE WHAT THIS SHOULD BE RESTRICTED TO","type":"string"},"type":{"type":"string","enum":["continuous","decile","discrete","percentage"]},"aggregation":{"type":"string","enum":["mean","median","sum"]},"aggregates":{"type":"object","properties":{"GB":{"type":"number"},"England":{"type":"number"},"Scotland":{"type":"number"},"Wales":{"type":"number"}}},"breakdown":{"description":"Names of (non-displayed) properties containing component properties for charts","type":"array","items":{"type":"string"},"uniqueItems":true},"property_group":{"description":"Properties w/ the same 'property_group' are grouped together as a single property to be toggled on/off","type":"string"},"application":{"anyOf":[{"$ref":"#/definitions/orbis_property_info"}]}}}},"application":{"type":"object","anyOf":[{"$ref":"#/definitions/orbis_layer_info"}]}},"required":[]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment