Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a way to retrieve metadata from multiple cubes #1271

Merged
merged 5 commits into from
Nov 17, 2023

Conversation

bprusinowski
Copy link
Collaborator

@bprusinowski bprusinowski commented Nov 15, 2023

This PR adapts the application logic to support retrieving metadata from multiple cubes at once. As we don't yet a design for this feature, there are some FIXME: adapt to design comments in places that would need to be revisited once ready.

GQL / SPARQL

  • Removed DataCubeMetadata query (replaced by DataCubesMetadata)
  • Changed the way we fetch cube metadata from DESCRIBEing cube shape to only fetching what we actually need via a dedicated, more performant query. To further improve performance and limit resolver chains, I've extracted the dimension types from GQL to TypeScript. It also means that we now explicitly parse them inside the resolver and don't need to fire additional queries to get theme and creator labels
  • Cleaned up the repository from fetching cube metadata in places that didn't require it

Context

This PR is a second part of preparations for merging the cubes. For the technical concept, see this Notion document.

  • DataCubesComponents
  • DataCubesMetadata
  • DataCubesObservations

How to test

  1. Click around in the application and make sure nothing is broken 💥
  2. Open GQL playground and send e.g. the following query to see that metadata from both cubes was fetched.

Query

query DataCubesMetadata(
  $sourceType: String!
  $sourceUrl: String!
  $locale: String!
  $filters: [DataCubeFilter!]!
) {
  dataCubesMetadata(
    sourceType: $sourceType
    sourceUrl: $sourceUrl
    locale: $locale
    filters: $filters
  )
}

Variables

{
  "sourceType": "sparql",
  "sourceUrl": "https://lindas.admin.ch/query",
  "locale": "en",
  "filters": [{ "iri": "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9", "latest": true }, { "iri": "https://environment.ld.admin.ch/foen/ubd0104/6", "latest": true }]
}

Copy link

vercel bot commented Nov 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2023 11:21am

@bprusinowski bprusinowski marked this pull request as ready for review November 16, 2023 11:42
Base automatically changed from feat/several-cubes-in-the-same-chart to main November 17, 2023 14:47
@bprusinowski bprusinowski merged commit 099771b into main Nov 17, 2023
2 of 3 checks passed
@bprusinowski bprusinowski deleted the feat/multiple-cubes-metadata branch November 17, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant