Namespace
Namespace
is defined in KerML specification on
page 47.
Excerpt from the machine readable specification:
A
Namespace
is anElement
that contains otherElements
, known as itsmembers
, viaMembership
Relationships
with thoseElements
. Themembers
of aNamespace
may be owned by theNamespace
, aliased in theNamespace
, or imported into theNamespace
viaImport
Relationships
.A
Namespace
can provide names for itsmembers
via thememberNames
andmemberShortNames
specified by theMemberships
in theNamespace
. If aMembership
specifies amemberName
and/ormemberShortName
, then those are names of the correspondingmemberElement
relative to theNamespace
. For anOwningMembership
, theowningMemberName
andowningMemberShortName
are given by theElement
name
andshortName
. Note that the sameElement
may be thememberElement
of multipleMemberships
in aNamespace
(though it may be owned at most once), each of which may define a separate alias for theElement
relative to theNamespace
.
The following diagram shows the inheritance hierarchy of Namespace
according to the specification:
![// Class: Namespace
digraph {
Namespace [label="Namespace (KerML)" shape=plaintext]
Element -> Namespace
Element [label="Element (KerML)" shape=plaintext]
}](../../../_images/graphviz-3a09e89078c66bc2d4d98ed7cde819b3076e3e46.png)
The following table shows all attributes defined for
Namespace
according to the specification together with
the documentation from the machine readable specification. Note
that in SysIDE API, we use snake case for attribute names
instead of Pascal case used in the specification.
Attribute |
Documentation from machine readable specification |
Attributes defined in |
|
The set of all member |
|
All |
|
The |
|
The owned |
|
The |
|
Attributes defined in |
|
The declared name of this |
|
An optional alternative name for the |
|
The Documentation owned by this Element. |
|
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. |
|
Whether all necessary implied Relationships have been included in the
|
|
Whether this Element is contained in the ownership tree of a library model. |
|
The name to be used for this |
|
The |
|
The Elements owned by this Element, derived as the ownedRelatedElements of the ownedRelationships of this Element. |
|
The Relationships for which this Element is the owningRelatedElement. |
|
The owner of this Element, derived as the |
|
The |
|
The |
|
The Relationship for which this Element is an ownedRelatedElement, if any. |
|
The full ownership-qualified name of this |
|
The short name to be used for this |
|
The |
The following table lists SysIDE specific attributes available for
class Namespace
:
Python Attribute |
- class Namespace
-
- STD: tuple[type[syside.Namespace], ...] = ()
- property prefixes: syside.NamespacePrefixes
- property children: syside.NamespaceBody
- property owned_memberships: syside.LazyIterator[syside.Membership]
- property owned_members: syside.LazyIterator[syside.Element]
- property memberships: syside.LazyIterator[syside.Membership]
- property members: syside.LazyIterator[syside.Element]
- property owned_imports: syside.LazyIterator[syside.Import]
- __getitem__(arg: str, /) syside.Element
- get_membership(arg: str, /) syside.Membership | None
- get_membership(arg0: str, arg1: syside.Membership, /) syside.Membership
- get_member(arg: str, /) syside.Element | None
- get_member(arg0: str, arg1: syside.Element, /) syside.Element
- property sema_state: syside.SemaState
- property qualified_name: syside.QualifiedName | None
- property owning_membership: syside.OwningMembership | None
- property owned_relationships: syside.LazyIterator[syside.Relationship]
- property owning_relationship: syside.Relationship | None
- property owning_namespace: syside.Namespace | None
- property owner: syside.Element | None
- property scoped_owner: syside.Element | None
- property owned_elements: syside.LazyIterator[syside.Element]
- property documentation: syside.LazyIterator[syside.Documentation]
- property owned_annotations: syside.LazyIterator[syside.Annotation]
- property comments: syside.LazyIterator[syside.Comment]
- property textual_representations: syside.LazyIterator[syside.TextualRepresentation]
- property metadata: syside.LazyIterator[syside.MetadataFeature | syside.MetadataUsage]
- isinstance(type: tuple[syside.AstNode.isinstance.type[syside.TNode], ...]) TypeGuard[syside.TNode]
- try_cast(type: tuple[syside.AstNode.try_cast.type[syside.TNode], ...]) syside.TNode | None
- cast(type: tuple[syside.AstNode.cast.type[syside.TNode], ...]) syside.TNode
- property parent: syside.Element | None
- property document: syside.Document
- property cst_node: syside.CstNode | None