httk.core.optimade.standard_names¶
Complete an OPTIMADE schema snapshot with standard-namespace name identities.
Real OPTIMADE providers almost never publish a property-definition $id in
their /info/<entry_type> documents, yet the specification reserves the
unprefixed property namespace on a standard endpoint for the standard property
of that name as of the specification version the service declares. This module
applies that namespace rule: it fills in the definition IRI of an advertised
unprefixed property name whose meaning the declared specification version fixes,
without ever overriding a declared $id and without guessing about
provider-prefixed names.
The pure core is infer_standard_names(); complete_standard_schema()
is the registry-driven wrapper that every code path building an
OptimadeSchemaSnapshot can consult.
Attributes¶
Evidence tag recorded for a name inferred from the standard namespace rule. |
Classes¶
Identities inferred for standard-namespace property names. |
Functions¶
|
Return the |
|
Infer definition IRIs for advertised standard-namespace property names. |
|
Return the standard-name completion for one schema snapshot. |
Module Contents¶
- httk.core.optimade.standard_names.STANDARD_NAME_EVIDENCE = 'standard-name'¶
Evidence tag recorded for a name inferred from the standard namespace rule.
- httk.core.optimade.standard_names.parse_optimade_api_version(value)¶
Return the
(major, minor)of a major-1 OPTIMADE version, orNone.MAJOR.MINORandMAJOR.MINOR.PATCHare accepted with optional trailing pre-release or build text ignored. Only the(major, minor)pair is compared. A value whose major version is not 1, or which does not parse, yieldsNone(the client supports major version 1 only).
- class httk.core.optimade.standard_names.StandardSchemaCompletion¶
Identities inferred for standard-namespace property names.
- Parameters:
entry_type – Entry type of the info document these names belong to.
api_version – Specification version the service declared, if any.
entry_type_definition_id – Definition IRI of the matched standard entry type, set only when standard-name inference is possible for this snapshot (a usable declared version and an owner-declared version table);
Noneotherwise.definitions_by_name – Remote property name mapped to the property definition IRI inferred for it.
evidence_by_name – Remote property name mapped to the evidence tag that justified its inference.
- definitions_by_name: collections.abc.Mapping[str, str]¶
- evidence_by_name: collections.abc.Mapping[str, str]¶
- httk.core.optimade.standard_names.infer_standard_names(*, entry_type, api_version, advertised, definition_ids_by_name, introduced_in)¶
Infer definition IRIs for advertised standard-namespace property names.
Pure and registry-free. For each advertised name the standard namespace rule is applied: an unprefixed name that the declared specification version already defines is completed to that standard property’s definition IRI. A declared
$idalways wins, provider-prefixed names carry no standard semantics, and a name introduced only in a later version stays unknown. An absent or non-major-1 declared version disables inference entirely.- Parameters:
entry_type (str) – Entry type being completed.
api_version (str | None) – Specification version the service declared.
advertised (collections.abc.Mapping[str, object]) – The info document’s
data.propertiesmapping.definition_ids_by_name (collections.abc.Mapping[str, str]) – Standard property name to definition IRI.
introduced_in (collections.abc.Mapping[str, str]) – Standard property name to its earliest spec version.
- Returns:
The names inferred for this schema, possibly empty.
- Return type:
- httk.core.optimade.standard_names.complete_standard_schema(snapshot)¶
Return the standard-name completion for one schema snapshot.
Registry-driven wrapper over
infer_standard_names(). It reads the declared specification version from the info document’s ownmeta.api_version, resolves the standard entry type by name against the registered OPTIMADE entry bindings, and gates name-based inference on that binding’sstandard_property_versionstable. It never raises for malformed or hostile remote input: the safe answer is an empty completion.entry_type_definition_idis set only when standard-name inference is possible for this snapshot (a usable declared version and an owner-declared version table).- Parameters:
snapshot (httk.core.optimade.resources.OptimadeSchemaSnapshot) – Schema snapshot whose advertised names to complete.
- Returns:
The inferred completion, empty when unresolved or unsupported by the declared version.
- Return type: