query

Labs

Description

syside.experimental.query: the accessors and mutators of the high-level API.

Experimental: the names and signatures may change in any release.

For every constructor parameter f of syside.experimental.builder there is a get_<f> that reads back what the parameter wrote, and, where the model can change it in place, set_<f>, or add_<f> and remove_<f> for a parameter taking several entries (see syside.experimental.query._getters and syside.experimental.query._mutators). The expression-template names from syside.experimental.expressions that the expression-valued accessors return and accept are re-exported here. Reading and writing never needs syside.experimental.builder: nothing in this package imports it, so the accessors work on a model loaded from text as on one built.

A get_* accessor never looks beyond the element it is handed: its cost is linear in that element’s own relationships or expression, never in the size of a model, document or subtree. The read-only queries over a whole model are in syside.query.

Index

Functions

get_about

Return the elements the annotating element is about (its about clause).

get_asserted_constraint

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_assigned_target

Return what follows assign, as it went into assigned_target=: the feature assigned to, or a chain() of the target object and the feature assigned to where the target is a feature reference, or of the chained feature assigned to after an expression target (get_target_object()).

get_assigned_value

Return the assignment action’s value argument as a template (written after :=), or None where the action carries none.

get_assumed_constraint

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where the membership’s kind is not syside.RequirementConstraintKind.Assumption: the member was written with another keyword.

get_body

Return the annotating element’s text.

get_clients

Return the dependency’s client elements (written before to).

get_condition

Return what condition= wrote, read by the kind of node:

get_conjugates

Return the conjugated port definitions the feature is typed by (: ~Q).

get_constant

Return whether the feature is declared constant.

get_cross_multiplicity

Return the multiplicity of the end’s owned cross feature (the [...] after end), as the bounds() template that writes it.

get_cross_name

Return the declared name of the end’s owned cross feature.

get_cross_nonunique

Return whether the end’s owned cross feature is declared nonunique.

get_cross_ordered

Return whether the end’s owned cross feature is declared ordered.

get_cross_short_name

Return the declared short name of the end’s owned cross feature.

get_cross_subsets

Return the features the end’s owned cross feature subsets.

get_crosses

Return the feature chain this feature crosses (its => rider).

get_default

Return whether the feature’s value is a default value (default = <value>).

get_defined_by

Return the types the feature is defined by (its :/defined by clause).

get_derived

Return whether the feature is declared derived.

get_direction

Return the usage’s effective direction: the in, out or inout before it, or Out for a return parameter, whose direction is fixed to out (KerML 8.3.4.7.8) whether or not the text says so, and In for an else action, a ParameterMembership’s member parameter (KerML validateParameterMembershipParameterDirection).

get_effect

Return the action the transition performs on firing (its do clause).

get_else_body

Return the if action’s else action, or None where the action has no else branch. An else if comes back as the nested IfActionUsage, which is an action usage; narrow it with try_cast.

get_else_if

Return the condition of the else if branch as a template, or None where the action has no else branch, its else branch is a plain body, or the nested condition slot is empty.

get_ends

Return every declared end of the connector, in order.

get_equals

Return the feature’s value expression as a template, or None if it has none.

get_event_occurrence

Return the OccurrenceUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_exhibited_state

Return the StateUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_filters

Return what filters= wrote, read by the kind of element:

get_for_

Return the element an alias names, or the action an initial node names (first <action>;).

get_framed_concern

Return the ConcernUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no FramedConcernMembership owns the usage: the property is that membership’s.

get_guard

Return the transition’s guard as a template – the expression after if – or None on a transition without one.

get_import_all

Return whether the import imports members whatever their visibility (its all keyword).

get_imported

Return what imported= wrote, read by the kind of element:

get_individual

Return whether the occurrence is declared an individual.

get_initial

Return whether the feature’s value is an initial value (:= <value>).

get_language

Return the language the representation’s text is written in.

get_locale

Return the comment’s locale.

get_loop_body

Return the loop’s body: the action whose members are the { ... } of the while, loop or for.

get_loop_variable

Return the for loop’s variable: the reference usage declared between for and in, which the body’s expressions refer to.

get_member

Return the member= value the declaration was written with: one of "return", "entry", "do", "exit", "else", "then", "body", "variable", or None for the plain declaration.

get_metadata

Return the default reading of metadata=, by the kind of element:

get_multiplicity

Return the multiplicity the feature declares (its [...] clause).

get_name

Return the default reading of name=, by the kind of element:

get_negated

Return whether the assertion is declared not.

get_nonunique

Return whether the feature is declared nonunique.

get_ordered

Return whether the feature is declared ordered.

get_parallel

Return whether the state is declared parallel.

get_payload

Return the send action’s payload argument as a template (written after send), or None where the action carries none.

get_payload_default

Return what payload_default= wrote, read by the kind of element:

get_payload_defined_by

Return what payload_defined_by= wrote, read by the kind of element:

get_payload_equals

Return what payload_equals= wrote, read by the kind of element:

get_payload_initial

Return whether the value of the payload of an accept action or a transition’s trigger is an initial value (:= <value>).

get_payload_multiplicity

Return what payload_multiplicity= wrote, read by the kind of element:

get_payload_name

Return what payload_name= wrote, read by the kind of element:

get_payload_ordered

Return what payload_ordered= wrote, read by the kind of element:

get_payload_parameter

Return the accept action’s payload parameter: the reference usage declared after accept, whose name and typing payload_name and payload_defined_by set.

get_payload_redefines

Return what payload_redefines= wrote, read by the kind of element:

get_payload_references

Return what payload_references= wrote, read by the kind of element:

get_payload_short_name

Return what payload_short_name= wrote, read by the kind of element:

get_payload_subsets

Return what payload_subsets= wrote, read by the kind of element:

get_performed_action

Return the ActionUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_portion

Return the portion prefix the occurrence usage is declared with.

get_prefix

Return every prefix= value the element holds: of "abstract", "variation", "end", those whose property the model sets. Several can hold at once where the model derives one from another: a variation is abstract too (variation part p; holds "abstract" and "variation"), and every message is abstract (message m; holds "abstract", SysML 7.16.2).

get_receiver

Return the action’s receiver argument as a template – the to clause of a send, the via clause of an accept or of a transition’s trigger – or None where the action has no (or an empty) receiver parameter.

get_recursive

Return whether the import is recursive (its ::** suffix).

get_redefines

Return the features this one redefines (its :>> clause).

get_ref

Return whether the usage is a reference rather than composite.

get_references

Return the feature this one references (its ::> clause), as it went into references=: the feature, or the chain() template of a feature chain.

get_rendering

Return the RenderingUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no ViewRenderingMembership owns the usage: the property is that membership’s.

get_required_constraint

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where the membership’s kind is not syside.RequirementConstraintKind.Requirement: the member was written with another keyword.

get_result

Return the result expression as a template – the bare expression the body ends with – or None on an element without one.

get_satisfied_by

Return the feature the usage’s by clause references, or None where it has no by clause. A chain comes back as the chain() template of its chained features, as it went into satisfied_by=.

get_satisfied_requirement

Return the RequirementUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_sender

Return the send action’s via argument as a template, or None where the action has no (or an empty) sender parameter.

get_sequence

Return the for loop’s sequence argument as a template (written after in), or None where the loop carries none.

get_short_name

Return what short_name= wrote, read by the kind of element:

get_source

Return what source= wrote, read by the kind of element:

get_source_multiplicity

Return the multiplicity of the connector’s source end.

get_source_name

Return the declared name of the connector’s source end.

get_specializes

Return the classifiers the definition specializes (its :> clause).

get_standard

Return whether the library package is declared a standard library.

get_subsets

Return the features this one subsets (its :>/subsets clause).

get_suppliers

Return the dependency’s supplier elements (written after to).

get_target

Return what target= wrote, read by the kind of element:

get_target_multiplicity

Return the multiplicity of the connector’s target end.

get_target_name

Return the declared name of the connector’s target end.

get_target_object

Return the assignment’s expression target as a template, or None where it has none or its target is a feature reference, which get_assigned_target() gives as the first feature of its chain().

get_terminated_occurrence

Return the node’s terminated-occurrence argument as a template, or None on a bare terminate;.

get_then_body

Return the if action’s then body: the action whose members are the { ... } after the condition.

get_trigger

Return the time or change trigger of an accept action or a transition’s trigger – at <time>, after <delay>, when <condition> – as the at() / after() / when() template that writes it.

get_until

Return the loop’s until condition as a template, or None where the loop has no until clause.

get_use_case_included

Return the UseCaseUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

get_variable_name

Return the declared name of the for loop’s variable, or None where the variable is anonymous or absent.

get_variant

Return whether the declaration was written with variant=True.

get_verified_requirement

Return the RequirementUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no RequirementVerificationMembership owns the usage: the property is that membership’s.

get_visibility

Return what visibility= wrote, read by the kind of element:

add_about

Add one Annotation from annotating to annotated.

add_clients

Add one client reference to dependency.

add_conjugates

Add one ConjugatedPortTyping from feature to conjugate.

add_cross_subsets

Add one Subsetting from the end’s owned cross feature to superset.

add_defined_by

Add one FeatureTyping from feature to definition.

add_filters

Add to what filters= wrote, by the kind of element:

add_payload_defined_by

Add to what payload_defined_by= wrote, by the kind of element:

add_payload_redefines

Add to what payload_redefines= wrote, by the kind of element:

add_payload_subsets

Add to what payload_subsets= wrote, by the kind of element:

add_redefines

Add one Redefinition from feature to redefined.

add_specializes

Add one Subclassification from definition to superclassifier.

add_subsets

Add one Subsetting from feature to superset.

add_suppliers

Add one supplier reference to dependency.

remove_about

Remove the declared Annotation``s from ``annotating to annotated.

remove_clients

Remove every client reference from dependency to client.

remove_conjugates

Remove the declared ConjugatedPortTyping``s from ``feature to conjugate.

remove_cross_subsets

Remove the declared Subsetting``s from the end's owned cross feature to ``superset.

remove_defined_by

Remove the declared FeatureTyping``s from ``feature to definition.

remove_filters

Remove from what filters= wrote, by the kind of element:

remove_payload_defined_by

Remove from what payload_defined_by= wrote, by the kind of element:

remove_payload_redefines

Remove from what payload_redefines= wrote, by the kind of element:

remove_payload_subsets

Remove from what payload_subsets= wrote, by the kind of element:

remove_redefines

Remove the declared Redefinition``s from ``feature to redefined.

remove_specializes

Remove the declared Subclassification``s from ``definition to superclassifier.

remove_subsets

Remove the declared Subsetting``s from ``feature to superset.

remove_suppliers

Remove every supplier reference from dependency to supplier.

set_assigned_value

Set the assignment action’s value argument.

set_body

Set the annotating element’s text.

set_condition

Rewrite what condition= wrote, by the kind of node:

set_constant

Declare the feature constant, or stop declaring it so.

set_cross_multiplicity

Rewrite the multiplicity of the end’s owned cross feature; None removes it.

set_cross_name

Set the declared name of the end’s owned cross feature.

set_cross_nonunique

Declare the end’s owned cross feature nonunique, or stop declaring it so.

set_cross_ordered

Declare the end’s owned cross feature ordered, or stop declaring it so.

set_cross_short_name

Set the declared short name of the end’s owned cross feature.

set_default

Declare the feature’s value a default value, or a fixed one.

set_derived

Declare the feature derived, or stop declaring it so.

set_direction

Set the usage’s direction (the in, out or inout before it).

set_else_body

Add or remove the if action’s else body.

set_else_if

Set the condition of the if action’s else if branch, nesting an if action there if there is none.

set_equals

Set the feature’s value expression.

set_guard

Set the transition’s guard – the expression written after if.

set_import_all

Set whether the import imports members whatever their visibility (its all keyword).

set_imported

Rewrite what imported= wrote, by the kind of element:

set_individual

Declare the occurrence an individual, or stop declaring it so.

set_initial

Declare the feature’s value an initial value (:=), or a bound one (=).

set_language

Set the language the representation’s text is written in.

set_locale

Set the comment’s locale.

set_multiplicity

Rewrite the feature’s [...] clause; None removes it.

set_name

Rewrite what name= wrote, by the kind of element:

set_negated

Declare the assertion not, or stop declaring it so.

set_nonunique

Declare the feature nonunique, or stop declaring it so.

set_ordered

Declare the feature ordered, or stop declaring it so.

set_parallel

Declare the state parallel, or stop declaring it so.

set_payload

Set the send action’s payload argument.

set_payload_default

Rewrite what payload_default= wrote, by the kind of element:

set_payload_equals

Rewrite what payload_equals= wrote, by the kind of element:

set_payload_initial

Declare the value of the payload of an accept action or a transition’s trigger an initial value (:=), or a bound one (=).

set_payload_multiplicity

Rewrite what payload_multiplicity= wrote, by the kind of element:

set_payload_name

Rewrite what payload_name= wrote, by the kind of element:

set_payload_ordered

Rewrite what payload_ordered= wrote, by the kind of element:

set_payload_short_name

Rewrite what payload_short_name= wrote, by the kind of element:

set_portion

Declare the occurrence usage a snapshot or a timeslice, or neither.

set_prefix

Rewrite the prefix= value in place; None removes it.

set_receiver

Set the action’s receiver argument – the to clause of a send, the via clause of an accept or of a transition’s trigger.

set_recursive

Set whether the import is recursive (its ::** suffix).

set_ref

Make the usage a reference, or composite.

set_result

Set the result expression – the bare expression the body ends with.

set_satisfied_by

Set the usage’s by clause, or remove it with None.

set_sender

Set the send action’s via argument.

set_sequence

Set the for loop’s sequence argument.

set_short_name

Rewrite what short_name= wrote, by the kind of element:

set_source_multiplicity

Rewrite the multiplicity of the connector’s source end; None removes it.

set_source_name

Rewrite the declared name of the connector’s source end; None removes it.

set_standard

Declare the library package a standard library, or stop declaring it so.

set_target_multiplicity

Rewrite the multiplicity of the connector’s target end; None removes it.

set_target_name

Rewrite the declared name of the connector’s target end; None removes it.

set_terminated_occurrence

Set the node’s terminated-occurrence argument.

set_trigger

Set the time or change trigger of an accept action or a transition’s trigger; None removes it.

set_until

Set the loop’s until condition.

set_variable_name

Set the declared name of the for loop’s variable.

set_visibility

Rewrite what visibility= wrote, by the kind of element:


Functions

get_about(annotating: syside.AnnotatingElement) → list[syside.Element]

Return the elements the annotating element is about (its about clause).

One entry per Annotation the element declares itself. An annotating element with no about clause annotates its owner, and that is not an Annotation of its own, so this returns an empty list for it. That holds in a relationship’s body too, where the owner is the Annotation relating the element to the relationship.

Parameters:

annotating – The comment, metadata usage or other annotating element to read.

Returns:

The annotated elements, always as a list – including when there are zero or one of them.

get_asserted_constraint(assertion: syside.AssertConstraintUsage) → syside.ConstraintUsage | syside.experimental.expressions.FeatureChainTemplate | None

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The ConstraintUsage to be performed by the AssertConstraintUsage. It is the referenceFeature of the ownedReferenceSubsetting for the AssertConstraintUsage, if there is one, and, otherwise, the AssertConstraintUsage itself.

There is no set_asserted_constraint: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

assertion – The assertion to read.

Returns:

The referenced ConstraintUsage (a chain() for a chained reference), or None where the member is of another kind.

get_assigned_target(assignment: syside.AssignmentActionUsage) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return what follows assign, as it went into assigned_target=: the feature assigned to, or a chain() of the target object and the feature assigned to where the target is a feature reference, or of the chained feature assigned to after an expression target (get_target_object()).

There is no set_assigned_target: replace the assignment by removing it and creating another.

Parameters:

assignment – The assignment action to read.

Returns:

The feature or chain, or None if the reference resolves to nothing.

get_assigned_value(assignment: syside.AssignmentActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the assignment action’s value argument as a template (written after :=), or None where the action carries none.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

assignment – The assignment action to read the value argument of.

Returns:

The template for the action’s value argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_assumed_constraint(usage: syside.ConstraintUsage) → syside.ConstraintUsage | None

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where the membership’s kind is not syside.RequirementConstraintKind.Assumption: the member was written with another keyword.

The ConstraintUsage that is referenced through this RequirementConstraintMembership. It is the referencedFeature of the ownedReferenceSubsetting of the ownedConstraint, if there is one, and, otherwise, the ownedConstraint itself.

There is no set_assumed_constraint: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced ConstraintUsage, or None where the member is of another kind.

get_body(annotating: syside.Comment | syside.TextualRepresentation) → str

Return the annotating element’s text.

The text comes back without the /* */ delimiters, in exactly the form body= accepts. For a textual representation that is the represented text, for a comment its prose.

Parameters:

annotating – The comment or textual representation to read the text of.

Returns:

The element’s text.

get_clients(dependency: syside.Dependency) → list[syside.Element]

Return the dependency’s client elements (written before to).

Parameters:

dependency – The dependency to read.

Returns:

The client elements, always as a list – including when there is only one of them.

get_condition(node: syside.IfActionUsage | syside.WhileLoopActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return what condition= wrote, read by the kind of node:

  • On IfActionUsage: Return the if action’s condition as a template – the expression after if – or None if the slot is empty.

  • On WhileLoopActionUsage: Return the while loop’s condition as a template – the expression after while – or None on a loop without one.

A condition that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

node – The element to read.

get_conjugates(feature: syside.Feature) → list[syside.ConjugatedPortDefinition]

Return the conjugated port definitions the feature is typed by (: ~Q).

One entry per ConjugatedPortTyping the feature declares itself; plain FeatureTyping``s are not included, although a ``ConjugatedPortTyping is one – : Q is read by get_defined_by. Inherited and implied typings are not included either.

Parameters:

feature – The feature to read the conjugated typings of.

Returns:

The conjugates, always as a list – including when the feature declares zero or one conjugated typing.

get_constant(feature: syside.Feature) → bool

Return whether the feature is declared constant.

Parameters:

feature – The feature to read the flag of.

Returns:

True if the feature is constant.

get_cross_multiplicity(end: syside.Feature) → syside.experimental.expressions.MultiplicityTemplate | None

Return the multiplicity of the end’s owned cross feature (the [...] after end), as the bounds() template that writes it.

Parameters:

end – The end feature to read.

Returns:

The cross multiplicity, or None if the cross feature declares none or the end has no owned cross feature.

Raises:

UndecodableExpression – If a bound is not an integer literal, * or a feature reference.

get_cross_name(end: syside.Feature) → str | None

Return the declared name of the end’s owned cross feature.

Parameters:

end – The end feature to read.

Returns:

The cross feature’s declared name, or None if it is anonymous or the end has no owned cross feature.

get_cross_nonunique(end: syside.Feature) → bool

Return whether the end’s owned cross feature is declared nonunique.

Parameters:

end – The end feature to read.

Returns:

True if the cross feature carries the nonunique keyword; False if it does not or the end has no owned cross feature.

get_cross_ordered(end: syside.Feature) → bool

Return whether the end’s owned cross feature is declared ordered.

Parameters:

end – The end feature to read.

Returns:

True if the cross feature carries the ordered keyword; False if it does not or the end has no owned cross feature.

get_cross_short_name(end: syside.Feature) → str | None

Return the declared short name of the end’s owned cross feature.

Parameters:

end – The end feature to read.

Returns:

The cross feature’s declared short name, or None if it declares none or the end has no owned cross feature.

get_cross_subsets(end: syside.Feature) → list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]

Return the features the end’s owned cross feature subsets.

As get_subsets reads them, of the cross feature rather than the end.

Parameters:

end – The end feature to read.

Returns:

The cross feature’s declared supersets, [] if the end has no owned cross feature.

get_crosses(feature: syside.Feature) → syside.experimental.expressions.FeatureChainTemplate | None

Return the feature chain this feature crosses (its => rider).

There is no set_crossed_feature: the core exposes no in-place retarget for a cross subsetting. Replace the crossing by removing the feature and creating another with the crossing it should have.

The chain comes back as the chain() template of its chained features, as it went into crosses=.

Parameters:

feature – The feature to read the crossing of.

Returns:

The crossed feature chain, or None where the feature declares no crossing.

get_default(feature: syside.Feature) → bool

Return whether the feature’s value is a default value (default = <value>).

Parameters:

feature – The feature to read.

Returns:

True if the feature has a value declared default; False if its value is fixed or it has none.

get_defined_by(feature: syside.Feature, *, include_conjugations: bool = ...) → list[syside.Classifier]

Return the types the feature is defined by (its :/defined by clause).

One entry per FeatureTyping the feature declares itself, the ConjugatedPortTyping of a : ~Q included; inherited and implied typings are not included.

Parameters:
  • feature – The feature to read the typings of.

  • include_conjugations – False leaves out the conjugated port definitions of : ~Q typings (what conjugates= wrote), reading what defined_by= wrote alone.

Returns:

The declared types, always as a list – including when the feature declares zero or one typing.

get_derived(feature: syside.Feature) → bool

Return whether the feature is declared derived.

Parameters:

feature – The feature to read the flag of.

Returns:

True if the declaration carries the derived prefix.

get_direction(usage: syside.Usage) → syside.FeatureDirectionKind | None

Return the usage’s effective direction: the in, out or inout before it, or Out for a return parameter, whose direction is fixed to out (KerML 8.3.4.7.8) whether or not the text says so, and In for an else action, a ParameterMembership’s member parameter (KerML validateParameterMembershipParameterDirection).

Parameters:

usage – The usage to read.

Returns:

The direction, or None if the usage has none.

get_effect(transition: syside.TransitionUsage, *, as_performed_action: bool = ...) → syside.ActionUsage | None

Return the action the transition performs on firing (its do clause).

There is no set_effect: the core exposes no in-place retarget for the perform usage’s reference. Replace the transition by removing it and creating another.

By default the entry is the PerformActionUsage the do clause created; as_performed_action=True reads the action it references, which is what went into effect=. A do clause declaring an action of its own references none, and reads as that action either way.

Parameters:
  • transition – The transition usage to read.

  • as_performed_action – True reads the action the perform usage references (what effect= took) instead of the perform usage.

Returns:

The effect action, or None if the transition declares none.

get_else_body(if_action: syside.IfActionUsage, *, as_flag: Literal[False] = ...) → syside.ActionUsage | None

Return the if action’s else action, or None where the action has no else branch. An else if comes back as the nested IfActionUsage, which is an action usage; narrow it with try_cast.

Parameters:
  • if_action – The if action to read the else body of.

  • as_flag – True reads whether the if action has an else { ... } body (what else_body= took): False for no else branch and for an else if.

Returns:

The body action, an owner for the ordinary constructors, or None; under as_flag=True, whether there is an else { ... } body.

get_else_body(if_action: syside.IfActionUsage, *, as_flag: Literal[True]) → bool
get_else_body(if_action: syside.IfActionUsage, *, as_flag: bool = ...) → syside.ActionUsage | bool | None
get_else_if(if_action: syside.IfActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the condition of the else if branch as a template, or None where the action has no else branch, its else branch is a plain body, or the nested condition slot is empty.

The nested if action itself is get_else_body(), narrowed to IfActionUsage; its bodies are read as the outer one’s.

A condition that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

if_action – The if action to read the else if condition of.

Returns:

The template for the nested condition, or None.

get_ends(connector: syside.ConnectorAsUsage) → list[syside.experimental.expressions.ConnectorEndTemplate]

Return every declared end of the connector, in order.

There is no set_ends: the core exposes no in-place retarget for a connector end’s reference. Replace the connector by removing it and creating another; an end’s multiplicity and name on the first two ends are set_source_multiplicity’s and its siblings’.

Each end as the connector_end() template that writes it: the referenced feature, the end’s multiplicity and its name. A binary connector’s two ends are read too; the first is get_source’s.

Parameters:

connector – The connector to read.

Returns:

The ends, always as a list – empty for a connector declaring none.

Raises:

ValueError – If an end’s reference resolves to no feature.

get_equals(feature: syside.Feature) → syside.experimental.expressions.ExpressionTemplate | None

Return the feature’s value expression as a template, or None if it has none.

attribute x = 3; gives literal(3), attribute z = x; gives ref(x), and attribute y = 2 * 3; gives literal(2) * literal(3). A value expression that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

feature – The feature to read the value expression of.

Returns:

The template for the feature’s value expression, or None if it has none.

Raises:

UndecodableExpression – If no template describes the value expression.

get_event_occurrence(usage: syside.EventOccurrenceUsage) → syside.OccurrenceUsage | None

Return the OccurrenceUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The OccurrenceUsage referenced as an event by this EventOccurrenceUsage. It is the referenceFeature of the ownedReferenceSubsetting for the EventOccurrenceUsage, if there is one, and, otherwise, the EventOccurrenceUsage itself.

There is no set_event_occurrence: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced OccurrenceUsage, or None where the member is of another kind.

get_exhibited_state(usage: syside.ExhibitStateUsage) → syside.StateUsage | None

Return the StateUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The StateUsage to be exhibited by the ExhibitStateUsage. It is the performedAction of the ExhibitStateUsage considered as a PerformActionUsage, which must be a StateUsage.

There is no set_exhibited_state: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced StateUsage, or None where the member is of another kind.

get_filters(element: syside.Package | syside.ViewDefinition | syside.ViewUsage | syside.Import) → list[syside.experimental.expressions.ExpressionTemplate]

Return what filters= wrote, read by the kind of element:

  • On Package: Return the package’s filter conditions as templates, in the order they are written.

    One entry per filter member the package declares. A condition that no template describes raises UndecodableExpression; read those with the low-level API.

  • On ViewDefinition or ViewUsage: Return the view’s own filter conditions as templates, in the order they are written.

    One entry per filter member the view declares itself; the conditions a view usage inherits from its view definition are not included. A condition that no template describes raises UndecodableExpression; read those with the low-level API.

  • On Import: Return the import’s filter conditions (import P::*[c];) as templates, in the order they are written; empty on an unfiltered import.

    A condition that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

element – The element to read.

get_for_(membership: syside.Membership) → syside.Element | None

Return the element an alias names, or the action an initial node names (first <action>;).

There is no set_for_: the core exposes no write for a membership’s member element and no way to retarget one in place. Replace an alias or an initial node by removing it and creating another.

Parameters:

membership – The alias or initial node to read.

Returns:

The named element, or None if the name resolves to nothing.

get_framed_concern(usage: syside.ConcernUsage) → syside.ConcernUsage | None

Return the ConcernUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no FramedConcernMembership owns the usage: the property is that membership’s.

The ConcernUsage that is referenced through this FramedConcernMembership. It is the referencedConstraint of the FramedConcernMembership considered as a RequirementConstraintMembership, which must be a ConcernUsage.

There is no set_framed_concern: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced ConcernUsage, or None where the member is of another kind.

get_guard(transition: syside.TransitionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the transition’s guard as a template – the expression after if – or None on a transition without one.

A guard that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

transition – The transition usage to read the guard of.

Returns:

The template for the guard, or None if there is none.

Raises:

UndecodableExpression – If no template describes the guard.

get_import_all(import_: syside.Import) → bool

Return whether the import imports members whatever their visibility (its all keyword).

private import all P::*; gives True. An expose always does, with no keyword written (SysML validateExposeIsImportAll).

Parameters:

import – The import or expose to read.

Returns:

True if private and protected members are imported too.

get_imported(element: syside.MembershipImport) → syside.Membership | None

Return what imported= wrote, read by the kind of element:

  • On MembershipImport: Return the membership the import imports.

  • On NamespaceImport: Return what the import imports: the namespace every member of which it imports, or, on a filtered import, what the import inside its filter package imports – a namespace, or the membership of import P::X[c];.

Parameters:

element – The element to read.

get_imported(element: syside.NamespaceImport) → syside.Namespace | syside.Membership | None
get_individual(element: syside.OccurrenceDefinition | syside.OccurrenceUsage) → bool

Return whether the occurrence is declared an individual.

Parameters:

element – The occurrence definition or usage to read the flag of.

Returns:

True if the declaration carries the individual prefix.

get_initial(feature: syside.Feature) → bool

Return whether the feature’s value is an initial value (:= <value>).

Parameters:

feature – The feature to read.

Returns:

True if the feature has a value written with :=; False if its value is bound with = or it has none.

get_language(representation: syside.TextualRepresentation) → str

Return the language the representation’s text is written in.

Parameters:

representation – The textual representation to read the language of.

Returns:

The language named by the language clause.

get_locale(comment: syside.Comment) → str | None

Return the comment’s locale.

Parameters:

comment – The comment to read the locale of.

Returns:

The locale, or None if the comment declares none.

get_loop_body(loop: syside.LoopActionUsage) → syside.ActionUsage

Return the loop’s body: the action whose members are the { ... } of the while, loop or for.

The body is populated: pass it as the owner of the ordinary constructors – new_action(get_loop_body(...), "a") – exactly as any action body. It is created with the node; a declared body takes its place through new_action(loop, ..., member="body").

Parameters:

loop – The while or for loop to read the body of.

Returns:

The body action, an owner for the ordinary constructors.

Raises:

ValueError – If the loop has no body – one not built by new_while() or new_for(); the grammar makes the body mandatory.

get_loop_variable(loop: syside.ForLoopActionUsage) → syside.ReferenceUsage

Return the for loop’s variable: the reference usage declared between for and in, which the body’s expressions refer to.

The variable is created with the loop; its name is written through set_name() on it, and a declared variable takes its place through new_ref(loop, ..., member="variable").

Parameters:

loop – The for loop to read the variable of.

Returns:

The loop variable.

Raises:

ValueError – If the loop has no variable – one not built by new_for(); the grammar makes the variable mandatory.

get_member(element: syside.Usage) → Literal[return, entry, do, exit, else, then, body, variable] | None

Return the member= value the declaration was written with: one of "return", "entry", "do", "exit", "else", "then", "body", "variable", or None for the plain declaration.

There is no set_member: the value is what makes the member the construct it is, and changing it means creating another member.

Parameters:

element – The element to read.

Returns:

The member= value, or None.

get_metadata(element: syside.Package, *, as_definitions: Literal[False] = ...) → list[syside.MetadataFeature | syside.MetadataUsage]

Return the default reading of metadata=, by the kind of element:

  • On Package: Return the metadata usages the package’s declaration is prefixed with.

    One entry per #M prefix. By default the entries are the metadata usages the prefixes created; as_definitions=True reads the metaclasses they name, which is what went into metadata=. A metadata : M; body member is not a prefix and is not returned.

  • On Feature: Return the metadata usages the usage’s declaration is prefixed with.

    One entry per #M prefix. By default the entries are the metadata usages the prefixes created; as_definitions=True reads the metaclasses they name, which is what went into metadata=. A metadata : M; body member is not a prefix and is not returned.

  • On Dependency: Return the metadata usages the dependency’s declaration is prefixed with.

    One entry per #M prefix, as on a definition. A dependency is a relationship and owns no membership, so the grammar relates its prefixes by Annotation; an annotating element written in the dependency’s own body (dependency d from A to B { doc /* ... */ metadata M; }) is related the same way and is not returned, since it is not a prefix.

  • On Definition: Return the metadata usages the definition’s declaration is prefixed with.

    One entry per #M prefix. By default the entries are the metadata usages the prefixes created; as_definitions=True reads the metaclasses they name, which is what went into metadata=. A metadata : M; body member is not a prefix and is not returned.

There is no set_ for the prefixes: the core exposes the prefixes container itself, so a prefix is added by appending to it and removed by removing its relationship, exactly as metadata= does at construction.

Parameters:
  • element – The element to read.

  • as_definitions – True reads the metaclass each prefix names (what metadata= took) instead of the metadata usage the prefix created.

get_metadata(element: syside.Package, *, as_definitions: Literal[True]) → list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Package, *, as_definitions: bool = ...) → list[syside.MetadataFeature | syside.MetadataUsage] | list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Feature, *, as_definitions: Literal[False] = ...) → list[syside.MetadataFeature | syside.MetadataUsage]
get_metadata(element: syside.Feature, *, as_definitions: Literal[True]) → list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Feature, *, as_definitions: bool = ...) → list[syside.MetadataFeature | syside.MetadataUsage] | list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Dependency, *, as_definitions: Literal[False] = ...) → list[syside.MetadataFeature | syside.MetadataUsage]
get_metadata(element: syside.Dependency, *, as_definitions: Literal[True]) → list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Dependency, *, as_definitions: bool = ...) → list[syside.MetadataFeature | syside.MetadataUsage] | list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Definition, *, as_definitions: Literal[False] = ...) → list[syside.MetadataFeature | syside.MetadataUsage]
get_metadata(element: syside.Definition, *, as_definitions: Literal[True]) → list[syside.Metaclass | syside.MetadataDefinition]
get_metadata(element: syside.Definition, *, as_definitions: bool = ...) → list[syside.MetadataFeature | syside.MetadataUsage] | list[syside.Metaclass | syside.MetadataDefinition]
get_multiplicity(feature: syside.Feature) → syside.experimental.expressions.MultiplicityTemplate | None

Return the multiplicity the feature declares (its [...] clause).

The bounds as written, as the bounds() template that writes them. A multiplicity the feature inherits, and the 1..1 a feature without one defaults to, are not read; the evaluated integer bounds are multiplicity_bounds()’s.

Parameters:

feature – The feature to read the multiplicity of.

Returns:

The multiplicity, or None if the feature declares none.

Raises:

UndecodableExpression – If a bound is not an integer literal, * or a feature reference.

get_name(element: syside.Element, *, only_long: bool = ...) → str | None

Return the default reading of name=, by the kind of element:

  • On Membership: Return the alias membership’s member name, else its member short name.

    This reads the abstract syntax’s memberName, falling back to memberShortName: the names the alias gives its member element in the owning namespace, not names on that element.

  • On Element: Return the element’s declared long name, else its declared short name.

    This reads the abstract syntax’s declaredName, falling back to declaredShortName where no long name is declared, so an element declared as attribute <mass>; yields "mass". Inherited names are not considered: for the effective name name resolution sees, use element.name.

Parameters:
  • element – The element to read.

  • only_long – True reads the declared long name alone, with no fallback to the short name: what name= wrote.

get_negated(assertion: syside.AssertConstraintUsage | syside.SatisfyRequirementUsage) → bool

Return whether the assertion is declared not.

Parameters:

assertion – The assert constraint or satisfy requirement usage to read.

Returns:

True if the declaration carries the not keyword.

get_nonunique(feature: syside.Feature) → bool

Return whether the feature is declared nonunique.

The keyword writes False into is_unique; this returns its negation.

Parameters:

feature – The feature to read the flag of.

Returns:

True if the declaration carries the nonunique keyword.

get_ordered(feature: syside.Feature) → bool

Return whether the feature is declared ordered.

Parameters:

feature – The feature to read the flag of.

Returns:

True if the declaration carries the ordered keyword.

get_parallel(state: syside.StateDefinition | syside.StateUsage) → bool

Return whether the state is declared parallel.

Parameters:

state – The state definition or usage to read the flag of.

Returns:

True if the declaration carries the parallel keyword.

get_payload(send: syside.SendActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the send action’s payload argument as a template (written after send), or None where the action carries none.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

send – The send action to read the payload argument of.

Returns:

The template for the action’s payload argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_payload_default(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → bool

Return what payload_default= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return whether the value of the payload of an accept action, a transition’s trigger or a flow is a default value (default = <value>).

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return whether the value of the payload of an accept action, a transition’s trigger or a flow is a default value (default = <value>).

Parameters:

element – The element to read.

get_payload_defined_by(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → list[syside.Classifier]

Return what payload_defined_by= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the types the payload of an accept action, a transition’s trigger or a flow is defined by (its :/defined by clause).

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the types the payload of an accept action, a transition’s trigger or a flow is defined by (its :/defined by clause).

One entry per FeatureTyping the payload declares itself; inherited and implied typings are not included. An element without a payload gives [].

Parameters:

element – The element to read.

get_payload_equals(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return what payload_equals= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the value of the payload of an accept action, a transition’s trigger or a flow (its = clause) as a template.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the value of the payload of an accept action, a transition’s trigger or a flow (its = clause) as a template.

accept x : T = t; gives ref(t). A time or change trigger, which is the payload’s value too, is read by get_trigger and gives None here.

Parameters:

element – The element to read.

get_payload_initial(element: syside.AcceptActionUsage | syside.TransitionUsage) → bool

Return whether the value of the payload of an accept action or a transition’s trigger is an initial value (:= <value>).

A flow’s, succession flow’s or message’s payload takes no :=: an initial value needs a feature that may vary in time, which a flow’s payload is not (KerML validateFeatureValueIsInitial), so the text is invalid wherever the flow is placed and this takes no flow.

Parameters:

element – The accept action or transition to read.

Returns:

True if the payload has a value written with :=; False if its value is bound with =, it has a time or change trigger or no value, or the element has no payload.

get_payload_multiplicity(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → syside.experimental.expressions.MultiplicityTemplate | None

Return what payload_multiplicity= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the multiplicity the payload of an accept action, a transition’s trigger or a flow declares.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the multiplicity the payload of an accept action, a transition’s trigger or a flow declares.

The bounds as written, as the bounds() template that writes them.

Parameters:

element – The element to read.

get_payload_name(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → str | None

Return what payload_name= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the declared name of the payload of an accept action, a transition’s trigger or a flow, or None where the payload is anonymous or absent.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the declared name of the payload of an accept action, a transition’s trigger or a flow, or None where the payload is anonymous or absent.

Parameters:

element – The element to read.

get_payload_ordered(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → bool

Return what payload_ordered= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return whether the payload of an accept action, a transition’s trigger or a flow is declared ordered.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return whether the payload of an accept action, a transition’s trigger or a flow is declared ordered.

Parameters:

element – The element to read.

get_payload_parameter(accept: syside.AcceptActionUsage) → syside.ReferenceUsage

Return the accept action’s payload parameter: the reference usage declared after accept, whose name and typing payload_name and payload_defined_by set.

There is no set_payload_parameter: the parameter is created with the action and named and typed through set_name and add_defined_by on the result of this getter.

Parameters:

accept – The accept action to read the payload parameter of.

Returns:

The payload parameter.

Raises:

ValueError – If the action has no payload parameter – one not built by new_accept(); the grammar makes it mandatory.

get_payload_redefines(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]

Return what payload_redefines= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow redefines (its :>> clause).

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow redefines (its :>> clause).

As get_redefines reads them, of the payload rather than the element: one entry per Redefinition the payload declares itself, the implied redefinition of the library’s payload feature not included.

Parameters:

element – The element to read.

get_payload_references(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return what payload_references= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the feature the payload of an accept action, a transition’s trigger or a flow references (its ::> clause), as it went into payload_references=: the feature, or the chain() template of a feature chain.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the feature the payload of an accept action, a transition’s trigger or a flow references (its ::> clause), as it went into payload_references=: the feature, or the chain() template of a feature chain.

There is no set_payload_references: the core exposes no in-place retarget for a reference subsetting. Replace the element by removing it and creating another whose payload has the reference it should have.

Parameters:

element – The element to read.

get_payload_short_name(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → str | None

Return what payload_short_name= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the declared short name of the payload of an accept action, a transition’s trigger or a flow: the <s> of accept <s> x : T;.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the declared short name of the payload of an accept action, a transition’s trigger or a flow: the <s> of accept <s> x : T;.

Parameters:

element – The element to read.

get_payload_subsets(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage) → list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]

Return what payload_subsets= wrote, read by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow subsets (its :> clause).

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow subsets (its :> clause).

As get_subsets reads them, of the payload rather than the element: the redefinitions, reference subsettings and implied subsettings are not included.

Parameters:

element – The element to read.

get_performed_action(usage: syside.PerformActionUsage) → syside.ActionUsage | None

Return the ActionUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The ActionUsage to be performed by this PerformedActionUsage. It is the eventOccurrence of the PerformActionUsage considered as an EventOccurrenceUsage, which must be an ActionUsage.

There is no set_performed_action: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced ActionUsage, or None where the member is of another kind.

get_portion(occurrence: syside.OccurrenceUsage) → Literal[snapshot, timeslice] | None

Return the portion prefix the occurrence usage is declared with.

Parameters:

occurrence – The occurrence usage to read the prefix of.

Returns:

"snapshot" or "timeslice", the keyword the declaration carries, or None if it carries neither.

get_prefix(element: syside.Definition | syside.Usage) → frozenset[syside.experimental.query.Prefix]

Return every prefix= value the element holds: of "abstract", "variation", "end", those whose property the model sets. Several can hold at once where the model derives one from another: a variation is abstract too (variation part p; holds "abstract" and "variation"), and every message is abstract (message m; holds "abstract", SysML 7.16.2).

Parameters:

element – The element to read.

Returns:

The values held; empty for the plain declaration.

get_receiver(action: syside.SendActionUsage | syside.AcceptActionUsage | syside.TransitionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the action’s receiver argument as a template – the to clause of a send, the via clause of an accept or of a transition’s trigger – or None where the action has no (or an empty) receiver parameter.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

action – The send action, accept action or transition to read the receiver argument of.

Returns:

The template for the action’s receiver argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_recursive(import_: syside.Import) → bool

Return whether the import is recursive (its ::** suffix).

On a filtered import (import P::*::**[c];) the suffix belongs to the import inside the filter package, which is what this reads.

Parameters:

import – The import to read.

Returns:

True if the import reaches into nested namespaces recursively.

get_redefines(feature: syside.Feature) → list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]

Return the features this one redefines (its :>> clause).

One entry per Redefinition the feature declares itself; inherited and implied redefinitions are not included. A redefinition of a feature chain comes back as the chain() template of its chained features, as it went into redefines=.

Parameters:

feature – The feature to read the redefinitions of.

Returns:

The redefined features, always as a list – including when the feature declares zero or one redefinition.

get_ref(usage: syside.Usage) → bool

Return whether the usage is a reference rather than composite.

A written ref always makes it one; without the keyword the spec still makes a usage a reference where it is directed, an end, owned by no type or by an attribute, an attribute itself, or a port outside a port definition (SysML 8.2.2.6.2, note 1), and this returns True there too.

Parameters:

usage – The usage to read.

Returns:

True if the usage is a reference, False if composite.

get_references(feature: syside.Feature) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return the feature this one references (its ::> clause), as it went into references=: the feature, or the chain() template of a feature chain.

There is no set_references: the core exposes no in-place retarget for a reference subsetting. Replace the feature by removing it and creating another with the reference it should have.

Parameters:

feature – The feature to read the reference of.

Returns:

The referenced feature or chain, or None where the feature declares no ReferenceSubsetting.

get_rendering(usage: syside.RenderingUsage) → syside.RenderingUsage | None

Return the RenderingUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no ViewRenderingMembership owns the usage: the property is that membership’s.

The RenderingUsage that is referenced through this ViewRenderingMembership. It is the referencedFeature of the ownedReferenceSubsetting for the ownedRendering, if there is one, and, otherwise, the ownedRendering itself.

There is no set_rendering: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced RenderingUsage, or None where the member is of another kind.

get_required_constraint(usage: syside.ConstraintUsage) → syside.ConstraintUsage | None

Return the ConstraintUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where the membership’s kind is not syside.RequirementConstraintKind.Requirement: the member was written with another keyword.

The ConstraintUsage that is referenced through this RequirementConstraintMembership. It is the referencedFeature of the ownedReferenceSubsetting of the ownedConstraint, if there is one, and, otherwise, the ownedConstraint itself.

There is no set_required_constraint: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced ConstraintUsage, or None where the member is of another kind.

get_result(element: syside.ConstraintDefinition | syside.ConstraintUsage | syside.CalculationDefinition | syside.CalculationUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the result expression as a template – the bare expression the body ends with – or None on an element without one.

A result expression that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

element – The calculation, constraint or case to read the result expression of.

Returns:

The template for the result expression, or None if there is none.

Raises:

UndecodableExpression – If no template describes the result expression.

get_satisfied_by(usage: syside.SatisfyRequirementUsage) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return the feature the usage’s by clause references, or None where it has no by clause. A chain comes back as the chain() template of its chained features, as it went into satisfied_by=.

Parameters:

usage – The satisfy requirement usage to read.

Returns:

The satisfying feature or chain, or None.

get_satisfied_requirement(usage: syside.SatisfyRequirementUsage) → syside.RequirementUsage | syside.experimental.expressions.FeatureChainTemplate | None

Return the RequirementUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The RequirementUsage that is satisfied by the satisfyingSubject of this SatisfyRequirementUsage. It is the assertedConstraint of the SatisfyRequirementUsage considered as an AssertConstraintUsage, which must be a RequirementUsage.

There is no set_satisfied_requirement: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced RequirementUsage (a chain() for a chained reference), or None where the member is of another kind.

get_sender(send: syside.SendActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the send action’s via argument as a template, or None where the action has no (or an empty) sender parameter.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

send – The send action to read the via argument of.

Returns:

The template for the action’s via argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_sequence(loop: syside.ForLoopActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the for loop’s sequence argument as a template (written after in), or None where the loop carries none.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

loop – The for loop to read the sequence argument of.

Returns:

The template for the loop’s sequence argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_short_name(element: syside.Element) → str | None

Return what short_name= wrote, read by the kind of element:

  • On Membership: Return the alias membership’s member short name.

    This reads the abstract syntax’s memberShortName: the <...> name the alias gives its member element, not a name on that element.

  • On Element: Return the element’s declared short name.

    This reads the abstract syntax’s declaredShortName. There is no fallback to the long name: the short name is a declaration of its own, so an element declared as attribute mass; yields None. For the derived short name use element.short_name.

Parameters:

element – The element to read.

get_source(element: syside.FlowUsage) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return what source= wrote, read by the kind of element:

  • On FlowUsage: Return the source end of the flow or message, as source= took it.

    There is no setter: the core exposes no in-place retarget of a flow end’s references. Replace the flow by removing it and creating another.

    A flow end comes back as the chain() of its prefix and its flowed feature – from t.o.f as chain(t, o, f). An end without a prefix (from t), which parsed text can have and the builder refuses, comes back as the flowed feature alone. A message end comes back as the feature its source event references, or the chain() it references.

  • On ConnectorAsUsage: Return the feature the connector’s source end references.

    There is no set_source: the core exposes no in-place retarget for a connector end’s reference. Replace the connector by removing it and creating another.

    The source end is the first declared end – the first clause of a succession.

  • On TransitionUsage: Return the action or state the transition runs from (its first clause).

    There is no set_source: the core exposes no in-place retarget for a non-owning membership. Replace the transition by removing it and creating another.

Parameters:

element – The element to read.

get_source(element: syside.ConnectorAsUsage) → syside.Feature | None
get_source(element: syside.TransitionUsage) → syside.ActionUsage | None
get_source_multiplicity(connector: syside.ConnectorAsUsage) → syside.experimental.expressions.MultiplicityTemplate | None

Return the multiplicity of the connector’s source end.

The bounds as written, as the bounds() template that writes them. The grammar puts an end’s multiplicity on a cross feature the end owns, which is what this reads.

Parameters:

connector – The connector to read.

Returns:

The multiplicity, or None if the source end declares none or the connector has no source end.

get_source_name(connector: syside.ConnectorAsUsage) → str | None

Return the declared name of the connector’s source end.

Parameters:

connector – The connector to read.

Returns:

The end’s name, or None if the source end declares none or the connector has no source end.

get_specializes(definition: syside.Classifier) → list[syside.Classifier]

Return the classifiers the definition specializes (its :> clause).

One entry per Subclassification the definition declares itself; inherited and implied specializations are not included.

Parameters:

definition – The definition to read the specializations of.

Returns:

The declared classifiers, always as a list – including when the definition declares zero or one specialization.

get_standard(package: syside.LibraryPackage) → bool

Return whether the library package is declared a standard library.

Parameters:

package – The library package to read the flag of.

Returns:

True if the declaration reads standard library package.

get_subsets(feature: syside.Feature) → list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]

Return the features this one subsets (its :>/subsets clause).

Redefinitions (:>>), reference subsettings (::>, and the event, perform, include and require shorthands that write one) and cross subsettings (=>) are not included, although the metamodel makes each a Subsetting: each is a clause of its own, read by get_redefines, the reference getter of its construct, and get_crosses. Inherited and implied subsettings are not included either. A subsetting of a feature chain comes back as the chain() template of its chained features, as it went into subsets=.

Parameters:

feature – The feature to read the subsettings of.

Returns:

The declared supersets, always as a list – including when the feature declares zero or one subsetting.

get_suppliers(dependency: syside.Dependency) → list[syside.Element]

Return the dependency’s supplier elements (written after to).

Parameters:

dependency – The dependency to read.

Returns:

The supplier elements, always as a list – including when there is only one of them.

get_target(element: syside.FlowUsage) → syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None

Return what target= wrote, read by the kind of element:

  • On FlowUsage: Return the target end of the flow or message, as target= took it.

    There is no setter: the core exposes no in-place retarget of a flow end’s references. Replace the flow by removing it and creating another.

    A flow end comes back as the chain() of its prefix and its flowed feature – to e.i.f as chain(e, i, f). An end without a prefix (to e), which parsed text can have and the builder refuses, comes back as the flowed feature alone. A message end comes back as the feature its target event references, or the chain() it references.

  • On ConnectorAsUsage: Return the feature the connector’s target end references.

    There is no set_target: the core exposes no in-place retarget for a connector end’s reference. Replace the connector by removing it and creating another.

    The target end is the second declared end – the then clause of a succession. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them through get_ends().

  • On TransitionUsage: Return the action or state the transition runs to (its then clause).

    There is no set_target: the core exposes no in-place retarget for a connector end’s reference. Replace the transition by removing it and creating another.

    The target is the last declared end of the succession the transition owns; the first end is the source, which the semantic pass derives. It is read from that end, not from the derived target, which is empty until the model is resolved.

Parameters:

element – The element to read.

get_target(element: syside.ConnectorAsUsage) → syside.Feature | None
get_target(element: syside.TransitionUsage) → syside.ActionUsage | None
get_target_multiplicity(connector: syside.ConnectorAsUsage) → syside.experimental.expressions.MultiplicityTemplate | None

Return the multiplicity of the connector’s target end.

The target end is the second declared end. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them through get_ends().

The bounds as written, as the bounds() template that writes them. The grammar puts an end’s multiplicity on a cross feature the end owns, which is what this reads.

Parameters:

connector – The connector to read.

Returns:

The multiplicity, or None if the target end declares none or the connector has no target end.

get_target_name(connector: syside.ConnectorAsUsage) → str | None

Return the declared name of the connector’s target end.

The target end is the second declared end. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them through get_ends().

Parameters:

connector – The connector to read.

Returns:

The end’s name, or None if the target end declares none or the connector has no target end.

get_target_object(assignment: syside.AssignmentActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the assignment’s expression target as a template, or None where it has none or its target is a feature reference, which get_assigned_target() gives as the first feature of its chain().

There is no set_target_object: replace the assignment by removing it and creating another.

An expression that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

assignment – The assignment action to read.

Returns:

The template for the target expression, or None.

Raises:

UndecodableExpression – If no template describes the expression.

get_terminated_occurrence(terminate: syside.TerminateActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the node’s terminated-occurrence argument as a template, or None on a bare terminate;.

An argument that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

terminate – The terminate node to read the argument of.

Returns:

The template for the node’s terminated-occurrence argument, or None if it has none.

Raises:

UndecodableExpression – If no template describes the argument.

get_then_body(if_action: syside.IfActionUsage) → syside.ActionUsage

Return the if action’s then body: the action whose members are the { ... } after the condition.

The body is populated: pass it as the owner of the ordinary constructors – new_action(get_then_body(...), "a") – exactly as any action body. It is created with the node; a declared body takes its place through new_action(if_action, ..., member="then").

Parameters:

if_action – The if action to read the then body of.

Returns:

The body action, an owner for the ordinary constructors.

Raises:

ValueError – If the if action has no then body – one not built by new_if(); the grammar makes the body mandatory.

get_trigger(element: syside.AcceptActionUsage | syside.TransitionUsage) → syside.experimental.expressions.TriggerTemplate | None

Return the time or change trigger of an accept action or a transition’s trigger – at <time>, after <delay>, when <condition> – as the at() / after() / when() template that writes it.

Parameters:

element – The accept action or transition to read.

Returns:

The trigger, or None if the element accepts a payload rather than a time or a change, or has no trigger.

Raises:

UndecodableExpression – If no template describes the trigger’s argument.

get_until(loop: syside.WhileLoopActionUsage) → syside.experimental.expressions.ExpressionTemplate | None

Return the loop’s until condition as a template, or None where the loop has no until clause.

A condition that no template describes raises UndecodableExpression; read those with the low-level API.

Parameters:

loop – The while loop to read the until condition of.

Returns:

The template for the until condition, or None if there is none.

Raises:

UndecodableExpression – If no template describes the condition.

get_use_case_included(usage: syside.IncludeUseCaseUsage) → syside.UseCaseUsage | None

Return the UseCaseUsage this usage stands for: the one it references, or the usage itself where it declares one of its own.

The UseCaseUsage to be included by this IncludeUseCaseUsage. It is the performedAction of the IncludeUseCaseUsage considered as a PerformActionUsage, which must be a UseCaseUsage.

There is no set_use_case_included: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced UseCaseUsage, or None where the member is of another kind.

get_variable_name(loop: syside.ForLoopActionUsage) → str | None

Return the declared name of the for loop’s variable, or None where the variable is anonymous or absent.

Parameters:

loop – The for loop to read the variable name of.

Returns:

The loop variable’s declared name, or None if it has none.

get_variant(element: syside.Usage) → bool

Return whether the declaration was written with variant=True.

There is no set_variant: the flag decides the membership the element is put in its owner through, and changing it means creating another member.

The values of an enumeration definition are variants without the keyword: enum def E { enum e; } puts e under a VariantMembership too, so get_variant of it is True.

Parameters:

element – The element to read.

Returns:

True if the element is a variant member.

get_verified_requirement(usage: syside.RequirementUsage) → syside.RequirementUsage | None

Return the RequirementUsage this usage stands for: the one it references, or the usage itself where it declares one of its own. None where no RequirementVerificationMembership owns the usage: the property is that membership’s.

The RequirementUsage that is identified as being verified. It is the referencedConstraint of the RequirementVerificationMembership considered as a RequirementConstraintMembership, which must be a RequirementUsage.

There is no set_verified_requirement: the core exposes no in-place retarget for a reference subsetting. Replace the usage by removing it and creating another.

Parameters:

usage – The usage to read.

Returns:

The referenced RequirementUsage, or None where the member is of another kind.

get_visibility(element: syside.Element) → syside.VisibilityKind

Return what visibility= wrote, read by the kind of element:

  • On Import: Return the import’s visibility (the indicator before import).

  • On Element: Return the member’s visibility (the indicator before the member).

    It is a property of the membership putting the member in its owner: of the element’s owning membership, or of the alias itself.

Parameters:

element – The element to read.

add_about(annotating: syside.AnnotatingElement, annotated: syside.Element) → None

Add one Annotation from annotating to annotated.

Same effect on the model as including annotated in about= at construction.

Parameters:
  • annotating – The comment, metadata usage or other annotating element to add to.

  • annotated – The element it comes to annotate.

add_clients(dependency: syside.Dependency, client: syside.Element) → None

Add one client reference to dependency.

Same effect on the model as including client in clients= at construction.

Parameters:
  • dependency – The dependency to add to.

  • client – The element that comes to depend on the suppliers.

add_conjugates(feature: syside.Feature, conjugate: syside.ConjugatedPortDefinition) → None

Add one ConjugatedPortTyping from feature to conjugate.

Same effect on the model as including conjugate in conjugates= at construction.

Parameters:
  • feature – The feature to add the conjugated typing to.

  • conjugate – The conjugated port definition the feature comes to be typed by.

add_cross_subsets(end: syside.Feature, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Add one Subsetting from the end’s owned cross feature to superset.

Same effect on the model as including superset in cross_subsets= at construction: a single feature, or a chain() of two or more features standing for their feature chain. An end without a cross feature gets one.

Parameters:
  • end – The end feature to write.

  • superset – The feature (or feature chain) the cross feature comes to subset.

add_defined_by(feature: syside.Feature, definition: syside.Classifier) → None

Add one FeatureTyping from feature to definition.

Same effect on the model as including definition in defined_by= at construction.

Parameters:
  • feature – The feature to add the typing to.

  • definition – The type the feature becomes defined by.

add_filters(element: syside.Package | syside.ViewDefinition | syside.ViewUsage | syside.Import, condition: syside.experimental.expressions.ExpressionLike) → None

Add to what filters= wrote, by the kind of element:

  • On Package: Add one filter <condition>; member to the package, after the filters it already carries.

    condition is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the filters= constructor parameter accepts; the effect on the model is the same as including it in filters= at construction.

  • On ViewDefinition or ViewUsage: Add one filter <condition>; member to the view, after the filters it already carries.

    condition is accepted in exactly the forms the filters= constructor parameter accepts; the effect on the model is the same as including it in filters= at construction.

  • On Import: Add one [<condition>] filter to the import, after the ones it already carries.

    On an unfiltered import this converts it to the filtered form, as filters= at construction builds it: the import keeps its position and visibility and imports a new filter package that imports what it imported. A filtered import is a NamespaceImport, so a MembershipImport (import P::X;) is replaced by one: read the import back from its owner rather than through the MembershipImport reference.

Parameters:
  • element – The element to write.

  • condition – The value to write.

add_payload_defined_by(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, definition: syside.Classifier) → None

Add to what payload_defined_by= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one FeatureTyping from the payload of an accept action, a transition’s trigger or a flow to definition.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one FeatureTyping from the payload of an accept action, a transition’s trigger or a flow to definition.

Same effect on the model as including definition in payload_defined_by= at construction; a missing payload is created.

Parameters:
  • element – The element to write.

  • definition – The value to write.

add_payload_redefines(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, redefined: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Add to what payload_redefines= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one Redefinition from the payload of an accept action, a transition’s trigger or a flow to redefined.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one Redefinition from the payload of an accept action, a transition’s trigger or a flow to redefined.

Same effect on the model as including redefined in payload_redefines= at construction: a single feature, or a chain() of two or more features standing for their feature chain. A missing payload is created.

Parameters:
  • element – The element to write.

  • redefined – The value to write.

add_payload_subsets(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Add to what payload_subsets= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one Subsetting from the payload of an accept action, a transition’s trigger or a flow to superset.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Add one Subsetting from the payload of an accept action, a transition’s trigger or a flow to superset.

Same effect on the model as including superset in payload_subsets= at construction: a single feature, or a chain() of two or more features standing for their feature chain. A missing payload is created.

Parameters:
  • element – The element to write.

  • superset – The value to write.

add_redefines(feature: syside.Feature, redefined: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Add one Redefinition from feature to redefined.

Same effect on the model as including redefined in redefines= at construction: a single feature, or a chain() of two or more features standing for their feature chain.

Parameters:
  • feature – The feature to add the redefinition to.

  • redefined – The feature (or feature chain) it comes to redefine.

add_specializes(definition: syside.Classifier, superclassifier: syside.Classifier) → None

Add one Subclassification from definition to superclassifier.

Same effect on the model as including superclassifier in specializes= at construction.

Parameters:
  • definition – The definition to add the specialization to.

  • superclassifier – The classifier the definition comes to specialize.

add_subsets(feature: syside.Feature, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Add one Subsetting from feature to superset.

Same effect on the model as including superset in subsets= at construction: a single feature, or a chain() of two or more features standing for their feature chain.

Parameters:
  • feature – The feature to add the subsetting to.

  • superset – The feature (or feature chain) it comes to subset.

add_suppliers(dependency: syside.Dependency, supplier: syside.Element) → None

Add one supplier reference to dependency.

Same effect on the model as including supplier in suppliers= at construction.

Parameters:
  • dependency – The dependency to add to.

  • supplier – The element the clients come to depend on.

remove_about(annotating: syside.AnnotatingElement, annotated: syside.Element) → None

Remove the declared Annotation``s from ``annotating to annotated.

Removing an element the annotating element is not about is a no-op.

Parameters:
  • annotating – The comment, metadata usage or other annotating element to remove from.

  • annotated – The element to stop annotating.

remove_clients(dependency: syside.Dependency, client: syside.Element) → None

Remove every client reference from dependency to client.

Removing an element the dependency does not name is a no-op. A dependency with no clients left cannot be written back to textual syntax.

Parameters:
  • dependency – The dependency to remove from.

  • client – The element to stop depending.

remove_conjugates(feature: syside.Feature, conjugate: syside.ConjugatedPortDefinition) → None

Remove the declared ConjugatedPortTyping``s from ``feature to conjugate.

Plain feature typings are left alone, as they are by get_conjugates, and so is any other heritage relationship to the same conjugate. Removing a conjugate the feature is not typed by is a no-op.

Parameters:
  • feature – The feature to remove the conjugated typings from.

  • conjugate – The conjugated port definition to stop being typed by.

remove_cross_subsets(end: syside.Feature, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Remove the declared Subsetting``s from the end's owned cross feature to ``superset.

Removing a feature the cross feature does not subset, or removing from an end without a cross feature, is a no-op. A cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • superset – The feature (or feature chain) to stop subsetting.

remove_defined_by(feature: syside.Feature, definition: syside.Classifier) → None

Remove the declared FeatureTyping``s from ``feature to definition.

Only feature typings are removed: other heritage relationships that happen to target the same type (a Subsetting, say) are left alone. Removing a type the feature is not defined by is a no-op.

Parameters:
  • feature – The feature to remove the typings from.

  • definition – The type to stop being defined by.

remove_filters(element: syside.Package | syside.ViewDefinition | syside.ViewUsage | syside.Import, condition: syside.experimental.expressions.ExpressionLike) → None

Remove from what filters= wrote, by the kind of element:

  • On Package: Remove the package’s filter members whose condition is condition.

    Conditions are compared as templates, so a filter written with a different but equal expression is removed too. Removing a condition the package does not filter by is a no-op; a condition no template describes is not a match and is left alone.

  • On ViewDefinition or ViewUsage: Remove the view’s own filter members whose condition is condition.

    Conditions are compared as templates, so a filter written with a different but equal expression is removed too. Removing a condition the view does not filter by is a no-op; a condition no template describes is not a match and is left alone.

  • On Import: Remove the import’s filters whose condition is condition.

    Conditions are compared as templates. Removing the last condition converts the import back to the unfiltered form: the import keeps its position and visibility and imports what the filter package imported – a MembershipImport replacing it where that is a membership. Removing a condition the import does not filter by is a no-op.

Parameters:
  • element – The element to write.

  • condition – The value to write.

remove_payload_defined_by(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, definition: syside.Classifier) → None

Remove from what payload_defined_by= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared FeatureTyping``s from the payload of an accept action, a transition's trigger or a flow to ``definition.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared FeatureTyping``s from the payload of an accept action, a transition's trigger or a flow to ``definition.

Only the payload’s feature typings are removed; removing a type the payload is not defined by, or removing from an element without a payload, is a no-op.

Parameters:
  • element – The element to write.

  • definition – The value to write.

remove_payload_redefines(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, redefined: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Remove from what payload_redefines= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared Redefinition``s from the payload of an accept action, a transition's trigger or a flow to ``redefined.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared Redefinition``s from the payload of an accept action, a transition's trigger or a flow to ``redefined.

Removing a feature the payload does not redefine, or removing from an element without a payload, is a no-op.

Parameters:
  • element – The element to write.

  • redefined – The value to write.

remove_payload_subsets(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Remove from what payload_subsets= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared Subsetting``s from the payload of an accept action, a transition's trigger or a flow to ``superset.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Remove the declared Subsetting``s from the payload of an accept action, a transition's trigger or a flow to ``superset.

Removing a feature the payload does not subset, or removing from an element without a payload, is a no-op.

Parameters:
  • element – The element to write.

  • superset – The value to write.

remove_redefines(feature: syside.Feature, redefined: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Remove the declared Redefinition``s from ``feature to redefined.

Other heritage relationships to the same feature – a plain Subsetting, say – are left alone. A chain() removes the redefinitions of exactly that feature chain. Removing a feature this one does not redefine is a no-op.

Parameters:
  • feature – The feature to remove the redefinitions from.

  • redefined – The feature (or feature chain) to stop redefining.

remove_specializes(definition: syside.Classifier, superclassifier: syside.Classifier) → None

Remove the declared Subclassification``s from ``definition to superclassifier.

Only subclassifications are removed: another heritage relationship to the same classifier is left alone. Removing a classifier the definition does not specialize is a no-op.

Parameters:
  • definition – The definition to remove the specializations from.

  • superclassifier – The classifier to stop specializing.

remove_subsets(feature: syside.Feature, superset: syside.Feature | syside.experimental.expressions.FeatureChainTemplate) → None

Remove the declared Subsetting``s from ``feature to superset.

Redefinitions, reference subsettings and cross subsettings are left alone, as they are by get_subsets, and so is any other heritage relationship to the same feature. A chain() removes the subsettings of exactly that feature chain. Removing a feature this one does not subset is a no-op.

Parameters:
  • feature – The feature to remove the subsettings from.

  • superset – The feature (or feature chain) to stop subsetting.

remove_suppliers(dependency: syside.Dependency, supplier: syside.Element) → None

Remove every supplier reference from dependency to supplier.

Removing an element the dependency does not name is a no-op. A dependency with no suppliers left cannot be written back to textual syntax.

Parameters:
  • dependency – The dependency to remove from.

  • supplier – The element to stop being depended on.

set_assigned_value(assignment: syside.AssignmentActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the assignment action’s value argument.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the assigned_value= constructor parameter accepts; the effect on the model is the same as passing assigned_value=value at construction. Any existing value argument is replaced.

Parameters:
  • assignment – The assignment action to write the value argument of.

  • value – The assigned value, in any form assigned_value= accepts.

set_body(annotating: syside.Comment | syside.TextualRepresentation, body: str) → None

Set the annotating element’s text.

Same effect on the model as passing body= at construction; the text is given without the /* */ delimiters.

Parameters:
  • annotating – The comment or textual representation to write the text on.

  • body – The text to set.

set_condition(node: syside.IfActionUsage | syside.WhileLoopActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Rewrite what condition= wrote, by the kind of node:

  • On IfActionUsage: Set the if action’s condition – the expression after if.

    value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the condition= constructor parameter accepts; the effect on the model is the same as passing condition=value at construction. Any existing condition is replaced.

  • On WhileLoopActionUsage: Set the while loop’s condition – the expression after while.

    value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the condition= constructor parameter accepts; the effect on the model is the same as passing condition=value at construction. Any existing condition is replaced; a loop given a condition becomes a while.

Parameters:
  • node – The element to write.

  • value – The value to write.

set_constant(feature: syside.Feature, constant: bool) → None

Declare the feature constant, or stop declaring it so.

Same effect on the model as passing constant= at construction.

Parameters:
  • feature – The feature to write the flag on.

  • constant – True to add the constant prefix, False to remove it.

set_cross_multiplicity(end: syside.Feature, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) → None

Rewrite the multiplicity of the end’s owned cross feature; None removes it.

Same effect on the model as passing cross_multiplicity= at construction. An end without a cross feature gets one, unless multiplicity is None; a cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • multiplicity – The multiplicity, built by bounds(), or None.

set_cross_name(end: syside.Feature, name: str | None) → None

Set the declared name of the end’s owned cross feature.

Same effect on the model as passing cross_name= at construction. An end without a cross feature gets one, unless name is None; a cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • name – The declared name, or None for an anonymous cross feature.

set_cross_nonunique(end: syside.Feature, nonunique: bool) → None

Declare the end’s owned cross feature nonunique, or stop declaring it so.

Same effect on the model as passing cross_nonunique= at construction. An end without a cross feature gets one, unless nonunique is False; a cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • nonunique – True to add the nonunique keyword, False to remove it.

set_cross_ordered(end: syside.Feature, ordered: bool) → None

Declare the end’s owned cross feature ordered, or stop declaring it so.

Same effect on the model as passing cross_ordered= at construction. An end without a cross feature gets one, unless ordered is False; a cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • ordered – True to add the ordered keyword, False to remove it.

set_cross_short_name(end: syside.Feature, short_name: str | None) → None

Set the declared short name of the end’s owned cross feature.

Same effect on the model as passing cross_short_name= at construction. An end without a cross feature gets one, unless short_name is None; a cross feature left declaring nothing is removed.

Parameters:
  • end – The end feature to write.

  • short_name – The declared short name, or None for none.

set_default(feature: syside.Feature, default: bool) → None

Declare the feature’s value a default value, or a fixed one.

Same effect on the model as passing default= at construction.

Parameters:
  • feature – The feature whose value to write.

  • default – True to add the default keyword, False to remove it.

Raises:

ValueError – If default is True and the feature has no value.

set_derived(feature: syside.Feature, derived: bool) → None

Declare the feature derived, or stop declaring it so.

Same effect on the model as passing derived= at construction.

Parameters:
  • feature – The feature to write the flag on.

  • derived – True to add the derived prefix, False to remove it.

set_direction(usage: syside.Usage, direction: syside.FeatureDirectionKind | None) → None

Set the usage’s direction (the in, out or inout before it).

Same effect on the model as direction= at construction.

Parameters:
  • usage – The usage to write.

  • direction – The direction to declare, or None to declare none.

Raises:
  • ValueError – If usage is an end feature, which has no direction (KerML validateFeatureEndNoDirection), or a return parameter given another direction than Out, to which it is fixed (KerML 8.3.4.7.8), or an else action given another than In, to which a ParameterMembership’s member parameter is fixed (KerML validateParameterMembershipParameterDirection). The constructors refuse the same direction= arguments, with TypeError as for every argument they refuse.

  • TypeError – If direction is not a syside.FeatureDirectionKind.

set_else_body(if_action: syside.IfActionUsage, value: bool) → None

Add or remove the if action’s else body.

True creates an empty else { ... } body where there is none, and replaces a nested else if with one – the same effect as else_body=True at construction. False removes the else branch, body or nested if alike, and is a no-op where there is none.

Parameters:
  • if_action – The if action to write the else body of.

  • value – Whether the action is to have an else body.

set_else_if(if_action: syside.IfActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the condition of the if action’s else if branch, nesting an if action there if there is none.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the else_if= constructor parameter accepts; on an action without an else branch the effect is the same as passing else_if=value at construction. A plain else body is replaced by the nested if action; a nested if action already there keeps its bodies and gets the new condition.

Parameters:
  • if_action – The if action to write the else if branch of.

  • value – The nested condition, in any form else_if= accepts.

set_equals(feature: syside.Feature, value: syside.experimental.expressions.ExpressionLike) → None

Set the feature’s value expression.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the equals= constructor parameter accepts; the effect on the model is the same as passing equals=value at construction. Any existing value expression is replaced.

Parameters:
  • feature – The feature to write the value expression of.

  • value – The value expression, in any form equals= accepts.

set_guard(transition: syside.TransitionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the transition’s guard – the expression written after if.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the guard= constructor parameter accepts; the effect on the model is the same as passing guard=value at construction. Any existing guard is replaced.

Parameters:
  • transition – The transition usage to write the guard of.

  • value – The guard, in any form guard= accepts.

set_import_all(import_: syside.Import, import_all: bool) → None

Set whether the import imports members whatever their visibility (its all keyword).

Same effect on the model as import_all= at construction.

Parameters:
  • import – The import to write.

  • import_all – True to add the all keyword, False to remove it.

Raises:

ValueError – If import_ is an expose and import_all is False: an expose imports all (SysML validateExposeIsImportAll).

set_imported(element: syside.MembershipImport | syside.NamespaceImport, target: syside.Membership | syside.Namespace) → None

Rewrite what imported= wrote, by the kind of element:

  • On MembershipImport: Retarget the import in place: same effect on the model as imported= at construction, keeping the import’s position, visibility, ::** and filters.

  • On NamespaceImport: Retarget the import in place: same effect on the model as imported= at construction, keeping the import’s position, visibility, ::** and filters.

A membership target makes it a membership import (import P::X;), a namespace target a namespace import (import P::*;), so the kind can change: read the import back from its owner rather than through a reference of the other kind. An expose stays an expose.

Parameters:
  • element – The element to write.

  • target – The value to write.

set_individual(element: syside.OccurrenceDefinition | syside.OccurrenceUsage, individual: bool) → None

Declare the occurrence an individual, or stop declaring it so.

Same effect on the model as passing individual= at construction.

Parameters:
  • element – The occurrence definition or usage to write the flag on.

  • individual – True to add the individual prefix, False to remove it.

set_initial(feature: syside.Feature, initial: bool) → None

Declare the feature’s value an initial value (:=), or a bound one (=).

Same effect on the model as passing initial= at construction.

Parameters:
  • feature – The feature whose value to write.

  • initial – True for :=, False for =.

Raises:

ValueError – If initial is True and the feature has no value.

set_language(representation: syside.TextualRepresentation, language: str) → None

Set the language the representation’s text is written in.

Same effect on the model as passing language= at construction.

Parameters:
  • representation – The textual representation to write the language on.

  • language – The language to set, e.g. "kerml".

set_locale(comment: syside.Comment, locale: str) → None

Set the comment’s locale.

Same effect on the model as passing locale= at construction.

Parameters:
  • comment – The comment to write the locale on.

  • locale – The locale to set, e.g. "en".

set_multiplicity(feature: syside.Feature, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) → None

Rewrite the feature’s [...] clause; None removes it.

Same effect on the model as passing multiplicity= at construction. A multiplicity already declared is replaced.

Parameters:
  • feature – The feature to write the multiplicity of.

  • multiplicity – The multiplicity, built by bounds(), or None.

set_name(element: syside.Element, name: str) → None

Rewrite what name= wrote, by the kind of element:

  • On Membership: Set the alias membership’s member name.

    This writes the abstract syntax’s memberName, with the same effect on the model as passing name= at construction. The named element’s own names are not touched.

  • On Element: Set the element’s declared long name.

    This writes the abstract syntax’s declaredName, with the same effect on the model as passing name= at construction. The derived effective name, element.name, follows from it.

Parameters:
  • element – The element to write.

  • name – The value to write.

set_negated(assertion: syside.AssertConstraintUsage | syside.SatisfyRequirementUsage, negated: bool) → None

Declare the assertion not, or stop declaring it so.

Same effect on the model as passing negated= at construction.

Parameters:
  • assertion – The assert constraint or satisfy requirement usage to write.

  • negated – True to add the not keyword, False to remove it.

set_nonunique(feature: syside.Feature, nonunique: bool) → None

Declare the feature nonunique, or stop declaring it so.

Same effect on the model as passing nonunique= at construction: writes the negation into is_unique.

Parameters:
  • feature – The feature to write the flag on.

  • nonunique – True to add the nonunique keyword, False to remove it.

set_ordered(feature: syside.Feature, ordered: bool) → None

Declare the feature ordered, or stop declaring it so.

Same effect on the model as passing ordered= at construction.

Parameters:
  • feature – The feature to write the flag on.

  • ordered – True to add the ordered keyword, False to remove it.

set_parallel(state: syside.StateDefinition | syside.StateUsage, parallel: bool) → None

Declare the state parallel, or stop declaring it so.

Same effect on the model as passing parallel= at construction. The states and transitions already in the body are not touched: whether they are admissible in a parallel state is settled by validation, not here.

Parameters:
  • state – The state definition or usage to write the flag on.

  • parallel – True to add the parallel keyword, False to remove it.

set_payload(send: syside.SendActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the send action’s payload argument.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the payload= constructor parameter accepts; the effect on the model is the same as passing payload=value at construction. Any existing payload argument is replaced.

Parameters:
  • send – The send action to write the payload argument of.

  • value – The payload, in any form payload= accepts.

set_payload_default(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, default: bool) → None

Rewrite what payload_default= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Declare the value of the payload of an accept action, a transition’s trigger or a flow a default value, or a fixed one.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Declare the value of the payload of an accept action, a transition’s trigger or a flow a default value, or a fixed one.

Same effect on the model as passing payload_default= at construction.

Parameters:
  • element – The element to write.

  • default – The value to write.

set_payload_equals(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, value: syside.experimental.expressions.ExpressionLike | None) → None

Rewrite what payload_equals= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the value of the payload of an accept action, a transition’s trigger or a flow; None removes it.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the value of the payload of an accept action, a transition’s trigger or a flow; None removes it.

Same effect on the model as passing payload_equals= at construction. A value replaces any existing one, a time or change trigger included; None leaves a trigger alone.

Parameters:
  • element – The element to write.

  • value – The value to write.

set_payload_initial(element: syside.AcceptActionUsage | syside.TransitionUsage, initial: bool) → None

Declare the value of the payload of an accept action or a transition’s trigger an initial value (:=), or a bound one (=).

Same effect on the model as passing payload_initial= at construction. A flow’s payload takes no := (see get_payload_initial), so this takes no flow.

Parameters:
  • element – The accept action or transition to write.

  • initial – True for :=, False for =.

Raises:

ValueError – If initial is True and the payload has no value, a time or change trigger not being one, or the element has no payload.

set_payload_multiplicity(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) → None

Rewrite what payload_multiplicity= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Rewrite the multiplicity of the payload of an accept action, a transition’s trigger or a flow; None removes it.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Rewrite the multiplicity of the payload of an accept action, a transition’s trigger or a flow; None removes it.

Same effect on the model as passing payload_multiplicity= at construction.

Parameters:
  • element – The element to write.

  • multiplicity – The value to write.

set_payload_name(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, value: str | None) → None

Rewrite what payload_name= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the declared name of the payload of an accept action, a transition’s trigger or a flow.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the declared name of the payload of an accept action, a transition’s trigger or a flow.

Same effect on the model as passing payload_name=value at construction. None makes the payload anonymous; without a payload it does nothing.

Parameters:
  • element – The element to write.

  • value – The value to write.

set_payload_ordered(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, ordered: bool) → None

Rewrite what payload_ordered= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Declare the payload of an accept action, a transition’s trigger or a flow ordered, or stop declaring it so.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Declare the payload of an accept action, a transition’s trigger or a flow ordered, or stop declaring it so.

Same effect on the model as passing payload_ordered= at construction.

Parameters:
  • element – The element to write.

  • ordered – The value to write.

set_payload_short_name(element: syside.AcceptActionUsage | syside.FlowUsage | syside.TransitionUsage, short_name: str | None) → None

Rewrite what payload_short_name= wrote, by the kind of element:

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the declared short name of the payload of an accept action, a transition’s trigger or a flow; None removes it.

  • On AcceptActionUsage or FlowUsage or TransitionUsage: Set the declared short name of the payload of an accept action, a transition’s trigger or a flow; None removes it.

Same effect on the model as passing payload_short_name= at construction.

Parameters:
  • element – The element to write.

  • short_name – The value to write.

set_portion(occurrence: syside.OccurrenceUsage, portion: Literal[snapshot, timeslice] | syside.PortionKind | None) → None

Declare the occurrence usage a snapshot or a timeslice, or neither.

Same effect on the model as passing portion= at construction. The two keywords are alternatives of one prefix (SysML 8.2.2.9.2), so setting one replaces the other.

Parameters:
  • occurrence – The occurrence usage to write the prefix on.

  • portion – "snapshot" or "timeslice", or the syside.PortionKind member of that name, to write the prefix; None to remove it.

Raises:

ValueError – If portion is neither None, "snapshot", "timeslice" nor a syside.PortionKind member.

set_prefix(element: syside.Definition | syside.Usage, value: Literal[abstract, variation] | None) → None

Rewrite the prefix= value in place; None removes it.

A declaration written with "end" keeps it: that value is what makes the member the construct it is, and changing it means creating another member.

Parameters:
  • element – The element to write.

  • value – One of "abstract", "variation", or None.

Raises:
  • ValueError – If the element holds "end".

  • ValueError – If value is None and the element is a connector with no ends, such as every message: a concrete connector needs two related features.

  • ValueError – If the element is an enumeration definition: it is always a variation.

set_receiver(action: syside.SendActionUsage | syside.AcceptActionUsage | syside.TransitionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the action’s receiver argument – the to clause of a send, the via clause of an accept or of a transition’s trigger.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the receiver= constructor parameter accepts; the effect on the model is the same as passing receiver=value at construction. Any existing receiver argument is replaced; a send without a sender parameter gets the empty one its textual form implies, and a transition without a trigger gets one.

Parameters:
  • action – The send action, accept action or transition to write the receiver argument of.

  • value – The receiver, in any form receiver= accepts.

Raises:

ValueError – If action is a transition without a trigger whose source is no state: a trigger is valid only on a transition from a state (SysML 2.1 validateTransitionUsageTriggerActions).

set_recursive(import_: syside.Import, recursive: bool) → None

Set whether the import is recursive (its ::** suffix).

Same effect on the model as recursive= at construction; on a filtered import, written on the import inside the filter package.

Parameters:
  • import – The import to write.

  • recursive – True to reach into nested namespaces recursively.

set_ref(usage: syside.Usage, ref: bool) → None

Make the usage a reference, or composite.

Same effect on the model as passing ref= at construction: writes the negation into is_composite.

Parameters:
  • usage – The usage to write.

  • ref – True for a reference (the ref prefix), False for composite.

Raises:

ValueError – If ref is False and usage is an attribute, an enumeration, an event occurrence, or a perform action, exhibit state or include use case usage, each a reference wherever it is placed.

set_result(element: syside.ConstraintDefinition | syside.ConstraintUsage | syside.CalculationDefinition | syside.CalculationUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the result expression – the bare expression the body ends with.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the result= constructor parameter accepts; the effect on the model is the same as passing result=value at construction. Any existing result expression is replaced.

Parameters:
  • element – The calculation, constraint or case to write the result expression of.

  • value – The result expression, in any form result= accepts.

Raises:

ValueError – If element is a requirement definition or usage, whose result the library fixes and whose body holds no result expression (RequirementCheck::result).

set_satisfied_by(usage: syside.SatisfyRequirementUsage, satisfied_by: syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None) → None

Set the usage’s by clause, or remove it with None.

Same effect on the model as passing satisfied_by= at construction.

Parameters:
  • usage – The satisfy requirement usage to write.

  • satisfied_by – The satisfying feature or chain(), or None.

Raises:

ValueError – If the usage has a subject of its own, declared in its body: a requirement usage has at most one (validateRequirementUsageOnlyOneSubject).

set_sender(send: syside.SendActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the send action’s via argument.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the sender= constructor parameter accepts; the effect on the model is the same as passing sender=value at construction. Any existing via argument is replaced; an empty sender parameter (a send ... to ...; without via) is filled.

Parameters:
  • send – The send action to write the via argument of.

  • value – The sender, in any form sender= accepts.

set_sequence(loop: syside.ForLoopActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the for loop’s sequence argument.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the sequence= constructor parameter accepts; the effect on the model is the same as passing sequence=value at construction. Any existing sequence argument is replaced.

Parameters:
  • loop – The for loop to write the sequence argument of.

  • value – The sequence, in any form sequence= accepts.

set_short_name(element: syside.Element, short_name: str) → None

Rewrite what short_name= wrote, by the kind of element:

  • On Membership: Set the alias membership’s member short name.

    This writes the abstract syntax’s memberShortName, with the same effect on the model as passing short_name= at construction. The named element’s own names are not touched.

  • On Element: Set the element’s declared short name.

    This writes the abstract syntax’s declaredShortName, with the same effect on the model as passing short_name= at construction. For the derived short name use element.short_name.

Parameters:
  • element – The element to write.

  • short_name – The value to write.

set_source_multiplicity(connector: syside.ConnectorAsUsage, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) → None

Rewrite the multiplicity of the connector’s source end; None removes it.

Same effect on the model as passing source_multiplicity= at construction.

Parameters:
  • connector – The connector to write.

  • multiplicity – The multiplicity, built by bounds(), or None.

Raises:

ValueError – If the connector has no source end.

set_source_name(connector: syside.ConnectorAsUsage, name: str | None) → None

Rewrite the declared name of the connector’s source end; None removes it.

Same effect on the model as passing source_name= at construction.

Parameters:
  • connector – The connector to write.

  • name – The end’s name, or None.

Raises:

ValueError – If the connector has no source end.

set_standard(package: syside.LibraryPackage, standard: bool) → None

Declare the library package a standard library, or stop declaring it so.

Same effect on the model as passing standard= at construction.

Parameters:
  • package – The library package to write the flag on.

  • standard – True to add the standard prefix, False to remove it.

set_target_multiplicity(connector: syside.ConnectorAsUsage, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) → None

Rewrite the multiplicity of the connector’s target end; None removes it.

The target end is the second declared end. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them through get_ends().

Same effect on the model as passing target_multiplicity= at construction.

Parameters:
  • connector – The connector to write.

  • multiplicity – The multiplicity, built by bounds(), or None.

Raises:

ValueError – If the connector has no target end.

set_target_name(connector: syside.ConnectorAsUsage, name: str | None) → None

Rewrite the declared name of the connector’s target end; None removes it.

The target end is the second declared end. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them through get_ends().

Same effect on the model as passing target_name= at construction.

Parameters:
  • connector – The connector to write.

  • name – The end’s name, or None.

Raises:

ValueError – If the connector has no target end.

set_terminated_occurrence(terminate: syside.TerminateActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the node’s terminated-occurrence argument.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the terminated_occurrence= constructor parameter accepts; the effect on the model is the same as passing terminated_occurrence=value at construction. Any existing argument is replaced.

Parameters:
  • terminate – The terminate node to write the argument of.

  • value – The terminated occurrence, in any form terminated_occurrence= accepts.

set_trigger(element: syside.AcceptActionUsage | syside.TransitionUsage, trigger: syside.experimental.expressions.TriggerTemplate | None) → None

Set the time or change trigger of an accept action or a transition’s trigger; None removes it.

Same effect on the model as passing trigger= at construction; a transition without a trigger gets one. Any existing trigger is replaced.

Parameters:
  • element – The accept action or transition to write.

  • trigger – The trigger, built by at(), after() or when(), or None.

Raises:

ValueError – If element is a transition without a trigger whose source is no state: a trigger is valid only on a transition from a state (SysML 2.1 validateTransitionUsageTriggerActions).

set_until(loop: syside.WhileLoopActionUsage, value: syside.experimental.expressions.ExpressionLike) → None

Set the loop’s until condition.

value is an ExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms the until= constructor parameter accepts; the effect on the model is the same as passing until=value at construction. Any existing until condition is replaced.

Parameters:
  • loop – The while loop to write the until condition of.

  • value – The condition, in any form until= accepts.

set_variable_name(loop: syside.ForLoopActionUsage, value: str | None) → None

Set the declared name of the for loop’s variable.

Same effect on the model as passing variable_name=value at construction; a missing loop variable is created. None makes the variable anonymous.

Parameters:
  • loop – The for loop to write the variable name of.

  • value – The new declared name, or None for an anonymous variable.

set_visibility(element: syside.Element, visibility: syside.VisibilityKind) → None

Rewrite what visibility= wrote, by the kind of element:

  • On Import: Set the import’s visibility (the indicator before import).

  • On Element: Set the member’s visibility (the indicator before the member).

Same effect on the model as visibility= at construction.

Parameters:
  • element – The element to write.

  • visibility – The value to write.