bento_meta.objects

This module contains the subclasses of Entity which are used in representing the models contained in the MDB.

Classes

Node

Subclass that models a data node.

Property

Subclass that models a property of a node or relationship (edge).

Edge

Subclass that models a relationship between model nodes.

Term

Subclass that models a term from a terminology.

ValueSet

Subclass that models an enumerated set of Property values.

Concept

Subclass that models a semantic concept.

Predicate

Subclass that models a semantic link between concepts.

Origin

Subclass that models a Term 's authoritative source.

Tag

Subclass that allows simple key-value tagging of a model at arbitrary points.

Model

Subclass with information regarding data model.

Functions

mergespec(→ tuple[dict[str, str], dict[str, ...)

Merge subclass attribute and mapping specification dicts with the base class's.

Module Contents

bento_meta.objects.mergespec(clsname: str, attspec: dict[str, str], mapspec: dict[str, str | dict[str, str]]) tuple[dict[str, str], dict[str, str | dict[str, str]]][source]

Merge subclass attribute and mapping specification dicts with the base class’s.

Not for human consumption.

class bento_meta.objects.Node(init: dict | neo4j.graph.Node | Node | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a data node.

attspec_
mapspec_
property annotations

If the Node is annotated by Term`s via a `Concept, return the `Term`s

get_key_prop() Property | list[Property] | None[source]

Return the Property entity with is_key=True for this Node if it exists.

If multiple key props exist, return a list of them; if none exist, return None.

class bento_meta.objects.Property(init: dict | neo4j.graph.Node | Property | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a property of a node or relationship (edge).

pvt_attr = ['pvt', 'neoid', 'dirty', 'removed_entities', 'attspec', 'mapspec', 'belongs', 'value_types']
attspec_
mapspec_
defaults
value_types = []
property annotations

If the Property is annotated by Term`s via a `Concept, return the `Term`s.

property terms

If the Property has a value_set domain, return the Term objects of its ValueSet

property values

If the Property as a value_set domain, return its term values as a list of str. :return: list of term values :rtype: list

class bento_meta.objects.Edge(init: dict | neo4j.graph.Node | Edge | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a relationship between model nodes.

defaults
attspec_
mapspec_
property annotations

If the Edge is annotated by Term`s via a `Concept, return the `Term`s

property triplet

(edge.handle, src.handle, dst.handle) src and dst attributes must be set.

Type:

A 3-tuple that fully qualifies the edge

class bento_meta.objects.Term(init: dict | neo4j.graph.Node | Term | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a term from a terminology.

attspec_
mapspec_
class bento_meta.objects.ValueSet(init: dict | neo4j.graph.Node | ValueSet | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models an enumerated set of Property values. Essentially a container for Term instances.

attspec_
mapspec_
__setattr__(name, value)[source]
class bento_meta.objects.Concept(init: dict | neo4j.graph.Node | Concept | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a semantic concept.

attspec_
mapspec_
class bento_meta.objects.Predicate(init: dict | neo4j.graph.Node | Predicate | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a semantic link between concepts.

attspec_
mapspec_
class bento_meta.objects.Origin(init: dict | neo4j.graph.Node | Origin | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that models a Term ‘s authoritative source.

attspec_
mapspec_
class bento_meta.objects.Tag(init: dict | neo4j.graph.Node | Tag | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass that allows simple key-value tagging of a model at arbitrary points.

attspec_
mapspec_
class bento_meta.objects.Model(init: dict | neo4j.graph.Node | Model | None = None)[source]

Bases: bento_meta.entity.Entity

Subclass with information regarding data model.

attspec_
mapspec_
defaults