httk.serve.dsp.catalogue

Public catalogue-policy seam and the built-in DSP minimal policy.

Attributes

DCAT_PROFILE

DCAT-AP profile parameter used by the built-in alternate representation.

DCAT_MEDIA_TYPE

Full media type of the built-in alternate catalogue representation.

Classes

DspCatalogueRepresentation

Describe one selected HTTP representation of a catalogue response.

DspCataloguePolicy

Define the replaceable publication-profile part of a DSP provider.

MinimalDspCataloguePolicy

Implement the built-in stable DSP minimal catalogue profile.

Module Contents

httk.serve.dsp.catalogue.DCAT_PROFILE = 'https://semiceu.github.io/DCAT-AP/releases/3.0.1/'[source]

DCAT-AP profile parameter used by the built-in alternate representation.

httk.serve.dsp.catalogue.DCAT_MEDIA_TYPE = 'application/ld+json; profile="https://semiceu.github.io/DCAT-AP/releases/3.0.1/"'[source]

Full media type of the built-in alternate catalogue representation.

class httk.serve.dsp.catalogue.DspCatalogueRepresentation[source]

Describe one selected HTTP representation of a catalogue response.

Parameters:
  • media_type – Exact response media type declared by the DSP OpenAPI contract.

  • alternate – Whether the policy should render its alternate catalogue projection.

  • headers – Additional response headers as immutable name-value pairs.

media_type: str[source]
alternate: bool = False[source]
headers: tuple[tuple[str, str], Ellipsis] = ()[source]
class httk.serve.dsp.catalogue.DspCataloguePolicy[source]

Bases: Protocol

Define the replaceable publication-profile part of a DSP provider.

Implementations own catalogue snapshot requirements, catalogue and dataset serialization, offer serialization, filter policy, and selection of an optional alternate catalogue representation. The provider continues to own live publication retrieval and all DSP negotiation and transfer mechanics.

build_profile(config, publications)[source]

Build and validate one immutable live catalogue snapshot.

validate_catalogue_request(config, message)[source]

Validate profile-specific catalogue request constraints.

select_catalogue_representation(config, accept)[source]

Select the catalogue HTTP representation for an Accept field.

serialize_catalogue(profile, *, alternate)[source]

Serialize one catalogue snapshot in the selected projection.

serialize_dataset(profile)[source]

Serialize one dataset root response.

serialize_offer(offer, *, include_target)[source]

Serialize an offer consistently for catalogues and negotiations.

class httk.serve.dsp.catalogue.MinimalDspCataloguePolicy[source]

Implement the built-in stable DSP minimal catalogue profile.

build_profile(config, publications)[source]

Build and cross-validate the built-in immutable snapshot.

validate_catalogue_request(config, message)[source]

Reject catalogue filtering in the built-in minimal profile.

select_catalogue_representation(config, accept)[source]

Apply the built-in exact alternate-representation negotiation rule.

serialize_catalogue(profile, *, alternate)[source]

Serialize the built-in DSP or context-substituted catalogue.

serialize_dataset(profile)[source]

Serialize one built-in DSP dataset document.

serialize_offer(offer, *, include_target)[source]

Serialize one built-in unconditional-use offer.