query
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
Return the elements the annotating element is about (its |
||
Return the |
||
Return what follows |
||
Return the assignment action’s value argument as a template (written
after |
||
Return the |
||
Return the annotating element’s text. |
||
Return the dependency’s client elements (written before |
||
Return what |
||
Return the conjugated port definitions the feature is typed by ( |
||
Return whether the feature is declared |
||
Return the multiplicity of the end’s owned cross feature (the |
||
Return the declared name of the end’s owned cross feature. |
||
Return whether the end’s owned cross feature is declared |
||
Return whether the end’s owned cross feature is declared |
||
Return the declared short name of the end’s owned cross feature. |
||
Return the features the end’s owned cross feature subsets. |
||
Return the feature chain this feature crosses (its |
||
Return whether the feature’s value is a default value ( |
||
Return the types the feature is defined by (its |
||
Return whether the feature is declared |
||
Return the usage’s effective direction: the |
||
Return the action the transition performs on firing (its |
||
Return the if action’s |
||
Return the condition of the |
||
Return every declared end of the connector, in order. |
||
Return the feature’s value expression as a template, or |
||
Return the |
||
Return the |
||
Return what |
||
Return the element an alias names, or the action an initial node names
( |
||
Return the |
||
Return the transition’s guard as a template – the expression after
|
||
Return whether the import imports members whatever their visibility (its
|
||
Return what |
||
Return whether the occurrence is declared an individual. |
||
Return whether the feature’s value is an initial value ( |
||
Return the language the representation’s text is written in. |
||
Return the comment’s locale. |
||
Return the loop’s body: the action whose members are the |
||
Return the for loop’s variable: the reference usage declared between
|
||
Return the |
||
Return the default reading of |
||
Return the multiplicity the feature declares (its |
||
Return the default reading of |
||
Return whether the assertion is declared |
||
Return whether the feature is declared |
||
Return whether the feature is declared |
||
Return whether the state is declared |
||
Return the send action’s payload argument as a template (written after
|
||
Return what |
||
Return what |
||
Return what |
||
Return whether the value of the payload of an accept action or a transition’s
trigger is an initial value ( |
||
Return what |
||
Return what |
||
Return what |
||
Return the accept action’s payload parameter: the reference usage declared
after |
||
Return what |
||
Return what |
||
Return what |
||
Return what |
||
Return the |
||
Return the portion prefix the occurrence usage is declared with. |
||
Return every |
||
Return the action’s receiver argument as a template – the |
||
Return whether the import is recursive (its |
||
Return the features this one redefines (its |
||
Return whether the usage is a reference rather than composite. |
||
Return the feature this one references (its |
||
Return the |
||
Return the |
||
Return the result expression as a template – the bare expression the
body ends with – or |
||
Return the feature the usage’s |
||
Return the |
||
Return the send action’s |
||
Return the for loop’s sequence argument as a template (written after
|
||
Return what |
||
Return what |
||
Return the multiplicity of the connector’s source end. |
||
Return the declared name of the connector’s source end. |
||
Return the classifiers the definition specializes (its |
||
Return whether the library package is declared a standard library. |
||
Return the features this one subsets (its |
||
Return the dependency’s supplier elements (written after |
||
Return what |
||
Return the multiplicity of the connector’s target end. |
||
Return the declared name of the connector’s target end. |
||
Return the assignment’s expression target as a template, or |
||
Return the node’s terminated-occurrence argument as a template, or
|
||
Return the if action’s |
||
Return the time or change trigger of an accept action or a transition’s trigger –
|
||
Return the loop’s |
||
Return the |
||
Return the declared name of the for loop’s variable, or |
||
Return whether the declaration was written with |
||
Return the |
||
Return what |
||
Add one |
||
Add one client reference to |
||
Add one |
||
Add one |
||
Add one |
||
Add to what |
||
Add to what |
||
Add to what |
||
Add to what |
||
Add one |
||
Add one |
||
Add one |
||
Add one supplier reference to |
||
Remove the declared |
||
Remove every client reference from |
||
Remove the declared |
||
Remove the declared |
||
Remove the declared |
||
Remove from what |
||
Remove from what |
||
Remove from what |
||
Remove from what |
||
Remove the declared |
||
Remove the declared |
||
Remove the declared |
||
Remove every supplier reference from |
||
Set the assignment action’s value argument. |
||
Set the annotating element’s text. |
||
Rewrite what |
||
Declare the feature |
||
Rewrite the multiplicity of the end’s owned cross feature; |
||
Set the declared name of the end’s owned cross feature. |
||
Declare the end’s owned cross feature |
||
Declare the end’s owned cross feature |
||
Set the declared short name of the end’s owned cross feature. |
||
Declare the feature’s value a default value, or a fixed one. |
||
Declare the feature |
||
Set the usage’s direction (the |
||
Add or remove the if action’s |
||
Set the condition of the if action’s |
||
Set the feature’s value expression. |
||
Set the transition’s guard – the expression written after |
||
Set whether the import imports members whatever their visibility (its
|
||
Rewrite what |
||
Declare the occurrence an individual, or stop declaring it so. |
||
Declare the feature’s value an initial value ( |
||
Set the language the representation’s text is written in. |
||
Set the comment’s locale. |
||
Rewrite the feature’s |
||
Rewrite what |
||
Declare the assertion |
||
Declare the feature |
||
Declare the feature |
||
Declare the state |
||
Set the send action’s payload argument. |
||
Rewrite what |
||
Rewrite what |
||
Declare the value of the payload of an accept action or a transition’s
trigger an initial value ( |
||
Rewrite what |
||
Rewrite what |
||
Rewrite what |
||
Rewrite what |
||
Declare the occurrence usage a snapshot or a timeslice, or neither. |
||
Rewrite the |
||
Set the action’s receiver argument – the |
||
Set whether the import is recursive (its |
||
Make the usage a reference, or composite. |
||
Set the result expression – the bare expression the body ends with. |
||
Set the usage’s |
||
Set the send action’s |
||
Set the for loop’s sequence argument. |
||
Rewrite what |
||
Rewrite the multiplicity of the connector’s source end; |
||
Rewrite the declared name of the connector’s source end; |
||
Declare the library package a standard library, or stop declaring it so. |
||
Rewrite the multiplicity of the connector’s target end; |
||
Rewrite the declared name of the connector’s target end; |
||
Set the node’s terminated-occurrence argument. |
||
Set the time or change trigger of an accept action or a transition’s
trigger; |
||
Set the loop’s |
||
Set the declared name of the for loop’s variable. |
||
Rewrite what |
Functions
- get_about(annotating: syside.AnnotatingElement) list[syside.Element]
Return the elements the annotating element is about (its
aboutclause).One entry per
Annotationthe element declares itself. An annotating element with noaboutclause annotates its owner, and that is not anAnnotationof its own, so this returns an empty list for it. That holds in a relationship’s body too, where the owner is theAnnotationrelating 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
ConstraintUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
ConstraintUsageto be performed by theAssertConstraintUsage. It is thereferenceFeatureof theownedReferenceSubsettingfor theAssertConstraintUsage, if there is one, and, otherwise, theAssertConstraintUsageitself.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(achain()for a chained reference), orNonewhere 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 intoassigned_target=: the feature assigned to, or achain()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
Noneif 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
:=), orNonewhere 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
Noneif it has none.- Raises:
UndecodableExpression – If no template describes the argument.
- get_assumed_constraint(usage: syside.ConstraintUsage) syside.ConstraintUsage | None
Return the
ConstraintUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.Nonewhere the membership’skindis notsyside.RequirementConstraintKind.Assumption: the member was written with another keyword.The
ConstraintUsagethat is referenced through thisRequirementConstraintMembership. It is thereferencedFeatureof theownedReferenceSubsettingof theownedConstraint, if there is one, and, otherwise, theownedConstraintitself.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, orNonewhere 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 formbody=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 ofnode:On
IfActionUsage: Return the if action’s condition as a template – the expression afterif– orNoneif the slot is empty.On
WhileLoopActionUsage: Return the while loop’s condition as a template – the expression afterwhile– orNoneon aloopwithout 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
ConjugatedPortTypingthe feature declares itself; plainFeatureTyping``s are not included, although a ``ConjugatedPortTypingis one –: Qis read byget_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:
Trueif 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
[...]afterend), as thebounds()template that writes it.- Parameters:
end – The end feature to read.
- Returns:
The cross multiplicity, or
Noneif 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
Noneif 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:
Trueif the cross feature carries thenonuniquekeyword;Falseif 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:
Trueif the cross feature carries theorderedkeyword;Falseif 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
Noneif 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_subsetsreads 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 intocrosses=.- Parameters:
feature – The feature to read the crossing of.
- Returns:
The crossed feature chain, or
Nonewhere 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:
Trueif the feature has a value declareddefault;Falseif 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 byclause).One entry per
FeatureTypingthe feature declares itself, theConjugatedPortTypingof a: ~Qincluded; inherited and implied typings are not included.- Parameters:
feature – The feature to read the typings of.
include_conjugations –
Falseleaves out the conjugated port definitions of: ~Qtypings (whatconjugates=wrote), reading whatdefined_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:
Trueif the declaration carries thederivedprefix.
- get_direction(usage: syside.Usage) syside.FeatureDirectionKind | None
Return the usage’s effective direction: the
in,outorinoutbefore it, orOutfor a return parameter, whose direction is fixed to out (KerML 8.3.4.7.8) whether or not the text says so, andInfor anelseaction, aParameterMembership’s member parameter (KerMLvalidateParameterMembershipParameterDirection).- Parameters:
usage – The usage to read.
- Returns:
The direction, or
Noneif 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
doclause).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
PerformActionUsagethedoclause created;as_performed_action=Truereads the action it references, which is what went intoeffect=. Adoclause 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 –
Truereads the action the perform usage references (whateffect=took) instead of the perform usage.
- Returns:
The effect action, or
Noneif the transition declares none.
- get_else_body(if_action: syside.IfActionUsage, *, as_flag: Literal[False] = ...) syside.ActionUsage | None
Return the if action’s
elseaction, orNonewhere the action has noelsebranch. Anelse ifcomes back as the nestedIfActionUsage, which is an action usage; narrow it withtry_cast.- Parameters:
if_action – The if action to read the
elsebody of.as_flag –
Truereads whether the if action has anelse { ... }body (whatelse_body=took):Falsefor noelsebranch and for anelse if.
- Returns:
The body action, an owner for the ordinary constructors, or
None; underas_flag=True, whether there is anelse { ... }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 ifbranch as a template, orNonewhere the action has noelsebranch, itselsebranch is a plain body, or the nested condition slot is empty.The nested if action itself is
get_else_body(), narrowed toIfActionUsage; 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 ifcondition 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 areset_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 isget_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
Noneif it has none.attribute x = 3;givesliteral(3),attribute z = x;givesref(x), andattribute y = 2 * 3;givesliteral(2) * literal(3). A value expression that no template describes raisesUndecodableExpression; 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
Noneif it has none.- Raises:
UndecodableExpression – If no template describes the value expression.
- get_event_occurrence(usage: syside.EventOccurrenceUsage) syside.OccurrenceUsage | None
Return the
OccurrenceUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
OccurrenceUsagereferenced as an event by thisEventOccurrenceUsage. It is thereferenceFeatureof theownedReferenceSubsettingfor theEventOccurrenceUsage, if there is one, and, otherwise, theEventOccurrenceUsageitself.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, orNonewhere the member is of another kind.
- get_exhibited_state(usage: syside.ExhibitStateUsage) syside.StateUsage | None
Return the
StateUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
StateUsageto be exhibited by theExhibitStateUsage. It is theperformedActionof theExhibitStateUsageconsidered as aPerformActionUsage, which must be aStateUsage.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, orNonewhere 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 ofelement:On
Package: Return the package’s filter conditions as templates, in the order they are written.One entry per
filtermember the package declares. A condition that no template describes raisesUndecodableExpression; read those with the low-level API.On
ViewDefinitionorViewUsage: Return the view’s own filter conditions as templates, in the order they are written.One entry per
filtermember the view declares itself; the conditions a view usage inherits from its view definition are not included. A condition that no template describes raisesUndecodableExpression; 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
Noneif the name resolves to nothing.
- get_framed_concern(usage: syside.ConcernUsage) syside.ConcernUsage | None
Return the
ConcernUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.Nonewhere noFramedConcernMembershipowns the usage: the property is that membership’s.The
ConcernUsagethat is referenced through thisFramedConcernMembership. It is thereferencedConstraintof theFramedConcernMembershipconsidered as aRequirementConstraintMembership, which must be aConcernUsage.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, orNonewhere 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– orNoneon 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
Noneif 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
allkeyword).private import all P::*;givesTrue. An expose always does, with no keyword written (SysMLvalidateExposeIsImportAll).- Parameters:
import – The import or expose to read.
- Returns:
Trueif private and protected members are imported too.
- get_imported(element: syside.MembershipImport) syside.Membership | None
Return what
imported=wrote, read by the kind ofelement: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 ofimport 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:
Trueif the declaration carries theindividualprefix.
- get_initial(feature: syside.Feature) bool
Return whether the feature’s value is an initial value (
:= <value>).- Parameters:
feature – The feature to read.
- Returns:
Trueif the feature has a value written with:=;Falseif 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
languageclause.
- 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
Noneif the comment declares none.
- get_loop_body(loop: syside.LoopActionUsage) syside.ActionUsage
Return the loop’s body: the action whose members are the
{ ... }of thewhile,looporfor.The body is populated: pass it as the
ownerof 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 throughnew_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()ornew_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
forandin, 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 throughnew_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", orNonefor 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, orNone.
- get_metadata(element: syside.Package, *, as_definitions: Literal[False] = ...) list[syside.MetadataFeature | syside.MetadataUsage]
Return the default reading of
metadata=, by the kind ofelement:On
Package: Return the metadata usages the package’s declaration is prefixed with.One entry per
#Mprefix. By default the entries are the metadata usages the prefixes created;as_definitions=Truereads the metaclasses they name, which is what went intometadata=. Ametadata : 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
#Mprefix. By default the entries are the metadata usages the prefixes created;as_definitions=Truereads the metaclasses they name, which is what went intometadata=. Ametadata : 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
#Mprefix, as on a definition. A dependency is a relationship and owns no membership, so the grammar relates its prefixes byAnnotation; 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
#Mprefix. By default the entries are the metadata usages the prefixes created;as_definitions=Truereads the metaclasses they name, which is what went intometadata=. Ametadata : M;body member is not a prefix and is not returned.
There is no
set_for the prefixes: the core exposes theprefixescontainer itself, so a prefix is added by appending to it and removed by removing its relationship, exactly asmetadata=does at construction.- Parameters:
element – The element to read.
as_definitions –
Truereads the metaclass each prefix names (whatmetadata=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 the1..1a feature without one defaults to, are not read; the evaluated integer bounds aremultiplicity_bounds()’s.- Parameters:
feature – The feature to read the multiplicity of.
- Returns:
The multiplicity, or
Noneif 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 ofelement:On
Membership: Return the alias membership’s member name, else its member short name.This reads the abstract syntax’s
memberName, falling back tomemberShortName: 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 todeclaredShortNamewhere no long name is declared, so an element declared asattribute <mass>;yields"mass". Inherited names are not considered: for the effective name name resolution sees, useelement.name.
- Parameters:
element – The element to read.
only_long –
Truereads the declared long name alone, with no fallback to the short name: whatname=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:
Trueif the declaration carries thenotkeyword.
- get_nonunique(feature: syside.Feature) bool
Return whether the feature is declared
nonunique.The keyword writes
Falseintois_unique; this returns its negation.- Parameters:
feature – The feature to read the flag of.
- Returns:
Trueif the declaration carries thenonuniquekeyword.
- get_ordered(feature: syside.Feature) bool
Return whether the feature is declared
ordered.- Parameters:
feature – The feature to read the flag of.
- Returns:
Trueif the declaration carries theorderedkeyword.
- 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:
Trueif the declaration carries theparallelkeyword.
- get_payload(send: syside.SendActionUsage) syside.experimental.expressions.ExpressionTemplate | None
Return the send action’s payload argument as a template (written after
send), orNonewhere 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
Noneif 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: 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
AcceptActionUsageorFlowUsageorTransitionUsage: 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the types the payload of an accept action, a transition’s trigger or a flow is defined by (its:/defined byclause).On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the types the payload of an accept action, a transition’s trigger or a flow is defined by (its:/defined byclause).
One entry per
FeatureTypingthe 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the value of the payload of an accept action, a transition’s trigger or a flow (its=clause) as a template.On
AcceptActionUsageorFlowUsageorTransitionUsage: 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;givesref(t). A time or change trigger, which is the payload’s value too, is read byget_triggerand givesNonehere.- 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 (KerMLvalidateFeatureValueIsInitial), 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:
Trueif the payload has a value written with:=;Falseif 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the multiplicity the payload of an accept action, a transition’s trigger or a flow declares.On
AcceptActionUsageorFlowUsageorTransitionUsage: 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the declared name of the payload of an accept action, a transition’s trigger or a flow, orNonewhere the payload is anonymous or absent.On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the declared name of the payload of an accept action, a transition’s trigger or a flow, orNonewhere 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return whether the payload of an accept action, a transition’s trigger or a flow is declaredordered.On
AcceptActionUsageorFlowUsageorTransitionUsage: Return whether the payload of an accept action, a transition’s trigger or a flow is declaredordered.
- 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 typingpayload_nameandpayload_defined_byset.There is no
set_payload_parameter: the parameter is created with the action and named and typed throughset_nameandadd_defined_byon 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow redefines (its:>>clause).On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow redefines (its:>>clause).
As
get_redefinesreads them, of the payload rather than the element: one entry perRedefinitionthe 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the feature the payload of an accept action, a transition’s trigger or a flow references (its::>clause), as it went intopayload_references=: the feature, or thechain()template of a feature chain.On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the feature the payload of an accept action, a transition’s trigger or a flow references (its::>clause), as it went intopayload_references=: the feature, or thechain()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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the declared short name of the payload of an accept action, a transition’s trigger or a flow: the<s>ofaccept <s> x : T;.On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the declared short name of the payload of an accept action, a transition’s trigger or a flow: the<s>ofaccept <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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow subsets (its:>clause).On
AcceptActionUsageorFlowUsageorTransitionUsage: Return the features the payload of an accept action, a transition’s trigger or a flow subsets (its:>clause).
As
get_subsetsreads 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
ActionUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
ActionUsageto be performed by thisPerformedActionUsage. It is theeventOccurrenceof thePerformActionUsageconsidered as anEventOccurrenceUsage, which must be anActionUsage.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, orNonewhere 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, orNoneif 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
toclause of a send, theviaclause of an accept or of a transition’s trigger – orNonewhere 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
Noneif 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:
Trueif 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
Redefinitionthe feature declares itself; inherited and implied redefinitions are not included. A redefinition of a feature chain comes back as thechain()template of its chained features, as it went intoredefines=.- 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
refalways 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 returnsTruethere too.- Parameters:
usage – The usage to read.
- Returns:
Trueif the usage is a reference,Falseif composite.
- get_references(feature: syside.Feature) syside.Feature | syside.experimental.expressions.FeatureChainTemplate | None
Return the feature this one references (its
::>clause), as it went intoreferences=: the feature, or thechain()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
Nonewhere the feature declares noReferenceSubsetting.
- get_rendering(usage: syside.RenderingUsage) syside.RenderingUsage | None
Return the
RenderingUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.Nonewhere noViewRenderingMembershipowns the usage: the property is that membership’s.The
RenderingUsagethat is referenced through thisViewRenderingMembership. It is thereferencedFeatureof theownedReferenceSubsettingfor theownedRendering, if there is one, and, otherwise, theownedRenderingitself.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, orNonewhere the member is of another kind.
- get_required_constraint(usage: syside.ConstraintUsage) syside.ConstraintUsage | None
Return the
ConstraintUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.Nonewhere the membership’skindis notsyside.RequirementConstraintKind.Requirement: the member was written with another keyword.The
ConstraintUsagethat is referenced through thisRequirementConstraintMembership. It is thereferencedFeatureof theownedReferenceSubsettingof theownedConstraint, if there is one, and, otherwise, theownedConstraintitself.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, orNonewhere 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
Noneon 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
Noneif 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
byclause references, orNonewhere it has nobyclause. A chain comes back as thechain()template of its chained features, as it went intosatisfied_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
RequirementUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
RequirementUsagethat is satisfied by thesatisfyingSubjectof thisSatisfyRequirementUsage. It is theassertedConstraintof theSatisfyRequirementUsageconsidered as anAssertConstraintUsage, which must be aRequirementUsage.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(achain()for a chained reference), orNonewhere the member is of another kind.
- get_sender(send: syside.SendActionUsage) syside.experimental.expressions.ExpressionTemplate | None
Return the send action’s
viaargument as a template, orNonewhere 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
viaargument of.- Returns:
The template for the action’s
viaargument, orNoneif 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), orNonewhere 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
Noneif 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 ofelement: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 asattribute mass;yieldsNone. For the derived short name useelement.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 ofelement:On
FlowUsage: Return the source end of the flow or message, assource=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.faschain(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 thechain()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
firstclause of a succession.On
TransitionUsage: Return the action or state the transition runs from (itsfirstclause).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
Noneif 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
Noneif 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
Subclassificationthe 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:
Trueif the declaration readsstandard library package.
- get_subsets(feature: syside.Feature) list[syside.Feature | syside.experimental.expressions.FeatureChainTemplate]
Return the features this one subsets (its
:>/subsetsclause).Redefinitions (
:>>), reference subsettings (::>, and theevent,perform,includeandrequireshorthands that write one) and cross subsettings (=>) are not included, although the metamodel makes each aSubsetting: each is a clause of its own, read byget_redefines, the reference getter of its construct, andget_crosses. Inherited and implied subsettings are not included either. A subsetting of a feature chain comes back as thechain()template of its chained features, as it went intosubsets=.- 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 ofelement:On
FlowUsage: Return the target end of the flow or message, astarget=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.faschain(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 thechain()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
thenclause of a succession. On a connector with more than two ends (ends=), KerML’s targets are every end but the first: read them throughget_ends().On
TransitionUsage: Return the action or state the transition runs to (itsthenclause).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 throughget_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
Noneif 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 throughget_ends().- Parameters:
connector – The connector to read.
- Returns:
The end’s name, or
Noneif 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
Nonewhere it has none or its target is a feature reference, whichget_assigned_target()gives as the first feature of itschain().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
Noneon a bareterminate;.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
Noneif 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
thenbody: the action whose members are the{ ... }after the condition.The body is populated: pass it as the
ownerof 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 throughnew_action(if_action, ..., member="then").- Parameters:
if_action – The if action to read the
thenbody of.- Returns:
The body action, an owner for the ordinary constructors.
- Raises:
ValueError – If the if action has no
thenbody – one not built bynew_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 theat()/after()/when()template that writes it.- Parameters:
element – The accept action or transition to read.
- Returns:
The trigger, or
Noneif 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
untilcondition as a template, orNonewhere the loop has nountilclause.A condition that no template describes raises
UndecodableExpression; read those with the low-level API.- Parameters:
loop – The while loop to read the
untilcondition of.- Returns:
The template for the
untilcondition, orNoneif there is none.- Raises:
UndecodableExpression – If no template describes the condition.
- get_use_case_included(usage: syside.IncludeUseCaseUsage) syside.UseCaseUsage | None
Return the
UseCaseUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.The
UseCaseUsageto be included by thisIncludeUseCaseUsage. It is theperformedActionof theIncludeUseCaseUsageconsidered as aPerformActionUsage, which must be aUseCaseUsage.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, orNonewhere 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
Nonewhere 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
Noneif 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; }putseunder aVariantMembershiptoo, soget_variantof it isTrue.- Parameters:
element – The element to read.
- Returns:
Trueif the element is avariantmember.
- get_verified_requirement(usage: syside.RequirementUsage) syside.RequirementUsage | None
Return the
RequirementUsagethis usage stands for: the one it references, or the usage itself where it declares one of its own.Nonewhere noRequirementVerificationMembershipowns the usage: the property is that membership’s.The
RequirementUsagethat is identified as being verified. It is thereferencedConstraintof theRequirementVerificationMembershipconsidered as aRequirementConstraintMembership, which must be aRequirementUsage.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, orNonewhere the member is of another kind.
- get_visibility(element: syside.Element) syside.VisibilityKind
Return what
visibility=wrote, read by the kind ofelement:On
Import: Return the import’s visibility (the indicator beforeimport).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
Annotationfromannotatingtoannotated.Same effect on the model as including
annotatedinabout=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
clientinclients=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
ConjugatedPortTypingfromfeaturetoconjugate.Same effect on the model as including
conjugateinconjugates=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
Subsettingfrom the end’s owned cross feature tosuperset.Same effect on the model as including
supersetincross_subsets=at construction: a single feature, or achain()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
FeatureTypingfromfeaturetodefinition.Same effect on the model as including
definitionindefined_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 ofelement:On
Package: Add onefilter <condition>;member to the package, after the filters it already carries.conditionis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thefilters=constructor parameter accepts; the effect on the model is the same as including it infilters=at construction.On
ViewDefinitionorViewUsage: Add onefilter <condition>;member to the view, after the filters it already carries.conditionis accepted in exactly the forms thefilters=constructor parameter accepts; the effect on the model is the same as including it infilters=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 aNamespaceImport, so aMembershipImport(import P::X;) is replaced by one: read the import back from its owner rather than through theMembershipImportreference.
- 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneFeatureTypingfrom the payload of an accept action, a transition’s trigger or a flow todefinition.On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneFeatureTypingfrom the payload of an accept action, a transition’s trigger or a flow todefinition.
Same effect on the model as including
definitioninpayload_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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneRedefinitionfrom the payload of an accept action, a transition’s trigger or a flow toredefined.On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneRedefinitionfrom the payload of an accept action, a transition’s trigger or a flow toredefined.
Same effect on the model as including
redefinedinpayload_redefines=at construction: a single feature, or achain()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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneSubsettingfrom the payload of an accept action, a transition’s trigger or a flow tosuperset.On
AcceptActionUsageorFlowUsageorTransitionUsage: Add oneSubsettingfrom the payload of an accept action, a transition’s trigger or a flow tosuperset.
Same effect on the model as including
supersetinpayload_subsets=at construction: a single feature, or achain()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
Redefinitionfromfeaturetoredefined.Same effect on the model as including
redefinedinredefines=at construction: a single feature, or achain()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
Subclassificationfromdefinitiontosuperclassifier.Same effect on the model as including
superclassifierinspecializes=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
Subsettingfromfeaturetosuperset.Same effect on the model as including
supersetinsubsets=at construction: a single feature, or achain()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
supplierinsuppliers=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 ``annotatingtoannotated.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
dependencytoclient.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 ``featuretoconjugate.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 ``featuretodefinition.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 ofelement:On
Package: Remove the package’sfiltermembers whose condition iscondition.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
ViewDefinitionorViewUsage: Remove the view’s ownfiltermembers whose condition iscondition.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 iscondition.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
MembershipImportreplacing 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredFeatureTyping``s from the payload of an accept action, a transition's trigger or a flow to ``definition.On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredFeatureTyping``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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredRedefinition``s from the payload of an accept action, a transition's trigger or a flow to ``redefined.On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredRedefinition``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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredSubsetting``s from the payload of an accept action, a transition's trigger or a flow to ``superset.On
AcceptActionUsageorFlowUsageorTransitionUsage: Remove the declaredSubsetting``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 ``featuretoredefined.Other heritage relationships to the same feature – a plain
Subsetting, say – are left alone. Achain()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 ``definitiontosuperclassifier.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 ``featuretosuperset.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. Achain()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
dependencytosupplier.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.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theassigned_value=constructor parameter accepts; the effect on the model is the same as passingassigned_value=valueat 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 ofnode:On
IfActionUsage: Set the if action’s condition – the expression afterif.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thecondition=constructor parameter accepts; the effect on the model is the same as passingcondition=valueat construction. Any existing condition is replaced.On
WhileLoopActionUsage: Set the while loop’s condition – the expression afterwhile.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thecondition=constructor parameter accepts; the effect on the model is the same as passingcondition=valueat construction. Any existing condition is replaced; aloopgiven a condition becomes awhile.
- 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 –
Trueto add theconstantprefix,Falseto 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;
Noneremoves it.Same effect on the model as passing
cross_multiplicity=at construction. An end without a cross feature gets one, unlessmultiplicityisNone; a cross feature left declaring nothing is removed.- Parameters:
end – The end feature to write.
multiplicity – The multiplicity, built by
bounds(), orNone.
- 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, unlessnameisNone; a cross feature left declaring nothing is removed.- Parameters:
end – The end feature to write.
name – The declared name, or
Nonefor 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, unlessnonuniqueisFalse; a cross feature left declaring nothing is removed.- Parameters:
end – The end feature to write.
nonunique –
Trueto add thenonuniquekeyword,Falseto 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, unlessorderedisFalse; a cross feature left declaring nothing is removed.- Parameters:
end – The end feature to write.
ordered –
Trueto add theorderedkeyword,Falseto 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, unlessshort_nameisNone; a cross feature left declaring nothing is removed.- Parameters:
end – The end feature to write.
short_name – The declared short name, or
Nonefor 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 –
Trueto add thedefaultkeyword,Falseto remove it.
- Raises:
ValueError – If
defaultisTrueand 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 –
Trueto add thederivedprefix,Falseto remove it.
- set_direction(usage: syside.Usage, direction: syside.FeatureDirectionKind | None) None
Set the usage’s direction (the
in,outorinoutbefore it).Same effect on the model as
direction=at construction.- Parameters:
usage – The usage to write.
direction – The direction to declare, or
Noneto declare none.
- Raises:
ValueError – If
usageis an end feature, which has no direction (KerMLvalidateFeatureEndNoDirection), or a return parameter given another direction thanOut, to which it is fixed (KerML 8.3.4.7.8), or anelseaction given another thanIn, to which aParameterMembership’s member parameter is fixed (KerMLvalidateParameterMembershipParameterDirection). The constructors refuse the samedirection=arguments, withTypeErroras for every argument they refuse.TypeError – If
directionis not asyside.FeatureDirectionKind.
- set_else_body(if_action: syside.IfActionUsage, value: bool) None
Add or remove the if action’s
elsebody.Truecreates an emptyelse { ... }body where there is none, and replaces a nestedelse ifwith one – the same effect aselse_body=Trueat construction.Falseremoves theelsebranch, body or nestedifalike, and is a no-op where there is none.- Parameters:
if_action – The if action to write the
elsebody of.value – Whether the action is to have an
elsebody.
- set_else_if(if_action: syside.IfActionUsage, value: syside.experimental.expressions.ExpressionLike) None
Set the condition of the if action’s
else ifbranch, nesting an if action there if there is none.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theelse_if=constructor parameter accepts; on an action without anelsebranch the effect is the same as passingelse_if=valueat construction. A plainelsebody 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 ifbranch 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.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theequals=constructor parameter accepts; the effect on the model is the same as passingequals=valueat 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.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theguard=constructor parameter accepts; the effect on the model is the same as passingguard=valueat 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
allkeyword).Same effect on the model as
import_all=at construction.- Parameters:
import – The import to write.
import_all –
Trueto add theallkeyword,Falseto remove it.
- Raises:
ValueError – If
import_is an expose andimport_allisFalse: an expose imports all (SysMLvalidateExposeIsImportAll).
- set_imported(element: syside.MembershipImport | syside.NamespaceImport, target: syside.Membership | syside.Namespace) None
Rewrite what
imported=wrote, by the kind ofelement:On
MembershipImport: Retarget the import in place: same effect on the model asimported=at construction, keeping the import’s position, visibility,::**and filters.On
NamespaceImport: Retarget the import in place: same effect on the model asimported=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 –
Trueto add theindividualprefix,Falseto 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 –
Truefor:=,Falsefor=.
- Raises:
ValueError – If
initialisTrueand 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;Noneremoves 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(), orNone.
- set_name(element: syside.Element, name: str) None
Rewrite what
name=wrote, by the kind ofelement:On
Membership: Set the alias membership’s member name.This writes the abstract syntax’s
memberName, with the same effect on the model as passingname=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 passingname=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 –
Trueto add thenotkeyword,Falseto 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 intois_unique.- Parameters:
feature – The feature to write the flag on.
nonunique –
Trueto add thenonuniquekeyword,Falseto 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 –
Trueto add theorderedkeyword,Falseto 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 –
Trueto add theparallelkeyword,Falseto remove it.
- set_payload(send: syside.SendActionUsage, value: syside.experimental.expressions.ExpressionLike) None
Set the send action’s payload argument.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thepayload=constructor parameter accepts; the effect on the model is the same as passingpayload=valueat 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: 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
AcceptActionUsageorFlowUsageorTransitionUsage: 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Set the value of the payload of an accept action, a transition’s trigger or a flow;Noneremoves it.On
AcceptActionUsageorFlowUsageorTransitionUsage: Set the value of the payload of an accept action, a transition’s trigger or a flow;Noneremoves it.
Same effect on the model as passing
payload_equals=at construction. A value replaces any existing one, a time or change trigger included;Noneleaves 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:=(seeget_payload_initial), so this takes no flow.- Parameters:
element – The accept action or transition to write.
initial –
Truefor:=,Falsefor=.
- Raises:
ValueError – If
initialisTrueand 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Rewrite the multiplicity of the payload of an accept action, a transition’s trigger or a flow;Noneremoves it.On
AcceptActionUsageorFlowUsageorTransitionUsage: Rewrite the multiplicity of the payload of an accept action, a transition’s trigger or a flow;Noneremoves 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Set the declared name of the payload of an accept action, a transition’s trigger or a flow.On
AcceptActionUsageorFlowUsageorTransitionUsage: 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=valueat construction.Nonemakes 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Declare the payload of an accept action, a transition’s trigger or a flowordered, or stop declaring it so.On
AcceptActionUsageorFlowUsageorTransitionUsage: Declare the payload of an accept action, a transition’s trigger or a flowordered, 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 ofelement:On
AcceptActionUsageorFlowUsageorTransitionUsage: Set the declared short name of the payload of an accept action, a transition’s trigger or a flow;Noneremoves it.On
AcceptActionUsageorFlowUsageorTransitionUsage: Set the declared short name of the payload of an accept action, a transition’s trigger or a flow;Noneremoves 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 thesyside.PortionKindmember of that name, to write the prefix;Noneto remove it.
- Raises:
ValueError – If
portionis neitherNone,"snapshot","timeslice"nor asyside.PortionKindmember.
- set_prefix(element: syside.Definition | syside.Usage, value: Literal[abstract, variation] | None) None
Rewrite the
prefix=value in place;Noneremoves 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", orNone.
- Raises:
ValueError – If the element holds
"end".ValueError – If
valueisNoneand 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
toclause of a send, theviaclause of an accept or of a transition’s trigger.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thereceiver=constructor parameter accepts; the effect on the model is the same as passingreceiver=valueat 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
actionis a transition without a trigger whose source is no state: a trigger is valid only on a transition from a state (SysML 2.1validateTransitionUsageTriggerActions).
- 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 –
Trueto 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 intois_composite.- Parameters:
usage – The usage to write.
ref –
Truefor a reference (therefprefix),Falsefor composite.
- Raises:
ValueError – If
refisFalseandusageis 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.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theresult=constructor parameter accepts; the effect on the model is the same as passingresult=valueat 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
elementis 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
byclause, or remove it withNone.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(), orNone.
- 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
viaargument.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thesender=constructor parameter accepts; the effect on the model is the same as passingsender=valueat construction. Any existingviaargument is replaced; an empty sender parameter (asend ... to ...;withoutvia) is filled.- Parameters:
send – The send action to write the
viaargument 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.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms thesequence=constructor parameter accepts; the effect on the model is the same as passingsequence=valueat 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 ofelement: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 passingshort_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 passingshort_name=at construction. For the derived short name useelement.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;
Noneremoves it.Same effect on the model as passing
source_multiplicity=at construction.- Parameters:
connector – The connector to write.
multiplicity – The multiplicity, built by
bounds(), orNone.
- 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;
Noneremoves 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 –
Trueto add thestandardprefix,Falseto remove it.
- set_target_multiplicity(connector: syside.ConnectorAsUsage, multiplicity: syside.experimental.expressions.MultiplicityTemplate | None) None
Rewrite the multiplicity of the connector’s target end;
Noneremoves 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 throughget_ends().Same effect on the model as passing
target_multiplicity=at construction.- Parameters:
connector – The connector to write.
multiplicity – The multiplicity, built by
bounds(), orNone.
- 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;
Noneremoves 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 throughget_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.
valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theterminated_occurrence=constructor parameter accepts; the effect on the model is the same as passingterminated_occurrence=valueat 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;
Noneremoves it.Same effect on the model as passing
trigger=at construction; a transition without a trigger gets one. Any existing trigger is replaced.- Parameters:
- Raises:
ValueError – If
elementis a transition without a trigger whose source is no state: a trigger is valid only on a transition from a state (SysML 2.1validateTransitionUsageTriggerActions).
- set_until(loop: syside.WhileLoopActionUsage, value: syside.experimental.expressions.ExpressionLike) None
Set the loop’s
untilcondition.valueis anExpressionTemplate, a bare model element, or a Python primitive, accepted in exactly the forms theuntil=constructor parameter accepts; the effect on the model is the same as passinguntil=valueat construction. Any existinguntilcondition is replaced.- Parameters:
loop – The while loop to write the
untilcondition 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=valueat construction; a missing loop variable is created.Nonemakes the variable anonymous.- Parameters:
loop – The for loop to write the variable name of.
value – The new declared name, or
Nonefor an anonymous variable.
- set_visibility(element: syside.Element, visibility: syside.VisibilityKind) None
Rewrite what
visibility=wrote, by the kind ofelement:On
Import: Set the import’s visibility (the indicator beforeimport).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.