Skip to content

Schemas

Pydantic request/response contracts used by FastAPI response_model / OpenAPI.

Filter widgets are defined in shacl_to_filters and re-exported from app.schemas.filters.

app.schemas.entities

Thin Pydantic GeoJSON models for entity list HTTP responses / OpenAPI.

Runtime GeoJSON is still built with the geojson package in sparql_to_geojson_translator. These models exist only so FastAPI response_model can document and validate the wire shape.

GeoJSONGeometry

Bases: BaseModel

GeoJSON geometry object (Point or opaque dict for OpenAPI).

GeoJSONFeature

Bases: BaseModel

Single GeoJSON Feature returned for a pin or region.

FeatureCollection

Bases: BaseModel

Minimal FeatureCollection compatible with RFC 7946 / the widget.

app.schemas.admin

Admin and common response models.

RootMessage

Bases: BaseModel

Payload returned by GET /.

ReloadSuccess

Bases: BaseModel

Payload returned when ontology reload succeeds.

app.schemas.stories

Stories proxy response models.

StoriesCountResponse

Bases: BaseModel

Result of GET /api/v1/stories/count.

app.schemas.facets

Facet count response: dimension id → tag IRI → count.

FacetCounts = dict[str, dict[str, int]] module-attribute

Mapping of filter dimension id to {tag_iri: entity_count}.