Documentation
¶
Overview ¶
Package metamodel evaluates derived SysML and KerML metamodel properties over a resolved semantic model, optionally using graph-stated structure.
Index ¶
Constants ¶
const ExtensionMetaclassPrefix = "sysx:"
ExtensionMetaclassPrefix marks a Structure metaclass outside the SysML vocabulary; the evaluator treats such an element's SysML metaclass as unknown.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
Symbol *symbols.Symbol
Node ast.Node
Container *symbols.Symbol
Membership Membership
IsMembership bool
Aspect string
}
Element is a semantic element and the membership that owns it, when it has one.
func MembershipElement ¶
func MembershipElement(membership Membership) Element
MembershipElement creates a handle for a membership that is itself an element.
func (Element) Key ¶
func (e Element) Key() ElementKey
Key returns the canonical identity of an element.
type ElementIdentityStructure ¶
ElementIdentityStructure optionally supplies stable API identities for elements whose derived values contain an ID rather than an element handle.
type ElementKey ¶
type ElementKey struct {
// contains filtered or unexported fields
}
ElementKey identifies an element independently of its container and embedded membership.
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator derives metamodel properties from a resolved semantic model.
type Membership ¶
type Membership struct {
Symbol *symbols.Symbol
Node ast.Node
Member *symbols.Symbol
Owner *symbols.Symbol
Feature bool
Aspect string
// contains filtered or unexported fields
}
Membership identifies an element's membership without depending on an export format.
func (Membership) Key ¶
func (m Membership) Key() MembershipKey
Key returns the canonical identity of a membership.
func (Membership) Metaclass ¶
func (m Membership) Metaclass() string
Metaclass returns the membership metaclass when it is known.
type MembershipKey ¶
type MembershipKey struct {
// contains filtered or unexported fields
}
MembershipKey identifies a membership independently of its feature flag.
type Options ¶
type Options struct {
Structure Structure
}
Options supplies graph-stated structure used by the evaluator. When Structure is nil, the evaluator serves properties derivable from the semantic model.
type QualifiedNameStructure ¶
QualifiedNameStructure supplies canonical names when graph containment is unavailable.
type Reason ¶
type Reason struct {
Category ReasonCategory
Detail string
Dependency string
}
Reason records the decision that made a property derivation unsupported.
type ReasonCategory ¶
type ReasonCategory string
ReasonCategory identifies why a property derivation is unsupported.
const ( ReasonNoRule ReasonCategory = "no-rule" ReasonUnresolvedReference ReasonCategory = "unresolved-reference" ReasonLibraryTargetWithoutCatalogIdentity ReasonCategory = "library-target-without-catalog-identity" ReasonDependsOnUnsupported ReasonCategory = "depends-on-unsupported" ReasonUnrepresentedEndpoint ReasonCategory = "unrepresented-endpoint" ReasonUnrepresentedElement ReasonCategory = "unrepresented-element" ReasonUnresolvedOperatorFunction ReasonCategory = "unresolved-operator-function" ReasonMissingStructure ReasonCategory = "missing-structure" ReasonMissingSemanticModel ReasonCategory = "missing-semantic-model" ReasonNotApplicable ReasonCategory = "not-applicable" ReasonIncompleteStructure ReasonCategory = "incomplete-structure" ReasonImpliedRelationshipNotMaterialized ReasonCategory = "implied-relationship-not-materialized" ReasonValueStatedUnderRedefinedProperty ReasonCategory = "value-stated-under-redefined-property" )
type StatedAttributeStructure ¶
type StatedAttributeStructure interface {
StatedAttribute(el Element, property string) (Value, bool)
}
StatedAttributeStructure distinguishes graph values from metamodel defaults.
type Structure ¶
type Structure interface {
Metaclass(Element) (string, bool)
Specializes(sub, super string) bool
OwnedRelationships(Element) ([]Element, bool)
OwningRelationship(Element) (Element, bool, bool)
OwnedRelatedElements(Element) ([]Element, bool)
OwningRelatedElement(Element) (Element, bool, bool)
RelatedElements(rel Element, property string) ([]Element, bool)
Attribute(el Element, property string) (Value, bool)
}
Structure supplies graph-stated metaclass, relationship, endpoint, and attribute facts used when a property cannot be derived from resolved semantics.