betty.json.linked_data module

Provide JSON-LD utilities.

class betty.json.linked_data.JsonLdObject[source]

Bases: Object

A JSON Schema for an object with JSON-LD.

__init__(*, def_name: str | None = None, title: str | None = None, description: str | None = None)[source]
class betty.json.linked_data.JsonLdSchema[source]

Bases: FileBasedSchema

A JSON-LD JSON Schema reference.

async classmethod new() Self[source]

Create a new instance.

class betty.json.linked_data.LinkedDataDumpable[source]

Bases: Generic[_SchemaTypeT]

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.

abstract async classmethod linked_data_schema(project: Project) _SchemaTypeT[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.