smart_city v2.4.2 SmartCity.Event.DatasetUpdate View Source

Struct defining a dataset update event. This is triggered when new datasets are put into the system or existing datasets are updated

const Dataset = {
  "id": "",                  // UUID
  "business": {              // Project Open Data Metadata Schema v1.1
    "categories": [""],
    "conformsToUri": "",
    "contactEmail": "",
    "contactName": "",
    "dataTitle": "",       // user friendly (dataTitle)
    "describedByMimeType": "",
    "describedByUrl": "",
    "description": "",
    "homepage": "",
    "issuedDate": "",
    "keywords": [""],
    "language": "",
    "license": "",
    "modifiedDate": "",
    "orgTitle": "",        // user friendly (orgTitle)
    "parentDataset": "",
    "publishFrequency": "",
    "referenceUrls": [""],
    "rights": "",
    "spatial": "",
    "temporal": ""
  },
  "technical": {
    "authHeaders": {"header1": "", "header2": ""}
    "authUrl": "",
    "cadence": "",
    "dataName": "",        // ~r/[a-zA-Z_]+$/
    "orgId": "",
    "orgName": "",         // ~r/[a-zA-Z_]+$/
    "protocol": "",       // List of protocols to use. Defaults to nil. Can be [http1, http2]
    "schema": [{
      "name": "",
      "type": "",
      "description": ""
    }],
    "sourceFormat": "",
    "sourceHeaders": {
      "header1": "",
      "header2": ""
    },
    "sourceQueryParams": {
      "key1": "",
      "key2": ""
    },
    "sourceType": "",     // remote|stream|ingest|host
    "sourceUrl": "",
    "systemName": "",      // ${orgName}__${dataName},
    "transformations": [], // ?
    "validations": [],     // ?
  },
  "_metadata": {
    "intendedUse": [],
    "expectedBenefit": []
  }
}

Link to this section Summary

Functions

Returns true if SmartCity.Dataset.Technical sourceType field is host

Returns true if SmartCity.Dataset.Technical sourceType field is ingest

Returns true if SmartCity.Dataset.Technical sourceType field is remote

Returns true if SmartCity.Dataset.Technical sourceType field is stream

Link to this section Types

Link to this section Functions

Link to this function

is_host?(dataset_update)

View Source

Returns true if SmartCity.Dataset.Technical sourceType field is host

Link to this function

is_ingest?(dataset_update)

View Source

Returns true if SmartCity.Dataset.Technical sourceType field is ingest

Link to this function

is_remote?(dataset_update)

View Source

Returns true if SmartCity.Dataset.Technical sourceType field is remote

Link to this function

is_stream?(dataset_update)

View Source

Returns true if SmartCity.Dataset.Technical sourceType field is stream

Link to this function

new(msg)

View Source
new(String.t() | map()) :: {:ok, map()} | {:error, term()}

Returns a new SmartCity.Event.DatasetUpdate struct. SmartCity.Event.DatasetUpdate.Business, SmartCity.Event.DatasetUpdate.Technical, and SmartCity.Event.DatasetUpdate.Metadata structs will be created along the way.

Parameters

  • msg : map defining values of the struct to be created. Can be initialized by

    • map with string keys
    • map with atom keys
    • JSON