betty.json.linked_data module¶
Provide JSON-LD utilities.
- class betty.json.linked_data.LinkedDataDumpable[source]¶
Bases:
object
Describe an object that can be dumped to linked data.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- betty.json.linked_data.add_json_ld(schema: 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]]], root_schema: 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]]] | None = None) None [source]¶
Allow JSON-LD properties to be added to a schema.
- betty.json.linked_data.dump_context(dump: DumpMapping[Dump], **contexts: str | Sequence[str]) None [source]¶
Add one or more contexts to a dump.
- async betty.json.linked_data.dump_link(dump: DumpMapping[Dump], project: Project, *links: Link) None [source]¶
Add one or more links to a dump.
- betty.json.linked_data.ref_json_ld(root_schema: 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]]]) 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]]] [source]¶
Reference the JSON-LD schema.