Namespace SysML
- class Namespace
Implementation of
Namespacedefined in the KerML specification.Specification:
A
Namespaceis anElementthat contains otherElements, known as itsmembers, viaMembershipRelationshipswith thoseElements. Themembersof aNamespacemay be owned by theNamespace, aliased in theNamespace, or imported into theNamespaceviaImportRelationships.A
Namespacecan provide names for itsmembersvia themember_namesandmember_short_namesspecified by theMembershipsin theNamespace. If aMembershipspecifies amember_nameand/ormember_short_name, then those are names of the correspondingmember_elementrelative to theNamespace. For anOwningMembership, theowning_member_nameandowning_member_short_nameare given by theElementnameandshort_name. Note that the sameElementmay be themember_elementof multipleMembershipsin aNamespace(though it may be owned at most once), each of which may define a separate alias for theElementrelative to theNamespace.For language description, see section 7.2.5 of the KerML specification. For more details on the model, see section 8.3.2.4.5 of the KerML specification.
Children
Members defined in
Namespace(11 members)
R
RThe elements enclosed by curly brackets in textual syntax.
RThe set of all member
Elementsof thisNamespace, which are themember_elementsof allmembershipsof theNamespace.
RAll
Membershipsin thisNamespace, including (at least) the union ofowned_membershipsandimported_memberships.
RThe
owned_relationshipsof thisNamespacethat areImports, for which theNamespaceis theimport_owning_namespace.
RThe owned
membersof thisNamespace, which are theowned_member_elementsof theowned_membershipsof theNamespace.
RThe
owned_relationshipsof thisNamespacethat areMemberships, for which theNamespaceis themembership_owning_namespace.
RMetadata prefixes, prefixed with
#in textual syntax.
Members inherited from
Element(23 members)
RThe owned
Commentsrelated byowned_relationships.
RWThe declared name of this
Element.
RWAn 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.
RThe Documentation owned by this Element.
RW- 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.
RWhether 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.
RWhether this Element is contained in the ownership tree of a library model.
RThe owned metadata related by
owned_relationships.
RThe 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.
RThe
owned_relationshipsof thisElementthat areAnnotations, for which thisElementis theannotated_element.
RThe Elements owned by this Element, derived as the owned_related_elements of the owned_relationships of this Element.
RThe Relationships for which this Element is the owning_related_element.
RThe owner of this Element, derived as the
owning_related_elementof theowning_relationshipof this Element, if any.
RThe
owning_relationshipof thisElement, if thatRelationshipis aMembership.
RThe
Namespacethat owns thisElement, which is themembership_owning_namespaceof theowning_membershipof thisElement, if any.
RThe Relationship for which this Element is an owned_related_element, if any.
RThe 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.
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.
RThe 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.
RThe
TextualRepresentationsthat annotate thisElement.
Members inherited from
AstNode(7 members) Attributes
- STD: tuple[type[syside.Namespace], ...] = ()
- property children: syside.NamespaceBody
The elements enclosed by curly brackets in textual syntax.
- property members: syside.LazyIterator[syside.Element]
The set of all member
Elementsof thisNamespace, which are themember_elementsof allmembershipsof theNamespace.
- property memberships: syside.LazyIterator[syside.Membership]
All
Membershipsin thisNamespace, including (at least) the union ofowned_membershipsandimported_memberships.
- property owned_imports: syside.LazyIterator[syside.Import]
The
owned_relationshipsof thisNamespacethat areImports, for which theNamespaceis theimport_owning_namespace.
- property owned_members: syside.LazyIterator[syside.Element]
The owned
membersof thisNamespace, which are theowned_member_elementsof theowned_membershipsof theNamespace.
- property owned_memberships: syside.LazyIterator[syside.Membership]
The
owned_relationshipsof thisNamespacethat areMemberships, for which theNamespaceis themembership_owning_namespace.
- property prefixes: syside.NamespacePrefixes
Metadata prefixes, prefixed with
#in textual syntax.
Methods
- __getitem__(arg: str, /) syside.Element
Access owned named members by name. Throws
KeyErrorif a member with such name does not exist.
- get_member(arg: str, /) syside.Element | None
Non-throwing variant of
__getitem__. Returns None if a named member was not found.
- get_member(arg0: str, arg1: syside.Element, /) syside.Element
Overload for
get_memberthat returns the last argument if a member was not found.
- get_membership(arg: str, /) syside.Membership | None
Access owned memberships by name. Returns None if an owned member or membership with such name does not exist.
- get_membership(arg0: str, arg1: syside.Membership, /) syside.Membership
Overload for
get_membershipthat returns the last argument if a member was not found.