graflo.architecture.evolution.ops¶
Typed manifest evolution operations.
AddEdgeIndexesOp
¶
Bases: ConfigBaseModel
Author secondary indexes on edge physical specs.
Source code in graflo/architecture/evolution/ops.py
AddEdgePropertiesOp
¶
Bases: ConfigBaseModel
Add edge properties for each relation in schema/profile defaults.
Source code in graflo/architecture/evolution/ops.py
AddEdgesOp
¶
Bases: ConfigBaseModel
Introduce new logical edge relations between existing vertex types.
Source code in graflo/architecture/evolution/ops.py
AddInverseEdgesOp
¶
Bases: ConfigBaseModel
Add inverse edge relations for matching relations across schema and ingestion.
Source code in graflo/architecture/evolution/ops.py
AddSecondaryIdentitiesOp
¶
Bases: ConfigBaseModel
Declare alternate lookup keys on existing vertices.
Secondary identities are lookup-only: upserts keep using the primary identity.
Each declared field-set automatically gains a non-unique index at
:meth:Schema.finish_init, so this op is how an edge-only source gains a way to
reference endpoints by a business key without touching the primary identity.
Source code in graflo/architecture/evolution/ops.py
AddVertexIndexesOp
¶
Bases: ConfigBaseModel
Author secondary indexes on vertices in the database profile.
Source code in graflo/architecture/evolution/ops.py
AddVertexPropertiesOp
¶
Bases: ConfigBaseModel
Add vertex properties to existing logical vertex types.
Source code in graflo/architecture/evolution/ops.py
AddVerticesOp
¶
Bases: ConfigBaseModel
Introduce new logical vertex types.
The unary counterpart to what :class:ComposeManifestsOp can only do binarily.
A replayable change set that cannot introduce a type could only ever describe a
shrinking graph, which is why this exists alongside remove_vertices.
Source code in graflo/architecture/evolution/ops.py
AssignedIdentityTarget
¶
Bases: ConfigBaseModel
Target an assigned identity: an intentional UUID primary key.
Source code in graflo/architecture/evolution/ops.py
BlankIdentityTarget
¶
Bases: ConfigBaseModel
Target a blank identity: an auto-generated placeholder ID.
Source code in graflo/architecture/evolution/ops.py
ChangeFieldTypesOp
¶
Bases: ConfigBaseModel
Set the logical type of existing vertex or edge properties.
Makes the differ's CHANGE_VERTEX_FIELD_TYPE / CHANGE_EDGE_FIELD_TYPE
authorable. Targets are validated against the profile's db_flavor so an
unsupported type fails here rather than at define time.
Source code in graflo/architecture/evolution/ops.py
ComposeManifestsOp
¶
Bases: ConfigBaseModel
Union two full GraphManifests using explicit equivalence maps.
Binary only — apply via :func:~graflo.architecture.evolution.compose.compose_manifests.
Unary :func:~graflo.architecture.evolution.apply.apply_evolution rejects this op.
Empty vertices / relations yields a disjoint union (schema + resources +
bindings), subject to name_conflict / resource_renames.
Source code in graflo/architecture/evolution/ops.py
EdgeIdentitiesEntry
¶
Bases: ConfigBaseModel
New uniqueness keys for one edge triple.
Source code in graflo/architecture/evolution/ops.py
EdgeIndexEntry
¶
Bases: ConfigBaseModel
Indexes for one edge physical spec.
Source code in graflo/architecture/evolution/ops.py
EdgeRetargetEntry
¶
Bases: ConfigBaseModel
Repoint one edge triple at a different source and/or target vertex type.
Source code in graflo/architecture/evolution/ops.py
EdgeSelector
¶
Bases: ConfigBaseModel
Schema edge triple selector matching :data:~graflo.architecture.graph_types.EdgeId.
Source code in graflo/architecture/evolution/ops.py
FieldTypeSpec
¶
Bases: ConfigBaseModel
Target logical type for one property.
Source code in graflo/architecture/evolution/ops.py
FunnelIdentityTarget
¶
Bases: ConfigBaseModel
Target an identity funnel: ordered fallback branches digested into id.
The general form of :class:HashIdentityTarget — a flat hash key is a funnel
with one branch. Both resolve to identity mode hash.
Source code in graflo/architecture/evolution/ops.py
HashIdentityTarget
¶
Bases: ConfigBaseModel
Target a hash identity: a deterministic synthetic id digested from fields.
Source code in graflo/architecture/evolution/ops.py
IdentityReplacement
¶
Bases: ConfigBaseModel
New identity policy for one vertex, plus what becomes of the old one.
Source code in graflo/architecture/evolution/ops.py
MergeEdgesOp
¶
Bases: ConfigBaseModel
Merge source relation names into a canonical relation name.
Source code in graflo/architecture/evolution/ops.py
MergeVerticesOp
¶
Bases: ConfigBaseModel
Merge source vertices into a single logical name (schema, edges, ingestion).
Source code in graflo/architecture/evolution/ops.py
NaturalIdentityTarget
¶
Bases: ConfigBaseModel
Target a natural key: the named properties identify the vertex directly.
Source code in graflo/architecture/evolution/ops.py
ProjectManifestOp
¶
Bases: ConfigBaseModel
Project a manifest to a vertex/edge subgraph with consistent cascade.
Keeps only the requested logical vertices and edges (and optionally resources).
All schema, db_profile, ingestion, and bindings references to removed
entities are pruned. Inverse edges are not auto-kept; list them explicitly
in keep_edges when needed.
With connectivity="induced_prune" (v1 default), when keep_vertices is
set, vertex types from that list with no incident surviving edge are dropped.
Source code in graflo/architecture/evolution/ops.py
PropertyEquivalence
¶
Bases: ConfigBaseModel
Align a property from the left and/or right vertex onto a canonical name.
At least one of left / right must be set. When both are set, both fields
rename to into before the vertices are merged.
Source code in graflo/architecture/evolution/ops.py
RelationEquivalence
¶
Bases: ConfigBaseModel
Collapse a left relation and a right relation onto one canonical name.
Source code in graflo/architecture/evolution/ops.py
RemoveEdgeIndexesOp
¶
Bases: ConfigBaseModel
Withdraw authored indexes from edge physical specs, addressed by field list.
Source code in graflo/architecture/evolution/ops.py
RemoveEdgePropertiesOp
¶
Bases: ConfigBaseModel
Remove edge properties for each relation across schema/profile/ingestion.
Source code in graflo/architecture/evolution/ops.py
RemoveEdgesOp
¶
Bases: ConfigBaseModel
Remove logical edge relations from schema, profile, and ingestion selectors.
Source code in graflo/architecture/evolution/ops.py
RemoveSecondaryIdentitiesOp
¶
Bases: ConfigBaseModel
Withdraw alternate lookup keys, dropping their derived indexes.
Rejected when a surviving edge step still selects the removed field-set — that step would have no way to resolve its endpoint.
Source code in graflo/architecture/evolution/ops.py
RemoveVertexIndexesOp
¶
Bases: ConfigBaseModel
Withdraw authored vertex indexes, addressed by field list.
Indexes derived from secondary_identities are not removable here — they would
be re-registered by the next finish_init. Use
:class:RemoveSecondaryIdentitiesOp for those.
Source code in graflo/architecture/evolution/ops.py
RemoveVertexPropertiesOp
¶
Bases: ConfigBaseModel
Remove vertex properties and propagate pruning to ingestion/db profile references.
Source code in graflo/architecture/evolution/ops.py
RemoveVerticesOp
¶
Bases: ConfigBaseModel
Remove logical vertices and cascade: edges, ingestion resources, bindings.
Source code in graflo/architecture/evolution/ops.py
RenameEdgePropertiesOp
¶
Bases: ConfigBaseModel
Rename edge properties for each relation across schema/profile/ingestion.
Source code in graflo/architecture/evolution/ops.py
RenameRelationsOp
¶
Bases: ConfigBaseModel
Rename logical edge relation names across schema and ingestion.
Source code in graflo/architecture/evolution/ops.py
RenameResourcesOp
¶
Bases: ConfigBaseModel
Rename ingestion resource names and bindings references.
Source code in graflo/architecture/evolution/ops.py
RenameVertexPropertiesOp
¶
Bases: ConfigBaseModel
Rename vertex properties (and identity references) and propagate to ingestion.
renames maps each vertex name to a per-vertex {old_field: new_field} map.
Schema-side: rewrites Field.name, vertex.identity, and any DB profile
structures that reference field names (vertex_indexes, edge_specs.indexes).
Ingestion-side: rewrites VertexActor.from so the doc still uses the OLD field
name (injecting {new_field: old_field} when missing), rewrites
TransformActor.rename values that target a renamed vertex field, and updates
Resource.extra_weights / edge.vertex_weights (:class:~graflo.architecture.graph_types.Weight
fields, map, and filter keys that address vertex observation columns).
Source code in graflo/architecture/evolution/ops.py
RenameVerticesOp
¶
Bases: ConfigBaseModel
Rename logical vertex names across schema, ingestion, and bindings.
Source code in graflo/architecture/evolution/ops.py
ReplaceEdgeIdentitiesOp
¶
Bases: ConfigBaseModel
Replace the uniqueness keys of logical edges.
The edge-side counterpart of :class:ReplaceIdentityOp. There is no retire policy:
edge identities have no lookup plane to demote into. Non-endpoint tokens are merged
into edge properties by Edge.finish_init, as with authored identities.
Source code in graflo/architecture/evolution/ops.py
ReplaceIdentityOp
¶
Bases: ConfigBaseModel
Replace the identity policy of one or more vertices.
Covers both a change of identity fields and a change of identity mode
(natural / hash / assigned / blank), because the cascade is the
same in either case: the field-set that upserts changes, and everything that
referenced the old one must be repointed or retired.
Not covered: blank vertices cannot retire by demotion (they cannot declare
secondary identities at all), and a no-op replacement does not bump the version.
Source code in graflo/architecture/evolution/ops.py
RetargetEdgesOp
¶
Bases: ConfigBaseModel
Change which vertex types an edge connects, preserving everything else.
Remove-plus-add would lose the edge's properties, uniqueness keys, directed
flag, and its db_profile physical spec. Retargeting rewrites the EdgeId
everywhere it is keyed instead: edge config, physical specs, and pipeline edge steps.
Source code in graflo/architecture/evolution/ops.py
SanitizeOp
¶
Bases: ConfigBaseModel
Apply DB-flavor-specific name/field sanitization to a manifest.
Composes (in order):
- Storage-name sanitization on
DatabaseProfile(vertex storage names + edge relation names) against the flavor's reserved-words set. - Vertex field rename for fields whose names are reserved words.
- For TigerGraph, normalize identity fields across edges that share a relation (TigerGraph requires consistent source/target indexes per relation).
Source code in graflo/architecture/evolution/ops.py
SetEdgeDirectedOp
¶
Bases: ConfigBaseModel
Set the directed flag on logical edges.
Small, but load-bearing for replay: directed decides what
:class:AddInverseEdgesOp is allowed to duplicate, so an un-authorable flag makes
inverse-edge change sets non-replayable.
Source code in graflo/architecture/evolution/ops.py
VertexEquivalence
¶
Bases: ConfigBaseModel
Collapse a left vertex and a right vertex into one composed type.
GraFlo applies this map deterministically; it does not infer semantic matches.
Source code in graflo/architecture/evolution/ops.py
ops_reaching_ingestion(ops)
¶
Names of ops whose effect extends into ingestion_model, in order.
Source code in graflo/architecture/evolution/ops.py
validate_rename_map_is_injective(renames, *, kind, merge_hint)
¶
Reject a rename map that would collapse two names onto one.
A rename is a relabelling: it must not change how many types exist. Two sources
sharing a target is a merge, and the merge ops exist precisely because merging
needs decisions a rename cannot express — which properties survive, how identity
combines, what happens to edges that become self-loops. Left unchecked the
collapse is silent: the name-keyed lookup maps in VertexConfig / EdgeConfig
keep the last definition and the earlier one is shadowed but still serialized.