betty.linked_data module¶
Provide JSON-LD utilities.
- final class betty.linked_data.JsonLdSchema¶
Bases:
SchemaA JSON-LD JSON Schema reference.
- __init__()¶
- class betty.linked_data.LinkedDataDumpable¶
Bases:
GenericDescribe an object that can be dumped to linked data.
- class betty.linked_data.LinkedDataDumpableWithSchema¶
Bases:
LinkedDataDumpable,GenericDescribe an object that can be dumped to linked data.
- abstractmethod async classmethod linked_data_schema(project: Project, /) SchemaT¶
Define the JSON Schema for
betty.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.linked_data.LinkedDataDumpableWithSchemaJsonLdObject¶
Bases:
LinkedDataDumpableWithSchema[JsonLdObject,PortableMapping],ABCA
betty.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.portable.PortableMappingdump.- async classmethod linked_data_schema(project: Project, /) JsonLdObject¶
Define the JSON Schema for
betty.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.linked_data.LinkedDataDumper¶
-
Provide linked data for instances of a target type.
- abstractmethod async dump_linked_data_for(project: Project, target: T, /) PortableDataT¶
Dump the given target to JSON-LD.
- abstractmethod async linked_data_schema_for(project: Project, /) SchemaT¶
Define the JSON Schema for
betty.linked_data.LinkedDataDumper.dump_linked_data_for().
- betty.linked_data.dump_context(portable: PortableMapping, **context_definitions: str) None¶
Add one or more contexts to a dump.
- async betty.linked_data.dump_link(portable: PortableMapping, project: Project, *links: Link) None¶
Add one or more links to a dump.
- async betty.linked_data.dump_schema(project: Project, portable: PortableMapping, linked_data_dumpable: LinkedDataDumpableWithSchema[Object, PortableMapping], /) None¶
Add the $schema item to a JSON-LD dump.