graflo.architecture.schema.identity_uuid¶
UUID identity helpers for assigned mode and UUID-typed natural keys.
Attributes¶
MINT_NAMESPACE = UUID('6f1c3a52-6a51-4f8e-9e0e-2b8c1d7a4e10')
module-attribute
¶
UUID_PATTERN = re.compile('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', re.IGNORECASE)
module-attribute
¶
Classes¶
Functions:¶
ensure_assigned_uuid(doc, field)
¶
Fill empty field with uuid4(); validate non-empty values in place.
Never overwrites a present valid UUID.
Source code in graflo/architecture/schema/identity_uuid.py
ensure_assigned_uuids_in_acc_vertex(acc_vertex, vertex_config)
¶
Mint/validate assigned UUIDs on acc_vertex docs before edge assembly.
acc_vertex maps vertex name -> location -> list of VertexRep (or
objects with a .vertex dict attribute).
Source code in graflo/architecture/schema/identity_uuid.py
ensure_assigned_uuids_on_docs(data, *, preferred_field)
¶
Idempotent assigned-UUID ensure for a flat doc list (writer safety net).
Source code in graflo/architecture/schema/identity_uuid.py
mint_uuid(schema_ref, source_id, vertex_type, ref)
¶
The key of a keyless entity introduced as ref in source source_id.
Deterministic, so the same source cast against the same schema gives the same key; a different ref or source_id gives a new one.
Source code in graflo/architecture/schema/identity_uuid.py
validate_uuid_typed_identity_fields(doc, vertex)
¶
Validate present values on UUID-typed identity fields; do not invent.
Source code in graflo/architecture/schema/identity_uuid.py
validate_uuid_value(value, *, context='UUID')
¶
Return a normalized UUID string; raise if value is non-empty but invalid.