diff --git a/app/charts/shared/chart-data-filters.tsx b/app/charts/shared/chart-data-filters.tsx index ed9304335..4375fb6ff 100644 --- a/app/charts/shared/chart-data-filters.tsx +++ b/app/charts/shared/chart-data-filters.tsx @@ -30,7 +30,6 @@ import { HierarchyValue, TemporalDimension, TimeUnit, - useDimensionHierarchyQuery, useDimensionValuesQuery, } from "@/graphql/query-hooks"; import { Icon } from "@/icons"; @@ -154,21 +153,7 @@ const DataFilter = ({ }, }); - const dimension = data?.dataCubeByIri?.dimensionByIri; - - const [hierarchyResp] = useDimensionHierarchyQuery({ - variables: { - cubeIri: dataSetIri, - dimensionIri: dimension?.iri!, - sourceType: dataSource.type, - sourceUrl: dataSource.url, - locale: locale, - }, - pause: !dimension, - }); - - const hierarchy = - hierarchyResp.data?.dataCubeByIri?.dimensionByIri?.hierarchy; + const hierarchy = data?.dataCubeByIri?.dimensionByIri?.hierarchy; const setDataFilter = ( e: SelectChangeEvent | { target: { value: string } } diff --git a/app/charts/shared/legend-color.tsx b/app/charts/shared/legend-color.tsx index e5fd98f53..7cca19773 100644 --- a/app/charts/shared/legend-color.tsx +++ b/app/charts/shared/legend-color.tsx @@ -20,8 +20,7 @@ import { import { Observation } from "@/domain/data"; import { DimensionMetadataFragment, - useDataCubeMetadataWithComponentValuesQuery, - useDimensionHierarchyQuery, + useDimensionValuesQuery, } from "@/graphql/query-hooks"; import SvgIcChevronRight from "@/icons/components/IcChevronRight"; import { useLocale } from "@/src"; @@ -108,9 +107,10 @@ const useDimension = ({ locale: string; dimensionIri?: string; }) => { - const [{ data: cubeMetadata }] = useDataCubeMetadataWithComponentValuesQuery({ + const [{ data: cubeMetadata }] = useDimensionValuesQuery({ variables: { - iri: dataset, + dataCubeIri: dataset, + dimensionIri: dimensionIri!, sourceType: dataSource.type, sourceUrl: dataSource.url, locale: locale, @@ -118,10 +118,8 @@ const useDimension = ({ pause: !dimensionIri, }); return useMemo(() => { - return cubeMetadata?.dataCubeByIri?.dimensions.find( - (d) => d.iri === dimensionIri - ); - }, [cubeMetadata?.dataCubeByIri?.dimensions, dimensionIri]); + return cubeMetadata?.dataCubeByIri?.dimensionByIri; + }, [cubeMetadata?.dataCubeByIri?.dimensionByIri]); }; const emptyObj = {}; @@ -168,9 +166,9 @@ const useLegendGroups = ({ dimensionIri: segmentField?.componentIri, }); - const [hierarchyResp] = useDimensionHierarchyQuery({ + const [hierarchyResp] = useDimensionValuesQuery({ variables: { - cubeIri: dataset, + dataCubeIri: dataset, dimensionIri: segmentDimension?.iri!, sourceType: dataSource.type, sourceUrl: dataSource.url, diff --git a/app/configurator/components/chart-configurator.tsx b/app/configurator/components/chart-configurator.tsx index b66d756f4..3706ca563 100644 --- a/app/configurator/components/chart-configurator.tsx +++ b/app/configurator/components/chart-configurator.tsx @@ -18,6 +18,7 @@ import { import { makeStyles } from "@mui/styles"; import isEmpty from "lodash/isEmpty"; import isEqual from "lodash/isEqual"; +import omitBy from "lodash/omitBy"; import sortBy from "lodash/sortBy"; import { useEffect, useRef, useState, useMemo } from "react"; import { @@ -283,27 +284,30 @@ const useFilterReorder = ({ return getFiltersByMappingStatus(state.chartConfig); }, [state.chartConfig]); - const variables = useMemo( - () => ({ + const variables = useMemo(() => { + const hasUnmappedFilters = Object.keys(unmappedFilters).length > 0; + const vars = { iri: state.dataSet, sourceType: state.dataSource.type, sourceUrl: state.dataSource.url, locale, - filters: unmappedFilters, + filters: hasUnmappedFilters ? unmappedFilters : undefined, // This is important for urql not to think that filters // are the same while the order of the keys has changed. // If this is not present, we'll have outdated dimension // values after we change the filter order - filterKeys: Object.keys(unmappedFilters).join(", "), - }), - [ - state.dataSet, - state.dataSource.type, - state.dataSource.url, - locale, - unmappedFilters, - ] - ); + filterKeys: hasUnmappedFilters + ? Object.keys(unmappedFilters).join(", ") + : undefined, + }; + return omitBy(vars, (x) => x === undefined) as typeof vars; + }, [ + state.dataSet, + state.dataSource.type, + state.dataSource.url, + locale, + unmappedFilters, + ]); const [{ data, fetching: dataFetching }, executeQuery] = useDataCubeMetadataWithComponentValuesQuery({ diff --git a/app/gql-flamegraph/devtool.tsx b/app/gql-flamegraph/devtool.tsx index e5e749f64..2ff21c502 100644 --- a/app/gql-flamegraph/devtool.tsx +++ b/app/gql-flamegraph/devtool.tsx @@ -169,6 +169,12 @@ const CopyLink = ({ toCopy, ...props }: { toCopy: string } & LinkProps) => { ); }; +const getOperationQueryName = (operation: Operation) => { + return operation.query.definitions.find( + (d): d is OperationDefinitionNode => d.kind === "OperationDefinition" + )?.name?.value; +}; + /** * Collapsible according showing for each request that has been made * a accordion with name @@ -208,13 +214,7 @@ const AccordionOperation = ({ }} > - {operation.key}{" "} - { - operation.query.definitions.find( - (d): d is OperationDefinitionNode => - d.kind === "OperationDefinition" - )?.name?.value - } + {operation.key} {getOperationQueryName(operation)} {result ? "✅" : "🔄"} diff --git a/app/graphql/queries/data-cubes.graphql b/app/graphql/queries/data-cubes.graphql index de43a48ea..cb239285a 100644 --- a/app/graphql/queries/data-cubes.graphql +++ b/app/graphql/queries/data-cubes.graphql @@ -216,6 +216,7 @@ query DimensionValues( sourceUrl: $sourceUrl ) { ...dimensionMetadata + ...hierarchyMetadata } } } diff --git a/app/graphql/query-hooks.ts b/app/graphql/query-hooks.ts index e2c133e3a..1b2391679 100644 --- a/app/graphql/query-hooks.ts +++ b/app/graphql/query-hooks.ts @@ -1,17 +1,13 @@ -import { DimensionValue } from "../domain/data"; -import { QueryFilters } from "../configurator"; -import { Observation } from "../domain/data"; -import { RawObservation } from "../domain/data"; -import gql from "graphql-tag"; -import * as Urql from "urql"; +import { DimensionValue } from '../domain/data'; +import { QueryFilters } from '../configurator'; +import { Observation } from '../domain/data'; +import { RawObservation } from '../domain/data'; +import gql from 'graphql-tag'; +import * as Urql from 'urql'; export type Maybe = T | null; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & - { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & - { [SubKey in K]: Maybe }; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; export type Omit = Pick>; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { @@ -31,21 +27,21 @@ export type Scalars = { }; export type DataCube = { - __typename: "DataCube"; - iri: Scalars["String"]; - identifier?: Maybe; - title: Scalars["String"]; - version?: Maybe; - contactName?: Maybe; - contactEmail?: Maybe; + __typename: 'DataCube'; + iri: Scalars['String']; + identifier?: Maybe; + title: Scalars['String']; + version?: Maybe; + contactName?: Maybe; + contactEmail?: Maybe; creator?: Maybe; - landingPage?: Maybe; - workExamples?: Maybe>>; - publisher?: Maybe; - description?: Maybe; - datePublished?: Maybe; - dateModified?: Maybe; - expires?: Maybe; + landingPage?: Maybe; + workExamples?: Maybe>>; + publisher?: Maybe; + description?: Maybe; + datePublished?: Maybe; + dateModified?: Maybe; + expires?: Maybe; publicationStatus: DataCubePublicationStatus; observations: ObservationsQuery; dimensions: Array; @@ -54,310 +50,333 @@ export type DataCube = { themes: Array; }; + export type DataCubeObservationsArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - limit?: Maybe; - dimensions?: Maybe>; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + limit?: Maybe; + dimensions?: Maybe>; + filters?: Maybe; }; + export type DataCubeDimensionsArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; + export type DataCubeDimensionByIriArgs = { - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; + export type DataCubeMeasuresArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export type DataCubeOrganization = { - __typename: "DataCubeOrganization"; - iri: Scalars["String"]; - label?: Maybe; + __typename: 'DataCubeOrganization'; + iri: Scalars['String']; + label?: Maybe; }; export enum DataCubePublicationStatus { - Draft = "DRAFT", - Published = "PUBLISHED", + Draft = 'DRAFT', + Published = 'PUBLISHED' } export type DataCubeResult = { - __typename: "DataCubeResult"; - score?: Maybe; - highlightedTitle?: Maybe; - highlightedDescription?: Maybe; + __typename: 'DataCubeResult'; + score?: Maybe; + highlightedTitle?: Maybe; + highlightedDescription?: Maybe; dataCube: DataCube; }; export enum DataCubeResultOrder { - Score = "SCORE", - TitleAsc = "TITLE_ASC", - CreatedDesc = "CREATED_DESC", + Score = 'SCORE', + TitleAsc = 'TITLE_ASC', + CreatedDesc = 'CREATED_DESC' } export type DataCubeSearchFilter = { - type: Scalars["String"]; - value: Scalars["String"]; + type: Scalars['String']; + value: Scalars['String']; }; export type DataCubeTheme = { - __typename: "DataCubeTheme"; - iri: Scalars["String"]; - label?: Maybe; + __typename: 'DataCubeTheme'; + iri: Scalars['String']; + label?: Maybe; }; export type DatasetCount = { - __typename: "DatasetCount"; - iri: Scalars["String"]; - count: Scalars["Int"]; + __typename: 'DatasetCount'; + iri: Scalars['String']; + count: Scalars['Int']; }; export type Dimension = { - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type DimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type DimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; + + + export type GeoCoordinates = { - __typename: "GeoCoordinates"; - iri: Scalars["String"]; - label: Scalars["String"]; - latitude: Scalars["Float"]; - longitude: Scalars["Float"]; + __typename: 'GeoCoordinates'; + iri: Scalars['String']; + label: Scalars['String']; + latitude: Scalars['Float']; + longitude: Scalars['Float']; }; export type GeoCoordinatesDimension = Dimension & { - __typename: "GeoCoordinatesDimension"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + __typename: 'GeoCoordinatesDimension'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; geoCoordinates?: Maybe>; related?: Maybe>; hierarchy?: Maybe>; }; + export type GeoCoordinatesDimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type GeoCoordinatesDimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; + export type GeoShapesDimension = Dimension & { - __typename: "GeoShapesDimension"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; - geoShapes?: Maybe; + __typename: 'GeoShapesDimension'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; + geoShapes?: Maybe; related?: Maybe>; hierarchy?: Maybe>; }; + export type GeoShapesDimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type GeoShapesDimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export type HierarchyValue = { - __typename: "HierarchyValue"; - value: Scalars["String"]; - label: Scalars["String"]; - alternateName?: Maybe; - position?: Maybe; - identifier?: Maybe; - dimensionIri: Scalars["String"]; - depth: Scalars["Int"]; + __typename: 'HierarchyValue'; + value: Scalars['String']; + label: Scalars['String']; + alternateName?: Maybe; + position?: Maybe; + identifier?: Maybe; + dimensionIri: Scalars['String']; + depth: Scalars['Int']; children?: Maybe>; - hasValue?: Maybe; + hasValue?: Maybe; }; export type Measure = NumericalMeasure | OrdinalMeasure; export type NominalDimension = Dimension & { - __typename: "NominalDimension"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + __typename: 'NominalDimension'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type NominalDimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type NominalDimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export type NumericalMeasure = Dimension & { - __typename: "NumericalMeasure"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - isCurrency?: Maybe; - isDecimal?: Maybe; - currencyExponent?: Maybe; - resolution?: Maybe; - values: Array; + __typename: 'NumericalMeasure'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + isCurrency?: Maybe; + isDecimal?: Maybe; + currencyExponent?: Maybe; + resolution?: Maybe; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type NumericalMeasureValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type NumericalMeasureHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; + export type ObservationFilter = { - __typename: "ObservationFilter"; - type: Scalars["String"]; - value?: Maybe; - iri: Scalars["String"]; + __typename: 'ObservationFilter'; + type: Scalars['String']; + value?: Maybe; + iri: Scalars['String']; }; export type ObservationsQuery = { - __typename: "ObservationsQuery"; + __typename: 'ObservationsQuery'; /** Observations with their values parsed to native JS types */ - data: Array; + data: Array; /** Observations with their original RDF-y type */ - rawData: Array; + rawData: Array; /** The generated SPARQL query string of the current query (doesn't fetch any data) */ - sparql: Scalars["String"]; + sparql: Scalars['String']; /** The generated SPARQL query URL of the current query to run a query on the endpoint's editor directly */ - sparqlEditorUrl?: Maybe; + sparqlEditorUrl?: Maybe; }; export type OrdinalDimension = Dimension & { - __typename: "OrdinalDimension"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + __typename: 'OrdinalDimension'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type OrdinalDimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type OrdinalDimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export type OrdinalMeasure = Dimension & { - __typename: "OrdinalMeasure"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + __typename: 'OrdinalMeasure'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type OrdinalMeasureValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type OrdinalMeasureHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export type Query = { - __typename: "Query"; + __typename: 'Query'; dataCubeByIri?: Maybe; possibleFilters: Array; dataCubes: Array; @@ -367,1094 +386,630 @@ export type Query = { datasetcount?: Maybe>; }; + export type QueryDataCubeByIriArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale?: Maybe; - iri: Scalars["String"]; - latest?: Maybe; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale?: Maybe; + iri: Scalars['String']; + latest?: Maybe; + filters?: Maybe; }; + export type QueryPossibleFiltersArgs = { - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters: Scalars["Filters"]; + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters: Scalars['Filters']; }; + export type QueryDataCubesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale?: Maybe; - query?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale?: Maybe; + query?: Maybe; order?: Maybe; - includeDrafts?: Maybe; + includeDrafts?: Maybe; filters?: Maybe>; }; + export type QueryThemesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; }; + export type QuerySubthemesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - parentIri: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + parentIri: Scalars['String']; }; + export type QueryOrganizationsArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; }; + export type QueryDatasetcountArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - theme?: Maybe; - organization?: Maybe; - subtheme?: Maybe; - includeDrafts?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + theme?: Maybe; + organization?: Maybe; + subtheme?: Maybe; + includeDrafts?: Maybe; }; + export type RelatedDimension = { - __typename: "RelatedDimension"; - type: Scalars["String"]; - iri: Scalars["String"]; + __typename: 'RelatedDimension'; + type: Scalars['String']; + iri: Scalars['String']; }; export type TemporalDimension = Dimension & { - __typename: "TemporalDimension"; - iri: Scalars["String"]; - label: Scalars["String"]; - description?: Maybe; + __typename: 'TemporalDimension'; + iri: Scalars['String']; + label: Scalars['String']; + description?: Maybe; timeUnit: TimeUnit; - timeFormat: Scalars["String"]; - unit?: Maybe; - scaleType?: Maybe; - dataType?: Maybe; - order?: Maybe; - isNumerical: Scalars["Boolean"]; - isKeyDimension: Scalars["Boolean"]; - values: Array; + timeFormat: Scalars['String']; + unit?: Maybe; + scaleType?: Maybe; + dataType?: Maybe; + order?: Maybe; + isNumerical: Scalars['Boolean']; + isKeyDimension: Scalars['Boolean']; + values: Array; related?: Maybe>; hierarchy?: Maybe>; }; + export type TemporalDimensionValuesArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters?: Maybe; }; + export type TemporalDimensionHierarchyArgs = { - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; }; export enum TimeUnit { - Year = "Year", - Month = "Month", - Week = "Week", - Day = "Day", - Hour = "Hour", - Minute = "Minute", - Second = "Second", + Year = 'Year', + Month = 'Month', + Week = 'Week', + Day = 'Day', + Hour = 'Hour', + Minute = 'Minute', + Second = 'Second' } + + export type DataCubesQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - query?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + query?: Maybe; order?: Maybe; - includeDrafts?: Maybe; + includeDrafts?: Maybe; filters?: Maybe | DataCubeSearchFilter>; }>; -export type DataCubesQuery = { - __typename: "Query"; - dataCubes: Array<{ - __typename: "DataCubeResult"; - highlightedTitle?: Maybe; - highlightedDescription?: Maybe; - dataCube: { - __typename: "DataCube"; - iri: string; - title: string; - workExamples?: Maybe>>; - description?: Maybe; - publicationStatus: DataCubePublicationStatus; - datePublished?: Maybe; - creator?: Maybe<{ - __typename: "DataCubeOrganization"; - iri: string; - label?: Maybe; - }>; - themes: Array<{ - __typename: "DataCubeTheme"; - iri: string; - label?: Maybe; - }>; - }; - }>; -}; -type DimensionMetadata_GeoCoordinatesDimension_Fragment = { - __typename: "GeoCoordinatesDimension"; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_GeoCoordinatesDimension_Fragment; - -type DimensionMetadata_GeoShapesDimension_Fragment = { - __typename: "GeoShapesDimension"; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_GeoShapesDimension_Fragment; - -type DimensionMetadata_NominalDimension_Fragment = { - __typename: "NominalDimension"; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_NominalDimension_Fragment; - -type DimensionMetadata_NumericalMeasure_Fragment = { - __typename: "NumericalMeasure"; - isCurrency?: Maybe; - currencyExponent?: Maybe; - resolution?: Maybe; - isDecimal?: Maybe; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_NumericalMeasure_Fragment; - -type DimensionMetadata_OrdinalDimension_Fragment = { - __typename: "OrdinalDimension"; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_OrdinalDimension_Fragment; - -type DimensionMetadata_OrdinalMeasure_Fragment = { - __typename: "OrdinalMeasure"; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_OrdinalMeasure_Fragment; - -type DimensionMetadata_TemporalDimension_Fragment = { - __typename: "TemporalDimension"; - timeUnit: TimeUnit; - timeFormat: string; - iri: string; - label: string; - description?: Maybe; - isNumerical: boolean; - isKeyDimension: boolean; - dataType?: Maybe; - order?: Maybe; - values: Array; - unit?: Maybe; - related?: Maybe< - Array<{ __typename: "RelatedDimension"; iri: string; type: string }> - >; -} & HierarchyMetadata_TemporalDimension_Fragment; - -export type DimensionMetadataFragment = - | DimensionMetadata_GeoCoordinatesDimension_Fragment - | DimensionMetadata_GeoShapesDimension_Fragment - | DimensionMetadata_NominalDimension_Fragment - | DimensionMetadata_NumericalMeasure_Fragment - | DimensionMetadata_OrdinalDimension_Fragment - | DimensionMetadata_OrdinalMeasure_Fragment - | DimensionMetadata_TemporalDimension_Fragment; +export type DataCubesQuery = { __typename: 'Query', dataCubes: Array<{ __typename: 'DataCubeResult', highlightedTitle?: Maybe, highlightedDescription?: Maybe, dataCube: { __typename: 'DataCube', iri: string, title: string, workExamples?: Maybe>>, description?: Maybe, publicationStatus: DataCubePublicationStatus, datePublished?: Maybe, creator?: Maybe<{ __typename: 'DataCubeOrganization', iri: string, label?: Maybe }>, themes: Array<{ __typename: 'DataCubeTheme', iri: string, label?: Maybe }> } }> }; -export type DataCubePreviewQueryVariables = Exact<{ - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; - filters?: Maybe; -}>; +type DimensionMetadata_GeoCoordinatesDimension_Fragment = ( + { __typename: 'GeoCoordinatesDimension', iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_GeoCoordinatesDimension_Fragment +); -export type DataCubePreviewQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - iri: string; - title: string; - description?: Maybe; - publicationStatus: DataCubePublicationStatus; - dimensions: Array< - | ({ - __typename: "GeoCoordinatesDimension"; - } & DimensionMetadata_GeoCoordinatesDimension_Fragment) - | ({ - __typename: "GeoShapesDimension"; - } & DimensionMetadata_GeoShapesDimension_Fragment) - | ({ - __typename: "NominalDimension"; - } & DimensionMetadata_NominalDimension_Fragment) - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalDimension"; - } & DimensionMetadata_OrdinalDimension_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment) - | ({ - __typename: "TemporalDimension"; - } & DimensionMetadata_TemporalDimension_Fragment) - >; - measures: Array< - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment) - >; - observations: { - __typename: "ObservationsQuery"; - data: Array; - sparql: string; - sparqlEditorUrl?: Maybe; - }; - }>; -}; +type DimensionMetadata_GeoShapesDimension_Fragment = ( + { __typename: 'GeoShapesDimension', iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_GeoShapesDimension_Fragment +); -export type DataCubeMetadataQueryVariables = Exact<{ - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; -}>; +type DimensionMetadata_NominalDimension_Fragment = ( + { __typename: 'NominalDimension', iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_NominalDimension_Fragment +); -export type DataCubeMetadataQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - iri: string; - identifier?: Maybe; - title: string; - description?: Maybe; - publisher?: Maybe; - version?: Maybe; - workExamples?: Maybe>>; - contactName?: Maybe; - contactEmail?: Maybe; - landingPage?: Maybe; - expires?: Maybe; - datePublished?: Maybe; - dateModified?: Maybe; - publicationStatus: DataCubePublicationStatus; - themes: Array<{ - __typename: "DataCubeTheme"; - iri: string; - label?: Maybe; - }>; - creator?: Maybe<{ - __typename: "DataCubeOrganization"; - iri: string; - label?: Maybe; - }>; - }>; -}; +type DimensionMetadata_NumericalMeasure_Fragment = ( + { __typename: 'NumericalMeasure', isCurrency?: Maybe, currencyExponent?: Maybe, resolution?: Maybe, isDecimal?: Maybe, iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_NumericalMeasure_Fragment +); -export type DataCubeMetadataWithComponentValuesQueryVariables = Exact<{ - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; - filters?: Maybe; -}>; +type DimensionMetadata_OrdinalDimension_Fragment = ( + { __typename: 'OrdinalDimension', iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_OrdinalDimension_Fragment +); -export type DataCubeMetadataWithComponentValuesQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - iri: string; - title: string; - publisher?: Maybe; - publicationStatus: DataCubePublicationStatus; - expires?: Maybe; - identifier?: Maybe; - workExamples?: Maybe>>; - landingPage?: Maybe; - creator?: Maybe<{ __typename: "DataCubeOrganization"; iri: string }>; - dimensions: Array< - | ({ - __typename: "GeoCoordinatesDimension"; - } & DimensionMetadata_GeoCoordinatesDimension_Fragment & - HierarchyMetadata_GeoCoordinatesDimension_Fragment) - | ({ - __typename: "GeoShapesDimension"; - } & DimensionMetadata_GeoShapesDimension_Fragment & - HierarchyMetadata_GeoShapesDimension_Fragment) - | ({ - __typename: "NominalDimension"; - } & DimensionMetadata_NominalDimension_Fragment & - HierarchyMetadata_NominalDimension_Fragment) - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment & - HierarchyMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalDimension"; - } & DimensionMetadata_OrdinalDimension_Fragment & - HierarchyMetadata_OrdinalDimension_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment & - HierarchyMetadata_OrdinalMeasure_Fragment) - | ({ - __typename: "TemporalDimension"; - } & DimensionMetadata_TemporalDimension_Fragment & - HierarchyMetadata_TemporalDimension_Fragment) - >; - measures: Array< - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment & - HierarchyMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment & - HierarchyMetadata_OrdinalMeasure_Fragment) - >; - }>; -}; +type DimensionMetadata_OrdinalMeasure_Fragment = ( + { __typename: 'OrdinalMeasure', iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_OrdinalMeasure_Fragment +); -type HierarchyMetadata_GeoCoordinatesDimension_Fragment = { - __typename: "GeoCoordinatesDimension"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; +type DimensionMetadata_TemporalDimension_Fragment = ( + { __typename: 'TemporalDimension', timeUnit: TimeUnit, timeFormat: string, iri: string, label: string, description?: Maybe, isNumerical: boolean, isKeyDimension: boolean, dataType?: Maybe, order?: Maybe, values: Array, unit?: Maybe, related?: Maybe> } + & HierarchyMetadata_TemporalDimension_Fragment +); -type HierarchyMetadata_GeoShapesDimension_Fragment = { - __typename: "GeoShapesDimension"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; +export type DimensionMetadataFragment = DimensionMetadata_GeoCoordinatesDimension_Fragment | DimensionMetadata_GeoShapesDimension_Fragment | DimensionMetadata_NominalDimension_Fragment | DimensionMetadata_NumericalMeasure_Fragment | DimensionMetadata_OrdinalDimension_Fragment | DimensionMetadata_OrdinalMeasure_Fragment | DimensionMetadata_TemporalDimension_Fragment; -type HierarchyMetadata_NominalDimension_Fragment = { - __typename: "NominalDimension"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; +export type DataCubePreviewQueryVariables = Exact<{ + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; + filters?: Maybe; +}>; -type HierarchyMetadata_NumericalMeasure_Fragment = { - __typename: "NumericalMeasure"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; -type HierarchyMetadata_OrdinalDimension_Fragment = { - __typename: "OrdinalDimension"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; +export type DataCubePreviewQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, title: string, description?: Maybe, publicationStatus: DataCubePublicationStatus, dimensions: Array<( + { __typename: 'GeoCoordinatesDimension' } + & DimensionMetadata_GeoCoordinatesDimension_Fragment + ) | ( + { __typename: 'GeoShapesDimension' } + & DimensionMetadata_GeoShapesDimension_Fragment + ) | ( + { __typename: 'NominalDimension' } + & DimensionMetadata_NominalDimension_Fragment + ) | ( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalDimension' } + & DimensionMetadata_OrdinalDimension_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + ) | ( + { __typename: 'TemporalDimension' } + & DimensionMetadata_TemporalDimension_Fragment + )>, measures: Array<( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + )>, observations: { __typename: 'ObservationsQuery', data: Array, sparql: string, sparqlEditorUrl?: Maybe } }> }; -type HierarchyMetadata_OrdinalMeasure_Fragment = { - __typename: "OrdinalMeasure"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; +export type DataCubeMetadataQueryVariables = Exact<{ + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; +}>; -type HierarchyMetadata_TemporalDimension_Fragment = { - __typename: "TemporalDimension"; - hierarchy?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - children?: Maybe< - Array< - { - __typename: "HierarchyValue"; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; - } & HierarchyValueFieldsFragment - > - >; -}; -export type HierarchyMetadataFragment = - | HierarchyMetadata_GeoCoordinatesDimension_Fragment - | HierarchyMetadata_GeoShapesDimension_Fragment - | HierarchyMetadata_NominalDimension_Fragment - | HierarchyMetadata_NumericalMeasure_Fragment - | HierarchyMetadata_OrdinalDimension_Fragment - | HierarchyMetadata_OrdinalMeasure_Fragment - | HierarchyMetadata_TemporalDimension_Fragment; +export type DataCubeMetadataQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, identifier?: Maybe, title: string, description?: Maybe, publisher?: Maybe, version?: Maybe, workExamples?: Maybe>>, contactName?: Maybe, contactEmail?: Maybe, landingPage?: Maybe, expires?: Maybe, datePublished?: Maybe, dateModified?: Maybe, publicationStatus: DataCubePublicationStatus, themes: Array<{ __typename: 'DataCubeTheme', iri: string, label?: Maybe }>, creator?: Maybe<{ __typename: 'DataCubeOrganization', iri: string, label?: Maybe }> }> }; + +export type DataCubeMetadataWithComponentValuesQueryVariables = Exact<{ + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; + filters?: Maybe; +}>; + + +export type DataCubeMetadataWithComponentValuesQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, title: string, publisher?: Maybe, publicationStatus: DataCubePublicationStatus, expires?: Maybe, identifier?: Maybe, workExamples?: Maybe>>, landingPage?: Maybe, creator?: Maybe<{ __typename: 'DataCubeOrganization', iri: string }>, dimensions: Array<( + { __typename: 'GeoCoordinatesDimension' } + & DimensionMetadata_GeoCoordinatesDimension_Fragment + & HierarchyMetadata_GeoCoordinatesDimension_Fragment + ) | ( + { __typename: 'GeoShapesDimension' } + & DimensionMetadata_GeoShapesDimension_Fragment + & HierarchyMetadata_GeoShapesDimension_Fragment + ) | ( + { __typename: 'NominalDimension' } + & DimensionMetadata_NominalDimension_Fragment + & HierarchyMetadata_NominalDimension_Fragment + ) | ( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + & HierarchyMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalDimension' } + & DimensionMetadata_OrdinalDimension_Fragment + & HierarchyMetadata_OrdinalDimension_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + & HierarchyMetadata_OrdinalMeasure_Fragment + ) | ( + { __typename: 'TemporalDimension' } + & DimensionMetadata_TemporalDimension_Fragment + & HierarchyMetadata_TemporalDimension_Fragment + )>, measures: Array<( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + & HierarchyMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + & HierarchyMetadata_OrdinalMeasure_Fragment + )> }> }; + +type HierarchyMetadata_GeoCoordinatesDimension_Fragment = { __typename: 'GeoCoordinatesDimension', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_GeoShapesDimension_Fragment = { __typename: 'GeoShapesDimension', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_NominalDimension_Fragment = { __typename: 'NominalDimension', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_NumericalMeasure_Fragment = { __typename: 'NumericalMeasure', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_OrdinalDimension_Fragment = { __typename: 'OrdinalDimension', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_OrdinalMeasure_Fragment = { __typename: 'OrdinalMeasure', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +type HierarchyMetadata_TemporalDimension_Fragment = { __typename: 'TemporalDimension', hierarchy?: Maybe> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> } + & HierarchyValueFieldsFragment + )>> }; + +export type HierarchyMetadataFragment = HierarchyMetadata_GeoCoordinatesDimension_Fragment | HierarchyMetadata_GeoShapesDimension_Fragment | HierarchyMetadata_NominalDimension_Fragment | HierarchyMetadata_NumericalMeasure_Fragment | HierarchyMetadata_OrdinalDimension_Fragment | HierarchyMetadata_OrdinalMeasure_Fragment | HierarchyMetadata_TemporalDimension_Fragment; export type DimensionValuesQueryVariables = Exact<{ - dataCubeIri: Scalars["String"]; - dimensionIri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; - filters?: Maybe; + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; + filters?: Maybe; }>; -export type DimensionValuesQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - dimensionByIri?: Maybe< - | ({ - __typename: "GeoCoordinatesDimension"; - } & DimensionMetadata_GeoCoordinatesDimension_Fragment) - | ({ - __typename: "GeoShapesDimension"; - } & DimensionMetadata_GeoShapesDimension_Fragment) - | ({ - __typename: "NominalDimension"; - } & DimensionMetadata_NominalDimension_Fragment) - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalDimension"; - } & DimensionMetadata_OrdinalDimension_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment) - | ({ - __typename: "TemporalDimension"; - } & DimensionMetadata_TemporalDimension_Fragment) - >; - }>; -}; + +export type DimensionValuesQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<( + { __typename: 'GeoCoordinatesDimension' } + & DimensionMetadata_GeoCoordinatesDimension_Fragment + & HierarchyMetadata_GeoCoordinatesDimension_Fragment + ) | ( + { __typename: 'GeoShapesDimension' } + & DimensionMetadata_GeoShapesDimension_Fragment + & HierarchyMetadata_GeoShapesDimension_Fragment + ) | ( + { __typename: 'NominalDimension' } + & DimensionMetadata_NominalDimension_Fragment + & HierarchyMetadata_NominalDimension_Fragment + ) | ( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + & HierarchyMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalDimension' } + & DimensionMetadata_OrdinalDimension_Fragment + & HierarchyMetadata_OrdinalDimension_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + & HierarchyMetadata_OrdinalMeasure_Fragment + ) | ( + { __typename: 'TemporalDimension' } + & DimensionMetadata_TemporalDimension_Fragment + & HierarchyMetadata_TemporalDimension_Fragment + )> }> }; export type GeoCoordinatesByDimensionIriQueryVariables = Exact<{ - dataCubeIri: Scalars["String"]; - dimensionIri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; }>; -export type GeoCoordinatesByDimensionIriQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - dimensionByIri?: Maybe< - | { - __typename: "GeoCoordinatesDimension"; - geoCoordinates?: Maybe< - Array<{ - __typename: "GeoCoordinates"; - iri: string; - label: string; - latitude: number; - longitude: number; - }> - >; - } - | { __typename: "GeoShapesDimension" } - | { __typename: "NominalDimension" } - | { __typename: "NumericalMeasure" } - | { __typename: "OrdinalDimension" } - | { __typename: "OrdinalMeasure" } - | { __typename: "TemporalDimension" } - >; - }>; -}; + +export type GeoCoordinatesByDimensionIriQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension', geoCoordinates?: Maybe> } | { __typename: 'GeoShapesDimension' } | { __typename: 'NominalDimension' } | { __typename: 'NumericalMeasure' } | { __typename: 'OrdinalDimension' } | { __typename: 'OrdinalMeasure' } | { __typename: 'TemporalDimension' }> }> }; export type GeoShapesByDimensionIriQueryVariables = Exact<{ - dataCubeIri: Scalars["String"]; - dimensionIri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; }>; -export type GeoShapesByDimensionIriQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - dimensionByIri?: Maybe< - | { __typename: "GeoCoordinatesDimension" } - | { __typename: "GeoShapesDimension"; geoShapes?: Maybe } - | { __typename: "NominalDimension" } - | { __typename: "NumericalMeasure" } - | { __typename: "OrdinalDimension" } - | { __typename: "OrdinalMeasure" } - | { __typename: "TemporalDimension" } - >; - }>; -}; + +export type GeoShapesByDimensionIriQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension' } | { __typename: 'GeoShapesDimension', geoShapes?: Maybe } | { __typename: 'NominalDimension' } | { __typename: 'NumericalMeasure' } | { __typename: 'OrdinalDimension' } | { __typename: 'OrdinalMeasure' } | { __typename: 'TemporalDimension' }> }> }; export type TemporalDimensionValuesQueryVariables = Exact<{ - dataCubeIri: Scalars["String"]; - dimensionIri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - latest?: Maybe; - filters?: Maybe; + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; + filters?: Maybe; }>; -export type TemporalDimensionValuesQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - dimensionByIri?: Maybe< - | { __typename: "GeoCoordinatesDimension" } - | { __typename: "GeoShapesDimension" } - | { __typename: "NominalDimension" } - | { __typename: "NumericalMeasure" } - | { __typename: "OrdinalDimension" } - | { __typename: "OrdinalMeasure" } - | ({ - __typename: "TemporalDimension"; - timeUnit: TimeUnit; - timeFormat: string; - } & DimensionMetadata_TemporalDimension_Fragment) - >; - }>; -}; + +export type TemporalDimensionValuesQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension' } | { __typename: 'GeoShapesDimension' } | { __typename: 'NominalDimension' } | { __typename: 'NumericalMeasure' } | { __typename: 'OrdinalDimension' } | { __typename: 'OrdinalMeasure' } | ( + { __typename: 'TemporalDimension', timeUnit: TimeUnit, timeFormat: string } + & DimensionMetadata_TemporalDimension_Fragment + )> }> }; export type DataCubeObservationsQueryVariables = Exact<{ - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - dimensions?: Maybe | Scalars["String"]>; - filters?: Maybe; - latest?: Maybe; - limit?: Maybe; + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + dimensions?: Maybe | Scalars['String']>; + filters?: Maybe; + latest?: Maybe; + limit?: Maybe; }>; -export type DataCubeObservationsQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - iri: string; - title: string; - description?: Maybe; - dimensions: Array< - | ({ - __typename: "GeoCoordinatesDimension"; - } & DimensionMetadata_GeoCoordinatesDimension_Fragment) - | ({ - __typename: "GeoShapesDimension"; - } & DimensionMetadata_GeoShapesDimension_Fragment) - | ({ - __typename: "NominalDimension"; - } & DimensionMetadata_NominalDimension_Fragment) - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalDimension"; - } & DimensionMetadata_OrdinalDimension_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment) - | ({ - __typename: "TemporalDimension"; - } & DimensionMetadata_TemporalDimension_Fragment) - >; - measures: Array< - | ({ - __typename: "NumericalMeasure"; - } & DimensionMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & DimensionMetadata_OrdinalMeasure_Fragment) - >; - observations: { - __typename: "ObservationsQuery"; - data: Array; - sparqlEditorUrl?: Maybe; - }; - }>; -}; + +export type DataCubeObservationsQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, title: string, description?: Maybe, dimensions: Array<( + { __typename: 'GeoCoordinatesDimension' } + & DimensionMetadata_GeoCoordinatesDimension_Fragment + ) | ( + { __typename: 'GeoShapesDimension' } + & DimensionMetadata_GeoShapesDimension_Fragment + ) | ( + { __typename: 'NominalDimension' } + & DimensionMetadata_NominalDimension_Fragment + ) | ( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalDimension' } + & DimensionMetadata_OrdinalDimension_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + ) | ( + { __typename: 'TemporalDimension' } + & DimensionMetadata_TemporalDimension_Fragment + )>, measures: Array<( + { __typename: 'NumericalMeasure' } + & DimensionMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & DimensionMetadata_OrdinalMeasure_Fragment + )>, observations: { __typename: 'ObservationsQuery', data: Array, sparqlEditorUrl?: Maybe } }> }; export type PossibleFiltersQueryVariables = Exact<{ - iri: Scalars["String"]; - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - filters: Scalars["Filters"]; + iri: Scalars['String']; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + filters: Scalars['Filters']; }>; -export type PossibleFiltersQuery = { - __typename: "Query"; - possibleFilters: Array<{ - __typename: "ObservationFilter"; - iri: string; - type: string; - value?: Maybe; - }>; -}; + +export type PossibleFiltersQuery = { __typename: 'Query', possibleFilters: Array<{ __typename: 'ObservationFilter', iri: string, type: string, value?: Maybe }> }; export type ThemesQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; }>; -export type ThemesQuery = { - __typename: "Query"; - themes: Array<{ - __typename: "DataCubeTheme"; - iri: string; - label?: Maybe; - }>; -}; + +export type ThemesQuery = { __typename: 'Query', themes: Array<{ __typename: 'DataCubeTheme', iri: string, label?: Maybe }> }; export type OrganizationsQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; }>; -export type OrganizationsQuery = { - __typename: "Query"; - organizations: Array<{ - __typename: "DataCubeOrganization"; - iri: string; - label?: Maybe; - }>; -}; + +export type OrganizationsQuery = { __typename: 'Query', organizations: Array<{ __typename: 'DataCubeOrganization', iri: string, label?: Maybe }> }; export type SubthemesQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - parentIri: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + parentIri: Scalars['String']; }>; -export type SubthemesQuery = { - __typename: "Query"; - subthemes: Array<{ - __typename: "DataCubeTheme"; - label?: Maybe; - iri: string; - }>; -}; -export type HierarchyValueFieldsFragment = { - __typename: "HierarchyValue"; - value: string; - dimensionIri: string; - depth: number; - label: string; - alternateName?: Maybe; - hasValue?: Maybe; - position?: Maybe; - identifier?: Maybe; -}; +export type SubthemesQuery = { __typename: 'Query', subthemes: Array<{ __typename: 'DataCubeTheme', label?: Maybe, iri: string }> }; + +export type HierarchyValueFieldsFragment = { __typename: 'HierarchyValue', value: string, dimensionIri: string, depth: number, label: string, alternateName?: Maybe, hasValue?: Maybe, position?: Maybe, identifier?: Maybe }; export type DimensionHierarchyQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - locale: Scalars["String"]; - cubeIri: Scalars["String"]; - dimensionIri: Scalars["String"]; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + locale: Scalars['String']; + cubeIri: Scalars['String']; + dimensionIri: Scalars['String']; }>; -export type DimensionHierarchyQuery = { - __typename: "Query"; - dataCubeByIri?: Maybe<{ - __typename: "DataCube"; - dimensionByIri?: Maybe< - | ({ - __typename: "GeoCoordinatesDimension"; - } & HierarchyMetadata_GeoCoordinatesDimension_Fragment) - | ({ - __typename: "GeoShapesDimension"; - } & HierarchyMetadata_GeoShapesDimension_Fragment) - | ({ - __typename: "NominalDimension"; - } & HierarchyMetadata_NominalDimension_Fragment) - | ({ - __typename: "NumericalMeasure"; - } & HierarchyMetadata_NumericalMeasure_Fragment) - | ({ - __typename: "OrdinalDimension"; - } & HierarchyMetadata_OrdinalDimension_Fragment) - | ({ - __typename: "OrdinalMeasure"; - } & HierarchyMetadata_OrdinalMeasure_Fragment) - | ({ - __typename: "TemporalDimension"; - } & HierarchyMetadata_TemporalDimension_Fragment) - >; - }>; -}; + +export type DimensionHierarchyQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<( + { __typename: 'GeoCoordinatesDimension' } + & HierarchyMetadata_GeoCoordinatesDimension_Fragment + ) | ( + { __typename: 'GeoShapesDimension' } + & HierarchyMetadata_GeoShapesDimension_Fragment + ) | ( + { __typename: 'NominalDimension' } + & HierarchyMetadata_NominalDimension_Fragment + ) | ( + { __typename: 'NumericalMeasure' } + & HierarchyMetadata_NumericalMeasure_Fragment + ) | ( + { __typename: 'OrdinalDimension' } + & HierarchyMetadata_OrdinalDimension_Fragment + ) | ( + { __typename: 'OrdinalMeasure' } + & HierarchyMetadata_OrdinalMeasure_Fragment + ) | ( + { __typename: 'TemporalDimension' } + & HierarchyMetadata_TemporalDimension_Fragment + )> }> }; export type DatasetCountQueryVariables = Exact<{ - sourceType: Scalars["String"]; - sourceUrl: Scalars["String"]; - theme?: Maybe; - organization?: Maybe; - subtheme?: Maybe; - includeDrafts?: Maybe; + sourceType: Scalars['String']; + sourceUrl: Scalars['String']; + theme?: Maybe; + organization?: Maybe; + subtheme?: Maybe; + includeDrafts?: Maybe; }>; -export type DatasetCountQuery = { - __typename: "Query"; - datasetcount?: Maybe< - Array<{ __typename: "DatasetCount"; count: number; iri: string }> - >; -}; + +export type DatasetCountQuery = { __typename: 'Query', datasetcount?: Maybe> }; export const HierarchyValueFieldsFragmentDoc = gql` - fragment hierarchyValueFields on HierarchyValue { - value - dimensionIri - depth - label - alternateName - hasValue - position - identifier - } -`; + fragment hierarchyValueFields on HierarchyValue { + value + dimensionIri + depth + label + alternateName + hasValue + position + identifier +} + `; export const HierarchyMetadataFragmentDoc = gql` - fragment hierarchyMetadata on Dimension { - hierarchy(sourceType: $sourceType, sourceUrl: $sourceUrl) { + fragment hierarchyMetadata on Dimension { + hierarchy(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...hierarchyValueFields + children { ...hierarchyValueFields children { ...hierarchyValueFields @@ -1464,618 +1019,422 @@ export const HierarchyMetadataFragmentDoc = gql` ...hierarchyValueFields children { ...hierarchyValueFields - children { - ...hierarchyValueFields - } } } } } } } - ${HierarchyValueFieldsFragmentDoc} -`; +} + ${HierarchyValueFieldsFragmentDoc}`; export const DimensionMetadataFragmentDoc = gql` - fragment dimensionMetadata on Dimension { + fragment dimensionMetadata on Dimension { + iri + label + description + isNumerical + isKeyDimension + dataType + order + values(sourceType: $sourceType, sourceUrl: $sourceUrl, filters: $filters) + unit + related { iri - label - description - isNumerical - isKeyDimension - dataType - order - values(sourceType: $sourceType, sourceUrl: $sourceUrl, filters: $filters) - unit - related { - iri - type - } - ...hierarchyMetadata - ... on TemporalDimension { - timeUnit - timeFormat - } - ... on NumericalMeasure { - isCurrency - currencyExponent - resolution - isDecimal - } + type + } + ...hierarchyMetadata + ... on TemporalDimension { + timeUnit + timeFormat + } + ... on NumericalMeasure { + isCurrency + currencyExponent + resolution + isDecimal } - ${HierarchyMetadataFragmentDoc} -`; +} + ${HierarchyMetadataFragmentDoc}`; export const DataCubesDocument = gql` - query DataCubes( - $sourceType: String! - $sourceUrl: String! - $locale: String! - $query: String - $order: DataCubeResultOrder - $includeDrafts: Boolean - $filters: [DataCubeSearchFilter!] + query DataCubes($sourceType: String!, $sourceUrl: String!, $locale: String!, $query: String, $order: DataCubeResultOrder, $includeDrafts: Boolean, $filters: [DataCubeSearchFilter!]) { + dataCubes( + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + query: $query + order: $order + includeDrafts: $includeDrafts + filters: $filters ) { - dataCubes( - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - query: $query - order: $order - includeDrafts: $includeDrafts - filters: $filters - ) { - highlightedTitle - highlightedDescription - dataCube { + highlightedTitle + highlightedDescription + dataCube { + iri + title + workExamples + creator { iri - title - workExamples - creator { - iri - label - } - description - publicationStatus - datePublished - themes { - iri - label - } + label + } + description + publicationStatus + datePublished + themes { + iri + label } } } -`; - -export function useDataCubesQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: DataCubesDocument, - ...options, - }); } + `; + +export function useDataCubesQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DataCubesDocument, ...options }); +}; export const DataCubePreviewDocument = gql` - query DataCubePreview( - $iri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean - $filters: Filters + query DataCubePreview($iri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean, $filters: Filters) { + dataCubeByIri( + iri: $iri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $iri - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - latest: $latest - ) { - iri - title - description - publicationStatus - dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - } - measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - } - observations(sourceType: $sourceType, sourceUrl: $sourceUrl, limit: 10) { - data - sparql - sparqlEditorUrl - } + iri + title + description + publicationStatus + dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + } + measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + } + observations(sourceType: $sourceType, sourceUrl: $sourceUrl, limit: 10) { + data + sparql + sparqlEditorUrl } } - ${DimensionMetadataFragmentDoc} -`; - -export function useDataCubePreviewQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: DataCubePreviewDocument, - ...options, - }); } + ${DimensionMetadataFragmentDoc}`; + +export function useDataCubePreviewQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DataCubePreviewDocument, ...options }); +}; export const DataCubeMetadataDocument = gql` - query DataCubeMetadata( - $iri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean + query DataCubeMetadata($iri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean) { + dataCubeByIri( + iri: $iri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $iri - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - latest: $latest - ) { + iri + identifier + title + description + publisher + version + workExamples + contactName + contactEmail + landingPage + expires + datePublished + dateModified + publicationStatus + themes { iri - identifier - title - description - publisher - version - workExamples - contactName - contactEmail - landingPage - expires - datePublished - dateModified - publicationStatus - themes { - iri - label - } - creator { - iri - label - } + label + } + creator { + iri + label } } -`; - -export function useDataCubeMetadataQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: DataCubeMetadataDocument, - ...options, - }); } + `; + +export function useDataCubeMetadataQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DataCubeMetadataDocument, ...options }); +}; export const DataCubeMetadataWithComponentValuesDocument = gql` - query DataCubeMetadataWithComponentValues( - $iri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean - $filters: Filters + query DataCubeMetadataWithComponentValues($iri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean, $filters: Filters) { + dataCubeByIri( + iri: $iri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $iri - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - latest: $latest - ) { + iri + title + publisher + publicationStatus + expires + identifier + workExamples + creator { iri - title - publisher - publicationStatus - expires - identifier - workExamples - creator { - iri - } - landingPage - dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - ...hierarchyMetadata - } - measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - ...hierarchyMetadata - } + } + landingPage + dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + ...hierarchyMetadata + } + measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + ...hierarchyMetadata } } - ${DimensionMetadataFragmentDoc} - ${HierarchyMetadataFragmentDoc} -`; - -export function useDataCubeMetadataWithComponentValuesQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: DataCubeMetadataWithComponentValuesDocument, - ...options, - }); } + ${DimensionMetadataFragmentDoc} +${HierarchyMetadataFragmentDoc}`; + +export function useDataCubeMetadataWithComponentValuesQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DataCubeMetadataWithComponentValuesDocument, ...options }); +}; export const DimensionValuesDocument = gql` - query DimensionValues( - $dataCubeIri: String! - $dimensionIri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean - $filters: Filters + query DimensionValues($dataCubeIri: String!, $dimensionIri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean, $filters: Filters) { + dataCubeByIri( + iri: $dataCubeIri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $dataCubeIri + dimensionByIri( + iri: $dimensionIri sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale - latest: $latest ) { - dimensionByIri( - iri: $dimensionIri - sourceType: $sourceType - sourceUrl: $sourceUrl - ) { - ...dimensionMetadata - } + ...dimensionMetadata + ...hierarchyMetadata } } - ${DimensionMetadataFragmentDoc} -`; - -export function useDimensionValuesQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: DimensionValuesDocument, - ...options, - }); } + ${DimensionMetadataFragmentDoc} +${HierarchyMetadataFragmentDoc}`; + +export function useDimensionValuesQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DimensionValuesDocument, ...options }); +}; export const GeoCoordinatesByDimensionIriDocument = gql` - query GeoCoordinatesByDimensionIri( - $dataCubeIri: String! - $dimensionIri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean + query GeoCoordinatesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean) { + dataCubeByIri( + iri: $dataCubeIri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $dataCubeIri + dimensionByIri( + iri: $dimensionIri sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale - latest: $latest ) { - dimensionByIri( - iri: $dimensionIri - sourceType: $sourceType - sourceUrl: $sourceUrl - ) { - ... on GeoCoordinatesDimension { - geoCoordinates { - iri - label - latitude - longitude - } + ... on GeoCoordinatesDimension { + geoCoordinates { + iri + label + latitude + longitude } } } } -`; - -export function useGeoCoordinatesByDimensionIriQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: GeoCoordinatesByDimensionIriDocument, - ...options, - }); } + `; + +export function useGeoCoordinatesByDimensionIriQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: GeoCoordinatesByDimensionIriDocument, ...options }); +}; export const GeoShapesByDimensionIriDocument = gql` - query GeoShapesByDimensionIri( - $dataCubeIri: String! - $dimensionIri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean + query GeoShapesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean) { + dataCubeByIri( + iri: $dataCubeIri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $dataCubeIri + dimensionByIri( + iri: $dimensionIri sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale - latest: $latest ) { - dimensionByIri( - iri: $dimensionIri - sourceType: $sourceType - sourceUrl: $sourceUrl - ) { - ... on GeoShapesDimension { - geoShapes - } + ... on GeoShapesDimension { + geoShapes } } } -`; - -export function useGeoShapesByDimensionIriQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: GeoShapesByDimensionIriDocument, - ...options, - }); } + `; + +export function useGeoShapesByDimensionIriQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: GeoShapesByDimensionIriDocument, ...options }); +}; export const TemporalDimensionValuesDocument = gql` - query TemporalDimensionValues( - $dataCubeIri: String! - $dimensionIri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $latest: Boolean - $filters: Filters + query TemporalDimensionValues($dataCubeIri: String!, $dimensionIri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $latest: Boolean, $filters: Filters) { + dataCubeByIri( + iri: $dataCubeIri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $dataCubeIri + dimensionByIri( + iri: $dimensionIri sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale - latest: $latest ) { - dimensionByIri( - iri: $dimensionIri - sourceType: $sourceType - sourceUrl: $sourceUrl - ) { - ... on TemporalDimension { - ...dimensionMetadata - timeUnit - timeFormat - } + ... on TemporalDimension { + ...dimensionMetadata + timeUnit + timeFormat } } } - ${DimensionMetadataFragmentDoc} -`; - -export function useTemporalDimensionValuesQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: TemporalDimensionValuesDocument, - ...options, - }); } + ${DimensionMetadataFragmentDoc}`; + +export function useTemporalDimensionValuesQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: TemporalDimensionValuesDocument, ...options }); +}; export const DataCubeObservationsDocument = gql` - query DataCubeObservations( - $iri: String! - $sourceType: String! - $sourceUrl: String! - $locale: String! - $dimensions: [String!] - $filters: Filters - $latest: Boolean - $limit: Int + query DataCubeObservations($iri: String!, $sourceType: String!, $sourceUrl: String!, $locale: String!, $dimensions: [String!], $filters: Filters, $latest: Boolean, $limit: Int) { + dataCubeByIri( + iri: $iri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + latest: $latest ) { - dataCubeByIri( - iri: $iri + iri + title + description + dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + } + measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { + ...dimensionMetadata + } + observations( sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale - latest: $latest + dimensions: $dimensions + filters: $filters + limit: $limit ) { - iri - title - description - dimensions(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - } - measures(sourceType: $sourceType, sourceUrl: $sourceUrl) { - ...dimensionMetadata - } - observations( - sourceType: $sourceType - sourceUrl: $sourceUrl - dimensions: $dimensions - filters: $filters - limit: $limit - ) { - data - sparqlEditorUrl - } + data + sparqlEditorUrl } } - ${DimensionMetadataFragmentDoc} -`; - -export function useDataCubeObservationsQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: DataCubeObservationsDocument, - ...options, - }); } + ${DimensionMetadataFragmentDoc}`; + +export function useDataCubeObservationsQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DataCubeObservationsDocument, ...options }); +}; export const PossibleFiltersDocument = gql` - query PossibleFilters( - $iri: String! - $sourceType: String! - $sourceUrl: String! - $filters: Filters! + query PossibleFilters($iri: String!, $sourceType: String!, $sourceUrl: String!, $filters: Filters!) { + possibleFilters( + iri: $iri + sourceType: $sourceType + sourceUrl: $sourceUrl + filters: $filters ) { - possibleFilters( - iri: $iri - sourceType: $sourceType - sourceUrl: $sourceUrl - filters: $filters - ) { - iri - type - value - } + iri + type + value } -`; - -export function usePossibleFiltersQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: PossibleFiltersDocument, - ...options, - }); } + `; + +export function usePossibleFiltersQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: PossibleFiltersDocument, ...options }); +}; export const ThemesDocument = gql` - query Themes($sourceType: String!, $sourceUrl: String!, $locale: String!) { - themes(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale) { - iri - label - } + query Themes($sourceType: String!, $sourceUrl: String!, $locale: String!) { + themes(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale) { + iri + label } -`; +} + `; -export function useThemesQuery( - options: Omit, "query"> = {} -) { +export function useThemesQuery(options: Omit, 'query'> = {}) { return Urql.useQuery({ query: ThemesDocument, ...options }); -} +}; export const OrganizationsDocument = gql` - query Organizations( - $sourceType: String! - $sourceUrl: String! - $locale: String! - ) { - organizations( - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - ) { - iri - label - } + query Organizations($sourceType: String!, $sourceUrl: String!, $locale: String!) { + organizations(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale) { + iri + label } -`; - -export function useOrganizationsQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: OrganizationsDocument, - ...options, - }); } + `; + +export function useOrganizationsQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: OrganizationsDocument, ...options }); +}; export const SubthemesDocument = gql` - query Subthemes( - $sourceType: String! - $sourceUrl: String! - $locale: String! - $parentIri: String! + query Subthemes($sourceType: String!, $sourceUrl: String!, $locale: String!, $parentIri: String!) { + subthemes( + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale + parentIri: $parentIri ) { - subthemes( - sourceType: $sourceType - sourceUrl: $sourceUrl - locale: $locale - parentIri: $parentIri - ) { - label - iri - } + label + iri } -`; - -export function useSubthemesQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: SubthemesDocument, - ...options, - }); } + `; + +export function useSubthemesQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: SubthemesDocument, ...options }); +}; export const DimensionHierarchyDocument = gql` - query DimensionHierarchy( - $sourceType: String! - $sourceUrl: String! - $locale: String! - $cubeIri: String! - $dimensionIri: String! + query DimensionHierarchy($sourceType: String!, $sourceUrl: String!, $locale: String!, $cubeIri: String!, $dimensionIri: String!) { + dataCubeByIri( + iri: $cubeIri + sourceType: $sourceType + sourceUrl: $sourceUrl + locale: $locale ) { - dataCubeByIri( - iri: $cubeIri + dimensionByIri( + iri: $dimensionIri sourceType: $sourceType sourceUrl: $sourceUrl - locale: $locale ) { - dimensionByIri( - iri: $dimensionIri - sourceType: $sourceType - sourceUrl: $sourceUrl - ) { - ...hierarchyMetadata - } + ...hierarchyMetadata } } - ${HierarchyMetadataFragmentDoc} -`; - -export function useDimensionHierarchyQuery( - options: Omit< - Urql.UseQueryArgs, - "query" - > = {} -) { - return Urql.useQuery({ - query: DimensionHierarchyDocument, - ...options, - }); } + ${HierarchyMetadataFragmentDoc}`; + +export function useDimensionHierarchyQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DimensionHierarchyDocument, ...options }); +}; export const DatasetCountDocument = gql` - query DatasetCount( - $sourceType: String! - $sourceUrl: String! - $theme: String - $organization: String - $subtheme: String - $includeDrafts: Boolean + query DatasetCount($sourceType: String!, $sourceUrl: String!, $theme: String, $organization: String, $subtheme: String, $includeDrafts: Boolean) { + datasetcount( + sourceType: $sourceType + sourceUrl: $sourceUrl + theme: $theme + organization: $organization + subtheme: $subtheme + includeDrafts: $includeDrafts ) { - datasetcount( - sourceType: $sourceType - sourceUrl: $sourceUrl - theme: $theme - organization: $organization - subtheme: $subtheme - includeDrafts: $includeDrafts - ) { - count - iri - } + count + iri } -`; - -export function useDatasetCountQuery( - options: Omit, "query"> = {} -) { - return Urql.useQuery({ - query: DatasetCountDocument, - ...options, - }); } + `; + +export function useDatasetCountQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: DatasetCountDocument, ...options }); +}; \ No newline at end of file diff --git a/app/rdf/queries.ts b/app/rdf/queries.ts index d8d039c11..55e4ff5f5 100644 --- a/app/rdf/queries.ts +++ b/app/rdf/queries.ts @@ -355,14 +355,24 @@ export const getCubeDimensionValuesWithMetadata = async ({ predicates: { identifier: scaleType === "Ordinal" || scaleType === "Nominal" - ? schema.identifier + ? { + predicate: schema.identifier, + } + : null, + position: + scaleType === "Ordinal" + ? { + predicate: schema.position, + } : null, - position: scaleType === "Ordinal" ? schema.position : null, color: scaleType === "Nominal" || scaleType === "Ordinal" - ? schema.color + ? { predicate: schema.color } : null, - alternateName: schema.alternateName, + alternateName: { + predicate: schema.alternateName, + locale: locale, + }, }, cache, }), diff --git a/app/rdf/query-literals.ts b/app/rdf/query-literals.ts index fa5b4fd2a..da8f09d34 100644 --- a/app/rdf/query-literals.ts +++ b/app/rdf/query-literals.ts @@ -7,7 +7,13 @@ import { LRUCache } from "typescript-lru-cache"; import batchLoad from "./batch-load"; import { pragmas } from "./create-source"; -type PredicateOption = Record | null>; +type PredicateOption = Record< + string, + null | { + predicate: NamedNode; + locale?: string; + } +>; type ResourceLiteral = { iri: NamedNode; @@ -30,9 +36,19 @@ const buildResourceLiteralQuery = ({ } ${Object.entries(predicates) - .filter((x) => x[1]) - .map(([attr, namedNode]) => { - return sparql`OPTIONAL { ?iri ${namedNode} ?${attr}. }`; + .filter((x): x is [typeof x[0], Exclude] => !!x[1]) + .map(([attr, option]) => { + const { predicate, locale } = option; + return sparql` + OPTIONAL { + ?iri ${predicate} ?${attr}. + ${ + locale + ? sparql`FILTER (langMatches(lang(?${attr}), "${locale}") || lang(?${attr}) = "")` + : "" + } + } + `; })} `.prologue`${pragmas}`; diff --git a/e2e/abbreviations.spec.ts b/e2e/abbreviations.spec.ts index 845eb941b..8d5253c29 100644 --- a/e2e/abbreviations.spec.ts +++ b/e2e/abbreviations.spec.ts @@ -98,3 +98,34 @@ test("hierarchies: it should be possible to enable abbreviations for colors", as expect(legendItems).toEqual(["CH4", "CO2", "N2O"]); }); + +test("localized abbreviations", async ({ actions, selectors }) => { + await actions.chart.createFrom( + "https://environment.ld.admin.ch/foen/gefahren-waldbrand-praeventionsmassnahmen-kantone/1", + "Int" + ); + + await actions.editor.changeChartType("Map"); + await actions.editor.selectActiveField("Warning region"); + + const checkbox = await selectors.edition.useAbbreviationsCheckbox(); + + await checkbox.click(); + + // Wait for the data to load. + await selectors.chart.loaded(); + await selectors.edition.filtersLoaded(); + await selectors.chart.colorLegend(undefined, { setTimeout: 5_000 }); + + const legendItems = await ( + await selectors.chart.colorLegendItems() + ).allInnerTexts(); + + expect(legendItems).toEqual([ + "No measures", + "Warning", + "Conditional ban on fires", + "Fire ban in the forest", + "Ban on fires", + ]); +});