httk.store.served_specs

Derive OPTIMADE property names and types from the storage schema IR.

This module deliberately depends only on the neutral schema representation and httk-core definitions. SQL and Mongo layers can therefore share the same property derivation without importing one another’s backend.

Functions

served_specs(schema, prefix)

Return the served (name, field spec, fulltype) triples.

definition_fulltype(definition)

Return the OPTIMADE fulltype declared by a property definition.

Module Contents

httk.store.served_specs.served_specs(schema, prefix)[source]

Return the served (name, field spec, fulltype) triples.

Parameters:
Returns:

One triple for every schema field with an OPTIMADE value type.

Return type:

list[tuple[str, httk.store.db.schema.FieldSpec, str]]

httk.store.served_specs.definition_fulltype(definition)[source]

Return the OPTIMADE fulltype declared by a property definition.

Parameters:

definition (httk.core.PropertyDefinition) – The property definition to inspect.

Returns:

Its scalar, list, or dictionary fulltype string.

Return type:

str