An element is a constituent of a model. As such, it has the capability of owning other elements. An element may not directly or indirectly own itself. OCL not self.allOwnedElements()->includes(self) Elements that must be owned must have an owner. OCL self.mustBeOwned() implies owner->notEmpty() The Elements owned by this element. The Element that owns this element. The Comments owned by this element. The query allOwnedElements() gives all of the direct and indirect owned elements of an element. OCL result = ownedElement->union(ownedElement->collect(e | e.allOwnedElements())) The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation. OCL result = true A named element is an element in a model that may have a name. If there is no name, or one of the containing namespaces has no name, there is no qualified name. OCL (self.name->isEmpty() or self.allNamespaces()->select(ns | ns.name->isEmpty())->notEmpty()) implies self.qualifiedName->isEmpty() When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces. OCL (self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty()) implies self.qualifiedName = self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result)) The name of the NamedElement. A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself. Specifies the namespace that owns the NamedElement. The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards. OCL result = if self.namespace->isEmpty() then Sequence{} else self.namespace.allNamespaces()->prepend(self.namespace) endif The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have unrelated types or (b) they have related types but different names. OCL result = if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType) then ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() else true endif The query separator() gives the string that is used to separate names when constructing a qualified name. OCL result = '::' When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces. OCL result = if self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty() then self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result)) else Set{} endif 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() A collection of NamedElements owned by the Namespace. A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance. 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. Those semantics are specified by overriding the getNamesOfMember operation. The specification here simply returns a set containing a single name, or the empty set if no name. OCL result = if member->includes(element) then Set{}->including(element.name) else Set{} endif The Boolean query membersAreDistinguishable() determines whether all of the namespaces members are distinguishable within it. OCL result = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self))) A classifier is a classification of instances - it describes a set of instances that have features in common. Specifies each feature defined in the classifier. The query allFeatures() gives all of the features in the namespace of the classifier. In general, through mechanisms such as inheritance, this will be a larger set than feature. OCL result = member->select(oclIsKindOf(Feature)) A feature declares a behavioral or structural characteristic of instances of classifiers. The Classifiers that have this Feature as a feature. An opaque expression is an uninterpreted textual statement that denotes a (possibly empty) set of values when evaluated in a context. The text of the expression, possibly in multiple languages. Specifies the languages in which the expression is stated. The interpretation of the expression body depends on the languages. If the languages are unspecified, they might be implicit from the expression body or the context. Languages are matched to body strings by order. 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 An expression is a structured tree of symbols that denotes a (possibly empty) set of values when evaluated in a context. The symbol associated with the node in the expression tree. Specifies a sequence of operands. MultiplicityElement supports the use of value specifications to define each bound of the multiplicity. Specifies the lower bound of the multiplicity interval. Specifies the upper bound of the multiplicity interval. The specification of the upper bound for this multiplicity. The specification of the lower bound for this multiplicity. The derived lower attribute must equal the lowerBound. OCL result = lowerBound() The derived upper attribute must equal the upperBound. OCL result = upperBound() The query lowerBound() returns the lower bound of the multiplicity as an integer. OCL result = if lowerValue->isEmpty() then 1 else lowerValue.integerValue() endif The query upperBound() returns the upper bound of the multiplicity as an unlimited natural. OCL result = if upperValue->isEmpty() then 1 else upperValue.unlimitedValue() endif A behavioral feature is a feature of a classifier that specifies an aspect of the behavior of its instances. Specifies the parameters of the BehavioralFeature. The query isDistinguishableFrom() determines whether two BehavioralFeatures may coexist in the same Namespace. It specifies that they have to have different signatures. OCL result = if n.oclIsKindOf(BehavioralFeature) then if ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->notEmpty() then Set{}->including(self)->including(n)->isUnique( bf | bf.parameter->collect(type)) else true endif else true endif A parameter is a specification of an argument used to pass information into or out of an invocation of a behavioral feature. 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) ) 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. The classifier or classifiers of the represented instance. If multiple classifiers are specified, the instance is classified by all of them. 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 value or values corresponding to the defining feature for the owning instance specification. The structural feature that specifies the values that may be held by the slot. An instance value is a value specification that identifies an instance. The instance that is the specified value. 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)) 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 generalization is a taxonomic relationship between a more general classifier and a more specific classifier. Each instance of the specific classifier is also an instance of the general classifier. Thus, the specific classifier indirectly has features of the more general classifier. References the specializing classifier in the Generalization relationship. References the general classifier in the Generalization relationship. A classifier is a type and can own generalizations, thereby making it possible to define generalization relationships to other classifiers. Specifies the Generalization relationships for this Classifier. These Generalizations navigate to more general classifiers in the generalization hierarchy. Specifies the general Classifiers for this Classifier. The general classifiers are the classifiers referenced by the generalization relationships. OCL result = self.parents() The query parents() gives all of the immediate ancestors of a generalized Classifier. OCL result = generalization.general The query conformsTo() gives true for a classifier that defines a type that conforms to another. This is used, for example, in the specification of signature conformance for operations. OCL result = (self=other) or (self.allParents()->includes(other)) 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. Relationship is an abstract concept that specifies some kind of relationship between elements. Specifies the elements related by the Relationship. StructuralFeature has an attribute that determines whether a client may modify its value. States whether the feature's value may be modified by a client. A structural feature is a typed feature of a classifier that specifies the structure of instances of the classifier. 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 Namespace that owns this NamedElement. A condition that must be true when evaluated in order for the constraint to be satisfied. The ordered set of Elements referenced by this Constraint. A namespace can own constraints. A constraint associated with a namespace may either apply to the namespace itself, or it may apply to elements in the namespace. Specifies a set of Constraints owned by this Namespace. A collection of NamedElements owned by the Namespace. A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance. A named element is an element in a model that may have a name. Specifies the namespace that owns the NamedElement. NamedElement has a visibility attribute. If a NamedElement is not owned by a Namespace, it does not have a visibility. OCL namespace->isEmpty() implies visibility->isEmpty() Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility. 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 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 classifier can specify a generalization hierarchy by referencing its general classifiers. Generalization hierarchies must be directed and acyclical. A classifier can not be both a transitively general and transitively specific classifier of the same classifier. OCL not self.allParents()->includes(self) A classifier may only specialize classifiers of a valid type. OCL self.parents()->forAll(c | self.maySpecializeType(c)) If true, the Classifier does not provide a complete declaration and can typically not be instantiated. An abstract classifier is intended to be used by other classifiers e.g. as the target of general metarelationships or generalization relationships. Specifies all elements inherited by this classifier from the general classifiers.