httk.store.query.portable¶
Derive portable query fields and operations from OPTIMADE definitions.
Classes¶
Describe the query operations guaranteed by one property definition. |
Functions¶
|
Derive the portable operation subset for |
|
Return the ordered portable query fields described by |
Module Contents¶
- class httk.store.query.portable.PortableQueryCapabilities[source]¶
Describe the query operations guaranteed by one property definition.
query-supportexpresses a cross-provider guarantee, not a particular server’s implementation detail.all optionalis deliberately fail-closed here: it gives a portable client no operation it can rely on. A server may offer more, but that is not represented by the definition.- Parameters:
query_support – The normalized declared query-support level.
operations – The portable operation families guaranteed by the definition.
- httk.store.query.portable.portable_query_capabilities(definition)[source]¶
Derive the portable operation subset for
definition.The operation names are
"equality","ordering","stringmatching", and"set". They intentionally describe the query-language operation families rather than storage implementation.IS [NOT] KNOWNis part of the equality family because it is the NULL spelling of equality/inequality in the OPTIMADE filter language.- Parameters:
definition (httk.core.PropertyDefinition) – The OPTIMADE property definition to inspect.
- Returns:
The guaranteed portable query capabilities.
- Return type:
- httk.store.query.portable.portable_query_fields(entry_type, *, include=(), exclude=())[source]¶
Return the ordered portable query fields described by
entry_type.By default, this selects scalar fields and flat lists with at least one operation guaranteed by their definition.
includeis an explicit binding override for named existing properties; it is appended as a second ordered group after the derived fields, in entry-definition order among the included names, but does not manufacture query capabilities absent from that definition.excludealways wins. Both arguments reject unknown or duplicate names so binding mistakes cannot silently broaden a profile.- Parameters:
entry_type (httk.core.EntryTypeDefinition) – The entry definition whose properties are inspected.
include (collections.abc.Iterable[str]) – Existing property names to append to the derived selection.
exclude (collections.abc.Iterable[str]) – Existing property names to remove from the selection.
- Returns:
Derived property names followed by explicitly included names.
- Raises:
ValueError – If
includeorexcludecontains an unknown or duplicate property name.- Return type: