TextualRepresentation
TextualRepresentation is defined in KerML specification on
page 108.
Excerpt from the machine readable specification:
A
TextualRepresentationis anAnnotatingElementwhosebodyrepresents therepresentedElementin a givenlanguage. TherepresentedElementmust be theownerof theTextualRepresentation. The namedlanguagecan be a natural language, in which case thebodyis an informal representation, or an artificial language, in which case thebodyis expected to be a formal, machine-parsable representation.If the named
languageof aTextualRepresentationis machine-parsable, then thebodytext should be legal input text as defined for thatlanguage. The interpretation of the named language string shall be case insensitive. The followinglanguagenames are defined to correspond to the given standard languages:
kermlKernel Modeling Language
oclObject Constraint Language
alfAction Language for fUML
Other specifications may define specific
languagestrings, other than those shown above, to be used to indicate the use of languages from those specifications in KerMLTextualRepresentation.If the
languageof aTextualRepresentationis “kerml”, then thebodytext shall be a legal representation of therepresentedElementin the KerML textual concrete syntax. A conforming tool can use such aTextualRepresentationAnnotationto record the original KerML concrete syntax text from which anElementwas parsed. In this case, it is a tool responsibility to ensure that thebodyof theTextualRepresentationremains correct (or the Annotation is removed) if the annotatedElementchanges other than by re-parsing thebodytext.An
Elementwith aTextualRepresentationin a language other than KerML is essentially a semantically “opaque”Elementspecified in the other language. However, a conforming KerML tool may interpret such an element consistently with the specification of the named language.
The following diagram shows the inheritance hierarchy of TextualRepresentation
according to the specification:
![// Class: TextualRepresentation
digraph {
TextualRepresentation [label="TextualRepresentation (KerML)" shape=plaintext]
AnnotatingElement -> TextualRepresentation
AnnotatingElement [label="AnnotatingElement (KerML)" shape=plaintext]
Element -> AnnotatingElement
Element [label="Element (KerML)" shape=plaintext]
}](../../../_images/graphviz-ab35538f581f4f9ed516779819afaf1164f45451.png)
The following table shows all attributes defined for
TextualRepresentation 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 textual representation of the |
|
The natural or artificial language in which the |
|
The |
|
Attributes defined in |
|
The |
|
The |
|
The |
|
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 TextualRepresentation:
Python Attribute |
- class TextualRepresentation
-
- STD: tuple[type[syside.TextualRepresentation], ...] = ()
- property represented_element: syside.Element | None
- property annotations: syside.ContainerView[syside.Annotation]
- property annotated_elements: syside.ContainerView[syside.Element]
- property owned_annotating_relationships: syside.ContainerView[syside.Annotation]
- property owning_annotating_relationship: syside.Annotation | None
- property about: syside.Annotations