Relationship
Relationship
is defined in KerML specification on
page 143.
Excerpt from the machine readable specification:
A
Relationship
is anElement
that relates otherElement
. Some of itsrelatedElements
may be owned, in which case thoseownedRelatedElements
will be deleted from a model if theirowningRelationship
is. ARelationship
may also be owned by anotherElement
, in which case theownedRelatedElements
of theRelationship
are also considered to be transitively owned by theowningRelatedElement
of theRelationship
.The
relatedElements
of aRelationship
are divided intosource
andtarget
Elements
. TheRelationship
is considered to be directed from thesource
to thetarget
Elements
. An undirectedRelationship
may have either allsource
or alltarget
Elements
.A “relationship
Element
” in the abstract syntax is generically anyElement
that is an instance of eitherRelationship
or a direct or indirect specialization ofRelationship
. Any other kind ofElement
is a “non-relationshipElement
”. It is a convention of that non-relationshipElements
are only related via reified relationshipElements
. Any meta-associations directly between non-relationshipElements
must be derived from underlying reifiedRelationship
.
The following diagram shows the inheritance hierarchy of Relationship
according to the specification:
![// Class: Relationship
digraph {
Relationship [label="Relationship (KerML)" shape=plaintext]
Element -> Relationship
Element [label="Element (KerML)" shape=plaintext]
}](../../../_images/graphviz-7bf83c314b73c23d7b844713b70212ad617b4459.png)
The following table shows all attributes defined for
Relationship
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 |
|
Whether this Relationship was generated by tooling to meet semantic rules, rather than being directly created by a modeler. |
|
The relatedElements of this Relationship that are owned by the Relationship. |
|
The relatedElement of this Relationship that owns the Relationship, if any. |
|
The Elements that are related by this Relationship, derived as the union
of 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 Relationship
:
Python Attribute |
- class Relationship
-
- STD: tuple[Union[type[syside.Relationship], type[syside.Association], type[syside.ConnectionDefinition], type[syside.Connector], type[syside.ConnectorAsUsage], type[syside.FlowConnectionDefinition]], ...] = ()
- property visibility: syside.VisibilityKind
- try_set_visibility(arg: syside.VisibilityKind | None) bool
- property sources: syside.ContainerView[syside.Element]
- property targets: syside.ContainerView[syside.Element]
- property first_source: syside.Element | None
- property first_target: syside.Element | None
- 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