bento_meta.object_map
This module contains ObjectMap
, a class which provides the
machinery for mapping bento_meta objects to a Bento Metamodel Database
in Neo4j. Mostly not for human consumption. The ObjectMap:
interprets the attribute specification (attspec) and map specification (mapspec) associated with
Entity
subclassesprovides the
get()
andput()
methods to subclasses, that enable them to get and put themselves to the databasegenerates appropriate Cypher queries to do gets and puts
One ObjectMap instance should be generated for each Entity subclass (see, e.g.,
bento_meta.model.Model
)
Module Contents
Classes
This module contains |
- class bento_meta.object_map.ObjectMap(*, cls=None, drv=None)[source]
Bases:
object
This module contains
ObjectMap
, a class which provides the machinery for mapping bento_meta objects to a Bento Metamodel Database in Neo4j. Mostly not for human consumption.- cache
- get_by_id(obj, id, refresh=False)[source]
Get an entity given an id attribute value (not the Neo4j id)
- get_by_node_nanoid(obj, nanoid, refresh=False)[source]
PROTOTYPE Get an entity given an id attribute value (not the Neo4j id)
- get(obj, refresh=False)[source]
Get the data for an object instance from the db and load the instance with it
- add(obj, att, tgt)[source]
Create a link between an object instance and a target object in the database. This represents adding an object-valued attribute to the object.
- drop(obj, att, tgt, tx=None)[source]
Remove an existing link between an object instance and a target object in the database. This represents dropping an object-valued attribute from the object.