Namespace SysML

class Namespace

Implementation of Namespace defined in the KerML specification.

Specification:

A Namespace is an Element that contains other Elements, known as its members, via Membership Relationships with those Elements. The members of a Namespace may be owned by the Namespace, aliased in the Namespace, or imported into the Namespace via Import Relationships.

A Namespace can provide names for its members via the member_names and member_short_names specified by the Memberships in the Namespace. If a Membership specifies a member_name and/or member_short_name, then those are names of the corresponding member_element relative to the Namespace. For an OwningMembership, the owned_member_name and owned_member_short_name are given by the Element name and short_name. Note that the same Element may be the member_element of multiple Memberships in a Namespace (though it may be owned at most once), each of which may define a separate alias for the Element relative to the Namespace.

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.

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

STD

R

children

R

The elements enclosed by curly brackets in textual syntax.

imported_memberships

R SysML

Implementation of imported_membership defined in the KerML specification.

members

R SysML

Implementation of member defined in the KerML specification.

memberships

R SysML

Implementation of membership defined in the KerML specification.

owned_imports

R SysML

Implementation of owned_import defined in the KerML specification.

owned_members

R SysML

Implementation of owned_member defined in the KerML specification.

owned_memberships

R SysML

Implementation of owned_membership defined in the KerML specification.

prefixes

R

Metadata prefixes, prefixed with # in textual syntax.

__getitem__

Access owned named members by name. Throws KeyError if a member with such name does not exist.

get_member

Non-throwing variant of __getitem__. Returns None if a named member was not found.

get_membership

Access owned memberships by name. Returns None if an owned member or membership with such name does not exist.

Members inherited from Element (25 members)

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.Namespace], ...] = ()
property children: syside.NamespaceBody

The elements enclosed by curly brackets in textual syntax.

property imported_memberships: syside.LazyIterator[syside.Membership]

Implementation of imported_membership defined in the KerML specification.

Specification:

The Memberships in this Namespace that result from the owned_imports of this Namespace.

See section 8.3.2.4.5 of the KerML specification for more details.

property members: syside.LazyIterator[syside.Element]

Implementation of member defined in the KerML specification.

Specification:

The set of all member Elements of this Namespace, which are the member_elements of all memberships of the Namespace.

See section 8.3.2.4.5 of the KerML specification for more details.

property memberships: syside.LazyIterator[syside.Membership]

Implementation of membership defined in the KerML specification.

Specification:

All Memberships in this Namespace, including (at least) the union of owned_memberships and imported_memberships.

See section 8.3.2.4.5 of the KerML specification for more details.

property owned_imports: syside.LazyIterator[syside.Import]

Implementation of owned_import defined in the KerML specification.

Specification:

The owned_relationships of this Namespace that are Imports, for which the Namespace is the import_owning_namespace.

See section 8.3.2.4.5 of the KerML specification for more details.

property owned_members: syside.LazyIterator[syside.Element]

Implementation of owned_member defined in the KerML specification.

Specification:

The owned members of this Namespace, which are the owned_member_elements of the owned_memberships of the Namespace.

See section 8.3.2.4.5 of the KerML specification for more details.

property owned_memberships: syside.LazyIterator[syside.Membership]

Implementation of owned_membership defined in the KerML specification.

Specification:

The owned_relationships of this Namespace that are Memberships, for which the Namespace is the membership_owning_namespace.

See section 8.3.2.4.5 of the KerML specification for more details.

property prefixes: syside.NamespacePrefixes

Metadata prefixes, prefixed with # in textual syntax.

Methods

__getitem__(arg: str, /) syside.Element

Access owned named members by name. Throws KeyError if 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_member that 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_membership that returns the last argument if a member was not found.

Used in