diff --git a/jsonpaths/com.opencagedata/geocoder_1.json b/jsonpaths/com.opencagedata/geocoder_1.json new file mode 100644 index 000000000..c0d298bc3 --- /dev/null +++ b/jsonpaths/com.opencagedata/geocoder_1.json @@ -0,0 +1,74 @@ +{ + "jsonpaths": [ + "$.schema.vendor", + "$.schema.name", + "$.schema.format", + "$.schema.version", + "$.hierarchy.rootId", + "$.hierarchy.rootTstamp", + "$.hierarchy.refRoot", + "$.hierarchy.refTree", + "$.hierarchy.refParent", + "$.data.annotations.sun.rise.apparent", + "$.data.annotations.sun.rise.astronomical", + "$.data.annotations.sun.rise.civil", + "$.data.annotations.sun.rise.nautical", + "$.data.annotations.sun.set.apparent", + "$.data.annotations.sun.set.astronomical", + "$.data.annotations.sun.set.civil", + "$.data.annotations.sun.set.nautical", + "$.data.bounds.northeast.lat", + "$.data.bounds.northeast.lng", + "$.data.bounds.southwest.lat", + "$.data.bounds.southwest.lng", + "$.data.annotations.DMS.lat", + "$.data.annotations.DMS.lng", + "$.data.annotations.MGRS", + "$.data.annotations.Maidenhead", + "$.data.annotations.Mercator.x", + "$.data.annotations.Mercator.y", + "$.data.annotations.OSM.edit_url", + "$.data.annotations.OSM.url", + "$.data.annotations.callingcode", + "$.data.annotations.currency.alternate_symbols", + "$.data.annotations.currency.decimal_mark", + "$.data.annotations.currency.html_entity", + "$.data.annotations.currency.iso_code", + "$.data.annotations.currency.iso_numeric", + "$.data.annotations.currency.name", + "$.data.annotations.currency.smallest_denomination", + "$.data.annotations.currency.subunit", + "$.data.annotations.currency.subunit_to_unit", + "$.data.annotations.currency.symbol", + "$.data.annotations.currency.symbol_first", + "$.data.annotations.currency.thousands_separator", + "$.data.annotations.flag", + "$.data.annotations.geohash", + "$.data.annotations.qibla", + "$.data.annotations.timezone.name", + "$.data.annotations.timezone.now_in_dst", + "$.data.annotations.timezone.offset_sec", + "$.data.annotations.timezone.offset_string", + "$.data.annotations.timezone.short_name", + "$.data.annotations.what3words.words", + "$.data.components.ISO_3166-1_alpha-2", + "$.data.components.ISO_3166-1_alpha-3", + "$.data.components._type", + "$.data.components.city", + "$.data.components.city_district", + "$.data.components.country", + "$.data.components.country_code", + "$.data.components.county", + "$.data.components.house_number", + "$.data.components.political_union", + "$.data.components.postcode", + "$.data.components.road", + "$.data.components.state", + "$.data.components.state_code", + "$.data.components.suburb", + "$.data.confidence", + "$.data.formatted", + "$.data.geometry.lat", + "$.data.geometry.lng" + ] +} diff --git a/schemas/com.opencagedata/geocoder/jsonschema/1-0-0 b/schemas/com.opencagedata/geocoder/jsonschema/1-0-0 new file mode 100644 index 000000000..70566a7be --- /dev/null +++ b/schemas/com.opencagedata/geocoder/jsonschema/1-0-0 @@ -0,0 +1,340 @@ +{ + "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", + "self": { + "vendor": "com.opencagedata", + "name": "geocoder", + "version": "1-0-0", + "format": "jsonschema" + }, + "type": "object", + "properties": { + "annotations": { + "type": "object", + "properties": { + "DMS": { + "type": "object", + "properties": { + "lat": { + "type": "string" + }, + "lng": { + "type": "string" + } + }, + "required": [ + "lat", + "lng" + ] + }, + "MGRS": { + "type": "string" + }, + "Maidenhead": { + "type": "string" + }, + "Mercator": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "required": [ + "x", + "y" + ] + }, + "OSM": { + "type": "object", + "properties": { + "edit_url": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "edit_url", + "url" + ] + }, + "callingcode": { + "type": "integer" + }, + "currency": { + "type": "object", + "properties": { + "alternate_symbols": { + "type": "array", + "items": { + "type": "string", + "maxLength": 5 + } + }, + "decimal_mark": { + "type": "string", + "maxLength": 1 + }, + "html_entity": { + "type": "string", + "maxLength": 128 + }, + "iso_code": { + "type": "string", + "maxLength": 2 + + }, + "iso_numeric": { + "type": "integer" + }, + "name": { + "type": "string", + "maxLength": 128 + }, + "smallest_denomination": { + "type": "integer" + }, + "subunit": { + "type": "string" + }, + "subunit_to_unit": { + "type": "integer" + }, + "symbol": { + "type": "string" + }, + "symbol_first": { + "type": "integer" + }, + "thousands_separator": { + "type": "string", + "maxLength": 1 + } + }, + "additionalProperties": false + }, + "flag": { + "type": "string" + }, + "geohash": { + "type": "string" + }, + "qibla": { + "type": "number" + }, + "sun": { + "type": "object", + "properties": { + "rise": { + "type": "object", + "properties": { + "apparent": { + "type": "integer" + }, + "astronomical": { + "type": "integer" + }, + "civil": { + "type": "integer" + }, + "nautical": { + "type": "integer" + } + }, + "required": [ + "apparent", + "astronomical", + "civil", + "nautical" + ] + }, + "set": { + "type": "object", + "properties": { + "apparent": { + "type": "integer" + }, + "astronomical": { + "type": "integer" + }, + "civil": { + "type": "integer" + }, + "nautical": { + "type": "integer" + } + }, + "required": [ + "apparent", + "astronomical", + "civil", + "nautical" + ] + } + }, + "required": [ + "rise", + "set" + ] + }, + "timezone": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "now_in_dst": { + "type": "integer" + }, + "offset_sec": { + "type": "integer" + }, + "offset_string": { + "type": "integer" + }, + "short_name": { + "type": "string" + } + }, + "required": [ + "name", + "now_in_dst", + "offset_sec", + "offset_string", + "short_name" + ] + }, + "what3words": { + "type": "object", + "properties": { + "words": { + "type": "string" + } + }, + "required": [ + "words" + ] + } + }, + "additionalProperties": false + }, + "bounds": { + "type": "object", + "properties": { + "northeast": { + "type": "object", + "properties": { + "lat": { + "type": "number" + }, + "lng": { + "type": "number" + } + }, + "required": [ + "lat", + "lng" + ] + }, + "southwest": { + "type": "object", + "properties": { + "lat": { + "type": "number" + }, + "lng": { + "type": "number" + } + }, + "required": [ + "lat", + "lng" + ] + } + }, + "required": [ + "northeast", + "southwest" + ] + }, + "components": { + "type": "object", + "properties": { + "ISO_3166-1_alpha-2": { + "type": "string" + }, + "ISO_3166-1_alpha-3": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "city": { + "type": "string" + }, + "city_district": { + "type": "string" + }, + "country": { + "type": "string" + }, + "country_code": { + "type": "string" + }, + "county": { + "type": "string" + }, + "house_number": { + "type": "string" + }, + "political_union": { + "type": "string" + }, + "postcode": { + "type": "string" + }, + "road": { + "type": "string" + }, + "state": { + "type": "string" + }, + "state_code": { + "type": "string" + }, + "suburb": { + "type": "string" + } + }, + "required": [ + "_type" + ] + }, + "confidence": { + "type": "integer" + }, + "formatted": { + "type": "string" + }, + "geometry": { + "type": "object", + "properties": { + "lat": { + "type": "number" + }, + "lng": { + "type": "number" + } + }, + "required": [ + "lat", + "lng" + ] + } + }, + "additionalProperties": false +} diff --git a/schemas/com.snowplowanalytics.snowplow.enrichments/opencage_enrichment_config/jsonschema/1-0-0 b/schemas/com.snowplowanalytics.snowplow.enrichments/opencage_enrichment_config/jsonschema/1-0-0 new file mode 100644 index 000000000..c664e9658 --- /dev/null +++ b/schemas/com.snowplowanalytics.snowplow.enrichments/opencage_enrichment_config/jsonschema/1-0-0 @@ -0,0 +1,49 @@ +{ + "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", + "description": "Schema for OpenCage API enrichment configuration", + "self": { + "vendor": "com.snowplowanalytics.snowplow.enrichments", + "name": "opencage_enrichment_config", + "format": "jsonschema", + "version": "1-0-0" + }, + + "type": "object", + "properties": { + "vendor": { + "type": "string" + }, + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "parameters": { + "type": "object", + "properties": { + "apiKey": { + "type": "string" + }, + "cacheSize": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "scale": { + "type": "integer", + "minimum": 0, + "maximum": 6 + }, + "timeout": { + "type": "integer", + "minimum": 1 + } + }, + "required": ["apiKey", "cacheSize", "scale", "timeout"], + "additionalProperties": false + } + }, + "required": ["name", "vendor", "enabled", "parameters"], + "additionalProperties": false +} diff --git a/sql/com.opencagedata/geocoder_1.sql b/sql/com.opencagedata/geocoder_1.sql new file mode 100644 index 000000000..40dea7626 --- /dev/null +++ b/sql/com.opencagedata/geocoder_1.sql @@ -0,0 +1,84 @@ +-- AUTO-GENERATED BY igluctl DO NOT EDIT +-- Generator: igluctl 0.5.0 +-- Generated: 2019-04-19 08:58 UTC + +CREATE SCHEMA IF NOT EXISTS atomic; + +CREATE TABLE IF NOT EXISTS atomic.com_opencagedata_geocoder_1 ( + "schema_vendor" VARCHAR(128) ENCODE ZSTD NOT NULL, + "schema_name" VARCHAR(128) ENCODE ZSTD NOT NULL, + "schema_format" VARCHAR(128) ENCODE ZSTD NOT NULL, + "schema_version" VARCHAR(128) ENCODE ZSTD NOT NULL, + "root_id" CHAR(36) ENCODE RAW NOT NULL, + "root_tstamp" TIMESTAMP ENCODE ZSTD NOT NULL, + "ref_root" VARCHAR(255) ENCODE ZSTD NOT NULL, + "ref_tree" VARCHAR(1500) ENCODE ZSTD NOT NULL, + "ref_parent" VARCHAR(255) ENCODE ZSTD NOT NULL, + "annotations.sun.rise.apparent" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.rise.astronomical" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.rise.civil" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.rise.nautical" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.set.apparent" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.set.astronomical" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.set.civil" BIGINT ENCODE ZSTD NOT NULL, + "annotations.sun.set.nautical" BIGINT ENCODE ZSTD NOT NULL, + "bounds.northeast.lat" DOUBLE PRECISION ENCODE RAW NOT NULL, + "bounds.northeast.lng" DOUBLE PRECISION ENCODE RAW NOT NULL, + "bounds.southwest.lat" DOUBLE PRECISION ENCODE RAW NOT NULL, + "bounds.southwest.lng" DOUBLE PRECISION ENCODE RAW NOT NULL, + "annotations.dms.lat" VARCHAR(4096) ENCODE ZSTD, + "annotations.dms.lng" VARCHAR(4096) ENCODE ZSTD, + "annotations.mgrs" VARCHAR(4096) ENCODE ZSTD, + "annotations.maidenhead" VARCHAR(4096) ENCODE ZSTD, + "annotations.mercator.x" DOUBLE PRECISION ENCODE RAW, + "annotations.mercator.y" DOUBLE PRECISION ENCODE RAW, + "annotations.osm.edit_url" VARCHAR(4096) ENCODE ZSTD, + "annotations.osm.url" VARCHAR(4096) ENCODE ZSTD, + "annotations.callingcode" BIGINT ENCODE ZSTD, + "annotations.currency.alternate_symbols" VARCHAR(5000) ENCODE ZSTD, + "annotations.currency.decimal_mark" VARCHAR(1) ENCODE ZSTD, + "annotations.currency.html_entity" VARCHAR(128) ENCODE ZSTD, + "annotations.currency.iso_code" VARCHAR(2) ENCODE ZSTD, + "annotations.currency.iso_numeric" BIGINT ENCODE ZSTD, + "annotations.currency.name" VARCHAR(128) ENCODE ZSTD, + "annotations.currency.smallest_denomination" BIGINT ENCODE ZSTD, + "annotations.currency.subunit" VARCHAR(4096) ENCODE ZSTD, + "annotations.currency.subunit_to_unit" BIGINT ENCODE ZSTD, + "annotations.currency.symbol" VARCHAR(4096) ENCODE ZSTD, + "annotations.currency.symbol_first" BIGINT ENCODE ZSTD, + "annotations.currency.thousands_separator" VARCHAR(1) ENCODE ZSTD, + "annotations.flag" VARCHAR(4096) ENCODE ZSTD, + "annotations.geohash" VARCHAR(4096) ENCODE ZSTD, + "annotations.qibla" DOUBLE PRECISION ENCODE RAW, + "annotations.timezone.name" VARCHAR(4096) ENCODE ZSTD, + "annotations.timezone.now_in_dst" BIGINT ENCODE ZSTD, + "annotations.timezone.offset_sec" BIGINT ENCODE ZSTD, + "annotations.timezone.offset_string" BIGINT ENCODE ZSTD, + "annotations.timezone.short_name" VARCHAR(4096) ENCODE ZSTD, + "annotations.what3words.words" VARCHAR(4096) ENCODE ZSTD, + "components.iso_3166_1_alpha_2" VARCHAR(4096) ENCODE ZSTD, + "components.iso_3166_1_alpha_3" VARCHAR(4096) ENCODE ZSTD, + "components._type" VARCHAR(4096) ENCODE ZSTD, + "components.city" VARCHAR(4096) ENCODE ZSTD, + "components.city_district" VARCHAR(4096) ENCODE ZSTD, + "components.country" VARCHAR(4096) ENCODE ZSTD, + "components.country_code" VARCHAR(4096) ENCODE ZSTD, + "components.county" VARCHAR(4096) ENCODE ZSTD, + "components.house_number" VARCHAR(4096) ENCODE ZSTD, + "components.political_union" VARCHAR(4096) ENCODE ZSTD, + "components.postcode" VARCHAR(4096) ENCODE ZSTD, + "components.road" VARCHAR(4096) ENCODE ZSTD, + "components.state" VARCHAR(4096) ENCODE ZSTD, + "components.state_code" VARCHAR(4096) ENCODE ZSTD, + "components.suburb" VARCHAR(4096) ENCODE ZSTD, + "confidence" BIGINT ENCODE ZSTD, + "formatted" VARCHAR(4096) ENCODE ZSTD, + "geometry.lat" DOUBLE PRECISION ENCODE RAW, + "geometry.lng" DOUBLE PRECISION ENCODE RAW, + FOREIGN KEY (root_id) REFERENCES atomic.events(event_id) +) +DISTSTYLE KEY +DISTKEY (root_id) +SORTKEY (root_tstamp); + +COMMENT ON TABLE atomic.com_opencagedata_geocoder_1 IS 'iglu:com.opencagedata/geocoder/jsonschema/1-0-0';