betty.json.linked_data module¶
Provide JSON-LD utilities.
- class betty.json.linked_data.JsonLdObject[source]¶
Bases:
ObjectA JSON Schema for an object with JSON-LD.
- final class betty.json.linked_data.JsonLdSchema[source]¶
Bases:
FileBasedSchemaA JSON-LD JSON Schema reference.
- class betty.json.linked_data.LinkedDataDumpable[source]¶
Bases:
Generic[_SchemaTypeT,_DumpT]Describe an object that can be dumped to linked data.
- abstract async classmethod linked_data_schema(project: Project) _SchemaTypeT[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.json.linked_data.LinkedDataDumpableJsonLdObject[source]¶
Bases:
LinkedDataDumpable[JsonLdObject,MutableMapping[str,bool|int|float|str|None|MutableSequence[Dump] |MutableMapping[str, Dump]]],ABCA
betty.json.linked_data.LinkedDataDumpableimplementation for object/mapping data.This is helpful when working with diamond class hierarchies where parent classes that may not be the root class want to make changes to the linked data, and expect an :py:class`betty.json.schema.Object` schema and a
betty.serde.dump.DumpMappingdump.- async classmethod linked_data_schema(project: Project) JsonLdObject[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.json.linked_data.LinkedDataDumpableProvider[source]¶
Bases:
Generic[_T,_SchemaTypeT,_DumpT],ABCProvide linked data for instances of a target type.
- abstract async dump_linked_data_for(project: Project, target: _T) _DumpT[source]¶
Dump the given target to JSON-LD.
- abstract async linked_data_schema_for(project: Project) _SchemaTypeT[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpableProvider.dump_linked_data_for().
- 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.