httk.serve.optimade.model.results

Classes

ResultRow

Represent one entry result and its envelope data.

QueryResults

The results of a query against a backend, as consumed by the entry endpoints.

QueryFunction

The callback seam through which the request engine runs queries on a backend.

OptimadeAdapter

Structural adapter contract consumed by the public serving helpers.

Module Contents

class httk.serve.optimade.model.results.ResultRow

Represent one entry result and its envelope data.

Parameters:
  • values – Response-field values keyed by OPTIMADE property name.

  • relationships – Related resources keyed by entry type.

  • property_metadata – Per-property metadata keyed by response field.

values: dict[str, Any]
relationships: dict[str, list[dict[str, Any]]]
property_metadata: dict[str, Any]
class httk.serve.optimade.model.results.QueryResults

Bases: Protocol

The results of a query against a backend, as consumed by the entry endpoints.

Iteration yields one ResultRow per entry; its values map OPTIMADE response-field names to values, and the id and type keys are always present.

property more_data_available: bool

Report whether another page is available.

count()

Return the total number of matches before pagination.

class httk.serve.optimade.model.results.QueryFunction

Bases: Protocol

The callback seam through which the request engine runs queries on a backend.

class httk.serve.optimade.model.results.OptimadeAdapter

Bases: Protocol

Structural adapter contract consumed by the public serving helpers.

Query execution may be backed by the ordinary Store/Searcher adapter or a storage federation with its own bounded paging policy. The HTTP layer only needs the served schema and a callback implementing QueryFunction.

property schema: httk.serve.optimade.schema.served.ServedSchema

Return the schema supplied by the adapter.

query_function()

Return the callback used to execute entry queries.