httk.serve.optimade.model.results ================================= .. py:module:: httk.serve.optimade.model.results Classes ------- .. autoapisummary:: httk.serve.optimade.model.results.ResultRow httk.serve.optimade.model.results.QueryResults httk.serve.optimade.model.results.QueryFunction httk.serve.optimade.model.results.OptimadeAdapter Module Contents --------------- .. py:class:: ResultRow Represent one entry result and its envelope data. :param values: Response-field values keyed by OPTIMADE property name. :param relationships: Related resources keyed by entry type. :param property_metadata: Per-property metadata keyed by response field. .. py:attribute:: values :type: dict[str, Any] .. py:attribute:: relationships :type: dict[str, list[dict[str, Any]]] .. py:attribute:: property_metadata :type: dict[str, Any] .. py:class:: QueryResults Bases: :py:obj:`Protocol` The results of a query against a backend, as consumed by the entry endpoints. Iteration yields one :class:`~httk.serve.optimade.model.results.ResultRow` per entry; its ``values`` map OPTIMADE response-field names to values, and the ``id`` and ``type`` keys are always present. .. py:property:: more_data_available :type: bool Report whether another page is available. .. py:method:: count() Return the total number of matches before pagination. .. py:class:: QueryFunction Bases: :py:obj:`Protocol` The callback seam through which the request engine runs queries on a backend. .. py:class:: OptimadeAdapter Bases: :py:obj:`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 :class:`~httk.serve.optimade.model.results.QueryFunction`. .. py:property:: schema :type: httk.serve.optimade.schema.served.ServedSchema Return the schema supplied by the adapter. .. py:method:: query_function() Return the callback used to execute entry queries.