Element SysML

class Element

Implementation of Element defined in the KerML specification.

Specification:

An Element is a constituent of a model that is uniquely identified relative to all other Elements. It can have Relationships with other Elements. Some of these Relationships might imply ownership of other Elements, which means that if an Element is deleted from a model, then so are all the Elements that it owns.

For language description, see section 7.2.2 of the KerML specification. For more details on the model, see section 8.3.2.1.2 of the KerML specification.

%3 Element Element syside.Element AstNode AstNode syside.AstNode AstNode->Element
Children
Members defined in Element (26 members)

STD

R

alias_ids

R SysML

Implementation of alias_ids defined in the KerML specification.

comments

R

The owned Comments related by owned_relationships.

declared_name

RW SysML

Implementation of declared_name defined in the KerML specification.

declared_short_name

RW SysML

Implementation of declared_short_name defined in the KerML specification.

documentation

R SysML

Implementation of documentation defined in the KerML specification.

element_id

RW SysML

Implementation of element_id defined in the KerML specification.

is_implied_included

R SysML

Implementation of is_implied_included defined in the KerML specification.

is_library_element

R SysML

Implementation of is_library_element defined in the KerML specification.

metadata

R

The owned metadata related by owned_relationships.

name

R SysML

Implementation of name defined in the KerML specification.

owned_annotations

R SysML

Implementation of owned_annotation defined in the KerML specification.

owned_elements

R SysML

Implementation of owned_element defined in the KerML specification.

owned_relationships

R SysML

Implementation of owned_relationship defined in the KerML specification.

owner

R SysML

Implementation of owner defined in the KerML specification.

owning_membership

R SysML

Implementation of owning_membership defined in the KerML specification.

owning_namespace

R SysML

Implementation of owning_namespace defined in the KerML specification.

owning_relationship

R SysML

Implementation of owning_relationship defined in the KerML specification.

path

R

Return a unique description of the location of this Element in the containment structure rooted in a root Namespace. In most cases the segments will be identical to QualifiedName.

qualified_name

R SysML

Implementation of qualified_name defined in the KerML specification.

scoped_owner

R

The owner of this Element as the parent of owning_membership or owning_relationship otherwise.

sema_state

RW

The state of semantic resolution for this Element. Based on this, sema may skip elements to avoid duplicate work, e.g. when resolving elements in a group of related documents.

short_name

R SysML

Implementation of short_name defined in the KerML specification.

textual_representations

R SysML

Implementation of textual_representation defined in the KerML specification.

__str__

matches_qualified_name

Check if the qualified name of this Element matches the provided segments of a qualified name.

Members inherited from AstNode (7 members)

cst_node

R

document

R

parent

R

__hash__

cast

isinstance

try_cast

Attributes

STD: tuple[type[syside.Element], ...] = ()
property alias_ids: list[str]

Implementation of alias_ids defined in the KerML specification.

Specification:

Various alternative identifiers for this Element. Generally, these will be set by tools.

See section 8.3.2.1.2 of the KerML specification for more details.

property comments: syside.LazyIterator[syside.Comment]

The owned Comments related by owned_relationships.

property declared_name: str | None

Implementation of declared_name defined in the KerML specification.

Specification:

The declared name of this Element.

See section 8.3.2.1.2 of the KerML specification for more details.

property declared_short_name: str | None

Implementation of declared_short_name defined in the KerML specification.

Specification:

An optional alternative name for the Element that is intended to be shorter or in some way more succinct than its primary name. It may act as a modeler-specified identifier for the Element, though it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a model or relative to some other context.

See section 8.3.2.1.2 of the KerML specification for more details.

property documentation: syside.LazyIterator[syside.Documentation]

Implementation of documentation defined in the KerML specification.

Specification:

The Documentation owned by this Element.

See section 8.3.2.1.2 of the KerML specification for more details.

property element_id: uuid.UUID

Implementation of element_id defined in the KerML specification.

Specification:

The globally unique identifier for this Element. This is intended to be set by tooling, and it must not change during the lifetime of the Element.

See section 8.3.2.1.2 of the KerML specification for more details.

Note that element_id may be deprecated in a future release to improve performance as it has no use outside of serialization. In such cases, we may instead create and store element_ids only during serialization. Otherwise __hash__ is guaranteed to remain stable while the Element is alive, however it may be reused on Document rebuilds.

Note that element_id is currently only stable for elements with qualified_name, and their owning memberships, using similar derivation strategy to the standard elements. path based element ids will be implemented in a future release when bulk-complexity can be guaranteed O(n). While qualified_name element id has complexity of O(d), path based has worst-case complexity of O(d^2) for elements without qualified_names because it needs to scan children linearly.

We reserve the option to change non-standard element id generation in future versions.

property is_implied_included: bool

Implementation of is_implied_included defined in the KerML specification.

Specification:

Whether all necessary implied Relationships have been included in the owned_relationships of this Element. This property may be true, even if there are not actually any owned_relationships with is_implied = true, meaning that no such Relationships are actually implied for this Element. However, if it is false, then owned_relationships may not contain any implied Relationships. That is, either all required implied Relationships must be included, or none of them.

See section 8.3.2.1.2 of the KerML specification for more details.

property is_library_element: bool

Implementation of is_library_element defined in the KerML specification.

Specification:

Whether this Element is contained in the ownership tree of a library model.

See section 8.3.2.1.2 of the KerML specification for more details.

property metadata: syside.LazyIterator[syside.MetadataFeature | syside.MetadataUsage]

The owned metadata related by owned_relationships.

property name: str | None

Implementation of name defined in the KerML specification.

Specification:

The name to be used for this Element during name resolution within its owning_namespace. This is derived using the effective_name() operation. By default, it is the same as the declared_name, but this is overridden for certain kinds of Elements to compute a name even when the declared_name is null.

See section 8.3.2.1.2 of the KerML specification for more details.

property owned_annotations: syside.LazyIterator[syside.Annotation]

Implementation of owned_annotation defined in the KerML specification.

Specification:

The owned_relationships of this Element that are Annotations, for which this Element is the annotated_element.

See section 8.3.2.1.2 of the KerML specification for more details.

property owned_elements: syside.LazyIterator[syside.Element]

Implementation of owned_element defined in the KerML specification.

Specification:

The Elements owned by this Element, derived as the owned_related_elements of the owned_relationships of this Element.

See section 8.3.2.1.2 of the KerML specification for more details.

property owned_relationships: syside.LazyIterator[syside.Relationship]

Implementation of owned_relationship defined in the KerML specification.

Specification:

The Relationships for which this Element is the owning_related_element.

See section 8.3.2.1.2 of the KerML specification for more details.

property owner: syside.Element | None

Implementation of owner defined in the KerML specification.

Specification:

The owner of this Element, derived as the owning_related_element of the owning_relationship of this Element, if any.

See section 8.3.2.1.2 of the KerML specification for more details.

property owning_membership: syside.OwningMembership | None

Implementation of owning_membership defined in the KerML specification.

Specification:

The owning_relationship of this Element, if that Relationship is a Membership.

See section 8.3.2.1.2 of the KerML specification for more details.

property owning_namespace: syside.Namespace | None

Implementation of owning_namespace defined in the KerML specification.

Specification:

The Namespace that owns this Element, which is the membership_owning_namespace of the owning_membership of this Element, if any.

See section 8.3.2.1.2 of the KerML specification for more details.

property owning_relationship: syside.Relationship | None

Implementation of owning_relationship defined in the KerML specification.

Specification:

The Relationship for which this Element is an owned_related_element, if any.

See section 8.3.2.1.2 of the KerML specification for more details.

property path: syside.Path

Return a unique description of the location of this Element in the containment structure rooted in a root Namespace. In most cases the segments will be identical to QualifiedName.

For example, an OwningMembership will return its owned_member_element path with to_owning_membership == True.

NOTE that for now, this is only partially implemented, resolution of positions is not yet performed and an empty Path is returned instead.

property qualified_name: syside.QualifiedName | None

Implementation of qualified_name defined in the KerML specification.

Specification:

The full ownership-qualified name of this Element, represented in a form that is valid according to the KerML textual concrete syntax for qualified names (including use of unrestricted name notation and escaped characters, as necessary). The qualified_name is null if this Element has no owning_namespace or if there is not a complete ownership chain of named Namespaces from a root Namespace to this Element. If the owning_namespace has other Elements with the same name as this one, then the qualified_name is null for all such Elements other than the first.

See section 8.3.2.1.2 of the KerML specification for more details.

property scoped_owner: syside.Element | None

The owner of this Element as the parent of owning_membership or owning_relationship otherwise.

property sema_state: syside.SemaState

The state of semantic resolution for this Element. Based on this, sema may skip elements to avoid duplicate work, e.g. when resolving elements in a group of related documents.

property short_name: str | None

Implementation of short_name defined in the KerML specification.

Specification:

The short name to be used for this Element during name resolution within its owning_namespace. This is derived using the effective_short_name() operation. By default, it is the same as the declared_short_name, but this is overridden for certain kinds of Elements to compute a short_name even when the declared_name is null.

See section 8.3.2.1.2 of the KerML specification for more details.

property textual_representations: syside.LazyIterator[syside.TextualRepresentation]

Implementation of textual_representation defined in the KerML specification.

Specification:

The TextualRepresentations that annotate this Element.

See section 8.3.2.1.2 of the KerML specification for more details.

Methods

__str__() str
matches_qualified_name(arg: Sequence[str], /) bool

Check if the qualified name of this Element matches the provided segments of a qualified name.

Used in