@varve/agency-sdks

Graph Metadata

Build bounded Eurostat dataset, dimension, and member graphs for search, lineage, and NLQ systems.

Eurostat metadata can expand quickly. getDatasetGraphMetadata() keeps expansion explicit by using strategies.

const graph = await client.getDatasetGraphMetadata('demo_gind', {
  strategy: 'filtered',
  filters: {
    freq: 'A',
    indic_de: 'JAN',
    geo: ['DE', 'FR'],
    time: ['2022', '2023'],
  },
});
 
console.log(graph.dataset);
console.log(graph.dimensions);
console.log(graph.members);

Strategies

// Default: use latest advertised period when available.
await client.getDatasetGraphMetadata('demo_gind');
 
// Use Eurostat default presentation filters plus latest period.
await client.getDatasetGraphMetadata('demo_gind', { strategy: 'sample' });
 
// Require explicit caller filters.
await client.getDatasetGraphMetadata('demo_gind', {
  strategy: 'filtered',
  filters: { freq: 'A', geo: ['DE', 'FR'], time: ['2023'] },
});
 
// Full expansion is guarded.
await client.getDatasetGraphMetadata('demo_gind', {
  strategy: 'full',
  allowLarge: true,
});
 
// Read the declared structure (DSD) instead of a data slice.
await client.getDatasetGraphMetadata('demo_gind', { strategy: 'structure' });

By default, full expansion throws for datasets above maxObservationCount unless allowLarge: true is passed.

Declared structure and fidelity

Every result carries a fidelity marker:

  • observed — dimensions and members come from an actual data slice, so members are only the values present in that slice.
  • declared — dimensions and members come from the dataset's structure definition (DSD), so members are the full codelist declared by Eurostat.

strategy: 'structure' fetches the DSD directly (as SDMX-ML, at the version advertised in the catalog) and returns fidelity: 'declared'. The other strategies also fall back to the declared structure automatically when a slice is too large to describe — Eurostat answers those with a 413 or a warning envelope — so oversized cubes still return metadata instead of throwing.

const graph = await client.getDatasetGraphMetadata('demo_gind', { strategy: 'structure' });
graph.fidelity; // 'declared'

Graph shape

(:Dataset {code})-[:HAS_DIMENSION {position}]->(:Dimension {id})
(:Dimension {id})-[:HAS_MEMBER {order}]->(:Member {id})

Use filtered graph metadata when you want a reproducible slice that can be cited or searched without importing an entire Eurostat cube.

On this page