Previous Table of Contents Next


11.6 OCL Representation of OLAP Constraints

   [C-1] Ensure that the Dimensions defining a Cube are unique.context Cube inv:self.cubeDimensionAssociation->forAll( c1, c2 | c1 <> c2 impliesc1.dimension <> c2.dimension )

   [C-2] A Cube without CubeRegions cannot be mapped to a deployment structure; thatis, physical source of data.context Cube inv:self.cubeRegion->isEmpty implies self.isVirtual = true

   [C-3] If a calcHierarchy is defined, it must be a Hierarchy owned by the Dimension referenced by the CubeDimensionAssociation.

   context CubeDimensionAssociation inv:

   self.calcHierarchy->notEmpty implies self.calcHierarchy.dimension = self.dimension

   [C-4] A “fully realized? CubeRegion has no MemberSelectionGroups (and hence, no MemberSelections).

   context CubeRegion inv:

   self.isFullyRealized implies self.memberSelectionGroup->isEmpty

   [C-5] A CubeRegion defined by MemberSelections must have, for each Dimension of its owning Cube, a corresponding MemberSelection within each of its MemberSelectionGroups.

   context CubeRegion inv

   self.memberSelectionGroup->notEmpty implies self.cube.cubeDimensionAssociation->forAll( d | self.memberSelectionGroup->forAll( g | g.memberSelection->exists( m | m.dimension = d.dimension ) ) )

   [C-6] A CubeRegion defined by MemberSelections must have, within each MemberSelectionGroup, a MemberSelection corresponding to each Dimension of its owning Cube.

   context CubeRegion inv:

   self.memberSelectionGroup->notEmpty implies self.memberSelectionGroup->forAll( g |g.memberSelection->forAll( m |self.cube.cubeDimensionAssociation->exists( d | d.dimension = m.dimension ) ) )

   [C-7] A Dimension may be a Time Dimension, a Measure Dimension, or neither, butnever both types at the same time.

   context Dimension inv:

   not ( self.isTime and self.isMeasure )

   [C-8] The default display Hierarchy (if defined) must be one of the Hierarchies owned by the Dimension.

   context Dimension inv:

   self.displayDefault->notEmpty implies self.hierarchy->includes( self.displayDefault )

   [C-9] An instance of DimensionDeployment must be referenced exclusively by either a HierarchyLevelAssociation or a ValueBasedHierarchy.

   context DimensionDeployment inv:

   self.hierarchyLevelAssociation->isEmpty xor self.valueBasedHierarchy->isEmpty

   [C-10] Within a DimensionDeployment, an “immediate parent? StructureMap mustalways have an associated and distinct “list of values? StructureMap.

   context DimensionDeployment inv:

   self.immediateParent->notEmpty implies ( self.listOfValues->notEmpty and self.listOfValues <> self.immediateParent )

   [C-11] A StructureMap referenced as a “list of values? StructureMap must not resideoutside of the DimensionDeployment's collection of StructureMaps.

   context DimensionDeployment inv:

   self.listOfValues->notEmpty implies self.structureMap->includes( self.listOfValues )

   [C-12] A StructureMap referenced as an “immediate parent? StructureMap must not reside outside of the DimensionDeployment's collection of StructureMaps.

   context DimensionDeployment inv:

   self.immediateParent->notEmpty implies self.structureMap->includes( self.immediateParent )

   [C-13] The currentLevel of each HierarchyLevelAssociation must refer to a Level owned by the Dimension of the LevelBasedHierarchy containing the HierarchyLevelAssociation.

   context LevelBasedHierarchy inv:

   self.hierarchyLevelAssociation->notEmpty implies self.hierarchyLevelAssociation->forAll( h |self.dimension.memberSelection->select( oclType = Olap::Level )->includes( h.currentLevel ) )

   [C-14] No two HierarchyLevelAssociations may designate the same Level instance astheir “current level.?

   context LevelBasedHierarchy inv:

   self.hierarchyLevelAssociation->forAll( h1, h2 | h1 <> h2 implies h1.currentLevel <> h2.currentLevel )

   [C-15] Each Hierarchy referenced by a HierarchyMemberSelectionGroup must have precisely one corresponding MemberSelection (of the same Dimension) in the HierarchyMemberSelectionGroup’s collection of MemberSelections.

   context HierarchyMemberSelectionGroupinv: self.hierarchy->forAll( h |self.memberSelection->exists( m | m.dimension = h.dimension ) )inv: self.hierarchy->size = self.memberSelection->size