betty.json.linked_data module

Provide JSON-LD utilities.

class betty.json.linked_data.JsonLdSchema[source]

Bases: FileBasedSchema

A JSON-LD JSON Schema reference.

async classmethod new() Self[source]

Create a new instance.

wrap(wrapped: Schema) None[source]

Wrap another schema and add JSON-LD properties.

This will alter the structure of the wrapped schema.

class betty.json.linked_data.LinkedDataDumpable[source]

Bases: object

Describe an object that can be dumped to linked data.

async dump_linked_data(project: Project) DumpMapping[Dump][source]

Dump this instance to JSON-LD.

async classmethod linked_data_schema(project: Project) Schema[source]

Define the JSON Schema for betty.json.linked_data.LinkedDataDumpable.dump_linked_data().

betty.json.linked_data.dump_context(dump: MutableMapping[str, bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]], **context_definitions: str) None[source]

Add one or more contexts to a dump.

Add one or more links to a dump.