graflo.hq.anchor¶
Resolve a traversal anchor to the identity it names (:mod:~graflo.architecture.schema.anchor).
A bare value and a primary identity are returned as given, with no read: a
vertex that does not exist simply has no neighbours. A derived key set is
digested. A secondary identity is looked up through :func:~graflo.hq.identify.identify,
under the read guard, and must find exactly one vertex.
Classes¶
Functions:¶
anchor_identity(schema, vertex_type, key, *, db, guard=None)
¶
The identity key names: a bare value, or a primary identity mapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
Schema
|
Logical schema of the graph. |
required |
vertex_type
|
str
|
Logical type of the anchor. |
required |
key
|
Any
|
A bare value or a mapping of logical field names to values. |
required |
db
|
Any
|
The open connection a secondary identity is looked up through. |
required |
guard
|
FilterExpression | None
|
Trusted read guard for that lookup. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
vertex_type is not in the schema. |
AnchorNotAKeyError
|
the mapping names no key. |
AnchorIncompleteError
|
part of a key, or an empty value. |
AnchorAmbiguousError
|
a secondary identity found several vertices. |
AnchorUnmatchedError
|
a secondary identity found none. |