betty.ancestry.link module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.ancestry.link module

The Link API allows data to reference external resources.

class betty.ancestry.link.HasLinks

  Bases: `LinkedDataDumpableJsonLdObject`

  A resource that has external links.

  __init__(*args: Any, links: MutableSequence[Link] | None = None, **kwargs: Any)
  async dump_linked_data(project: Project) → DumpMapping[Dump]

    Dump this instance to JSON-LD.

  async classmethod linked_data_schema(project: Project) → JsonLdObject

    Define the JSON Schema for `betty.json.linked_data.LinkedDataDumpable.dump_linked_data()`.

  property links: MutableSequence[Link]

    The extenal links.

final class betty.ancestry.link.Link

  Bases: `Link`, `HasMediaType`, `HasLocale`, `HasDescription`, `LinkedDataDumpableJsonLdObject`

  An external link.

  __init__(url: str, *, relationship: str | None = None, label: ShorthandStaticTranslations | None = None, description: ShorthandStaticTranslations | None = None, media_type: MediaType | None = None, locale: str = 'und')
  async dump_linked_data(project: Project) → DumpMapping[Dump]

    Dump this instance to JSON-LD.

  property label: StaticTranslationsLocalizable

    The human-readable short link label.

  async classmethod linked_data_schema(project: Project) → LinkSchema

    Define the JSON Schema for `betty.json.linked_data.LinkedDataDumpable.dump_linked_data()`.

  relationship: str | None

    The link’s IANA link relationship.

  property url: str

    The absolute URL the link points to.

class betty.ancestry.link.LinkCollectionSchema

  Bases: `Array`

  A JSON Schema for `betty.ancestry.link.Link` collections.

  __init__(link_schema: LinkSchema)
  async classmethod new() → Self

    Create a new instance.

final class betty.ancestry.link.LinkSchema

  Bases: `JsonLdObject`

  A JSON Schema for `betty.ancestry.link.Link`.

  __init__(json_ld_schema: JsonLdSchema)
  async classmethod new() → Self

    Create a new instance.