Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Betty documentation
Logo
Betty documentation
  • Installation
  • Usage
    • Ancestry
      • Citation
      • Dates
      • Enclosure
      • Event
      • Event Type
      • File
      • File reference
      • Gender
      • Link
      • Media Type
      • Name
      • Note
      • Person
      • Person Name
      • Place
      • Place Type
      • Presence
      • Presence Role
      • Privacy
      • Source
      • Static translations
    • Asset Management
    • The command line
    • Application configuration
    • Copyright notices
    • Environment variables
    • Extensions
      • The Cotton Candy extension
      • The Deriver extension
      • The Gramps extension
      • The HTTP API Documentation extension
      • The Maps extension
      • The Privatizer extension
      • The Raspberry Mint extension
      • The Trees extension
      • The Wikipedia extension
    • GEDCOM
    • Licenses
    • Projects
      • Project configuration
    • Templating
      • Filters
      • Globals
      • Tests
    • Translations
  • Development
    • Developing Betty itself
      • Helpful commands
      • Installing a development environment
      • Localization
      • Testing Betty’s source code
    • Event dispatching
    • Plugins
      • CLI command plugins
      • Copyright notice plugins
      • Entity type plugins
      • Event type plugins
      • Extension plugins
      • Gender plugins
      • License plugins
      • Place type plugins
      • Presence role plugins
      • Renderer plugins
      • Serialization format plugins
    • Testing your source code
  • API Documentation
  • Glossary
  • About
    • Contributing to Betty
      • Code of Conduct
    • Copyright & license
    • Sponsors
    • Versions
Back to top
View this page

betty.ancestry.link module¶

The Link API allows data to reference external resources.

class betty.ancestry.link.HasLinks[source]¶

Bases: LinkedDataDumpableJsonLdObject

A resource that has external links.

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

Dump this instance to JSON-LD.

async classmethod linked_data_schema(project: Project) → JsonLdObject[source]¶

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[source]¶

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')[source]¶
async dump_linked_data(project: Project) → DumpMapping[Dump][source]¶

Dump this instance to JSON-LD.

property label: StaticTranslationsLocalizable¶

The human-readable short link label.

async classmethod linked_data_schema(project: Project) → LinkSchema[source]¶

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[source]¶

Bases: Array

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

__init__(link_schema: LinkSchema)[source]¶
async classmethod new() → Self[source]¶

Create a new instance.

final class betty.ancestry.link.LinkSchema[source]¶

Bases: JsonLdObject

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

__init__(json_ld_schema: JsonLdSchema)[source]¶
async classmethod new() → Self[source]¶

Create a new instance.

Copyright © Bart Feenstra and contributors
Made with Sphinx and @pradyunsg's Furo
On this page
  • betty.ancestry.link module
    • HasLinks
      • HasLinks.__init__()
      • HasLinks.dump_linked_data()
      • HasLinks.linked_data_schema()
      • HasLinks.links
    • Link
      • Link.__init__()
      • Link.dump_linked_data()
      • Link.label
      • Link.linked_data_schema()
      • Link.relationship
      • Link.url
    • LinkCollectionSchema
      • LinkCollectionSchema.__init__()
      • LinkCollectionSchema.new()
    • LinkSchema
      • LinkSchema.__init__()
      • LinkSchema.new()