Element SysML
- class Element
Implementation of
Elementdefined in the KerML specification.Specification:
An
Elementis a constituent of a model that is uniquely identified relative to all otherElements. It can haveRelationshipswith otherElements. Some of theseRelationshipsmight imply ownership of otherElements, which means that if anElementis deleted from a model, then so are all theElementsthat 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.
Children
Members defined in
Element(26 members)
R
RSysMLImplementation of
alias_idsdefined in the KerML specification.
RThe owned
Commentsrelated byowned_relationships.
RWSysMLImplementation of
declared_namedefined in the KerML specification.
RWSysMLImplementation of
declared_short_namedefined in the KerML specification.
RSysMLImplementation of
documentationdefined in the KerML specification.
RWSysMLImplementation of
element_iddefined in the KerML specification.
RSysMLImplementation of
is_implied_includeddefined in the KerML specification.
RSysMLImplementation of
is_library_elementdefined in the KerML specification.
RThe owned metadata related by
owned_relationships.
RSysMLImplementation of
namedefined in the KerML specification.
RSysMLImplementation of
owned_annotationdefined in the KerML specification.
RSysMLImplementation of
owned_elementdefined in the KerML specification.
RSysMLImplementation of
owned_relationshipdefined in the KerML specification.
RSysMLImplementation of
ownerdefined in the KerML specification.
RSysMLImplementation of
owning_membershipdefined in the KerML specification.
RSysMLImplementation of
owning_namespacedefined in the KerML specification.
RSysMLImplementation of
owning_relationshipdefined in the KerML specification.
RReturn a unique description of the location of this
Elementin the containment structure rooted in a rootNamespace. In most cases the segments will be identical toQualifiedName.
RSysMLImplementation of
qualified_namedefined in the KerML specification.
RThe owner of this
Elementas the parent ofowning_membershiporowning_relationshipotherwise.
RWThe 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.
RSysMLImplementation of
short_namedefined in the KerML specification.
RSysMLImplementation of
textual_representationdefined in the KerML specification.
Check if the qualified name of this
Elementmatches the provided segments of a qualified name.Members inherited from
AstNode(7 members) Attributes
- STD: tuple[type[syside.Element], ...] = ()
- property alias_ids: list[str]
Implementation of
alias_idsdefined 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
Commentsrelated byowned_relationships.
- property declared_name: str | None
Implementation of
declared_namedefined 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_namedefined in the KerML specification.Specification:
An optional alternative name for the
Elementthat is intended to be shorter or in some way more succinct than its primaryname. It may act as a modeler-specified identifier for theElement, 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
documentationdefined 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_iddefined 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_idmay 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 storeelement_idsonly during serialization. Otherwise__hash__is guaranteed to remain stable while theElementis alive, however it may be reused onDocumentrebuilds.Note that
element_idis currently only stable for elements withqualified_name, and their owning memberships, using similar derivation strategy to the standard elements.pathbased element ids will be implemented in a future release when bulk-complexity can be guaranteedO(n). Whilequalified_nameelement id has complexity ofO(d),pathbased has worst-case complexity ofO(d^2)for elements withoutqualified_namesbecause 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_includeddefined in the KerML specification.Specification:
Whether all necessary implied Relationships have been included in the
owned_relationshipsof this Element. This property may be true, even if there are not actually anyowned_relationshipswithis_implied = true, meaning that no such Relationships are actually implied for this Element. However, if it is false, thenowned_relationshipsmay 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_elementdefined 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
namedefined in the KerML specification.Specification:
The name to be used for this
Elementduring name resolution within itsowning_namespace. This is derived using theeffective_name()operation. By default, it is the same as thedeclared_name, but this is overridden for certain kinds ofElementsto compute anameeven when thedeclared_nameis 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_annotationdefined in the KerML specification.Specification:
The
owned_relationshipsof thisElementthat areAnnotations, for which thisElementis theannotated_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_elementdefined 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_relationshipdefined 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
ownerdefined in the KerML specification.Specification:
The owner of this Element, derived as the
owning_related_elementof theowning_relationshipof 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_membershipdefined in the KerML specification.Specification:
The
owning_relationshipof thisElement, if thatRelationshipis aMembership.See section 8.3.2.1.2 of the KerML specification for more details.
- property owning_namespace: syside.Namespace | None
Implementation of
owning_namespacedefined in the KerML specification.Specification:
The
Namespacethat owns thisElement, which is themembership_owning_namespaceof theowning_membershipof thisElement, 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_relationshipdefined 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
Elementin the containment structure rooted in a rootNamespace. In most cases the segments will be identical toQualifiedName.For example, an
OwningMembershipwill return itsowned_member_elementpath withto_owning_membership == True.NOTE that for now, this is only partially implemented, resolution of positions is not yet performed and an empty
Pathis returned instead.
- property qualified_name: syside.QualifiedName | None
Implementation of
qualified_namedefined 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). Thequalified_nameis null if thisElementhas noowning_namespaceor if there is not a complete ownership chain of namedNamespacesfrom a rootNamespaceto thisElement. If theowning_namespacehas otherElementswith the same name as this one, then thequalified_nameis null for all suchElementsother 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
Elementas the parent ofowning_membershiporowning_relationshipotherwise.
- 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_namedefined in the KerML specification.Specification:
The short name to be used for this
Elementduring name resolution within itsowning_namespace. This is derived using theeffective_short_name()operation. By default, it is the same as thedeclared_short_name, but this is overridden for certain kinds ofElementsto compute ashort_nameeven when thedeclared_nameis 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_representationdefined in the KerML specification.Specification:
The
TextualRepresentationsthat annotate thisElement.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
Elementmatches the provided segments of a qualified name.