httk.core.services¶
Neutral service identity and endpoint metadata contract.
Classes¶
Describe one service independently of its publication transport. |
|
Store one |
Module Contents¶
- class httk.core.services.Service[source]¶
Describe one service independently of its publication transport.
The service and endpoint identifiers are absolute IRIs; this neutral core contract does not impose a particular scheme.
conforms_tonames one or more standards the service implements, and may be supplied as any ordered non-string iterable.- Parameters:
id – The service’s absolute IRI.
title – The service’s human-readable title.
endpoint_url – The service endpoint’s absolute IRI.
conforms_to – Non-empty unique absolute IRIs for implemented standards.
serves_dataset_ids – Optional non-empty unique absolute IRIs for served datasets.
endpoint_description – An optional absolute IRI describing the endpoint.
- classmethod create(obj)[source]¶
Coerce a mapping or existing service into a
Service.- Parameters:
obj (Service | Mapping[str, Any]) – A service instance or a mapping with service fields.
- Returns:
The existing or newly constructed service.
- Raises:
TypeError – If
objis neither a service nor a mapping.ValueError – If the mapping has missing, unknown, or invalid fields.
- Return type:
Self
- class httk.core.services.ServiceRecord[source]¶
Bases:
ServiceStore one
Serviceusing the core service storage contract.- Parameters:
id – The service’s absolute IRI.
title – The service’s human-readable title.
endpoint_url – The service endpoint’s absolute IRI.
conforms_to – Non-empty unique absolute IRIs for implemented standards.
serves_dataset_ids – Optional non-empty unique absolute IRIs for served datasets.
endpoint_description – An optional absolute IRI describing the endpoint.
- classmethod create(obj)[source]¶
Coerce a service record, neutral service, or field mapping.
- Parameters:
obj (ServiceRecord | Service | Mapping[str, Any]) – A service record, neutral service, or service field mapping.
- Returns:
The existing or newly constructed service record.
- Raises:
TypeError – If
objis not a service or mapping.ValueError – If the mapping has unknown, missing, or invalid fields.
- Return type:
Self