Feature SysML

class Feature

Implementation of Feature defined in the KerML specification.

Specification:

A Feature is a Type that classifies relations between multiple things (in the universe). The domain of the relation is the intersection of the featuring_types of the Feature. (The domain of a Feature with no featuring_types is implicitly the most general Type Base::Anything from the Kernel Semantic Library.) The co-domain of the relation is the intersection of the types of the Feature.

In the simplest cases, the featuring_types and types are Classifiers and the Feature relates two things, one from the domain and one from the range. Examples include cars paired with wheels, people paired with other people, and cars paired with numbers representing the car length.

Since Features are Types, their featuring_types and types can be Features. In this case, the Feature effectively classifies relations between relations, which can be interpreted as the sequence of things related by the domain Feature concatenated with the sequence of things related by the co-domain Feature.

The values of a Feature for a given instance of its domain are all the instances of its co-domain that are related to that domain instance by the Feature. The values of a Feature with chaining_features are the same as values of the last Feature in the chain, which can be found by starting with values of the first Feature, then using those values as domain instances to obtain values of the second Feature, and so on, to values of the last Feature.

For language description, see section 7.3.4 of the KerML specification. For more details on the model, see section 8.3.3.3.4 of the KerML specification.

Feature Feature syside.Feature Type Type syside.Type Type->Feature Namespace Namespace syside.Namespace Namespace->Type Element Element syside.Element Element->Namespace AstNode AstNode syside.AstNode AstNode->Element
Children
Members defined in Feature (39 members)

STD

R

basic_feature

R

The last_chaining_feature if one exists, otherwise this Feature.

cross_feature

R

The second chaining_feature of the crossed_feature of the owned_cross_subsetting of this Feature, if it has one. Semantically, the values of the cross_feature of an end Feature must include all values of the end Feature obtained when navigating from values of the other end Features of the same owning_type.

direction

RW

Indicates how values of this Feature are determined or used (as specified for the FeatureDirectionKind).

end_owning_type

R

The Type that is related to this Feature by an EndFeatureMembership in which the Feature is an owned_member_feature.

explicit_direction

R

Returns the direction this Feature has been declared with in the textual syntax.

feature_target

R

The last of the chaining_features of this Feature, if it has any. Otherwise, this Feature itself.

feature_value

R

The FeatureValue owned by this Feature if any.

feature_value_expression

R

The feature value Expression of this Feature if any.

feature_value_member

R

SysIDE specific accessor for manipulating feature_value.

featuring_types

R

Types that feature this Feature, such that any instance in the domain of the Feature must be classified by all of these Types, including at least all the featuring_types of its type_featurings. If the Feature is chained, then the featuring_types of the first Feature in the chain are also featuring_types of the chained Feature.

first_chaining_feature

R

The related Feature related by the first owned_feature_chaining if any.

is_composite

RW

Whether the Feature is a composite feature of its featuring_type. If so, the values of the Feature cannot exist after its featuring instance no longer does.

is_composite_explicitly

R

Returns True if this Feature has been declared composite in the textual syntax.

is_derived

RW

Whether the values of this Feature can always be computed from the values of other Features.

is_end

RW

Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping each of its domain instances to a single co-domain instance. However, it may have a cross_feature, in which case values of the cross_feature must be the same as those found by navigation across instances of the owning_type from values of other end Features to values of this Feature. If the owning_type has n end Features, then the multiplicity, ordering, and uniqueness declared for the cross_feature of any one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of values of that Feature reached by navigation when the values of the other n-1 end Features are held fixed.

is_end_explicitly

R

Returns True if this Feature has been declared end in the textual syntax.

is_nonunique

RW

is_ordered

RW

Whether an order exists for the values of this Feature or not.

is_portion

RW

Whether the values of this Feature are contained in the space and time of instances of the domain of the Feature and represent the same thing as those instances.

is_read_only

RW

Whether the values of this Feature can change over the lifetime of an instance of the domain.

is_unique

RW

Whether or not values for this Feature must have no duplicates or not.

last_chaining_feature

R

The related Feature related by the last owned_feature_chaining if any.

owned_cross_feature

R

The member Feature that is declared before any prefixes in the textual syntax.

owned_cross_feature_member

R

SysIDE specific accessor for either owned crossing_feature or crossing_multiplicity. This is the member Feature that is declared before any prefixes in the textual syntax.

owned_cross_subsetting

R

The one owned_subsetting of this Feature, if any, that is a CrossSubsetting}, for which the Feature is the crossing_feature.

owned_feature_chainings

R

The owned_relationships of this Feature that are FeatureChainings, for which the Feature will be the feature_chained.

owned_feature_invertings

R

The owned_relationships of this Feature that are FeatureInvertings and for which the Feature is the feature_inverted.

owned_redefinitions

R

The owned_subsettings of this Feature that are Redefinitions, for which the Feature is the redefining_feature.

owned_reference_subsetting

R

The one owned_subsetting of this Feature, if any, that is a ReferenceSubsetting, for which the Feature is the referencing_feature.

owned_subsettings

R

The owned_specializations of this Feature that are Subsettings, for which the Feature is the subsetting_feature.

owned_type_featurings

R

The owned_relationships of this Feature that are TypeFeaturings and for which the Feature is the feature_of_type.

owned_typings

R

The owned_specializations of this Feature that are FeatureTypings, for which the Feature is the typed_feature.

owning_feature_membership

R

The FeatureMembership that owns this Feature as an owned_member_feature, determining its owning_type.

owning_type

R

The Type that is the owning_type of the owning_feature_membership of this Feature.

referenced_feature

R

Returns the Feature this Feature references through ReferenceSubsetting if any.

referenced_feature_target

R

Returns the feature_target of referenced_feature, i.e. referenced_feature.feature_target.

types

R

Types that restrict the values of this Feature, such that the values must be instances of all the types. The types of a Feature are derived from its typings and the types of its subsettings. If the Feature is chained, then the types of the last Feature in the chain are also types of the chained Feature.

find_owned_cross_feature

Members inherited from Type (36 members)

declared_multiplicity

R

The owned multiplicity that is declared before the children block in the textual syntax.

declared_multiplicity_member

R

SysIDE specific accessor for manipulating declared_multiplicity.

differencing_types

R

The interpretations of a Type with differencing_types are asserted to be those of the first of those Types, but not including those of the remaining Types. For example, a Classifier might be the difference of a Classifier for people and another for people of a particular nationality, leaving people who are not of that nationality. Similarly, a feature of people might be the difference between a feature for their children and a Classifier for people of a particular sex, identifying their children not of that sex (because the interpretations of the children Feature that identify those of that sex are also interpretations of the Classifier for that sex).

directed_features

R

The features of this Type that have a non-null direction.

disjoining_types

R

The types that related to this Type through owned_disjoinings.

end_features

R

All features of this Type with is_end = true.

feature_memberships

R

The FeatureMemberships for features of this Type, which include all owned_feature_memberships and those inherited_memberships that are FeatureMemberships (but does not include any imported_memberships).

features

R

The owned_member_features of the feature_memberships of this Type.

heritage

R

The specializations and conjugations owned by this Type.

inherited_features

R

All the member_features of the inherited_memberships of this Type that are FeatureMemberships.

inherited_memberships

R

All Memberships inherited by this Type via Specialization or Conjugation. These are included in the derived union for the memberships of the Type.

inputs

R

All features related to this Type by FeatureMemberships that have direction in or inout.

intersecting_types

R

The interpretations of a Type with intersecting_types are asserted to be those in common among the intersecting_types, which are the Types derived from the intersecting_type of the owned_intersectings of this Type. For example, a Classifier might be an intersection of Classifiers for people of a particular sex and of a particular nationality. Similarly, a feature for people’s children of a particular sex might be the intersection of a Feature for their children and a Classifier for people of that sex (because the interpretations of the children Feature that identify those of that sex are also interpretations of the Classifier for that sex).

is_abstract

RW

Indicates whether instances of this Type must also be instances of at least one of its specialized Types.

is_conjugated

R

Indicates whether this Type has an owned_conjugator.

is_sufficient

RW

Whether all things that meet the classification conditions of this Type must be classified by the Type.

is_sufficient_explicitly

R

Returns True if this Type was declared as sufficient in the textual syntax.

multiplicity

R

An owned_member of this Type that is a Multiplicity, which constraints the cardinality of the Type. If there is no such owned_member, then the cardinality of this Type is constrained by all the Multiplicity constraints applicable to any direct supertypes.

outputs

R

All features related to this Type by FeatureMemberships that have direction out or inout.

owned_conjugator

R

A Conjugation owned by this Type for which the Type is the original_type.

owned_differencings

R

The owned_relationships of this Type that are Differencings, having this Type as their type_differenced.

owned_directed_features

R

The directed_features that are owned by this Type.

owned_disjoinings

R

The owned_relationships of this Type that are Disjoinings, for which the Type is the type_disjoined Type.

owned_end_features

R

All end_features of this Type that are owned_features.

owned_feature_memberships

R

The owned_memberships of this Type that are FeatureMemberships, for which the Type is the owning_type. Each such FeatureMembership identifies an owned_feature of the Type.

owned_features

R

The owned_member_features of the owned_feature_memberships of this Type.

owned_inputs

R

The inputs that are owned by this Type.

owned_intersectings

R

The owned_relationships of this Type that are Intersectings, have the Type as their type_intersected.

owned_outputs

R

The outputs that are owned by this Type.

owned_specializations

R

The owned_relationships of this Type that are Specializations, for which the Type is the specific Type.

owned_unionings

R

The owned_relationships of this Type that are Unionings, having the Type as their type_unioned.

type_relationships

R

The other type, feature relationships and FeatureChainings owned by this Type.

unioning_types

R

The interpretations of a Type with unioning_types are asserted to be the same as those of all the unioning_types together, which are the Types derived from the unioning_type of the owned_unionings of this Type. For example, a Classifier for people might be the union of Classifiers for all the sexes. Similarly, a feature for people’s children might be the union of features dividing them in the same ways as people in general.

conforms

direction_of

specializes

Members inherited from Namespace (10 members)

children

R

The elements enclosed by curly brackets in textual syntax.

members

R

The set of all member Elements of this Namespace, which are the member_elements of all memberships of the Namespace.

memberships

R

All Memberships in this Namespace, including (at least) the union of owned_memberships and imported_memberships.

owned_imports

R

The owned_relationships of this Namespace that are Imports, for which the Namespace is the import_owning_namespace.

owned_members

R

The owned members of this Namespace, which are the owned_member_elements of the owned_memberships of the Namespace.

owned_memberships

R

The owned_relationships of this Namespace that are Memberships, for which the Namespace is the membership_owning_namespace.

prefixes

R

Metadata prefixes, prefixed with # in textual syntax.

__getitem__

get_member

get_membership

Members inherited from Element (23 members)

comments

R

The owned Comments related by owned_relationships.

declared_name

RW

The declared name of this Element.

declared_short_name

RW

An optional alternative name for the Element that is intended to be shorter or in some way more succinct than its primary name. It may act as a modeler-specified identifier for the Element, though it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a model or relative to some other context.

documentation

R

The Documentation owned by this Element.

element_id

RW

The globally unique identifier for this Element. This is intended to be

set by tooling, and it must not change during the lifetime of the Element.

is_implied_included

R

Whether all necessary implied Relationships have been included in the owned_relationships of this Element. This property may be true, even if there are not actually any owned_relationships with is_implied = true, meaning that no such Relationships are actually implied for this Element. However, if it is false, then owned_relationships may not contain any implied Relationships. That is, either all required implied Relationships must be included, or none of them.

is_library_element

R

Whether this Element is contained in the ownership tree of a library model.

metadata

R

The owned metadata related by owned_relationships.

name

R

The name to be used for this Element during name resolution within its owning_namespace. This is derived using the effective_name() operation. By default, it is the same as the declared_name, but this is overridden for certain kinds of Elements to compute a name even when the declared_name is null.

owned_annotations

R

The owned_relationships of this Element that are Annotations, for which this Element is the annotated_element.

owned_elements

R

The Elements owned by this Element, derived as the owned_related_elements of the owned_relationships of this Element.

owned_relationships

R

The Relationships for which this Element is the owning_related_element.

owner

R

The owner of this Element, derived as the owning_related_element of the owning_relationship of this Element, if any.

owning_membership

R

The owning_relationship of this Element, if that Relationship is a Membership.

owning_namespace

R

The Namespace that owns this Element, which is the membership_owning_namespace of the owning_membership of this Element, if any.

owning_relationship

R

The Relationship for which this Element is an owned_related_element, if any.

qualified_name

R

The full ownership-qualified name of this Element, represented in a form that is valid according to the KerML textual concrete syntax for qualified names (including use of unrestricted name notation and escaped characters, as necessary). The qualified_name is null if this Element has no owning_namespace or if there is not a complete ownership chain of named Namespaces from a root Namespace to this Element.

scoped_owner

R

The owner of this Element as the parent of owning_membership or owning_relationship otherwise.

sema_state

RW

The state of semantic resolution for this Element. Based on this, sema may skip elements to avoid duplicate work, e.g. when resolving elements in a group of related documents.

short_name

R

The short name to be used for this Element during name resolution within its owning_namespace. This is derived using the effective_short_name() operation. By default, it is the same as the declared_short_name, but this is overridden for certain kinds of Elements to compute a short_name even when the declared_name is null.

textual_representations

R

The TextualRepresentations that annotate this Element.

__str__

matches_qualified_name

Members inherited from AstNode (7 members)

cst_node

R

document

R

parent

R

__hash__

cast

isinstance

try_cast

Attributes

STD: tuple[type[syside.Feature], ...] = ()
property basic_feature: syside.Feature

The last_chaining_feature if one exists, otherwise this Feature.

property cross_feature: syside.Feature | None

The second chaining_feature of the crossed_feature of the owned_cross_subsetting of this Feature, if it has one. Semantically, the values of the cross_feature of an end Feature must include all values of the end Feature obtained when navigating from values of the other end Features of the same owning_type.

property direction: syside.FeatureDirectionKind | None

Indicates how values of this Feature are determined or used (as specified for the FeatureDirectionKind).

property end_owning_type: syside.Type | None

The Type that is related to this Feature by an EndFeatureMembership in which the Feature is an owned_member_feature.

property explicit_direction: syside.FeatureDirectionKind | None

Returns the direction this Feature has been declared with in the textual syntax.

property feature_target: syside.Feature

The last of the chaining_features of this Feature, if it has any. Otherwise, this Feature itself.

property feature_value: syside.FeatureValue | None

The FeatureValue owned by this Feature if any.

property feature_value_expression: syside.Expression | None

The feature value Expression of this Feature if any.

property feature_value_member: syside.FeatureValueAccessor

SysIDE specific accessor for manipulating feature_value.

property featuring_types: syside.LazyIterator[syside.Type]

Types that feature this Feature, such that any instance in the domain of the Feature must be classified by all of these Types, including at least all the featuring_types of its type_featurings. If the Feature is chained, then the featuring_types of the first Feature in the chain are also featuring_types of the chained Feature.

property first_chaining_feature: syside.Feature | None

The related Feature related by the first owned_feature_chaining if any.

property is_composite: bool

Whether the Feature is a composite feature of its featuring_type. If so, the values of the Feature cannot exist after its featuring instance no longer does.

property is_composite_explicitly: bool

Returns True if this Feature has been declared composite in the textual syntax.

property is_derived: bool

Whether the values of this Feature can always be computed from the values of other Features.

property is_end: bool

Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping each of its domain instances to a single co-domain instance. However, it may have a cross_feature, in which case values of the cross_feature must be the same as those found by navigation across instances of the owning_type from values of other end Features to values of this Feature. If the owning_type has n end Features, then the multiplicity, ordering, and uniqueness declared for the cross_feature of any one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of values of that Feature reached by navigation when the values of the other n-1 end Features are held fixed.

property is_end_explicitly: bool

Returns True if this Feature has been declared end in the textual syntax.

property is_nonunique: bool
property is_ordered: bool

Whether an order exists for the values of this Feature or not.

property is_portion: bool

Whether the values of this Feature are contained in the space and time of instances of the domain of the Feature and represent the same thing as those instances.

property is_read_only: bool

Whether the values of this Feature can change over the lifetime of an instance of the domain.

property is_unique: bool

Whether or not values for this Feature must have no duplicates or not.

property last_chaining_feature: syside.Feature | None

The related Feature related by the last owned_feature_chaining if any.

property owned_cross_feature: syside.Feature | None

The member Feature that is declared before any prefixes in the textual syntax.

property owned_cross_feature_member: syside.OwnedFeatureAccessor

SysIDE specific accessor for either owned crossing_feature or crossing_multiplicity. This is the member Feature that is declared before any prefixes in the textual syntax.

property owned_cross_subsetting: syside.CrossSubsetting | None

The one owned_subsetting of this Feature, if any, that is a CrossSubsetting}, for which the Feature is the crossing_feature.

property owned_feature_chainings: syside.LazyIterator[syside.FeatureChaining]

The owned_relationships of this Feature that are FeatureChainings, for which the Feature will be the feature_chained.

property owned_feature_invertings: syside.LazyIterator[syside.FeatureInverting]

The owned_relationships of this Feature that are FeatureInvertings and for which the Feature is the feature_inverted.

property owned_redefinitions: syside.LazyIterator[syside.Redefinition]

The owned_subsettings of this Feature that are Redefinitions, for which the Feature is the redefining_feature.

property owned_reference_subsetting: syside.ReferenceSubsetting | None

The one owned_subsetting of this Feature, if any, that is a ReferenceSubsetting, for which the Feature is the referencing_feature.

property owned_subsettings: syside.LazyIterator[syside.Subsetting]

The owned_specializations of this Feature that are Subsettings, for which the Feature is the subsetting_feature.

property owned_type_featurings: syside.LazyIterator[syside.TypeFeaturing]

The owned_relationships of this Feature that are TypeFeaturings and for which the Feature is the feature_of_type.

property owned_typings: syside.LazyIterator[syside.FeatureTyping]

The owned_specializations of this Feature that are FeatureTypings, for which the Feature is the typed_feature.

property owning_feature_membership: syside.FeatureMembership | None

The FeatureMembership that owns this Feature as an owned_member_feature, determining its owning_type.

property owning_type: syside.Type | None

The Type that is the owning_type of the owning_feature_membership of this Feature.

property referenced_feature: syside.Feature | None

Returns the Feature this Feature references through ReferenceSubsetting if any.

property referenced_feature_target: syside.Feature | None

Returns the feature_target of referenced_feature, i.e. referenced_feature.feature_target.

property types: syside.LazyIterator[syside.Type]

Types that restrict the values of this Feature, such that the values must be instances of all the types. The types of a Feature are derived from its typings and the types of its subsettings. If the Feature is chained, then the types of the last Feature in the chain are also types of the chained Feature.

Methods

find_owned_cross_feature() syside.Feature | None

Find the owned cross feature by potentially checking children. This is needed for spec that defined owned cross feature as the first member feature that is not a MetadataFeature or Multiplicity of an end feature. Since SysML does not allow member features (member keyword in KerML), this is equivalent to owned_cross_feature in SysML.

Used in