graflo.architecture.evolution.aspects.spec¶
What a caller must declare for a lift, and what the lift works out itself.
The split is not arbitrary. A lift can see structure -- which edges leave
directed unstated, which types have no grounding, where a property is a
float with no unit -- but it cannot see meaning. Nothing in a schema says that
Machine denotes a sosa:FeatureOfInterest, or that temp_c
is degrees Celsius rather than a count, or that status is a fact that
changes over time while serial_number is not. Those are the things this
spec carries, and the reason the state aspect requires it.
Everything else is mechanical and never appears here: undeclared directionality,
the scaffolding types and their groundings, the provenance edges. The
provenance aspect needs no spec at all.
Attributes¶
__all__ = ['EdgeGrounding', 'Grounding', 'LiftSpec']
module-attribute
¶
Classes¶
EdgeGrounding
¶
Bases: Grounding
A grounding addressed at one edge triple.
Source code in graflo/architecture/evolution/aspects/spec.py
Attributes¶
relation = PydanticField(default=None, description='Relation name.')
class-attribute
instance-attribute
¶
source = PydanticField(..., description='Source vertex type name.')
class-attribute
instance-attribute
¶
target = PydanticField(..., description='Target vertex type name.')
class-attribute
instance-attribute
¶
Grounding
¶
Bases: ConfigBaseModel
An external-vocabulary anchor a caller asserts for one element.
Source code in graflo/architecture/evolution/aspects/spec.py
Attributes¶
exact_match = PydanticField(default_factory=list, description='IRIs asserted equivalent to it.')
class-attribute
instance-attribute
¶
iri = PydanticField(default=None, description='IRI of the concept this element denotes.')
class-attribute
instance-attribute
¶
synonyms = PydanticField(default_factory=list, description='Alternative labels an agent may meet.')
class-attribute
instance-attribute
¶
LiftSpec
¶
Bases: ConfigBaseModel
The semantic input to :func:~graflo.architecture.evolution.aspects.plan_lift.
Source code in graflo/architecture/evolution/aspects/spec.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
Attributes¶
access_edges = PydanticField(default_factory=dict, description='Edge relations that gain ``access_zones``, each with the merge mode of its zones on upsert: ``replace`` or ``union``.')
class-attribute
instance-attribute
¶
access_for = PydanticField(default_factory=dict, description='Vertex types that gain ``access_zones``, each with the merge mode of its zones on upsert: ``replace`` or ``union``.')
class-attribute
instance-attribute
¶
edge_grounding = PydanticField(default_factory=list, description='Per-edge grounding, addressed by triple.')
class-attribute
instance-attribute
¶
grounding = PydanticField(default_factory=dict, description='Per-vertex grounding: ``{type_name: Grounding}``.')
class-attribute
instance-attribute
¶
identity = PydanticField(default_factory=dict, description='Explicit identity for types that would otherwise fall back to ``identity_from_all_properties``. Required only for those.')
class-attribute
instance-attribute
¶
measured = PydanticField(default_factory=dict, description="Units for existing properties, as ``{'Type.property': ucum_token}``. UCUM has no currency, so currency uses ISO-4217 (``USD``).")
class-attribute
instance-attribute
¶
mentions_for = PydanticField(default_factory=list, description='Existing types a source record can name: ``SourceRecord`` gains a ``mentions`` edge to each.')
class-attribute
instance-attribute
¶
observed = PydanticField(default_factory=list, description='Types that gain a ``<Type>Observation`` scaffold for measurements taken of them at a time.')
class-attribute
instance-attribute
¶
provenance = PydanticField(default=True, description="Lift the ``provenance`` aspect as well: ``SourceRecord`` and ``Agent`` with the edges that make 'where did this fact come from' answerable. ``false`` leaves it out, as does not naming the aspect.")
class-attribute
instance-attribute
¶
provenance_for = PydanticField(default_factory=list, description='Existing types whose facts are read from a source record: each gains a ``wasDerivedFrom`` edge to ``SourceRecord``. The state and observation scaffolds get one regardless.')
class-attribute
instance-attribute
¶
retire = PydanticField(default='move', description='What happens to a property named in ``stateful``. ``move`` removes it from the entity, since a fact that changes over time does not belong on the thing it is about. ``keep`` leaves it as a denormalized current value beside the history.')
class-attribute
instance-attribute
¶
stateful = PydanticField(default_factory=dict, description='Per-type mutable properties: ``{type_name: [property, ...]}``. Each named type gains a ``<Type>State`` carrying those properties over a validity interval.')
class-attribute
instance-attribute
¶
Methods:¶
measured_for(vertex)
¶
{property: unit} for one type.