TextualRepresentation SysML

class TextualRepresentation

Implementation of TextualRepresentation defined in the KerML specification.

Specification:

A TextualRepresentation is an AnnotatingElement whose body represents the represented_element in a given language. The represented_element must be the owner of the TextualRepresentation. The named language can be a natural language, in which case the body is an informal representation, or an artificial language, in which case the body is expected to be a formal, machine-parsable representation.

If the named language of a TextualRepresentation is machine-parsable, then the body text should be legal input text as defined for that language. The interpretation of the named language string shall be case insensitive. The following language names are defined to correspond to the given standard languages:

kerml

Kernel Modeling Language

ocl

Object Constraint Language

alf

Action Language for f_u_m_l

Other specifications may define specific language strings, other than those shown above, to be used to indicate the use of languages from those specifications in KerML TextualRepresentation.

If the language of a TextualRepresentation is “kerml”, then the body text shall be a legal representation of the represented_element in the KerML textual concrete syntax. A conforming tool can use such a TextualRepresentation Annotation to record the original KerML concrete syntax text from which an Element was parsed. In this case, it is a tool responsibility to ensure that the body of the TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element changes other than by re-parsing the body text.

An Element with a TextualRepresentation in a language other than KerML is essentially a semantically “opaque” Element specified in the other language. However, a conforming KerML tool may interpret such an element consistently with the specification of the named language.

For language description, see section 7.2.4.3 of the KerML specification. For more details on the model, see section 8.3.2.3.6 of the KerML specification.

TextualRepresentation TextualRepresentation syside.TextualRepresentation AnnotatingElement AnnotatingElement syside.AnnotatingElement AnnotatingElement->TextualRepresentation Element Element syside.Element Element->AnnotatingElement AstNode AstNode syside.AstNode AstNode->Element
Members defined in TextualRepresentation (4 members)

STD

R

body

RW

The textual representation of the represented_element in the given language.

language

RW

The natural or artificial language in which the body text is written.

represented_element

R

The Element that is represented by this TextualRepresentation.

Members inherited from AnnotatingElement (5 members)

about

R

Container for owned annotations.

annotated_elements

R

The Elements that are annotated by this AnnotatingElement. If annotation is not empty, these are the annotated_elements of the annotations. If annotation is empty, then it is the owning_namespace of the AnnotatingElement.

annotations

R

The Annotations that relate this AnnotatingElement to its annotated_elements. This includes the owning_annotating_relationship (if any) followed by all the owned_annotating_relationships.

owned_annotating_relationships

R

The owned_relationships of this AnnotatingElement that are Annotations, for which this AnnotatingElement is the annotating_element.

owning_annotating_relationship

R

The owning_relationship of this AnnotatingRelationship, if it is an Annotation

Members inherited from Element (23 members)

comments

R

The owned Comments related by owned_relationships.

declared_name

RW

The declared name of this Element.

declared_short_name

RW

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.

documentation

R

The Documentation owned by this Element.

element_id

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.

is_implied_included

R

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.

is_library_element

R

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

metadata

R

The owned metadata related by owned_relationships.

name

R

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.

owned_annotations

R

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

owned_elements

R

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

owned_relationships

R

The Relationships for which this Element is the owning_related_element.

owner

R

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

owning_membership

R

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

owning_namespace

R

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

owning_relationship

R

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

qualified_name

R

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.

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

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.

textual_representations

R

The TextualRepresentations that annotate this Element.

__str__

matches_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.TextualRepresentation], ...] = ()
property body: str

The textual representation of the represented_element in the given language.

property language: str

The natural or artificial language in which the body text is written.

property represented_element: syside.Element | None

The Element that is represented by this TextualRepresentation.

Used in