/discovery_api

A RESTful API for exploring and querying datasets and their associated metadata

Primary LanguageElixirApache License 2.0Apache-2.0

DiscoveryApi

Discovery API serves as middleware between our metadata store and our Data Discovery UI.

To start your Phoenix server(from the root directory):

  • MIX_ENV=integration mix docker.start
  • Install dependencies with mix deps.get
  • Start Phoenix endpoint with MIX_ENV=integration iex -S mix start
  • MIX_ENV=integration mix docker.stop

To run the tests

  • Run mix test to run the tests a single time
  • Run mix test.watch to re-run the tests when a file changes
  • Run mix test.watch --stale to only rerun the tests for modules that have changes
  • Run mix test.integration to run the integration tests

To run inside a container(from the root directory):

  • docker build . -t <image_name:tag>

To see the application live:

Calculating Completeness scores manually

For all datasets:

DiscoveryApi.Stats.StatsCalculator.produce_completeness_stats()

For a single dataset:

SmartCity.Dataset.get!(dataset_id) |> DiscoveryApi.Stats.StatsCalculator.calculate_and_save_completeness()

Datasets will be calculated and persisted to Redis with a key of discovery-api:stats:{{dataset_id}}