Documentation
¶
Overview ¶
Package queryexec executes immutable document-query plans.
Index ¶
- Constants
- Variables
- func DeclaredMetaclassFeatures(index *symbols.Index) map[string][]*symbols.Symbol
- func ElementIDOf(read ElementIDReader, idx *symbols.Index, sym *symbols.Symbol) (string, error)
- func LocateInline(inline *queryplan.Inline, err error) error
- func OutcomeLines(err error) []string
- func RationalText(value semantics.Value) string
- func RegisterElementIDSource(s ElementIDSource)
- func ResultViewName(query string) string
- func ValueText(value Value, names func(*symbols.Symbol) string) string
- type Bindings
- type Cell
- type Column
- type Constraint
- type Context
- type ElementIDDocument
- type ElementIDReader
- type ElementIDSource
- type Error
- type ErrorKind
- type Event
- func (ev Event) Alternatives() []string
- func (ev Event) Assigned() (feature string, value runtime.Value, ok bool)
- func (ev Event) At() float64
- func (ev Event) Behavior() *symbols.Symbol
- func (ev Event) Kind() string
- func (ev Event) Label() string
- func (ev Event) Machine() string
- func (ev Event) Object() (*runtime.Instance, string)
- func (ev Event) Payload() []string
- func (ev Event) Record() runtime.TraceRecord
- func (ev Event) Step() int
- func (ev Event) Summary() string
- func (ev Event) Taken() string
- func (ev Event) Target() (*runtime.Instance, string)
- func (ev Event) Text() string
- func (ev Event) Time() Value
- func (ev Event) Token() int64
- type Failure
- type FeatureRef
- type Finding
- type Frontier
- type Member
- type ModelError
- type Options
- type Outcome
- type PathError
- type RelationshipTables
- type ResultView
- type Root
- type Row
- type RowSet
- type State
- type Step
- type StepKind
- type Value
- func BooleanValue(value bool) Value
- func ConnectorEndValue(connector *symbols.Symbol, position int, label string) Value
- func ElementValue(sym *symbols.Symbol) Value
- func EventValue(event Event) Value
- func IntegerOf(value semantics.Value) Value
- func IntegerValue(value int64) Value
- func ObjectValue(inst *runtime.Instance, label string) Value
- func QuantityHeldAs(quantity semantics.Quantity, kind *symbols.Symbol) Value
- func QuantityValue(quantity semantics.Quantity) Value
- func RationalOf(value semantics.Value) Value
- func ReadFeature(context Context, row Value, property string, options Options) ([]Value, error)
- func RealValue(value float64) Value
- func StateValue(state State) Value
- func StringValue(value string) Value
- func VerdictValue(verdict Verdict) Value
- func (v Value) Boolean() (bool, bool)
- func (v Value) ConnectorEnd() (*symbols.Symbol, int, bool)
- func (v Value) Declaration() *symbols.Symbol
- func (v Value) Element() (*symbols.Symbol, bool)
- func (v Value) Event() (Event, bool)
- func (v Value) Integer() (int64, bool)
- func (v Value) IntegerConst() (semantics.Value, bool)
- func (v Value) Kind() ValueKind
- func (v Value) Label() string
- func (v Value) Magnitude() (Value, bool)
- func (v Value) Object() (*runtime.Instance, string, bool)
- func (v Value) Origin() symbols.Origin
- func (v Value) Quantity() (semantics.Quantity, bool)
- func (v Value) QuantityKind() *symbols.Symbol
- func (v Value) Rational() (semantics.Value, bool)
- func (v Value) Real() (float64, bool)
- func (v Value) State() (State, bool)
- func (v Value) String() (string, bool)
- func (v Value) Text(identity func(*symbols.Symbol) string) (string, bool)
- func (v Value) Verdict() (Verdict, bool)
- type ValueKind
- type Verdict
- func (v Verdict) Assertion() *symbols.Symbol
- func (v Verdict) Carrier() (*runtime.Instance, bool)
- func (v Verdict) CarrierDeclaration() *symbols.Symbol
- func (v Verdict) Condition() string
- func (v Verdict) Kind() runtime.AssertionKind
- func (v Verdict) Label() string
- func (v Verdict) Path() string
- func (v Verdict) Reason() string
- func (v Verdict) Requirement() *symbols.Symbol
- func (v Verdict) Status() runtime.ValidationStatus
- func (v Verdict) Summary() string
- func (v Verdict) Text() string
- func (v Verdict) Verification() []runtime.VerdictKind
Constants ¶
const ( ResultViewLibrary = "QVTS" ResultViewDefinition = "QVTS::QueryResult" OutcomeEstablished = "established" )
The names the QVTS library declares, which a written result view is typed by.
const AssertionVerification runtime.AssertionKind = "verification"
AssertionVerification is the kind of a verdict row reporting a verification case's run, following the requirement verdict it verifies.
const DefaultResultViewName = "Answer"
DefaultResultViewName names the view of a run whose query has no name.
const PropertyValuation = "valuation"
PropertyValuation projects what a row feature's own valuation binds (KerML Feature::valuation): the value its declaration writes, or a redefinition binds, evaluated where it is an expression. A row that is not a feature, or a feature bound to nothing, reads as absent.
const WildcardProperty = "*"
WildcardProperty among a Project's properties stands for every property the source rows could name — those of the element rows' metaclasses the evaluator serves, the evaluator's own, the features of the object rows — sorted; `path.*` for those of the elements a property path reaches. A column no row carries is left out.
Variables ¶
var MetaclassPackages = []string{"KerML::Root", "KerML::Core", "KerML::Kernel", "SysML::Systems"}
MetaclassPackages are the library packages declaring the abstract syntax metaclasses, whose features are the metamodel properties.
Functions ¶
func DeclaredMetaclassFeatures ¶ added in v0.13.0
DeclaredMetaclassFeatures are the features the metaclasses of MetaclassPackages declare themselves, by name: every property of the metamodel, as each inherited one is some metaclass's own.
func ElementIDOf ¶ added in v0.12.0
ElementIDOf is sym's elementId through read. A relationship the notation writes as part of another element reads as the conversion writes it: an implied OwningMembership as its member's owning membership, an import as its declaration, a written clause or an end's attachment as the element materialized for it, a prefix metadata's Annotation as the metadata's; one the conversion never writes reads empty.
func LocateInline ¶ added in v0.13.0
LocateInline wraps a planning or execution error whose origin is in an inline query's text as a queryplan.InlineError positioned within the text.
func OutcomeLines ¶ added in v0.12.0
OutcomeLines is the record behind err rendered for a prompt, none for an error that carries no record.
func RationalText ¶ added in v0.10.0
RationalText spells an exact Rational as a document spells a number: a terminating one in decimal, as strconv's shortest 'g' form spells a Real, else `numer/denom`.
func RegisterElementIDSource ¶ added in v0.12.0
func RegisterElementIDSource(s ElementIDSource)
RegisterElementIDSource installs the source elementId is read from.
func ResultViewName ¶ added in v0.13.0
ResultViewName is the view name of a query: the last segment of its qualified name, DefaultResultViewName for a query with none.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is one immutable projected value sequence.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column describes one ordered projected property.
func StaticColumn ¶ added in v0.12.0
StaticColumn is a column of a table whose rows were written out rather than queried: headed label, sized width (0 for automatic), and originating where the table was written.
func (Column) Label ¶ added in v0.9.2
Label is the heading the column is presented under: the stated label, or the name when none is stated.
func (Column) Width ¶ added in v0.9.2
Width is the column's stated width in source units relative to the other columns of its table, 0 when the column is sized automatically.
type Constraint ¶ added in v0.12.0
type Constraint string
Constraint is what a model error found violated, one per constructor of the Lean Constraint.
const ( ConstraintAmbiguousName Constraint = "ambiguousName" ConstraintMultiplicity Constraint = "multiplicity" ConstraintTyping Constraint = "typing" ConstraintUnit Constraint = "unit" ConstraintDuplicateKey Constraint = "duplicateKey" )
type Context ¶
type Context struct {
Index *symbols.Index
Resolver *resolve.Resolver
Model *semantics.Model
LineIndex func(doc string) *source.LineIndex
// ElementID reads the elementId a conversion of the model writes for an
// element, or why the model has none; without one, elementId is absent.
ElementID func(sym *symbols.Symbol) (string, error)
// Identity names an element where a frontend reports it under another
// identity than its qualified name; nil keeps the qualified name.
Identity func(sym *symbols.Symbol) string
// ElementAddress is the address the conversion stated for an elementId it wrote (ElementIDReader.ReadAddress).
ElementAddress func(id string) (string, bool)
// Runtime holds the objects the query may read; nil makes object bindings
// and Objects typed errors.
Runtime *runtime.Context
// Roots are the objects the session holds directly, each under its label,
// in the order Objects enumerates them.
Roots []Root
// Related memoizes relationship edge tables across the executions sharing
// this context; nil builds them once per execution.
Related *RelationshipTables
}
Context provides the semantic workspace used by one execution; Index, Resolver and Model are required, Runtime and Roots absent over the model alone.
func (Context) HeldRoot ¶
HeldRoot returns the first root materialized from a declaration, so a binding naming the declaration binds its object while the session holds one.
func (Context) PropertyText ¶ added in v0.13.0
PropertyText is a value as a property's text on a surface that names elements by Identity: Value.Text, an expression element — which has no identity — reported as written. ok is false for a value the surface has no text for, an element it cannot name included.
func (Context) Verifier ¶ added in v0.10.0
func (c Context) Verifier() runtime.RequirementVerifier
Verifier runs verification cases over the context: in its runtime when it holds one, or a behavior-free reader over its model.
func (Context) WrittenExpression ¶ added in v0.13.0
WrittenExpression is the text an element the model synthesizes — a send's argument, a feature's value, the chain Feature a chained end references (`a.p`) — was written as. Such an element has no name, scope or identity of its own, so a surface that names elements by identity reports it this way; ok is false for any other.
type ElementIDDocument ¶ added in v0.12.0
type ElementIDDocument struct {
File *source.SourceFile
Root *ast.RootNamespace
ParseDiags []parser.Diagnostic
}
ElementIDDocument is a document of the model a conversion writes, with its parse's errors, which refuse a model of several documents.
type ElementIDReader ¶ added in v0.12.0
type ElementIDReader interface {
Read(doc string, decl ast.Node, fqn string) (string, error)
ReadOwningMembership(doc string, decl ast.Node, fqn string) (string, error)
ReadRelationship(doc string, node ast.Node) (string, error)
ReadExpressionPart(doc string, node ast.Node, slot string) (element, membership string, err error)
// ReadAddress is the address the conversion stated for the element written with id: its
// qualifiedName, or a positional address (`P::@2::x`); none for a minted or unknown id.
ReadAddress(id string) (string, bool)
}
ElementIDReader reads the elementIds a conversion of the model writes: Read, for the element declared at decl in document doc, named fqn; ReadOwningMembership, for the membership through which its namespace owns it; ReadRelationship, for the relationship element the notation implies at a node (a head clause, a bound end's attachment, a dependency's prefix metadata). Each reports why the model has none.
func OpenElementIDs ¶ added in v0.12.0
func OpenElementIDs(docs []ElementIDDocument) ElementIDReader
OpenElementIDs opens the registered source over docs; nil when none is linked, and elementId is then absent.
type ElementIDSource ¶ added in v0.12.0
type ElementIDSource func(docs []ElementIDDocument) ElementIDReader
ElementIDSource opens a reader over a model's documents, converting them once, on the first read: how a query's elementId column is filled. The converter registers one (queryexec/elementids), so a binary that links no translator reports elementId absent.
type Error ¶
type Error struct {
Kind ErrorKind
Query string
Operation queryplan.Operation
Parameter string
Property string
Target string
Path []string
Expected string
Actual string
Origin symbols.Origin
// Candidates are what the model offers in place of what the query asked for:
// the spellings nearest an unresolved name, or the elements an ambiguous name denotes.
Candidates []string
// Outcome is the QVTS record behind a path or model error (outcome.go); nil for
// the failures that are neither, the flat fields above being its rendering.
Outcome *Outcome
// Also names the other elements the same fan-out failed on (missing-feature);
// the message spells the first alsoLimit and counts the rest.
Also []string
// Cause is the evaluator's reason an unevaluable feature could not be read.
Cause error
}
Error is a typed query-execution failure with plan provenance.
type ErrorKind ¶
type ErrorKind string
ErrorKind classifies a document-query execution failure.
const ( ErrorInvalidContext ErrorKind = "invalid-context" ErrorUnknownBinding ErrorKind = "unknown-binding" ErrorMissingBinding ErrorKind = "missing-binding" ErrorBindingType ErrorKind = "binding-type" ErrorBindingMultiplicity ErrorKind = "binding-multiplicity" ErrorMissingElement ErrorKind = "missing-element" ErrorUnsupportedOperation ErrorKind = "unsupported-operation" ErrorInvalidArgument ErrorKind = "invalid-argument" ErrorInvalidOperator ErrorKind = "invalid-operator" ErrorInvalidOrder ErrorKind = "invalid-order" ErrorUnknownProperty ErrorKind = "unknown-property" ErrorUnknownClassification ErrorKind = "unknown-classification" ErrorUnknownElement ErrorKind = "unknown-element" // ErrorAmbiguousElement: Named was given a name several elements carry — a // finding about the model, where ErrorUnknownElement is one about the query. ErrorAmbiguousElement ErrorKind = "ambiguous-element" ErrorUnknownRelationship ErrorKind = "unknown-relationship" // ErrorMissingFeature: Project or WhereFeature read a feature an element row // lacks — a path error about that element; ErrorUnknownProperty: no row had it. ErrorMissingFeature ErrorKind = "missing-feature" ErrorUnevaluableFeature ErrorKind = "unevaluable-feature" // ErrorUnservedProperty: a metamodel property the row's metaclass carries, // which this OpenSysML does not derive yet — a path error naming the gap. ErrorUnservedProperty ErrorKind = "unserved-property" ErrorUnknownInvocation ErrorKind = "unknown-invocation" ErrorInvocationCycle ErrorKind = "invocation-cycle" ErrorInvocationDepth ErrorKind = "invocation-depth" ErrorInvocationBudget ErrorKind = "invocation-budget" ErrorVisitBudget ErrorKind = "visit-budget" ErrorResultType ErrorKind = "result-type" ErrorResultMultiplicity ErrorKind = "result-multiplicity" ErrorColumnOperand ErrorKind = "column-operand" ErrorColumnOperandType ErrorKind = "column-operand-type" ErrorColumnDivisionByZero ErrorKind = "column-division-by-zero" ErrorColumnIncommensurable ErrorKind = "column-incommensurable" ErrorColumnArithmetic ErrorKind = "column-arithmetic" ErrorColumnAbsent ErrorKind = "column-absent" // ErrorUnknownColumn: Differ named a key or column one side does not project. ErrorUnknownColumn ErrorKind = "unknown-column" // ErrorDuplicateKey: a Differ side carries one key value on two rows, or a key cell // that is not single-valued — the model error, every finding kept. ErrorDuplicateKey ErrorKind = "duplicate-key" ErrorColumnCardinality ErrorKind = "column-cardinality" // ErrorNoRuntime: an operation over a session's objects ran with no session. ErrorNoRuntime ErrorKind = "no-runtime" // ErrorObjectRow: a model-only operation was given a runtime object row. ErrorObjectRow ErrorKind = "object-row" // ErrorVerdictRow: a model-only operation was given a verdict row. ErrorVerdictRow ErrorKind = "verdict-row" // ErrorNotAnObject: Verdicts was asked about an element that declares no object. ErrorNotAnObject ErrorKind = "not-an-object" // ErrorIncompleteValidation: Verdicts could not check every assertion about a row. ErrorIncompleteValidation ErrorKind = "incomplete-validation" // ErrorStateRow: a model-only operation was given a state row. ErrorStateRow ErrorKind = "state-row" // ErrorEventRow: a model-only operation was given an event row. ErrorEventRow ErrorKind = "event-row" // ErrorNotHeld: a runtime operation was given an element the session holds no object of. ErrorNotHeld ErrorKind = "not-held" // ErrorNoStateMachine: States was asked about an object exhibiting no state machine. ErrorNoStateMachine ErrorKind = "no-state-machine" // ErrorUnknownState: InState named a state no session object's machine declares. ErrorUnknownState ErrorKind = "unknown-state" // ErrorObjectDestroyed: States or Events was given an object the run destroyed. ErrorObjectDestroyed ErrorKind = "object-destroyed" // ErrorNoTrace: Events ran in a session that records no trace. ErrorNoTrace ErrorKind = "no-trace" // ErrorInvalidInterval: an Events bound is not an instant on the clock, or the interval is empty. ErrorInvalidInterval ErrorKind = "invalid-interval" // ErrorTraceTruncated: Events reaches back to records the session's bounded trace has dropped. ErrorTraceTruncated ErrorKind = "trace-truncated" // ErrorUndeclaredRow: a RelatedColumn was to traverse from a row no element declares. ErrorUndeclaredRow ErrorKind = "undeclared-row" // ErrorProjectedAncestors: Tree was given ancestors for rows already projected. ErrorProjectedAncestors ErrorKind = "projected-ancestors" )
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is one row of Events: a typed record of the session's trace, at the instant it was made. Immutable once built.
func EventsFromTrace ¶ added in v0.10.0
func EventsFromTrace(ctx *runtime.Context, records []runtime.TraceRecord) []Event
EventsFromTrace converts documented trace records into rows in run order.
func (Event) Alternatives ¶
Alternatives are a choice's alternatives as offered, or a decide's branches, nil for any other record.
func (Event) Assigned ¶ added in v0.12.0
Assigned is the feature an assign record wrote and the value it holds since; ok is false for any other record.
func (Event) Kind ¶
Kind names the record's kind as its `kind` property does: `accept`, `send`, `transition`, `entry`, `exit`, `do`, `choice`, `guard`, `terminate`, and for an action's run `step`, `wait`, `assign`, `decide`, `complete`.
func (Event) Label ¶
Label names the row: the machine it came from and its text (`lamp.lp: enter: on`); a record with no object reads as its text alone.
func (Event) Object ¶
Object is the object whose behavior made the record, nil for one made from outside the run, with the label a session reaches it by.
func (Event) Payload ¶
Payload is an accept's or send's payload, `name = value` per parameter in name order, in the runtime's notation.
func (Event) Record ¶
func (ev Event) Record() runtime.TraceRecord
Record is the trace record the row reads.
func (Event) Step ¶ added in v0.12.0
Step is the executor step the record was made in, 0 for a record of none.
func (Event) Summary ¶
Summary is the event in one line: its instant in clock units, then its label.
func (Event) Taken ¶
Taken is the alternative a choice took or the branch a decide took, "" for any other record.
func (Event) Target ¶
Target is the object a send was addressed to, nil for any other record, with the label a session reaches it by.
type Failure ¶ added in v0.12.0
type Failure struct {
Step Step `json:"step"`
Expected string `json:"expected"`
Frontier Frontier `json:"frontier"`
}
Failure is one failure of one step on one element: what the step asserted (Expected) and what the model holds there (Frontier).
type FeatureRef ¶ added in v0.12.0
FeatureRef is one feature reachable on the element the path stopped at, `(name, type)`; Type is empty for an untyped feature.
func (FeatureRef) MarshalJSON ¶ added in v0.12.0
func (f FeatureRef) MarshalJSON() ([]byte, error)
type Finding ¶ added in v0.12.0
type Finding struct {
Step Step `json:"step"`
Element string `json:"element"`
Constraint Constraint `json:"constraint"`
Observed string `json:"observed"`
}
Finding is one finding about Element at Step: a constraint the model violates.
type Frontier ¶ added in v0.12.0
type Frontier struct {
At string
Members []Member
Features []FeatureRef
Kinds []string
Nearest string
// contains filtered or unexported fields
}
Frontier is what the model holds where the path stopped resolving: the last element that did resolve (At) and what it offers in place of what was asked.
func (Frontier) MarshalJSON ¶ added in v0.12.0
type Member ¶ added in v0.12.0
Member is one owned member of the namespace the path stopped at, `(name, metaclass)`.
func (Member) MarshalJSON ¶ added in v0.12.0
type ModelError ¶ added in v0.12.0
type ModelError struct {
Findings []Finding `json:"findings"`
PathFailures []Failure `json:"pathFailures"`
}
ModelError says the model violates a constraint a legitimate step relied on, with the path failures of the elements that failed in the same fan-out.
type Outcome ¶ added in v0.12.0
type Outcome struct {
Path *PathError
Model *ModelError
}
Outcome is the QVTS record behind a failed query: exactly one of Path and Model is set, as Outcome.pathError / Outcome.modelError are in Lean.
func (Outcome) Lines ¶ added in v0.12.0
Lines renders the record for a prompt or a CLI, one indented line per failure or finding, the frontier on the line after it.
func (Outcome) MarshalJSON ¶ added in v0.12.0
MarshalJSON writes the record in the shape qvts's SPARQL differential records: `outcome`, `step`, then the failures or the findings and path failures.
type PathError ¶ added in v0.12.0
type PathError struct {
Failures []Failure `json:"failures"`
}
PathError says the query is wrong about this model: every failure with its own step.
type RelationshipTables ¶
type RelationshipTables struct {
// contains filtered or unexported fields
}
RelationshipTables memoizes one model's per-kind edge tables across the executions whose Context shares them. Not safe for concurrent use.
func NewRelationshipTables ¶
func NewRelationshipTables() *RelationshipTables
NewRelationshipTables returns empty tables for a Context to carry.
type ResultView ¶ added in v0.13.0
type ResultView struct {
// Name names the view: the query's name, or one the caller chose.
Name string
// Query is the query as the surface was given it: a qualified name with its
// bindings, an inline expression, or SysML v2 API or OSLC query text.
Query string
// Source is the model as the surface knows it: file paths or a model hash.
Source string
// Provenance identifies the run's inputs; a failed run's step is added to it.
Provenance string
}
ResultView is what a surface knows about one query run besides its outcome: the four attributes of the QVTS::QueryResult view the run is written as.
func (ResultView) ResultViewQualifiedName ¶ added in v0.13.0
func (v ResultView) ResultViewQualifiedName() string
ResultViewQualifiedName is the qualified name of the view Write declares.
func (ResultView) Write ¶ added in v0.13.0
Write is the run as one view typed by QVTS::QueryResult exposing the selection, or a failed run's frontier and finding elements; false for an error carrying no QVTS record.
func (ResultView) WriteOutcome ¶ added in v0.13.0
func (v ResultView) WriteOutcome(context Context, failed Outcome) string
WriteOutcome is a failed run as its view: failed is its path or model error.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row retains the selected element, object, verdict, state or event and its ordered projected cells.
func StaticRow ¶ added in v0.12.0
StaticRow is a row written out rather than queried: one text cell per column, originating where the row was written, and selecting no element.
func (Row) Depth ¶ added in v0.9.2
Depth is the row's nesting under the rows above it: 0 for a top-level row, one more for each row it nests under when the query arranged its rows as a tree (`Tree`); otherwise every row is at depth 0.
type RowSet ¶
type RowSet struct {
// contains filtered or unexported fields
}
RowSet is an immutable ordered query result.
func Execute ¶
func Execute(program *queryplan.Program, context Context, bindings Bindings, options Options) (*RowSet, error)
Execute evaluates a compiled entry query into an immutable ordered row set.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is one row of States or InState: an active leaf state of one object's state machine, as the session stands. Immutable once built.
func (State) Declaration ¶
Declaration is the state as declared, nil when lowering synthesized it.
func (State) Enclosing ¶
Enclosing names the composite states the leaf is nested in, outermost first; each is active with the leaf.
func (State) Label ¶
Label names the row: the state's path on its object's machine (`lamp.lp in on.dim`).
func (State) Object ¶
Object is the object whose machine is in the state, under the label the session reaches it by.
type Step ¶ added in v0.12.0
Step is one operation of the query with its argument: the name Named looked up, the feature Feature read, the column Project filled.
func (Step) Label ¶ added in v0.12.0
Label spells the step as the Lean and SPARQL sides do: `Named(Observatory::x)`.
func (Step) MarshalJSON ¶ added in v0.12.0
type StepKind ¶ added in v0.12.0
type StepKind string
StepKind is the operation a QVTS outcome points at, one per constructor of lean/QVTS/Outcome.lean's Step.
const ( StepNamed StepKind = "Named" StepOwned StepKind = "Owned" StepDescendants StepKind = "Descendants" StepFeature StepKind = "Feature" StepValue StepKind = "Value" StepOfType StepKind = "OfType" StepRelated StepKind = "Related" StepWhereFeature StepKind = "WhereFeature" StepProject StepKind = "Project" StepDiffer StepKind = "Differ" )
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is one immutable scalar carried through query execution.
func ConnectorEndValue ¶ added in v0.10.0
ConnectorEndValue constructs the value of end position of connector, labelled by the attachment it names (`bench.ccd.usb`), with the connector as provenance.
func ElementValue ¶
ElementValue constructs an element value with declaration provenance.
func EventValue ¶
EventValue constructs an event value; its provenance is the object's declaration.
func IntegerOf ¶ added in v0.10.0
IntegerOf constructs the integer value of the Integer constant value, which may lie beyond int64.
func ObjectValue ¶
ObjectValue constructs a runtime object value under the label a session reaches it by (`car.wheels[2]`, `#7`), with its declaration as provenance.
func QuantityHeldAs ¶ added in v0.13.0
QuantityHeldAs is the quantity as a feature of the quantity value type kind holds it; nil is none.
func QuantityValue ¶
QuantityValue constructs a quantity value from a magnitude in a unit; the quantity is deep-copied, so the value stays immutable.
func RationalOf ¶ added in v0.10.0
RationalOf constructs the value of the exact Rational constant value.
func ReadFeature ¶ added in v0.12.0
ReadFeature reads one feature of a row as a span column's cell does: the property is a feature name or member path below the row, read from the declared model for an element row and from the object for a session row. Absent features answer no values; a feature that cannot be evaluated is an unevaluable-feature error.
func StateValue ¶
StateValue constructs a state value; its declaration is the state.
func VerdictValue ¶
VerdictValue constructs a verdict value; its declaration is the assertion.
func (Value) ConnectorEnd ¶ added in v0.10.0
ConnectorEnd returns the connector and end position a connector-end value stands for, and whether it is one.
func (Value) Declaration ¶
Declaration returns the element a value is declared by: an element itself, the usage or definition an object stands for, the assertion a verdict is about, the state a state row is of, the behavior an event row came from (its object's declaration when the record names none), and nil for a scalar.
func (Value) Integer ¶
Integer returns the value's integer and whether it is an integer value within int64; IntegerConst reads any integer value.
func (Value) IntegerConst ¶ added in v0.10.0
IntegerConst returns the value's Integer, of any size, and whether it is an integer value.
func (Value) Label ¶ added in v0.10.0
Label is the text a connector-end value is labelled by: the attachment it names, as written on the connector.
func (Value) Magnitude ¶
Magnitude returns a quantity value's magnitude as the bare integer or real value it is, and whether the value is a quantity.
func (Value) Object ¶
Object returns the value's runtime object, the label it is reached by, and whether it is an object value.
func (Value) Quantity ¶
Quantity returns an independent copy of the value's quantity and whether it is a quantity value.
func (Value) QuantityKind ¶ added in v0.13.0
QuantityKind is the quantity value type a quantity read off a feature is held as, nil for none.
func (Value) Rational ¶ added in v0.10.0
Rational returns the value's exact Rational and whether it is a rational value.
type ValueKind ¶
type ValueKind string
ValueKind classifies one scalar query value.
const ( ValueElement ValueKind = "element" // ValueObject is a runtime object a session holds, `car.wheels[2]`, as opposed // to the model element declaring it. ValueObject ValueKind = "object" // ValueVerdict is an assertion checked about an object, carried as a row whose // declaration is the asserting element. ValueVerdict ValueKind = "verdict" // ValueState is one active state of an object's state machine, carried as a // row whose declaration is the state. ValueState ValueKind = "state" // ValueEvent is one record of a session's trace, carried as a row whose // declaration is the behavior that made it. ValueEvent ValueKind = "event" ValueString ValueKind = "string" ValueInteger ValueKind = "integer" ValueReal ValueKind = "real" // ValueRational is an exact non-integer Rational, `1/3` or `0.1`. ValueRational ValueKind = "rational" ValueBoolean ValueKind = "boolean" ValueInfinity ValueKind = "infinity" // ValueQuantity is a magnitude in a measurement unit, `2290000 [kg]`. ValueQuantity ValueKind = "quantity" // ValueConnectorEnd is one end of a connector usage, reached by navigating // its Connector::connectorEnd: it names the features its attachment walks. ValueConnectorEnd ValueKind = "connectorEnd" )
type Verdict ¶
type Verdict struct {
// contains filtered or unexported fields
}
Verdict is one row of Verdicts: an assertion checked about one object, and how it came out. Immutable once built.
func (Verdict) Assertion ¶
Assertion is the asserting element: the constraint, requirement, satisfy usage or verification case.
func (Verdict) Carrier ¶
Carrier is the object the assertion was checked on, and whether the query's session holds it rather than the check having materialized it as declared.
func (Verdict) CarrierDeclaration ¶
CarrierDeclaration is the element the carrier stands for in the model.
func (Verdict) Condition ¶
Condition is the condition that evaluated to false on a violated verdict.
func (Verdict) Kind ¶
func (v Verdict) Kind() runtime.AssertionKind
Kind is the kind of assertion checked: constraint, requirement, satisfaction or verification.
func (Verdict) Path ¶
Path names the carrier from the row checked: its label, then the features walked to the carrier (`car.wheels[2]`).
func (Verdict) Requirement ¶
Requirement is the requirement a requirement, satisfaction or verification verdict is about; nil for a constraint.
func (Verdict) Status ¶
func (v Verdict) Status() runtime.ValidationStatus
Status is how the assertion came out.
func (Verdict) Text ¶
Text is the assertion as written (`constraint massLimit`), naming an anonymous one.
func (Verdict) Verification ¶
func (v Verdict) Verification() []runtime.VerdictKind
Verification is the verdict kinds of the verification cases the row reports: its own case on a verification row, those verifying its requirement otherwise.
Source Files
¶
- computed.go
- derived.go
- differ.go
- elementids.go
- errors.go
- event.go
- events.go
- execute.go
- feature.go
- inline.go
- memberpath.go
- metaclassproperties.go
- metadata.go
- named.go
- navigate.go
- objects.go
- operations.go
- outcome.go
- related.go
- related_column.go
- resultview.go
- setops.go
- state.go
- states.go
- tree.go
- valuation.go
- value.go
- verdict.go
- verdicts.go
- where_related.go
- wheretext.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package elementids gives queries the elementId a conversion of the model writes for each element, read from the RDF export; a binary links it to fill the column, and one that does not reports elementId absent.
|
Package elementids gives queries the elementId a conversion of the model writes for each element, read from the RDF export; a binary links it to fill the column, and one that does not reports elementId absent. |