TextualRepresentation
TextualRepresentation
is defined in KerML specification on
page 108.
Excerpt from the machine readable specification:
A
TextualRepresentation
is anAnnotatingElement
whosebody
represents therepresentedElement
in a givenlanguage
. TherepresentedElement
must be theowner
of theTextualRepresentation
. The namedlanguage
can be a natural language, in which case thebody
is an informal representation, or an artificial language, in which case thebody
is expected to be a formal, machine-parsable representation.If the named
language
of aTextualRepresentation
is machine-parsable, then thebody
text should be legal input text as defined for thatlanguage
. The interpretation of the named language string shall be case insensitive. The followinglanguage
names are defined to correspond to the given standard languages:
kerml
Kernel Modeling Language
ocl
Object Constraint Language
alf
Action Language for fUML
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 KerMLTextualRepresentation
.If the
language
of aTextualRepresentation
is “kerml
”, then thebody
text shall be a legal representation of therepresentedElement
in the KerML textual concrete syntax. A conforming tool can use such aTextualRepresentation
Annotation
to record the original KerML concrete syntax text from which anElement
was parsed. In this case, it is a tool responsibility to ensure that thebody
of theTextualRepresentation
remains correct (or the Annotation is removed) if the annotatedElement
changes other than by re-parsing thebody
text.An
Element
with aTextualRepresentation
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.
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