An integer is a primitive type representing integer values. A Boolean type is used for logical expression, consisting of the predefined values true and false. A string is a sequence of characters in some suitable character set used to display information about the model. Character sets may include non-Roman alphabets and characters. An unlimited natural is a primitive type representing unlimited natural values. A comment is a textual annotation that can be attached to a set of elements. Specifies a string that is the comment. References the Element(s) being commented. A directed relationship represents a relationship between a collection of source model elements and a collection of target model elements. Specifies the sources of the DirectedRelationship. Specifies the targets of the DirectedRelationship. A literal specification identifies a literal constant being modeled. A literal integer is a specification of an integer value. The specified Integer value. The query isComputable() is redefined to be true. OCL result = true The query integerValue() gives the value. OCL result = value A literal string is a specification of a string value. The specified String value. The query isComputable() is redefined to be true. OCL result = true The query stringValue() gives the value. OCL result = value A literal Boolean is a specification of a Boolean value. The specified Boolean value. The query isComputable() is redefined to be true. OCL result = true The query booleanValue() gives the value. OCL result = value A literal null specifies the lack of a value. The query isComputable() is redefined to be true. OCL result = true The query isNull() returns true. OCL result = true A constraint is a condition or restriction expressed in natural language text or in a machine readable language for the purpose of declaring some of the semantics of an element. A constraint cannot be applied to itself. OCL not constrainedElement->includes(self) The value specification for a constraint must evaluate to a Boolean value. OCL self.specification().booleanValue().isOclKindOf(Boolean) The value specification for a constraint must evaluate to a Boolean value. OCL true Evaluating the value specification for a constraint must not have side effects. OCL true A constraint cannot be applied to itself. OCL not constrainedElement->includes(self) The ordered set of Elements referenced by this Constraint. A condition that must be true when evaluated in order for the constraint to be satisfied. Specifies the namespace that owns the NamedElement. An element import identifies an element in another package, and allows the element to be referenced using its name without a qualifier. The visibility of an ElementImport is either public or private. OCL self.visibility = #public or self.visibility = #private An importedElement has either public visibility or no visibility at all. OCL self.importedElement.visibility.notEmpty() implies self.importedElement.visibility = #public Specifies the visibility of the imported PackageableElement within the importing Package. The default visibility is the same as that of the imported element. If the imported element does not have a visibility, it is possible to add visibility to the element import. Specifies the name that should be added to the namespace of the importing package in lieu of the name of the imported packagable element. The aliased name must not clash with any other member name in the importing package. By default, no alias is used. Specifies the PackageableElement whose name is to be added to a Namespace. Specifies the Namespace that imports a PackageableElement from another Package. The query getName() returns the name under which the imported PackageableElement will be known in the importing namespace. OCL result = if self.alias->notEmpty() then self.alias else self.importedElement.name endif A typed element is a kind of named element that represents an element with a type. A typed element has a type. This information is derived from the return result for this Operation. The type of the TypedElement. A feature declares a behavioral or structural characteristic of instances of classifiers. Specifies whether this feature characterizes individual instances classified by the classifier (false) or the classifier itself (true). The Classifiers that have this Feature as a feature. A redefinable element is an element that, when defined in the context of a classifier, can be redefined more specifically or differently in the context of another classifier that specializes (directly or indirectly) the context classifier. At least one of the redefinition contexts of the redefining element must be a specialization of at least one of the redefinition contexts for each redefined element. OCL self.redefinedElement->forAll(e | self.isRedefinitionContextValid(e)) A redefining element must be consistent with each redefined element. OCL self.redefinedElement->forAll(re | re.isConsistentWith(self)) Indicates whether it is possible to further specialize a RedefinableElement. If the value is true, then it is not possible to further specialize the RedefinableElement. The redefinable element that is being redefined by this element. References the contexts that this element may be redefined from. The query isConsistentWith() specifies, for any two RedefinableElements in a context in which redefinition is possible, whether redefinition would be logically consistent. By default, this is false; this operation must be overridden for subclasses of RedefinableElement to define the consistency conditions. OCL redefinee.isRedefinitionContextValid(self) OCL result = false The query isRedefinitionContextValid() specifies whether the redefinition contexts of this RedefinableElement are properly related to the redefinition contexts of the specified RedefinableElement to allow this element to redefine the other. By default at least one of the redefinition contexts of this element must be a specialization of at least one of the redefinition contexts of the specified element. OCL result = redefinitionContext->exists(c | c.allParents()->includes(redefined.redefinitionContext))) A structural feature is a typed feature of a classifier that specifies the structure of instances of the classifier. By specializing multiplicity element, it supports a multiplicity that specifies valid cardinalities for the collection of values associated with an instantiation of the structural feature. States whether the feature's value may be modified by a client. An instance specification is a model element that represents an instance in a modeled system. The defining feature of each slot is a structural feature (directly or inherited) of a classifier of the instance specification. OCL slot->forAll(s | classifier->exists (c | c.allFeatures()->includes (s.definingFeature))) One structural feature (including the same feature inherited from multiple classifiers) is the defining feature of at most one slot in an instance specification. OCL classifier->forAll(c | (c.allFeatures()->forAll(f | slot->select(s | s.definingFeature = f)->size() <= 1))) The classifier or classifiers of the represented instance. If multiple classifiers are specified, the instance is classified by all of them. A slot giving the value or values of a structural feature of the instance. An instance specification can have one slot per structural feature of its classifiers, including inherited features. It is not necessary to model a slot for each structural feature, in which case the instance specification is a partial description. A specification of how to compute, derive, or construct the instance. A slot specifies that an entity modeled by an instance specification has a value or values for a specific structural feature. The instance specification that owns this slot. The structural feature that specifies the values that may be held by the slot. The value or values corresponding to the defining feature for the owning instance specification. A package import is a relationship that allows the use of unqualified names to refer to package members from other namespaces. The visibility of a PackageImport is either public or private. OCL self.visibility = #public or self.visibility = #private Specifies the visibility of the imported PackageableElements within the importing Namespace, i.e., whether imported elements will in turn be visible to other packages that use that importingPackage as an importedPackage. If the PackageImport is public, the imported elements will be visible outside the package, while if it is private they will not. Specifies the Namespace that imports the members from a Package. Specifies the Package whose members are imported into a Namespace. A data type is a type whose instances are identified only by their value. A data type may contain attributes to support the modeling of structured data types. The Attributes owned by the DataType. The Operations owned by the DataType. The inherit operation is overridden to exclude redefined properties. OCL result = inhs->excluding(inh | ownedMember->select(oclIsKindOf(RedefinableElement))->select(redefinedElement->includes(inh))) An enumeration is a data type whose values are enumerated in the model as enumeration literals. The ordered set of literals for this Enumeration. An enumeration literal is a user-defined data value for an enumeration. The Enumeration that this EnumerationLiteral is a member of. A primitive type defines a predefined data type, without any relevant substructure (i.e., it has no parts in the context of UML). A primitive datatype may have an algebra and operations defined outside of UML, for example, mathematically. An association describes a set of tuples whose values refer to typed instances. An instance of an association is called a link. An association specializing another association has the same number of ends as the other association. OCL self.parents()->forAll(p | p.memberEnd.size() = self.memberEnd.size()) When an association specializes another association, every end of the specific association corresponds to an end of the general association, and the specific end reaches the same type or a subtype of the more general end. OCL true Only binary associations can be aggregations. OCL self.memberEnd->exists(aggregation <> Aggregation::none) implies self.memberEnd->size() = 2 Association ends of associations with more than two ends must be owned by the association. OCL if memberEnd->size() > 2 then ownedEnd->includesAll(memberEnd) Specifies whether the association is derived from other model elements such as other associations or constraints. The ends that are owned by the association itself. References the classifiers that are used as types of the ends of the association. Each end represents participation of instances of the classifier connected to the end in links of the association. The navigable ends that are owned by the association itself. endType is derived from the types of the member ends. OCL result = self.memberEnd->collect(e | e.type) A value specification is the specification of a (possibly empty) set of instances, including both objects and data values. The query isComputable() determines whether a value specification can be computed in a model. This operation cannot be fully defined in OCL. A conforming implementation is expected to deliver true for this operation for all value specifications that it can compute, and to compute all of those for which the operation is true. A conforming implementation is expected to be able to compute the value of all literals. OCL result = false The query integerValue() gives a single Integer value when one can be computed. OCL result = Set{} The query booleanValue() gives a single Boolean value when one can be computed. OCL result = Set{} The query stringValue() gives a single String value when one can be computed. OCL result = Set{} The query unlimitedValue() gives a single UnlimitedNatural value when one can be computed. OCL result = Set{} The query isNull() returns true when it can be computed that the value is null. OCL result = false Relationship is an abstract concept that specifies some kind of relationship between elements. Specifies the elements related by the Relationship. A package merge defines how the contents of one package are extended by the contents of another package. References the Package that is being extended with the contents of the merged package of the PackageMerge. References the Package that is to be merged with the receiving package of the PackageMerge. An instance value is a value specification that identifies an instance. The instance that is the specified value. A literal unlimited natural is a specification of an unlimited natural number. The specified UnlimitedNatural value. The query isComputable() is redefined to be true. OCL result = true The query unlimitedValue() gives the value. OCL result = value A type is a named element that is used as the type for a typed element. A type can be contained in a package. A type constrains the values represented by a typed element. Specifies the owning package of this classifier, if any. The query conformsTo() gives true for a type that conforms to another. By default, two types do not conform to each other. This query is intended to be redefined for specific conformance situations. OCL result = false An expression is a structured tree of symbols that denotes a (possibly empty) set of values when evaluated in a context. An expression represents a node in an expression tree, which may be non-terminal or terminal. It defines a symbol, and has a possibly empty sequence of operands which are value specifications. The symbol associated with the node in the expression tree. Specifies a sequence of operands. AggregationKind is an enumeration type that specifies the literals for defining the kind of aggregation of a property. Indicates that the property has no aggregation. Indicates that the property has a shared aggregation. Indicates that the property is aggregated compositely, i.e., the composite object has responsibility for the existence and storage of the composed objects (parts). Parameter direction kind is an enumeration type that defines literals used to specify direction of parameters. Indicates that parameter values are passed into the behavioral element by the caller. Indicates that parameter values are passed into a behavioral element by the caller and then back out to the caller from the behavioral element. Indicates that parameter values are passed from a behavioral element out to the caller. Indicates that parameter values are passed as return values from a behavioral element back to the caller. VisibilityKind is an enumeration type that defines literals to determine the visibility of elements in a model. The query bestVisibility() examines a set of VisibilityKinds, and returns public as the preferred visibility. OCL pre: not vis->includes(#protected) and not vis->includes(#package) OCL result = if vis->includes(#public) then #public else #private endif A public element is visible to all elements that can access the contents of the namespace that owns it. A private element is only visible inside the namespace that owns it. A protected element is visible to elements that have a generalization relationship to the namespace that owns it. A package element is owned by a namespace that is not a package, and is visible to elements that are in the same package as its owning namespace. Only named elements that are not owned by packages can be marked as having package visibility. Any element marked as having package visibility is visible to all elements within the nearest enclosing package (given that other owning elements have proper visibility). Outside the nearest enclosing package, an element marked as having package visibility is not visible. A usage is a relationship in which one element requires another element (or set of elements) for its full implementation or operation. A usage is a dependency in which the client requires the presence of the supplier. An abstraction is a relationship that relates two elements or sets of elements that represent the same concept at different levels of abstraction or from different viewpoints. An composition of an Expression that states the abstraction relationship between the supplier and the client. In some cases, such as Derivation, it is usually formal and unidirectional; in other cases, such as Trace, it is usually informal and bidirectional. The mapping expression is optional and may be omitted if the precise relationship between the elements is not specified. A dependency is a relationship that signifies that a single or a set of model elements requires other model elements for their specification or implementation. This means that the complete semantics of the depending elements is either semantically or structurally dependent on the definition of the supplier element(s). The element(s) independent of the client element(s), in the same respect and the same dependency relationship. In some directed dependency relationships (such as Refinement Abstractions), a common convention in the domain of class-based OO software is to put the more abstract element in this role. Despite this convention, users of UML may stipulate a sense of dependency suitable for their domain, which makes a more abstract element dependent on that which is more specific. The element(s) dependent on the supplier element(s). In some cases (such as a Trace Abstraction) the assignment of direction (that is, the designation of the client element) is at the discretion of the modeler, and is a stipulation. Realization is a specialized abstraction relationship between two sets of model elements, one representing a specification (the supplier) and the other represents an implementation of the latter (the client). Realization can be used to model stepwise refinement, optimizations, transformations, templates, model synthesis, framework composition, etc. A substitution is a relationship between two classifiers signifies that the substituting classifier complies with the contract specified by the contract classifier. This implies that instances of the substituting classifier are runtime substitutable where instances of the contract classifier are expected. The contract with which the substituting classifier complies. Instances of the substituting classifier are runtime substitutable where instances of the contract classifier are expected. A packageable element indicates a named element that may be owned directly by a package. Indicates that packageable elements must always have a visibility, i.e., visibility is not optional. A namespace is an element in a model that contains a set of named elements that can be identified by name. All the members of a Namespace are distinguishable within it. OCL membersAreDistinguishable() References the ElementImports owned by the Namespace. References the PackageImports owned by the Namespace. Specifies a set of Constraints owned by this Namespace. A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance. References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. A collection of NamedElements owned by the Namespace. The importedMember property is derived from the ElementImports and the PackageImports. References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. OCL result = self.importMembers(self.elementImport.importedElement.asSet()- >union(self.packageImport.importedPackage->collect(p | p.visibleMembers()))) The query getNamesOfMember() takes importing into account. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. The query takes account of importing. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. OCL result = if self.ownedMember ->includes(element) then Set{}->include(element.name) else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName()) else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element)) endif endif The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it. OCL result = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self))) The query importMembers() defines which of a set of PackageableElements are actually imported into the namespace. This excludes hidden ones, i.e., those which have names that conflict with names of owned members, and also excludes elements which would have the same name when imported. OCL result = self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self))) The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this namespace. OCL result = imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))