betty.entity package¶
Subpackages¶
Module contents¶
Provide Betty’s data model API.
- class betty.entity.Entity¶
Bases:
LinkedDataDumpableWithSchemaJsonLdObject,DataPlugin[EntityDefinition],HasPrivacyAn entity is a uniquely identifiable data container.
To test your own subclasses, use
betty.test_utils.entity.EntityTestBase.- __init__(*args: Any, id: ResolvableMachineName | None = None, privacy: Privacy = Privacy.UNDETERMINED, **kwargs: Any)¶
- final classmethod associations() Iterable[Association[Self]]¶
Get all associations on entities of this type.
- id: Final[MachineName]¶
The entity ID.
This MUST be unique per entity type, per ancestry.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project, /) JsonLdObject¶
Define the JSON Schema for
betty.linked_data.LinkedDataDumpable.dump_linked_data().
- final class betty.entity.EntityDefinition¶
Bases:
CountableHumanFacingDefinition,ObjectDefinition,DataPluginDefinition,GenericThe entity plugin type. Entities represent the information in your ancestry, such as people and places.
Plugin type ID
entityDefinition
Built-in entities:
- citation (
Citation) - Citation
- enclosure (
Enclosure) - Enclosure
- event (
Event) - Event
- file (
File) - File
- file-reference (
FileReference) - File reference
- link (
Link) - Link
- note (
Note) - Note
- person (
Person) - Person
- person-name (
PersonName) - Person name
- place (
Place) - Place
- place-name (
PlaceName) - Place name
- presence (
Presence) - Presence: A person's presence at an event.
- source (
Source) - Source
- __init__(plugin_id: ResolvableMachineName, *, label: ResolvableLocalizable, label_plural: ResolvableLocalizable, label_countable: CountableLocalizable, auto: bool = True, description: ResolvableLocalizable | None = None, public_facing: bool = True, requires: Requires = ())¶
- static type() PluginTypeDefinition[Self]¶
The plugin type definition.
- citation (