OKF Explorer Overview Context

Status

Design specification. This document captures the expected behaviour for the definitive OKF Explorer and the generated data needed to support it.

Problem

The Explorer must work for both small Markdown OKF bundles and very large static corpora such as the GOV.UK CKAN bundle. Large corpora cannot hydrate all datasets, resources, and relationships before rendering a first useful screen.

The current large-corpus path loads a lightweight data/overview.json, but that overview is mostly counts, top facet previews, and a small record sample. This means the first Reader, Graph, Links, Timeline, Type, Resources, and Map views do not share a meaningful context:

The Explorer therefore needs a generated overview context that every display can render before full-record hydration.

Principle

The first context for every bundle is overview.

The overview context is not a search result and not an arbitrary sample. It is a generated summary of the shape of the bundle. It should set expectations for what the bundle contains and offer useful routes into narrower contexts.

All view tabs render the active context:

Changing search, a facet, a hierarchy node, or a graph overview node changes the active context. The same reduced context must then apply consistently to every view.

Left Panel

The left panel is a global context reducer. It is not merely a local filter for the currently visible tab.

For the GOV.UK CKAN large corpus, the current left-panel inputs represent:

These dimensions should not be rendered as equal raw lists. The builder should analyse each dimension and recommend an appropriate control:

Provider-authored presentation defaults and device-local user overrides are specified separately from generated analysis. See the Facet presentation experiment. It defines the okf-explorer-presentation.v1 profile, compact distributions, high-cardinality search behaviour and the provider-to-user precedence model.

Generated Analysis Artifact

Large static corpora should expose an additive analysis artifact, for example:

{
  "schema": "okf-explorer-analysis.v1",
  "generated_at": "2026-07-06T00:00:00Z",
  "source_bundle": "okf-explorer.json",
  "contexts": {
    "overview": {
      "label": "Overview",
      "description": "Bundle-level generated overview context",
      "record_count": 58461,
      "resource_count": 268241,
      "relationship_count": 1178122
    }
  },
  "views": {
    "reader": {},
    "graph": {},
    "links": {},
    "timeline": {},
    "type": {},
    "resources": {},
    "map": {},
    "narrative": {}
  }
}

The expected path for large corpora is:

data/analysis/overview.json

Generated Concept Enrichment

Large-corpus builders should emit deterministic concept semantics before the Explorer tries to render a graph:

Relationship output should prefer explicit verbs over generic links. Builders should emit relationships such as download resource, API endpoint, documentation, licence, maintainer, spatial coverage, temporal coverage, derived from, and supersedes where metadata supports them, while keeping compatibility relationships such as published by and has resource when existing viewers depend on them.

The large-corpus descriptor should advertise it:

{
  "entrypoints": {
    "data_manifest": "data/manifest.json",
    "overview_index": "data/overview.json",
    "analysis_overview": "data/analysis/overview.json",
    "search_manifest": "data/search/manifest.json"
  }
}

This artifact must stay small enough to load before full dataset, resource, or relationship hydration.

View Contexts

Reader

The Reader overview should contain:

Graph

The Graph overview should contain aggregate nodes and weighted edges, not sampled raw records.

Example node categories:

Example edge categories:

Each aggregate node should include counts, sample routes, and a drill-down query or context expression.

The Links overview should show relationship-type counts, top connected entity groups, and representative paths. It should not load the full relationship universe until a reduced context or selected node makes that necessary.

Timeline

The Timeline overview should show the distribution of records over time. It should support buckets such as year, month, decade, or custom date bands, with counts and representative records for each bucket.

Type And Facets

The Type view should become a facet and dimension analysis view. It should order facets by usefulness rather than by hard-coded key order.

Facet analysis should include:

Resources

The Resources overview should describe the resource landscape:

Narrative

Narrative should be restored as a first-class view. It should provide a readable explanation of the active context and link to the same graph, timeline, links, and resource evidence used by the other views.

Map

Map should treat geography as both evidence and a context reducer. It should classify source-declared coverage, recognised UK geographies, explicit coordinates and geospatial services/files deterministically. A selected area or evidence class must reduce the same active context used by the other views.

Initial display must not depend on a tile service or geocoder. Remote GeoJSON or ArcGIS feature data may be previewed only after an explicit action, within response and feature limits, with the original source retained as the recovery path. Inferred representative centroids must be labelled as navigation aids and must never be drawn as authoritative boundaries.

The detailed evidence model and prototype constraints are defined in Geospatial Map Exploration.

Hierarchies

Generated hierarchy support is central to making the overview useful.

Candidate hierarchies include:

Hierarchy definitions should include stable route expressions so selecting a hierarchy node reduces all views consistently.

Ontology Analysis

Ontology alignment is optional enrichment, not an OKF core requirement. The layered standards boundary, proposed semantic extension, relationship-type registry and inference/validation roadmap are defined in Ontology and semantic graph architecture.

The builder may inspect local or configured ontology packs, such as schema.org or SeeLinks data packs, and produce ontology_candidates in the analysis artifact.

Each candidate should record:

For CKAN-like data, schema.org may contribute concepts such as Dataset, DataCatalog, DataDownload, Organization, CreativeWork, Place, keywords, license, distribution, encodingFormat, spatialCoverage, and temporalCoverage.

The Explorer should show ontology fit only when it explains or improves navigation. It should not display ontology labels as decoration.

Capturing Analysis In OKF Bundles

There are two related needs:

  1. keep the OKF bundle self-describing;
  2. avoid putting large generated indexes into a monolithic bundle.

The recommended model is a hybrid extension model.

Small Bundles

Small okf-bundle.json files can embed the generated overview analysis inline:

{
  "schema": "okf-explorer-bundle.v0",
  "kind": "okf-bundle",
  "extensions": {
    "okf-explorer-analysis.v1": {
      "mode": "inline",
      "analysis": {
        "contexts": {},
        "views": {},
        "facet_analysis": [],
        "hierarchies": [],
        "ontology_candidates": []
      }
    }
  }
}

This keeps drag-and-drop or file-picker usage simple for small wikis.

Large Bundles

Large descriptor-based corpora should reference generated analysis artifacts:

{
  "schema": "okf-explorer-large-corpus.v1",
  "kind": "okf-large-corpus",
  "entrypoints": {
    "analysis_overview": "data/analysis/overview.json"
  },
  "extensions": {
    "okf-explorer-analysis.v1": {
      "mode": "external",
      "entrypoint": "analysis_overview"
    }
  }
}

This keeps startup small and lets browsers cache analysis, search, record, and relationship artifacts independently.

Node And Edge Annotations

Generated OKF nodes and edges can also carry analysis hints when they are small, stable, and route-relevant:

{
  "id": "document/themes/discovery-to-governance.md",
  "title": "The discovery-to-governance lifecycle",
  "x_okf_explorer": {
    "facet_values": {
      "section": ["document", "themes"],
      "topic_cluster": ["governance"]
    },
    "ontology_matches": [
      {
        "ontology": "schema.org",
        "class": "CreativeWork",
        "confidence": 0.72
      }
    ]
  }
}

Use x_okf_explorer for generated Explorer hints rather than changing the core OKF node semantics. The same pattern can be used on edges for aggregate relationship labels, relationship confidence, or evidence counts.

Builder Responsibilities

The bundle builder should:

  1. generate core OKF nodes and edges;
  2. generate or reference okf-explorer-analysis.v1;
  3. score and order facets;
  4. identify useful hierarchies;
  5. produce aggregate graph, timeline, link, and resource overview contexts;
  6. optionally evaluate ontology candidates;
  7. record provenance for generated classifications and suppress low-confidence enrichment by default.

The Explorer should:

  1. load the descriptor, manifest, and overview analysis first;
  2. render overview for every view without full hydration;
  3. update one shared active context from left-panel selections and graph clicks;
  4. hydrate full records, resources, or relationships only when the active context requires them;
  5. keep all routes addressable with query and hash state.

Open Decisions

The display-metadata transport decision is now settled experimentally: use an explicit okf-explorer-presentation.v1 profile, embedded in or referenced by a large descriptor. Do not overload the term datapack and do not probe implicitly beside each index.md.