httk.optimade.backend.adapter¶
Attributes¶
Classes¶
One queryable source (table/type) behind an OPTIMADE entry endpoint. |
|
Binds a store to the OPTIMADE entry endpoints it serves. |
Module Contents¶
- class httk.optimade.backend.adapter.EntrySource[source]¶
One queryable source (table/type) behind an OPTIMADE entry endpoint.
targetis what gets passed tosearcher.variable();fieldsmaps OPTIMADE response-field names to extractors applied to matched row objects.relationships, when set, is an extractor mapping a matched row to a dictionary keyed by related entry type, each value a list of{'id': str, 'description': str?, 'role': str?}dictionaries.sort_keysmaps response-field names to the backend field names to sort on.property_metadatamaps response-field names to extractors returning the per-property metadata dictionary for a matched row (orNonewhen there is no metadata for that row).- sort_keys: collections.abc.Mapping[str, str][source]¶
- relationships: FieldExtractor | None = None[source]¶
- property_metadata: collections.abc.Mapping[str, FieldExtractor][source]¶
- class httk.optimade.backend.adapter.BackendAdapter[source]¶
Binds a store to the OPTIMADE entry endpoints it serves.
sourcesmaps entry endpoint names (e.g.'structures') to the sources queried for that endpoint; an endpoint with several sources (e.g. several calculation result types) is queried across all of them.schemais required: it declares the served entry types and properties.field_handlersmaps each entry type to its filter-handler table. When omitted (left empty) it is derived fromschemaviasimple_property_handlers(), using an identity property-key map (each property is filtered against a backend field of the same name); a backend whose field names differ, or that wants finer control, supplies its own tables instead.- field_handlers: collections.abc.Mapping[str, httk.data.optimade_query.HandlerTable][source]¶
- query_function() httk.optimade.model.results.QueryFunction[source]¶