httk.core.services

Neutral service identity and endpoint metadata contract.

Classes

Service

Describe one service independently of its publication transport.

ServiceRecord

Store one Service using the core service storage contract.

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_to names 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.

id: str[source]
title: str[source]
endpoint_url: str[source]
conforms_to: tuple[str, Ellipsis][source]
serves_dataset_ids: tuple[str, Ellipsis] | None = None[source]
endpoint_description: str | None = None[source]
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 obj is 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: Service

Store one Service using 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 obj is not a service or mapping.

  • ValueError – If the mapping has unknown, missing, or invalid fields.

Return type:

Self