Skip to content

Domain System

folia's core is domain-agnostic. Domains are pluggable modules that extend the platform with:

  • Schema extensions - additional properties on layers (e.g., geo:, tabular:)
  • Operations - domain-specific transforms and analyses
  • Implementations - the libraries and logic that execute those operations

Decided in ADR-0006

Domain vs Operation Category

Not everything that adds operations is a domain. The litmus test: "Can it be a top-level block on a layer?"

DomainOperation Category
AddsSchema extension on layersOperations + display hints
Answers"What kind of data?""What can I do with it?"
Examplegeo, tabular, temporalterrain, h3, hydrology
Layer blockgeo: {}, tabular: {}None

Operation categories (like terrain or hydrology) live inside a domain. They organize operations but do not extend the layer schema.

Module Structure

Each domain is a Python package under folia/domains/<name>/:

folia/domains/<name>/
  domain.yaml       # manifest
  schema/            # JSON Schema extensions
  operations/        # Operation YAMLs organized by category
  implementations/   # Operation implementations

Domain Manifest

The domain.yaml file declares a domain's identity and capabilities.

FieldTypeRequiredDescription
idstringYesUnique domain identifier
namestringYesHuman-readable name
versionstringNoSemantic version
descriptionstringNoWhat this domain provides
schema_extensionstringYesKey added to layers (e.g., geo:)
transforms_modulestringYesPython module path for transform implementations
operations_dirstringNoPath to operation YAML directory
implementationslistNoAvailable operation implementations
default_implementation_prioritylistNoOrdered implementation preference
typeslistNoData types this domain introduces
uri_schemeslistNoURI schemes this domain handles
yaml
# folia/domains/geo/domain.yaml
name: geo
schema_extension: "geo:"
transforms_module: folia.domains.geo.transforms
description: >
  Geospatial domain - terrain analysis, raster/vector transforms,
  H3 hexagonal indexing, tile generation, STAC and USGS 3DEP connectors.

Current Domains

DomainOperationsPriorityDescription
geo47P1Geospatial - terrain, raster, vector, analysis, imagery, classification, hydrology, utility
tabular6P1Tabular data - DuckDB-powered SQL transforms
temporal6P2Time-series - resample, rolling, align, interpolate
ml4P3Machine learning - foundation model inference, embedding, chip/reassemble

Future domains under consideration: imagery (P2), sensor (P3).

Third-Party Domains

Domains are pip-installable. A third-party domain ships as a standard Python package:

bash
pip install folia-medical

This installs to folia/domains/medical/ and is automatically discovered at startup. Third-party domains follow the same manifest and directory conventions as built-in domains.

How Domains Compose

A single layer MAY include extensions from multiple domains:

yaml
layers:
  weather-stations:
    uri: s3://bucket/stations.parquet
    type: table
    geo:
      bbox: [-120, 35, -110, 45]
      crs: EPSG:4326
    tabular:
      key_column: station_id
    temporal:
      time_column: observed_at
      frequency: 1h

The geo:, tabular:, and temporal: blocks are each validated by their respective domain's JSON Schema extension. The core layer schema knows nothing about their contents.

Decided in ADR-0001 - everything is a layer, domains extend the layer schema.

Licensed under CC-BY-4.0