httk.serve.dsp.serializers

JSON projections for the DSP/DCAT catalogue and its process records.

Functions

offer_policy(offer, *, include_target)

Serialize the unconditional ODRL use offer.

serialize_data_service(service)

Serialize a DSP data service embedded in a distribution.

serialize_distribution(distribution)

Serialize the DSP distribution with its embedded service and access URL.

serialize_dsp_dataset(profile)

Serialize one dataset in its DSP catalogue projection.

serialize_dsp_catalogue(profile)

Serialize the fixed catalogue under the protected official DSP context.

serialize_dsp_dataset_document(profile)

Serialize one dataset as a DSP root response document.

serialize_dcat_catalogue(profile)

Serialize the context-substituted DCAT-AP projection.

serialize_agreement(agreement)

Serialize an immutable agreement record as a fresh JSON policy.

serialize_negotiation(record)

Serialize a negotiation process at its acknowledged state.

serialize_transfer(record)

Serialize a transfer process at its acknowledged state.

version_document(service_id)

Serialize the DSP HTTPS version-discovery response.

Module Contents

httk.serve.dsp.serializers.offer_policy(offer, *, include_target)[source]

Serialize the unconditional ODRL use offer.

Parameters:
Returns:

Fresh JSON policy object.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_data_service(service)[source]

Serialize a DSP data service embedded in a distribution.

Parameters:

service (httk.serve.dsp.models.DataServiceProfile) – Data-service profile to serialize.

Returns:

Fresh DSP data-service object.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_distribution(distribution)[source]

Serialize the DSP distribution with its embedded service and access URL.

Parameters:

distribution (httk.serve.dsp.models.DistributionProfile) – Distribution profile to serialize.

Returns:

Fresh DSP distribution object.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_dsp_dataset(profile)[source]

Serialize one dataset in its DSP catalogue projection.

Parameters:

profile (httk.serve.dsp.models.DatasetProfile) – Fixed provider catalogue profile.

Returns:

Fresh DSP dataset object.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_dsp_catalogue(profile)[source]

Serialize the fixed catalogue under the protected official DSP context.

Parameters:

profile (httk.serve.dsp.models.CatalogueProfile) – Fixed provider catalogue profile.

Returns:

Fresh DSP catalogue document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_dsp_dataset_document(profile)[source]

Serialize one dataset as a DSP root response document.

Parameters:

profile (httk.serve.dsp.models.DatasetProfile) – Fixed provider catalogue profile.

Returns:

Fresh DSP dataset document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_dcat_catalogue(profile)[source]

Serialize the context-substituted DCAT-AP projection.

The common catalogue value is byte-for-byte derived from the DSP value; only the top-level context is replaced. The owned context changes every endpointURL string from an RDF literal to an RDF IRI.

Parameters:

profile (httk.serve.dsp.models.CatalogueProfile) – Fixed provider catalogue profile.

Returns:

Fresh DCAT-AP-compatible JSON-LD catalogue document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_agreement(agreement)[source]

Serialize an immutable agreement record as a fresh JSON policy.

Parameters:

agreement (httk.serve.dsp.models.AgreementRecord) – Agreement record to serialize.

Returns:

Fresh agreement policy object.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_negotiation(record)[source]

Serialize a negotiation process at its acknowledged state.

Parameters:

record (httk.serve.dsp.models.NegotiationRecord) – Negotiation snapshot to serialize.

Returns:

Fresh DSP contract-negotiation document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.serialize_transfer(record)[source]

Serialize a transfer process at its acknowledged state.

Parameters:

record (httk.serve.dsp.models.TransferRecord) – Transfer snapshot to serialize.

Returns:

Fresh DSP transfer-process document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]

httk.serve.dsp.serializers.version_document(service_id)[source]

Serialize the DSP HTTPS version-discovery response.

Parameters:

service_id (str) – Configured service identifier.

Returns:

Fresh protocol version document.

Return type:

dict[str, httk.serve.dsp.models.JsonValue]