Core

Core module.

Models

Core database models.

class asclepias_broker.core.models.Identifier(**kwargs)[source]

Identifier model.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property data

Get the metadata of the identity group the identifier belongs to.

fetch_or_create_id()[source]

Fetches from the database or creates an id for the identifier.

classmethod get(value=None, scheme=None, **kwargs)[source]

Get the identifier from the database.

get_children(rel_type, as_relation=False)[source]

Get all children of given Identifier for given relation.

get_identities()[source]

Get the fully-expanded list of ‘Identical’ Identifiers.

get_parents(rel_type, as_relation=False)[source]

Get all parents of given Identifier for given relation.

property identity_group

Get the identity group the identifier belongs to.

class asclepias_broker.core.models.Relation[source]

Relation type.

class asclepias_broker.core.models.Relationship(**kwargs)[source]

Relationship between two identifiers.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property data

Get the relationship’s identity group metadata.

fetch_or_create_id()[source]

Fetches from the database or creates an id for the relationship.

classmethod get(source, target, relation, **kwargs)[source]

Get the relationship from the database.

property identity_group

Get the relationship’s identity group.