SlideShare a Scribd company logo
Introduction         Filtering Conceptual Schemas         Evaluation      Application to Event Types        Conclusions




                  Understanding Constraint Expressions
                     in Large Conceptual Schemas
                         by Automatic Filtering

                Antonio Villegas, Antoni Oliv´, and Maria-Ribera Sancho
                                             e
                                          {avillegas, olive, ribera}@essi.upc.edu


                         Department of Service and Information System Engineering
                                  Universitat Polit`cnica de Catalunya
                                                   e




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                     ER 2012                            October 15, 2012     1 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     2 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     3 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     4 / 42
Introduction         Filtering Conceptual Schemas           Evaluation          Application to Event Types          Conclusions

Conceptual Schemas


osCommerce                                                                                     www.oscommerce.com




                 84 Entity types, 262 Event types, 209 Attributes, 183 Relationship types, 393 IsA Relationships


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                       ER 2012                                  October 15, 2012     5 / 42
Introduction         Filtering Conceptual Schemas           Evaluation          Application to Event Types         Conclusions

Conceptual Schemas


Magento                                                                               www.magentocommerce.com




                218 Entity types, 187 Event types, 983 Attributes, 319 Relationship types, 165 IsA Relationships


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                      ER 2012                                  October 15, 2012     6 / 42
Introduction         Filtering Conceptual Schemas           Evaluation          Application to Event Types         Conclusions

Conceptual Schemas


UML metaschema                                                                            www.omg.org/spec/UML




                         293 Entity types, 93 Attributes, 377 Relationship types, 355 IsA Relationships


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                      ER 2012                                  October 15, 2012     7 / 42
Introduction         Filtering Conceptual Schemas           Evaluation          Application to Event Types         Conclusions

Conceptual Schemas


EU-Rent                                             www.lsi.upc.edu/~techreps/files/R03-59.zip




                 65 Entity types, 120 Event types, 85 Attributes, 152 Relationship types, 207 IsA Relationships


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                      ER 2012                                  October 15, 2012     8 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types        Conclusions

Conceptual Schemas


Constraint expressions


       In general, large conceptual schemas or ontologies include many
       formal constraint expressions, which are used for defining:
               static or dynamic integrity constraints
               default values
               pre and postconditions of operations
               results of operations


                               We focus on human understanding
                                of constraint expressions defined
                                  in large conceptual schemas


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                         October 15, 2012     9 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Constraint Expressions




                    osCommerce                                        Magento
                   457 constraints                                 734 constraints




                 UML Metaschema                                       EU-Rent
                  170 constraints                                  283 constraints




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       10 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Constraint Expressions




                           We try to ease the understanding of
                     constraint expressions in large conceptual schemas.


       The problem is significant
               in a large conceptual schema there may be many constraint expressions,
               used as –among others– invariants, derivation rules, and pre/post
               conditions

               understanding such expressions is a necessity during their definition,
               validation, implementation, and maintenance

               understanding such expressions is very difficult when the conceptual
               schema is large, because the elements involved in those expressions are in
               general scattered throughout the schema, and it is not easy to
               navigate through the schema in the way implied by the expressions



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       11 / 42
Introduction              Filtering Conceptual Schemas        Evaluation     Application to Event Types           Conclusions

Constraint Expressions


Simple Example




                {
                                context Bn inv:                   self.c.att > 0

                                  b        R        c                      Understanding such
                         B                                   C             expression requires:
                                  *                 1    att:Integer
n-level specialization




                                                                             1   finding entity type Bn
                         ...                                                     (the context) in the schema


                         Bi
                                                                             2   moving upwards the n-level
                                                                                 hierarchy until the root
                                                                                 (entity type B)
                         ...
                                                                             3   navigating towards C
                         Bn
                                                                             4   finding attribute att



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                           October 15, 2012       12 / 42
Introduction              Filtering Conceptual Schemas        Evaluation    Application to Event Types           Conclusions

Constraint Expressions


Simple Example




                {
                                context Bn inv:                   self.c.att > 0

                                  b        R        c
                         B                                   C
                                  *                 1    att:Integer
n-level specialization




                         ...
                                                                            Filtered Schema
                         Bi                                                   b        R        c
                                                                       Bn                                C
                                                                              *                 1   att:Integer
                         ...
                                                               Note that the hierarchy Bn IsA ... Bi IsA ... B
                         Bn                                    does not appear in the filtered schema, and that
                                                               the first participant of the relationship type R
                                                               has changed to Bn .


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                          October 15, 2012       13 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       14 / 42
Introduction         Filtering Conceptual Schemas            Evaluation         Application to Event Types            Conclusions




Method Overview
                       Focus Set                            Filtering Method
                    context   inv ...                                                                    Filtered
                    context
                    context
                              derive ...
                              init ...
                                                    1 En�ty and Event Types Processing                  Conceptual
                    context   pre ...                                                                    Schema
                    context   post ...              2 Rela�onship Types Processing
                    context   body ...

                                                    3   Generaliza�ons Processing
                       Large
                     Conceptual
                      Schema                        4 Data Types Processing                            context   inv ...
                                                                                                       context   derive ...
                                                                                                       context   init ...
                                                    5 Schema Rules Processing                          context   pre ...
                                                                                                       context   post ...
                                                                                                       context   body ...
                                                    6   Presenta�on




       Filtering Approach
       The user focuses on a set of constraints and the method obtains the smallest
       subset of the large schema that is needed to understand those expressions.



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                              October 15, 2012            15 / 42
Introduction         Filtering Conceptual Schemas            Evaluation         Application to Event Types            Conclusions

Output of the Filtering Method


Method Overview: Output
                       Focus Set                            Filtering Method
                    context   inv ...                                                                    Filtered
                    context
                    context
                              derive ...
                              init ...
                                                    1 En�ty and Event Types Processing                  Conceptual
                    context   pre ...                                                                    Schema
                    context   post ...              2 Rela�onship Types Processing
                    context   body ...

                                                    3   Generaliza�ons Processing
                       Large
                     Conceptual
                      Schema                        4 Data Types Processing                            context   inv ...
                                                                                                       context   derive ...
                                                                                                       context   init ...
                                                    5 Schema Rules Processing                          context   pre ...
                                                                                                       context   post ...
                                                                                                       context   body ...
                                                    6   Presenta�on




       Minimal Subset
       The knowledge contained in the filtered schema is the smallest subset of the
       knowledge from the large schema referenced by the constraints of focus.


       Valid Instantiation
       The filtered conceptual schema is a valid instance of the corresponding metaschema
       of the large schema from which it is obtained.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                              October 15, 2012            16 / 42
Introduction         Filtering Conceptual Schemas            Evaluation         Application to Event Types            Conclusions

Stages of the Filtering Method


Method Overview: Stages
                       Focus Set                            Filtering Method
                    context   inv ...                                                                    Filtered
                    context
                    context
                              derive ...
                              init ...
                                                    1 En�ty and Event Types Processing                  Conceptual
                    context   pre ...                                                                    Schema
                    context   post ...              2 Rela�onship Types Processing
                    context   body ...

                                                    3   Generaliza�ons Processing
                       Large
                     Conceptual
                      Schema                        4 Data Types Processing                            context   inv ...
                                                                                                       context   derive ...
                                                                                                       context   init ...
                                                    5 Schema Rules Processing                          context   pre ...
                                                                                                       context   post ...
                                                                                                       context   body ...
                                                    6   Presenta�on




       Running Example
       We assume that the user needs to understand the following constraint defined in the
       Magento, in the context of the entity type ConfigurableProduct:

       context ConfigurableProduct
          inv: - is associated to products with the same attributes
             self.associatedProduct->forAll(ap |
               ap.ableToRateAttribute->includesAll(self.configurableAttribute))


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                              October 15, 2012            17 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types




       Stage 1
       The method firstly extracts the entity and event types referenced
       by the selected constraints of focus and includes them in the
       resulting filtered conceptual schema.




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       18 / 42
Introduction         Filtering Conceptual Schemas     Evaluation    Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types
                                                    Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                          Filtered Entity and Event Types




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                 ER 2012                         October 15, 2012       19 / 42
Introduction         Filtering Conceptual Schemas     Evaluation      Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types
                                                    Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                          Filtered Entity and Event Types

                       ConfigurableProduct



                     ConfigurableProduct: context of the constraint




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                 ER 2012                           October 15, 2012       19 / 42
Introduction         Filtering Conceptual Schemas     Evaluation      Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types
                                                    Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                          Filtered Entity and Event Types

                       ConfigurableProduct           ConfiguredProduct



                     ConfigurableProduct: context of the constraint

                     ConfiguredProduct: target participant of self.associatedProduct navigation




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                 ER 2012                           October 15, 2012       19 / 42
Introduction         Filtering Conceptual Schemas      Evaluation       Application to Event Types            Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types
                                                    Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                          Filtered Entity and Event Types

                       ConfigurableProduct           ConfiguredProduct               Attribute



                     ConfigurableProduct: context of the constraint

                     ConfiguredProduct: target participant of self.associatedProduct navigation

                     Attribute: target participant of ap.ableToRateAttribute navigation)




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                 ER 2012                              October 15, 2012       19 / 42
Introduction         Filtering Conceptual Schemas      Evaluation       Application to Event Types            Conclusions

Stages of the Filtering Method


Stage 1: Filtering of Entity and Event Types
                                                     Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                          Filtered Entity and Event Types

                       ConfigurableProduct            ConfiguredProduct              Attribute

                                             SingleValuedEnumerationAttribute

                     ConfigurableProduct: context of the constraint

                     ConfiguredProduct: target participant of self.associatedProduct navigation

                     Attribute: target participant of ap.ableToRateAttribute navigation)

                     SingleValuedEnumerationAttribute: target participant of
                                                    self.configurableAttribute navigation


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                  ER 2012                             October 15, 2012       19 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes




       Stage 2
       The method extracts the relationship types and attributes
       referenced by the selected constraints of focus and includes them
       in the resulting filtered conceptual schema.




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       20 / 42
Introduction         Filtering Conceptual Schemas    Evaluation     Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                    Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                ER 2012                          October 15, 2012       21 / 42
Introduction         Filtering Conceptual Schemas            Evaluation             Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                           Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                           IsRepresentedBy 1..*
                          ConfigurableProduct       1..*        associatedProduct
                                                                                    ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                        ER 2012                                  October 15, 2012       21 / 42
Introduction         Filtering Conceptual Schemas             Evaluation             Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                            Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                            IsRepresentedBy 1..*
                          ConfigurableProduct        1..*        associatedProduct
                                                                                     ConfiguredProduct

                      ap.ableToRateAttribute navigation:
                                                        IsAbleToRate          *
                                          Item                                    Attribute
                                                 *          ableToRateAttribute




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                         ER 2012                                  October 15, 2012       21 / 42
Introduction         Filtering Conceptual Schemas               Evaluation              Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                              Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                              IsRepresentedBy 1..*
                          ConfigurableProduct          1..*        associatedProduct
                                                                                        ConfiguredProduct

                      ap.ableToRateAttribute navigation:
                                                          IsAbleToRate          *
                                          Item                                      Attribute
                                                   *          ableToRateAttribute

                      self.configurableAttribute navigation:
                                                 IsConfiguredBy
                                                                    1..*
                    ConfigurableProduct     1..*
                                                                           SingleValuedEnumerationAttribute
                                                                configurableAttribute



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                   October 15, 2012       21 / 42
Introduction         Filtering Conceptual Schemas               Evaluation              Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                              Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                              IsRepresentedBy 1..*
                          ConfigurableProduct          1..*        associatedProduct
                                                                                        ConfiguredProduct

                      ap.ableToRateAttribute navigation:
                                                          IsAbleToRate          *
                                          Item                                      Attribute
                                                   *          ableToRateAttribute

                      self.configurableAttribute navigation:
                                                 IsConfiguredBy
                                                                    1..*
                    ConfigurableProduct     1..*
                                                                           SingleValuedEnumerationAttribute
                                                                configurableAttribute



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                   October 15, 2012       21 / 42
Introduction         Filtering Conceptual Schemas               Evaluation              Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                              Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                              Referenced Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                              IsRepresentedBy 1..*
                          ConfigurableProduct          1..*        associatedProduct
                                                                                        ConfiguredProduct

                      ap.ableToRateAttribute navigation:                                    Projection Required
                                                          IsAbleToRate          *
                                          Item                                      Attribute
                                                   *          ableToRateAttribute

                      self.configurableAttribute navigation:
                                                 IsConfiguredBy
                                                                    1..*
                    ConfigurableProduct     1..*
                                                                           SingleValuedEnumerationAttribute
                                                                configurableAttribute



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                   October 15, 2012       21 / 42
Introduction          Filtering Conceptual Schemas              Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method

Stage 2: Filtering of Relationship Types and Attributes
Projection




               Item   item                            Original Schema
                      *      IsAbleToRate            *    Attribute
                                    ableToRateAttribute




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                          ER 2012                         October 15, 2012       22 / 42
Introduction           Filtering Conceptual Schemas              Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method

Stage 2: Filtering of Relationship Types and Attributes
Projection




                Item   item                            Original Schema
                       *      IsAbleToRate            *    Attribute
                                     ableToRateAttribute
               Product

SimpleProduct       ConfigurableProduct

ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                         October 15, 2012       22 / 42
Introduction           Filtering Conceptual Schemas              Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method

Stage 2: Filtering of Relationship Types and Attributes
Projection




                Item   item                            Original Schema
                       *      IsAbleToRate            *    Attribute
                                     ableToRateAttribute
               Product

SimpleProduct       ConfigurableProduct

ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                         October 15, 2012       22 / 42
Introduction           Filtering Conceptual Schemas              Evaluation         Application to Event Types                   Conclusions

Stages of the Filtering Method

Stage 2: Filtering of Relationship Types and Attributes
Projection




                Item   item                            Original Schema                               Filtered Schema
                       *      IsAbleToRate            *    Attribute
                                     ableToRateAttribute                      LCA                      IsAbleToRate
               Product                                                              Product   *                             *    Attribute
                                                                                              item         ableToRateAttribute


SimpleProduct       ConfigurableProduct                                        ConfiguredProduct          ConfigurableProduct

ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                   October 15, 2012           22 / 42
Introduction         Filtering Conceptual Schemas              Evaluation              Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 2: Filtering of Relationship Types and Attributes
                                                             Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                 Filtered Relationship Types and Attributes
                      self.associatedProduct navigation:
                                                             IsRepresentedBy 1..*
                          ConfigurableProduct         1..*        associatedProduct
                                                                                       ConfiguredProduct

                      ap.ableToRateAttribute navigation:
                                                  item IsAbleToRate            *
                                      Product                                      Attribute
                                                  *          ableToRateAttribute

                      self.configurableAttribute navigation:
                                                IsConfiguredBy
                                                                   1..*
                    ConfigurableProduct    1..*
                                                                          SingleValuedEnumerationAttribute
                                                               configurableAttribute



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                          ER 2012                                   October 15, 2012       23 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 3: Filtering of Generalization Relationships




       Stage 3
       The method extracts the generalization relationships between
       the entity and event types in the resulting filtered conceptual
       schema.




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       24 / 42
Introduction         Filtering Conceptual Schemas        Evaluation         Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 3: Filtering of Generalization Relationships
                                                      Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                     Filtered Generalization Relationships



                                                                      LCA
                                          Attribute                     Product


                                  EnumerationAttribute        SimpleProduct       ConfigurableProduct


                   SingleValuedEnumerationAttribute           ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                    ER 2012                              October 15, 2012       25 / 42
Introduction         Filtering Conceptual Schemas      Evaluation         Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 3: Filtering of Generalization Relationships
                                                      Focus Set
                    context ConfigurableProduct
                      inv: -- is associated to products with the same attributes
                        self.associatedProduct->forAll( ap |
                           ap.ableToRateAttribute->includesAll(self.configurableAttribute) )


                                     Filtered Generalization Relationships



                                                                    LCA
                                          Attribute                      Product
                                                          Indirect
                                                        Generalization
                                                                                ConfigurableProduct


                   SingleValuedEnumerationAttribute         ConfiguredProduct




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                  ER 2012                              October 15, 2012       25 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 4: Filtering of Data Types


       Stage 4
       The method includes in the filtered schema those data types from
       the original one that are referenced in the specification of a
       constraint of focus or define the type of a filtered attribute.


       In the running example, there are no data types referenced by the
       constraint of focus:

       context ConfigurableProduct
          inv: - is associated to products with the same attributes
             self.associatedProduct->forAll(ap |
               ap.ableToRateAttribute->includesAll(self.configurableAttribute))




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       26 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Stages of the Filtering Method


Stage 5: Filtering of Schema Rules (optional)

       Stage 5
       The method selects the schema rules (constraint expressions) that are defined in the
       context of elements from the filtered schema and that are referentially-complete.
       A schema rule is referentially-complete whenever all the schema elements used in the
       specification of the rule belong to the filtered conceptual schema.



       Considering the running example, the method selects the constraint of focus:
       context ConfigurableProduct
          inv: - is associated to products with the same attributes
             self.associatedProduct->forAll(ap |
               ap.ableToRateAttribute->includesAll(self.configurableAttribute))

       and an additional constraint that is referentially-complete:
       context ConfigurableProduct
          inv: - configurableAttribute subsets ableToRateAttribute
             self.ableToRateAttribute->includesAll(self.configurableAttribute))


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       27 / 42
Introduction         Filtering Conceptual Schemas                Evaluation             Application to Event Types             Conclusions

Stages of the Filtering Method


Stage 6: Presentation of the Filtered Schema

                                            Filtered Conceptual Schema

                            SingleValuedEnumerationAttribute                                    Attribute
                           1..* configurableAttribute                               ableToRateAttribute *
                                                                           IsAbleToRate

                                 IsConfiguredBy                       * item
                                                                    Product

                             *                                 IsRepresentedBy 1..*
                            ConfigurableProduct         1..*        associatedProduct
                                                                                        ConfiguredProduct

                     context ConfigurableProduct
                       inv: -- is associated to products with the same attributes
                         self.associatedProduct->forAll( ap |
                            ap.ableToRateAttribute->includesAll(self.configurableAttribute) )

                    context ConfigurableProduct
                       inv: -- configurableAttribute subsets ableToRateAttribute
                         self.ableToRateAttribute->
                            includesAll(self.configurableAttribute)


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                            ER 2012                                    October 15, 2012       28 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       29 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions




Evaluation


                      We have implemented the filtering method as a prototype tool



       We have evaluated the efficiency and effectiveness of the method by using four
       distinct case studies: the schema of Magento, the UML metaschema, the schema of
       osCommerce, and the EU-Rent car rental schema.

               The effectiveness measures the benefits obtained from the application of the
               filtering method

               The efficiency indicates the time interval between the request and the answer

       We have applied our filtering method for each OCL constraint expression specified in
       these conceptual schemas (1644 constraints).




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       30 / 42
Introduction            Filtering Conceptual Schemas         Evaluation             Application to Event Types           Conclusions

Effectiveness Analysis


Effectiveness

       Goal
       The bigger size reduction our method obtains, the better


       Evaluation
       We compare the final size of the filtered schema with the size of the context
       constraint schema


       Context Constraint Schema
       The portion of the large schema the user needs to manually explore in order to cover
       the elements referenced by the formal specification of the constraints of focus
            A with the referenced elements from the constraints of focus,
            B with complete generalization hierarchies of entity and event types between elements of A,
            C with all the attributes owned by entity and event types of A and B,
            D with all the relationship types in which the entity and event types of A and B participate,
            E without projection of referenced attributes and relationship types.



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                       ER 2012                                   October 15, 2012       31 / 42
Introduction              Filtering Conceptual Schemas                                 Evaluation         Application to Event Types           Conclusions

Effectiveness Analysis

Effectiveness
Context Constraint Schema


                                Filtered Conceptual Schema

                SingleValuedEnumerationAttribute                                 Attribute
               1..* configurableAttribute                               ableToRateAttribute *
                                                             IsAbleToRate

                     IsConfiguredBy                       * item
                                                        Product

                 *                                 IsRepresentedBy 1..*
                ConfigurableProduct         1..*        associatedProduct
                                                                            ConfiguredProduct

          context ConfigurableProduct
            inv: -- is associated to products with the same attributes
              self.associatedProduct->forAll( ap |
                 ap.ableToRateAttribute->includesAll(self.configurableAttribute) )

          context ConfigurableProduct
             inv: -- configurableAttribute subsets ableToRateAttribute
               self.ableToRateAttribute->
                  includesAll(self.configurableAttribute)


                      (a)     Filtered conceptual schema (CSF ).                                    (b)    Context constraint schema (CSC ).


       Figure: Comparison between (a) the filtered conceptual schema and (b) the
       corresponding fragment of Magento for the constraint of ConfigurableProduct.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                                  ER 2012                              October 15, 2012       32 / 42
Introduction            Filtering Conceptual Schemas    Evaluation        Application to Event Types           Conclusions

Effectiveness Analysis

Effectiveness
Filtering Utility Factor



       Filtering Utility Factor
       Therefore, we define the filtering utility factor between the filtered schema CSF and
       the context constraint schema CSC as follows:

                                                                              Σ(CSF )
                                   Filtering Utility Factor: ∆       =   1−           ,
                                                                              Σ(CSC )


       where the size Σ(CS) of a conceptual schema CS counts:

               the number of entity and event types in CS
               the number of relationship types in CS
               the number of attributes in CS
               the number of generalization relationships in CS

       Note that Σ(CSF ) ≤ Σ(CSC )



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                   ER 2012                             October 15, 2012       33 / 42
Introduction            Filtering Conceptual Schemas             Evaluation          Application to Event Types             Conclusions

Effectiveness Analysis


Effectiveness
       For each schema, the plot indicates the smallest observation (sample minimum), lower quartile (Q1), median (Q2),
       upper quartile (Q3), and largest observation (sample maximum).
       The black diamonds indicate the mean of each sample.
       The bottom and top of each box (Q1 and Q3) are the 5th and 95th percentiles, which means that the box contains
       the 90% of the samples.

                                          Filtering Utility Factor ∆ [0,1]
                              1
                            0.9
                            0.8          0.85
                           0.7                            0.79
                                                                           0.72             0.74
                            0.6
                           0.5
                           0.4
                            0.3
                            0.2
                            0.1
                              0
                                     Magento             UML         osCommerce          EU Rent
                        Box plot with the resulting values for the filtering utility factor applied to each of the
                        1644 schema rules of the case studies.
A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                            ER 2012                                 October 15, 2012       34 / 42
Introduction         Filtering Conceptual Schemas           Evaluation          Application to Event Types            Conclusions

Efficiency Analysis


Efficiency

       A good method does not only need to be useful, but it also needs to obtain the results in an acceptable time
       according to the user’s expectations.
       Record the time lapse between the input of a user-selected focus set and the obtainment of the filtered schema.


                                             Response Time (ms)
                       25

                       20

                       15

                       10

                                                    4.08             4.21
                        5          3.25                                              2.69


                        0
                                Magento             UML        osCommerce         EU Rent
                      Values obtained by an Intel Core 2 Duo 3GHz processor with 4GB of DDR2 RAM.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                      ER 2012                                 October 15, 2012       35 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       36 / 42
Introduction         Filtering Conceptual Schemas               Evaluation             Application to Event Types                Conclusions

Event Types




       Our method can be used to help understanding the specification of event types
       (system operations) in large conceptual schemas.


       Event Types              Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004
                                                                                                                           e

               An event describes a nonempty set of changes in the population of entity or
               relationship types in the domain of the conceptual schema.
               We assume event types are represented as entity types with the stereotype
               «event». This allows one to define relationships between events and other
               entities, integrity constraints, derivation rules, etc. in a way very similar to that
               for ordinary entity types
               We define an effect() operation in each event type, whose purpose is to specify
               the effect of the event in the domain.
               The postcondition of this operation will be exactly the postcondition of the
               corresponding event.


       We can directly apply our filtering method to the set of postconditions of a particular
       event type in order to obtain its corresponding filtered schema.



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                      October 15, 2012             37 / 42
Introduction         Filtering Conceptual Schemas               Evaluation             Application to Event Types                Conclusions

Event Types




       Our method can be used to help understanding the specification of event types
       (system operations) in large conceptual schemas.


       Event Types              Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004
                                                                                                                           e

               An event describes a nonempty set of changes in the population of entity or
               relationship types in the domain of the conceptual schema.
               We assume event types are represented as entity types with the stereotype
               «event». This allows one to define relationships between events and other
               entities, integrity constraints, derivation rules, etc. in a way very similar to that
               for ordinary entity types
               We define an effect() operation in each event type, whose purpose is to specify
               the effect of the event in the domain.
               The postcondition of this operation will be exactly the postcondition of the
               corresponding event.


       We can directly apply our filtering method to the set of postconditions of a particular
       event type in order to obtain its corresponding filtered schema.



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                      October 15, 2012             37 / 42
Introduction         Filtering Conceptual Schemas               Evaluation             Application to Event Types                Conclusions

Event Types




       Our method can be used to help understanding the specification of event types
       (system operations) in large conceptual schemas.


       Event Types              Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004
                                                                                                                           e

               An event describes a nonempty set of changes in the population of entity or
               relationship types in the domain of the conceptual schema.
               We assume event types are represented as entity types with the stereotype
               «event». This allows one to define relationships between events and other
               entities, integrity constraints, derivation rules, etc. in a way very similar to that
               for ordinary entity types
               We define an effect() operation in each event type, whose purpose is to specify
               the effect of the event in the domain.
               The postcondition of this operation will be exactly the postcondition of the
               corresponding event.


       We can directly apply our filtering method to the set of postconditions of a particular
       event type in order to obtain its corresponding filtered schema.



A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                           ER 2012                                      October 15, 2012             37 / 42
Introduction           Filtering Conceptual Schemas                            Evaluation   Application to Event Types           Conclusions

Event Types
                                               Focus Set
               context AddProductToShoppingCart::effect()
               post addProduct:
                let existingItem:ShoppingCartItem
                  = self.shoppingCart@pre.shoppingCartItem@pre
                     ->any(i|i.product=self.product)
                in let productExists:Boolean=not existingItem.oclIsUndefined() and
                      existingItem.optionValueInOption=self.optionValue and
                      existingItem.textOptionRating
                       ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet()
                       = self.textOption and
                  existingItem.dateOptionRating
                       ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet()
                       = self.dateOption
                in if productExists then
                   let i = self.shoppingCart.shoppingCartItem
                       ->any(i|i.product=self.product)
                   in i.quantity = i@pre.quantity + self.quantity
                else
                (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre())
                    ->one(i:ShoppingCartItem |
                 i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and
                 i.shoppingCart = self.shoppingCart and i.product = self.product and
                 i.quantity = self.quantity and i.applyDiscount = true and
                 (self.textOption->notEmpty() implies
                   self.textOption ->forAll(tupleOpt |
                  (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre())
                        ->exists(r:TextOptionRating |
                         r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and
                         r.textOption = tupleOpt.o and r.value = tupleOpt.text and
                         r.shoppingCartItem = i
                 ) ) ) and (self.dateOption->notEmpty() implies
                  self.dateOption->forAll(tupleOpt|
                    (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre())
                      ->exists(r:DateOptionRating |
                      r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and
                      r.dateOption = tupleOpt.o and r.value = tupleOpt.date and
                      r.shoppingCartItem = i
                 ) ) ) and i.optionValueInOption = self.optionValue )
                endif
               post decreaseQuantity:
                StockConfiguration.allInstances()
                 ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies
                 (self.product.quantity = self.product@pre.quantity@pre-self.quantity)

A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                         ER 2012                         October 15, 2012       38 / 42
Introduction           Filtering Conceptual Schemas                            Evaluation   Application to Event Types           Conclusions

Event Types
                                               Focus Set
               context AddProductToShoppingCart::effect()
               post addProduct:
                let existingItem:ShoppingCartItem
                  = self.shoppingCart@pre.shoppingCartItem@pre
                     ->any(i|i.product=self.product)
                in let productExists:Boolean=not existingItem.oclIsUndefined() and
                      existingItem.optionValueInOption=self.optionValue and
                      existingItem.textOptionRating
                       ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet()
                       = self.textOption and
                  existingItem.dateOptionRating
                       ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet()
                       = self.dateOption
                in if productExists then
                   let i = self.shoppingCart.shoppingCartItem
                       ->any(i|i.product=self.product)
                   in i.quantity = i@pre.quantity + self.quantity
                else
                (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre())
                    ->one(i:ShoppingCartItem |
                 i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and
                 i.shoppingCart = self.shoppingCart and i.product = self.product and
                 i.quantity = self.quantity and i.applyDiscount = true and
                 (self.textOption->notEmpty() implies
                   self.textOption ->forAll(tupleOpt |
                  (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre())
                        ->exists(r:TextOptionRating |
                         r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and
                         r.textOption = tupleOpt.o and r.value = tupleOpt.text and
                         r.shoppingCartItem = i
                 ) ) ) and (self.dateOption->notEmpty() implies
                  self.dateOption->forAll(tupleOpt|
                    (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre())
                      ->exists(r:DateOptionRating |
                      r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and
                      r.dateOption = tupleOpt.o and r.value = tupleOpt.date and
                      r.shoppingCartItem = i
                 ) ) ) and i.optionValueInOption = self.optionValue )
                endif
               post decreaseQuantity:
                StockConfiguration.allInstances()
                 ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies
                 (self.product.quantity = self.product@pre.quantity@pre-self.quantity)

A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                         ER 2012                         October 15, 2012       38 / 42
Introduction           Filtering Conceptual Schemas                            Evaluation   Application to Event Types           Conclusions

Event Types
                                               Focus Set
               context AddProductToShoppingCart::effect()
               post addProduct:
                let existingItem:ShoppingCartItem
                  = self.shoppingCart@pre.shoppingCartItem@pre
                     ->any(i|i.product=self.product)
                in let productExists:Boolean=not existingItem.oclIsUndefined() and
                      existingItem.optionValueInOption=self.optionValue and
                      existingItem.textOptionRating
                       ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet()
                       = self.textOption and
                  existingItem.dateOptionRating
                       ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet()
                       = self.dateOption
                in if productExists then
                   let i = self.shoppingCart.shoppingCartItem
                       ->any(i|i.product=self.product)
                   in i.quantity = i@pre.quantity + self.quantity
                else
                (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre())
                    ->one(i:ShoppingCartItem |
                 i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and
                 i.shoppingCart = self.shoppingCart and i.product = self.product and
                 i.quantity = self.quantity and i.applyDiscount = true and
                 (self.textOption->notEmpty() implies
                   self.textOption ->forAll(tupleOpt |
                  (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre())
                        ->exists(r:TextOptionRating |
                         r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and
                         r.textOption = tupleOpt.o and r.value = tupleOpt.text and
                         r.shoppingCartItem = i
                 ) ) ) and (self.dateOption->notEmpty() implies
                  self.dateOption->forAll(tupleOpt|
                    (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre())
                      ->exists(r:DateOptionRating |
                      r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and
                      r.dateOption = tupleOpt.o and r.value = tupleOpt.date and
                      r.shoppingCartItem = i
                 ) ) ) and i.optionValueInOption = self.optionValue )
                endif
               post decreaseQuantity:
                StockConfiguration.allInstances()
                 ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies
                 (self.product.quantity = self.product@pre.quantity@pre-self.quantity)

A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                         ER 2012                         October 15, 2012       38 / 42
Introduction           Filtering Conceptual Schemas                            Evaluation                     Application to Event Types                                         Conclusions

Event Types
                                               Focus Set                                                                Filtered Schema
               context AddProductToShoppingCart::effect()
                                                                                                                                   event
               post addProduct:
                let existingItem:ShoppingCartItem                                                             AddProductToShoppingCart
                  = self.shoppingCart@pre.shoppingCartItem@pre                                       quantity:Integer
                     ->any(i|i.product=self.product)                                                 textOption:Tuple(o:TextOption, text:String)[0..*]
                in let productExists:Boolean=not existingItem.oclIsUndefined() and                    dateOption:Tuple(o:DateOption, date:Date)[0..*]
                      existingItem.optionValueInOption=self.optionValue and                                                            *
                                                                                                          *                                          *
                      existingItem.textOptionRating
                       ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet()
                       = self.textOption and
                  existingItem.dateOptionRating
                       ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet()
                       = self.dateOption                                                                                                             1
                                                                                                          1
                in if productExists then                                                                                                             Product
                   let i = self.shoppingCart.shoppingCartItem                                    ShoppingCart                                   quantity:Real[0..1]
                       ->any(i|i.product=self.product)                                           1                                                                    1
                   in i.quantity = i@pre.quantity + self.quantity
                else
                (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre())
                    ->one(i:ShoppingCartItem |                                                                     optionValue *




                                                                                                                                                                IsAPurchaseOfA
                 i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and
                 i.shoppingCart = self.shoppingCart and i.product = self.product and                            OptionValueInOption
                 i.quantity = self.quantity and i.applyDiscount = true and                                                             *
                 (self.textOption->notEmpty() implies




                                                                                                                             Chooses
                   self.textOption ->forAll(tupleOpt |
                  (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre())
                        ->exists(r:TextOptionRating |
                                                                                                                                       *
                         r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and
                         r.textOption = tupleOpt.o and r.value = tupleOpt.text and                                 ShoppingCartItem
                                                                                                               *                          *
                         r.shoppingCartItem = i                                                                    quantity:Integer[0..1]
                 ) ) ) and (self.dateOption->notEmpty() implies                                                    applyDiscount:Boolean
                  self.dateOption->forAll(tupleOpt|                                                                      *                  *
                    (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre())   DateOptionRating                                     TextOptionRating
                      ->exists(r:DateOptionRating |
                      r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and
                                                                                            value:Date                                           value:String
                      r.dateOption = tupleOpt.o and r.value = tupleOpt.date and                                          *                  *
                      r.shoppingCartItem = i                                                                   TextOption                  DateOption
                 ) ) ) and i.optionValueInOption = self.optionValue )
                endif
               post decreaseQuantity:
                StockConfiguration.allInstances()                                                                    StockConfiguration
                 ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies                                   decreaseStockWhenOrderIsPlaced:Boolean
                 (self.product.quantity = self.product@pre.quantity@pre-self.quantity)

A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                         ER 2012                                                            October 15, 2012                    38 / 42
Introduction           Filtering Conceptual Schemas                            Evaluation                   Application to Event Types                                     Conclusions

Event Types
                                               Focus Set                                                              Filtered Schema
               context AddProductToShoppingCart::effect()
                                                                                                                      event
               post addProduct:
                let existingItem:ShoppingCartItem                                                     AddProductToShoppingCart
                  = self.shoppingCart@pre.shoppingCartItem@pre                                quantity:Integer
                     ->any(i|i.product=self.product)                                          textOption:Tuple(o:TextOption, text:String)[0..*]
                in let productExists:Boolean=not existingItem.oclIsUndefined() and             dateOption:Tuple(o:DateOption, date:Date)[0..*]
                      existingItem.optionValueInOption=self.optionValue and                                            *
                                                                                                   *                               *
                      existingItem.textOptionRating
                       ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet()
                       = self.textOption and
                  existingItem.dateOptionRating
                       ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet()
                       = self.dateOption                                                                                           1
                                                                                                   1
                in if productExists then                                                                                          Product
                                                                                            ShoppingCart
                           ∆ = 0.8 in 3ms
                   let i = self.shoppingCart.shoppingCartItem
                       ->any(i|i.product=self.product)                                      1
                                                                                                                              quantity:Real[0..1]
                                                                                                                                            1
                   in i.quantity = i@pre.quantity + self.quantity
                else       Such schema can be seen as an Effect Correspondence Diagram
                (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre())
                           (ECD) that shows all the entities affected by a given event type.
                    ->one(i:ShoppingCartItem |                                                             optionValue *




                                                                                                                                                          IsAPurchaseOfA
                 i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and
                 i.shoppingCart = self.shoppingCart and i.product = self.product and Systems Analysis OptionValueInOption
                                                                       Structured                         and Design Method:
                 i.quantity = self.quantity and i.applyDiscount = true and
                                                                 Application and Context. Downs et al. Prentice Hall 1992
                                                                                                                       *
                 (self.textOption->notEmpty() implies




                                                                                                                           Chooses
                   self.textOption ->forAll(tupleOpt |
                  (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre())
                        ->exists(r:TextOptionRating |
                                                                                                                       *
                         r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and
                         r.textOption = tupleOpt.o and r.value = tupleOpt.text and                         ShoppingCartItem
                                                                                                        *                         *
                         r.shoppingCartItem = i                                                                  quantity:Integer[0..1]
                 ) ) ) and (self.dateOption->notEmpty() implies                                                  applyDiscount:Boolean
                  self.dateOption->forAll(tupleOpt|                                                                    *              *
                    (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre())   DateOptionRating                               TextOptionRating
                      ->exists(r:DateOptionRating |
                      r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and
                                                                                            value:Date                                     value:String
                      r.dateOption = tupleOpt.o and r.value = tupleOpt.date and                                        *              *
                      r.shoppingCartItem = i                                                                 TextOption              DateOption
                 ) ) ) and i.optionValueInOption = self.optionValue )
                endif
               post decreaseQuantity:
                StockConfiguration.allInstances()                                                                  StockConfiguration
                 ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies                                   decreaseStockWhenOrderIsPlaced:Boolean
                 (self.product.quantity = self.product@pre.quantity@pre-self.quantity)

A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                                         ER 2012                                                      October 15, 2012                    39 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions




Outline


       1       Introduction

       2       Filtering Conceptual Schemas

       3       Evaluation

       4       Application to Event Types

       5       Conclusions




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       40 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas   Evaluation   Application to Event Types           Conclusions

Conclusions


Conclusions
       Problem: understanding constraint expressions in large conceptual schemas.

       Referenced elements may be very distant from each other and embedded in an
       intricate web of irrelevant elements.

       Filtering method: users focuses on a set of constraints. The method automatically
       obtains a filtered schema that includes the smallest subset of the original schema
       that is needed to understand those expressions.

       Prototype tool: evaluated by means of its application to 4 real large conceptual
       schemas.

       Results (I): size reduction ≥70% in the number of schema elements to explore by
       using filtered schemas instead of working manually.

       Results (II): average time per request → short enough for our purpose (ms).

       Application of the method to help understanding the specification of event types.


A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                               ER 2012                        October 15, 2012       41 / 42
Introduction         Filtering Conceptual Schemas         Evaluation      Application to Event Types           Conclusions




                  Understanding Constraint Expressions
                     in Large Conceptual Schemas
                         by Automatic Filtering

                Antonio Villegas, Antoni Oliv´, and Maria-Ribera Sancho
                                             e
                                          {avillegas, olive, ribera}@essi.upc.edu


                         Department of Service and Information System Engineering
                                  Universitat Polit`cnica de Catalunya
                                                   e




A. Villegas, A. Oliv´, and M.-R. Sancho
                    e                                     ER 2012                           October 15, 2012       42 / 42

More Related Content

Similar to Understanding Constraint Expressions in Large Conceptual Schemas by Automatic Filtering

Model Risk Management : Best Practices
Model Risk Management : Best PracticesModel Risk Management : Best Practices
Model Risk Management : Best Practices
QuantUniversity
 
Towards a framework for making applications provenance aware: UML2PROV
Towards a framework for making applications provenance aware: UML2PROVTowards a framework for making applications provenance aware: UML2PROV
Towards a framework for making applications provenance aware: UML2PROV
Universidad de La Rioja
 
130924 yann-gael gueheneuc - an overview of software code quality and conne...
130924   yann-gael gueheneuc - an overview of software code quality and conne...130924   yann-gael gueheneuc - an overview of software code quality and conne...
130924 yann-gael gueheneuc - an overview of software code quality and conne...
Ptidej Team
 
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
Yuriy Tymchuk
 
A cluster-based analysis to diagnose students’ learning achievements
A cluster-based analysis to diagnose students’ learning achievementsA cluster-based analysis to diagnose students’ learning achievements
A cluster-based analysis to diagnose students’ learning achievements
Miguel R. Artacho
 
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
eMadrid network
 
HCI for Recommender Systems - The past, present and future
HCI for Recommender Systems - The past, present and futureHCI for Recommender Systems - The past, present and future
HCI for Recommender Systems - The past, present and future
André Calero Valdez
 
Sociotechnical systems resilience
Sociotechnical systems resilienceSociotechnical systems resilience
Sociotechnical systems resilience
Jean-René RUAULT
 
Aligning Leadership [Presentation]
Aligning Leadership [Presentation]Aligning Leadership [Presentation]
Aligning Leadership [Presentation]
Aligning Leadership Association
 
09 introduction to_modeling
09 introduction to_modeling09 introduction to_modeling
09 introduction to_modeling
Majong DevJfu
 
Dubrowski assessment and evaluation
Dubrowski assessment and evaluationDubrowski assessment and evaluation
Dubrowski assessment and evaluation
Adam Dubrowski
 
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5aIHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
IHE Brasil
 
The SQALE method: Meaningful insights into your Technical Debt
The SQALE method: Meaningful insights into your Technical DebtThe SQALE method: Meaningful insights into your Technical Debt
The SQALE method: Meaningful insights into your Technical Debt
Jean-Louis LETOUZEY
 
Best Practice Reference Architecture for Data Curation
Best Practice Reference Architecture for Data CurationBest Practice Reference Architecture for Data Curation
Best Practice Reference Architecture for Data Curation
OSTHUS
 
14 analysis techniques
14 analysis techniques14 analysis techniques
14 analysis techniques
Majong DevJfu
 
Me2011 Presentation by Loniewski
Me2011 Presentation by LoniewskiMe2011 Presentation by Loniewski
Icvem 2012 v&m there's value everywhere v2.ppt
Icvem 2012 v&m there's value everywhere v2.pptIcvem 2012 v&m there's value everywhere v2.ppt
Icvem 2012 v&m there's value everywhere v2.ppt
Olaf de Hemmer Gudme
 
Upskill Yourself With GSDC Site Reliability Engineering Certification
Upskill Yourself With GSDC Site Reliability Engineering CertificationUpskill Yourself With GSDC Site Reliability Engineering Certification
Upskill Yourself With GSDC Site Reliability Engineering Certification
gsdcouncil1
 
Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...
Nathaniel Palmer
 
Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...
Nathaniel Palmer
 

Similar to Understanding Constraint Expressions in Large Conceptual Schemas by Automatic Filtering (20)

Model Risk Management : Best Practices
Model Risk Management : Best PracticesModel Risk Management : Best Practices
Model Risk Management : Best Practices
 
Towards a framework for making applications provenance aware: UML2PROV
Towards a framework for making applications provenance aware: UML2PROVTowards a framework for making applications provenance aware: UML2PROV
Towards a framework for making applications provenance aware: UML2PROV
 
130924 yann-gael gueheneuc - an overview of software code quality and conne...
130924   yann-gael gueheneuc - an overview of software code quality and conne...130924   yann-gael gueheneuc - an overview of software code quality and conne...
130924 yann-gael gueheneuc - an overview of software code quality and conne...
 
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
Treating Code Quality as a First Class Entity (icsme15) [doc. symposium]
 
A cluster-based analysis to diagnose students’ learning achievements
A cluster-based analysis to diagnose students’ learning achievementsA cluster-based analysis to diagnose students’ learning achievements
A cluster-based analysis to diagnose students’ learning achievements
 
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
V Jornadas eMadrid sobre “Educación Digital”. Jesús G. Boticario, Universidad...
 
HCI for Recommender Systems - The past, present and future
HCI for Recommender Systems - The past, present and futureHCI for Recommender Systems - The past, present and future
HCI for Recommender Systems - The past, present and future
 
Sociotechnical systems resilience
Sociotechnical systems resilienceSociotechnical systems resilience
Sociotechnical systems resilience
 
Aligning Leadership [Presentation]
Aligning Leadership [Presentation]Aligning Leadership [Presentation]
Aligning Leadership [Presentation]
 
09 introduction to_modeling
09 introduction to_modeling09 introduction to_modeling
09 introduction to_modeling
 
Dubrowski assessment and evaluation
Dubrowski assessment and evaluationDubrowski assessment and evaluation
Dubrowski assessment and evaluation
 
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5aIHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
IHE / RSNA Image Sharing Project - IHE Colombia Workshop (12/2014) Module 5a
 
The SQALE method: Meaningful insights into your Technical Debt
The SQALE method: Meaningful insights into your Technical DebtThe SQALE method: Meaningful insights into your Technical Debt
The SQALE method: Meaningful insights into your Technical Debt
 
Best Practice Reference Architecture for Data Curation
Best Practice Reference Architecture for Data CurationBest Practice Reference Architecture for Data Curation
Best Practice Reference Architecture for Data Curation
 
14 analysis techniques
14 analysis techniques14 analysis techniques
14 analysis techniques
 
Me2011 Presentation by Loniewski
Me2011 Presentation by LoniewskiMe2011 Presentation by Loniewski
Me2011 Presentation by Loniewski
 
Icvem 2012 v&m there's value everywhere v2.ppt
Icvem 2012 v&m there's value everywhere v2.pptIcvem 2012 v&m there's value everywhere v2.ppt
Icvem 2012 v&m there's value everywhere v2.ppt
 
Upskill Yourself With GSDC Site Reliability Engineering Certification
Upskill Yourself With GSDC Site Reliability Engineering CertificationUpskill Yourself With GSDC Site Reliability Engineering Certification
Upskill Yourself With GSDC Site Reliability Engineering Certification
 
Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...
 
Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...Governance and Business Participation: The Key Requirements for Effective SOA...
Governance and Business Participation: The Key Requirements for Effective SOA...
 

Understanding Constraint Expressions in Large Conceptual Schemas by Automatic Filtering

  • 1. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Understanding Constraint Expressions in Large Conceptual Schemas by Automatic Filtering Antonio Villegas, Antoni Oliv´, and Maria-Ribera Sancho e {avillegas, olive, ribera}@essi.upc.edu Department of Service and Information System Engineering Universitat Polit`cnica de Catalunya e A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 1 / 42
  • 2. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 2 / 42
  • 3. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 3 / 42
  • 4. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 5. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 6. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 7. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 8. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 9. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 4 / 42
  • 10. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas osCommerce www.oscommerce.com 84 Entity types, 262 Event types, 209 Attributes, 183 Relationship types, 393 IsA Relationships A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 5 / 42
  • 11. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas Magento www.magentocommerce.com 218 Entity types, 187 Event types, 983 Attributes, 319 Relationship types, 165 IsA Relationships A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 6 / 42
  • 12. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas UML metaschema www.omg.org/spec/UML 293 Entity types, 93 Attributes, 377 Relationship types, 355 IsA Relationships A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 7 / 42
  • 13. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas EU-Rent www.lsi.upc.edu/~techreps/files/R03-59.zip 65 Entity types, 120 Event types, 85 Attributes, 152 Relationship types, 207 IsA Relationships A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 8 / 42
  • 14. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conceptual Schemas Constraint expressions In general, large conceptual schemas or ontologies include many formal constraint expressions, which are used for defining: static or dynamic integrity constraints default values pre and postconditions of operations results of operations We focus on human understanding of constraint expressions defined in large conceptual schemas A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 9 / 42
  • 15. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Constraint Expressions osCommerce Magento 457 constraints 734 constraints UML Metaschema EU-Rent 170 constraints 283 constraints A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 10 / 42
  • 16. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Constraint Expressions We try to ease the understanding of constraint expressions in large conceptual schemas. The problem is significant in a large conceptual schema there may be many constraint expressions, used as –among others– invariants, derivation rules, and pre/post conditions understanding such expressions is a necessity during their definition, validation, implementation, and maintenance understanding such expressions is very difficult when the conceptual schema is large, because the elements involved in those expressions are in general scattered throughout the schema, and it is not easy to navigate through the schema in the way implied by the expressions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 11 / 42
  • 17. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Constraint Expressions Simple Example { context Bn inv: self.c.att > 0 b R c Understanding such B C expression requires: * 1 att:Integer n-level specialization 1 finding entity type Bn ... (the context) in the schema Bi 2 moving upwards the n-level hierarchy until the root (entity type B) ... 3 navigating towards C Bn 4 finding attribute att A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 12 / 42
  • 18. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Constraint Expressions Simple Example { context Bn inv: self.c.att > 0 b R c B C * 1 att:Integer n-level specialization ... Filtered Schema Bi b R c Bn C * 1 att:Integer ... Note that the hierarchy Bn IsA ... Bi IsA ... B Bn does not appear in the filtered schema, and that the first participant of the relationship type R has changed to Bn . A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 13 / 42
  • 19. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 14 / 42
  • 20. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Method Overview Focus Set Filtering Method context inv ... Filtered context context derive ... init ... 1 En�ty and Event Types Processing Conceptual context pre ... Schema context post ... 2 Rela�onship Types Processing context body ... 3 Generaliza�ons Processing Large Conceptual Schema 4 Data Types Processing context inv ... context derive ... context init ... 5 Schema Rules Processing context pre ... context post ... context body ... 6 Presenta�on Filtering Approach The user focuses on a set of constraints and the method obtains the smallest subset of the large schema that is needed to understand those expressions. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 15 / 42
  • 21. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Output of the Filtering Method Method Overview: Output Focus Set Filtering Method context inv ... Filtered context context derive ... init ... 1 En�ty and Event Types Processing Conceptual context pre ... Schema context post ... 2 Rela�onship Types Processing context body ... 3 Generaliza�ons Processing Large Conceptual Schema 4 Data Types Processing context inv ... context derive ... context init ... 5 Schema Rules Processing context pre ... context post ... context body ... 6 Presenta�on Minimal Subset The knowledge contained in the filtered schema is the smallest subset of the knowledge from the large schema referenced by the constraints of focus. Valid Instantiation The filtered conceptual schema is a valid instance of the corresponding metaschema of the large schema from which it is obtained. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 16 / 42
  • 22. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Method Overview: Stages Focus Set Filtering Method context inv ... Filtered context context derive ... init ... 1 En�ty and Event Types Processing Conceptual context pre ... Schema context post ... 2 Rela�onship Types Processing context body ... 3 Generaliza�ons Processing Large Conceptual Schema 4 Data Types Processing context inv ... context derive ... context init ... 5 Schema Rules Processing context pre ... context post ... context body ... 6 Presenta�on Running Example We assume that the user needs to understand the following constraint defined in the Magento, in the context of the entity type ConfigurableProduct: context ConfigurableProduct inv: - is associated to products with the same attributes self.associatedProduct->forAll(ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute)) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 17 / 42
  • 23. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Stage 1 The method firstly extracts the entity and event types referenced by the selected constraints of focus and includes them in the resulting filtered conceptual schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 18 / 42
  • 24. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Entity and Event Types A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 19 / 42
  • 25. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Entity and Event Types ConfigurableProduct ConfigurableProduct: context of the constraint A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 19 / 42
  • 26. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Entity and Event Types ConfigurableProduct ConfiguredProduct ConfigurableProduct: context of the constraint ConfiguredProduct: target participant of self.associatedProduct navigation A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 19 / 42
  • 27. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Entity and Event Types ConfigurableProduct ConfiguredProduct Attribute ConfigurableProduct: context of the constraint ConfiguredProduct: target participant of self.associatedProduct navigation Attribute: target participant of ap.ableToRateAttribute navigation) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 19 / 42
  • 28. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 1: Filtering of Entity and Event Types Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Entity and Event Types ConfigurableProduct ConfiguredProduct Attribute SingleValuedEnumerationAttribute ConfigurableProduct: context of the constraint ConfiguredProduct: target participant of self.associatedProduct navigation Attribute: target participant of ap.ableToRateAttribute navigation) SingleValuedEnumerationAttribute: target participant of self.configurableAttribute navigation A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 19 / 42
  • 29. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Stage 2 The method extracts the relationship types and attributes referenced by the selected constraints of focus and includes them in the resulting filtered conceptual schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 20 / 42
  • 30. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 31. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 32. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct ap.ableToRateAttribute navigation: IsAbleToRate * Item Attribute * ableToRateAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 33. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct ap.ableToRateAttribute navigation: IsAbleToRate * Item Attribute * ableToRateAttribute self.configurableAttribute navigation: IsConfiguredBy 1..* ConfigurableProduct 1..* SingleValuedEnumerationAttribute configurableAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 34. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct ap.ableToRateAttribute navigation: IsAbleToRate * Item Attribute * ableToRateAttribute self.configurableAttribute navigation: IsConfiguredBy 1..* ConfigurableProduct 1..* SingleValuedEnumerationAttribute configurableAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 35. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Referenced Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct ap.ableToRateAttribute navigation: Projection Required IsAbleToRate * Item Attribute * ableToRateAttribute self.configurableAttribute navigation: IsConfiguredBy 1..* ConfigurableProduct 1..* SingleValuedEnumerationAttribute configurableAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 21 / 42
  • 36. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Projection Item item Original Schema * IsAbleToRate * Attribute ableToRateAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 22 / 42
  • 37. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Projection Item item Original Schema * IsAbleToRate * Attribute ableToRateAttribute Product SimpleProduct ConfigurableProduct ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 22 / 42
  • 38. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Projection Item item Original Schema * IsAbleToRate * Attribute ableToRateAttribute Product SimpleProduct ConfigurableProduct ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 22 / 42
  • 39. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Projection Item item Original Schema Filtered Schema * IsAbleToRate * Attribute ableToRateAttribute LCA IsAbleToRate Product Product * * Attribute item ableToRateAttribute SimpleProduct ConfigurableProduct ConfiguredProduct ConfigurableProduct ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 22 / 42
  • 40. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 2: Filtering of Relationship Types and Attributes Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Relationship Types and Attributes self.associatedProduct navigation: IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct ap.ableToRateAttribute navigation: item IsAbleToRate * Product Attribute * ableToRateAttribute self.configurableAttribute navigation: IsConfiguredBy 1..* ConfigurableProduct 1..* SingleValuedEnumerationAttribute configurableAttribute A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 23 / 42
  • 41. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 3: Filtering of Generalization Relationships Stage 3 The method extracts the generalization relationships between the entity and event types in the resulting filtered conceptual schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 24 / 42
  • 42. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 3: Filtering of Generalization Relationships Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Generalization Relationships LCA Attribute Product EnumerationAttribute SimpleProduct ConfigurableProduct SingleValuedEnumerationAttribute ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 25 / 42
  • 43. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 3: Filtering of Generalization Relationships Focus Set context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) Filtered Generalization Relationships LCA Attribute Product Indirect Generalization ConfigurableProduct SingleValuedEnumerationAttribute ConfiguredProduct A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 25 / 42
  • 44. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 4: Filtering of Data Types Stage 4 The method includes in the filtered schema those data types from the original one that are referenced in the specification of a constraint of focus or define the type of a filtered attribute. In the running example, there are no data types referenced by the constraint of focus: context ConfigurableProduct inv: - is associated to products with the same attributes self.associatedProduct->forAll(ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute)) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 26 / 42
  • 45. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 5: Filtering of Schema Rules (optional) Stage 5 The method selects the schema rules (constraint expressions) that are defined in the context of elements from the filtered schema and that are referentially-complete. A schema rule is referentially-complete whenever all the schema elements used in the specification of the rule belong to the filtered conceptual schema. Considering the running example, the method selects the constraint of focus: context ConfigurableProduct inv: - is associated to products with the same attributes self.associatedProduct->forAll(ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute)) and an additional constraint that is referentially-complete: context ConfigurableProduct inv: - configurableAttribute subsets ableToRateAttribute self.ableToRateAttribute->includesAll(self.configurableAttribute)) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 27 / 42
  • 46. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Stages of the Filtering Method Stage 6: Presentation of the Filtered Schema Filtered Conceptual Schema SingleValuedEnumerationAttribute Attribute 1..* configurableAttribute ableToRateAttribute * IsAbleToRate IsConfiguredBy * item Product * IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) context ConfigurableProduct inv: -- configurableAttribute subsets ableToRateAttribute self.ableToRateAttribute-> includesAll(self.configurableAttribute) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 28 / 42
  • 47. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 29 / 42
  • 48. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Evaluation We have implemented the filtering method as a prototype tool We have evaluated the efficiency and effectiveness of the method by using four distinct case studies: the schema of Magento, the UML metaschema, the schema of osCommerce, and the EU-Rent car rental schema. The effectiveness measures the benefits obtained from the application of the filtering method The efficiency indicates the time interval between the request and the answer We have applied our filtering method for each OCL constraint expression specified in these conceptual schemas (1644 constraints). A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 30 / 42
  • 49. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Effectiveness Analysis Effectiveness Goal The bigger size reduction our method obtains, the better Evaluation We compare the final size of the filtered schema with the size of the context constraint schema Context Constraint Schema The portion of the large schema the user needs to manually explore in order to cover the elements referenced by the formal specification of the constraints of focus A with the referenced elements from the constraints of focus, B with complete generalization hierarchies of entity and event types between elements of A, C with all the attributes owned by entity and event types of A and B, D with all the relationship types in which the entity and event types of A and B participate, E without projection of referenced attributes and relationship types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 31 / 42
  • 50. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Effectiveness Analysis Effectiveness Context Constraint Schema Filtered Conceptual Schema SingleValuedEnumerationAttribute Attribute 1..* configurableAttribute ableToRateAttribute * IsAbleToRate IsConfiguredBy * item Product * IsRepresentedBy 1..* ConfigurableProduct 1..* associatedProduct ConfiguredProduct context ConfigurableProduct inv: -- is associated to products with the same attributes self.associatedProduct->forAll( ap | ap.ableToRateAttribute->includesAll(self.configurableAttribute) ) context ConfigurableProduct inv: -- configurableAttribute subsets ableToRateAttribute self.ableToRateAttribute-> includesAll(self.configurableAttribute) (a) Filtered conceptual schema (CSF ). (b) Context constraint schema (CSC ). Figure: Comparison between (a) the filtered conceptual schema and (b) the corresponding fragment of Magento for the constraint of ConfigurableProduct. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 32 / 42
  • 51. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Effectiveness Analysis Effectiveness Filtering Utility Factor Filtering Utility Factor Therefore, we define the filtering utility factor between the filtered schema CSF and the context constraint schema CSC as follows: Σ(CSF ) Filtering Utility Factor: ∆ = 1− , Σ(CSC ) where the size Σ(CS) of a conceptual schema CS counts: the number of entity and event types in CS the number of relationship types in CS the number of attributes in CS the number of generalization relationships in CS Note that Σ(CSF ) ≤ Σ(CSC ) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 33 / 42
  • 52. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Effectiveness Analysis Effectiveness For each schema, the plot indicates the smallest observation (sample minimum), lower quartile (Q1), median (Q2), upper quartile (Q3), and largest observation (sample maximum). The black diamonds indicate the mean of each sample. The bottom and top of each box (Q1 and Q3) are the 5th and 95th percentiles, which means that the box contains the 90% of the samples. Filtering Utility Factor ∆ [0,1] 1 0.9 0.8 0.85 0.7 0.79 0.72 0.74 0.6 0.5 0.4 0.3 0.2 0.1 0 Magento UML osCommerce EU Rent Box plot with the resulting values for the filtering utility factor applied to each of the 1644 schema rules of the case studies. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 34 / 42
  • 53. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Efficiency Analysis Efficiency A good method does not only need to be useful, but it also needs to obtain the results in an acceptable time according to the user’s expectations. Record the time lapse between the input of a user-selected focus set and the obtainment of the filtered schema. Response Time (ms) 25 20 15 10 4.08 4.21 5 3.25 2.69 0 Magento UML osCommerce EU Rent Values obtained by an Intel Core 2 Duo 3GHz processor with 4GB of DDR2 RAM. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 35 / 42
  • 54. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 36 / 42
  • 55. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Our method can be used to help understanding the specification of event types (system operations) in large conceptual schemas. Event Types Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004 e An event describes a nonempty set of changes in the population of entity or relationship types in the domain of the conceptual schema. We assume event types are represented as entity types with the stereotype «event». This allows one to define relationships between events and other entities, integrity constraints, derivation rules, etc. in a way very similar to that for ordinary entity types We define an effect() operation in each event type, whose purpose is to specify the effect of the event in the domain. The postcondition of this operation will be exactly the postcondition of the corresponding event. We can directly apply our filtering method to the set of postconditions of a particular event type in order to obtain its corresponding filtered schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 37 / 42
  • 56. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Our method can be used to help understanding the specification of event types (system operations) in large conceptual schemas. Event Types Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004 e An event describes a nonempty set of changes in the population of entity or relationship types in the domain of the conceptual schema. We assume event types are represented as entity types with the stereotype «event». This allows one to define relationships between events and other entities, integrity constraints, derivation rules, etc. in a way very similar to that for ordinary entity types We define an effect() operation in each event type, whose purpose is to specify the effect of the event in the domain. The postcondition of this operation will be exactly the postcondition of the corresponding event. We can directly apply our filtering method to the set of postconditions of a particular event type in order to obtain its corresponding filtered schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 37 / 42
  • 57. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Our method can be used to help understanding the specification of event types (system operations) in large conceptual schemas. Event Types Definition of events and their effects in object-oriented conceptual modeling languages. Oliv´ A. ER 2004 e An event describes a nonempty set of changes in the population of entity or relationship types in the domain of the conceptual schema. We assume event types are represented as entity types with the stereotype «event». This allows one to define relationships between events and other entities, integrity constraints, derivation rules, etc. in a way very similar to that for ordinary entity types We define an effect() operation in each event type, whose purpose is to specify the effect of the event in the domain. The postcondition of this operation will be exactly the postcondition of the corresponding event. We can directly apply our filtering method to the set of postconditions of a particular event type in order to obtain its corresponding filtered schema. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 37 / 42
  • 58. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Focus Set context AddProductToShoppingCart::effect() post addProduct: let existingItem:ShoppingCartItem = self.shoppingCart@pre.shoppingCartItem@pre ->any(i|i.product=self.product) in let productExists:Boolean=not existingItem.oclIsUndefined() and existingItem.optionValueInOption=self.optionValue and existingItem.textOptionRating ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet() = self.textOption and existingItem.dateOptionRating ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet() = self.dateOption in if productExists then let i = self.shoppingCart.shoppingCartItem ->any(i|i.product=self.product) in i.quantity = i@pre.quantity + self.quantity else (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre()) ->one(i:ShoppingCartItem | i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and i.shoppingCart = self.shoppingCart and i.product = self.product and i.quantity = self.quantity and i.applyDiscount = true and (self.textOption->notEmpty() implies self.textOption ->forAll(tupleOpt | (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre()) ->exists(r:TextOptionRating | r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and r.textOption = tupleOpt.o and r.value = tupleOpt.text and r.shoppingCartItem = i ) ) ) and (self.dateOption->notEmpty() implies self.dateOption->forAll(tupleOpt| (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre()) ->exists(r:DateOptionRating | r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and r.dateOption = tupleOpt.o and r.value = tupleOpt.date and r.shoppingCartItem = i ) ) ) and i.optionValueInOption = self.optionValue ) endif post decreaseQuantity: StockConfiguration.allInstances() ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies (self.product.quantity = self.product@pre.quantity@pre-self.quantity) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 38 / 42
  • 59. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Focus Set context AddProductToShoppingCart::effect() post addProduct: let existingItem:ShoppingCartItem = self.shoppingCart@pre.shoppingCartItem@pre ->any(i|i.product=self.product) in let productExists:Boolean=not existingItem.oclIsUndefined() and existingItem.optionValueInOption=self.optionValue and existingItem.textOptionRating ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet() = self.textOption and existingItem.dateOptionRating ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet() = self.dateOption in if productExists then let i = self.shoppingCart.shoppingCartItem ->any(i|i.product=self.product) in i.quantity = i@pre.quantity + self.quantity else (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre()) ->one(i:ShoppingCartItem | i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and i.shoppingCart = self.shoppingCart and i.product = self.product and i.quantity = self.quantity and i.applyDiscount = true and (self.textOption->notEmpty() implies self.textOption ->forAll(tupleOpt | (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre()) ->exists(r:TextOptionRating | r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and r.textOption = tupleOpt.o and r.value = tupleOpt.text and r.shoppingCartItem = i ) ) ) and (self.dateOption->notEmpty() implies self.dateOption->forAll(tupleOpt| (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre()) ->exists(r:DateOptionRating | r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and r.dateOption = tupleOpt.o and r.value = tupleOpt.date and r.shoppingCartItem = i ) ) ) and i.optionValueInOption = self.optionValue ) endif post decreaseQuantity: StockConfiguration.allInstances() ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies (self.product.quantity = self.product@pre.quantity@pre-self.quantity) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 38 / 42
  • 60. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Focus Set context AddProductToShoppingCart::effect() post addProduct: let existingItem:ShoppingCartItem = self.shoppingCart@pre.shoppingCartItem@pre ->any(i|i.product=self.product) in let productExists:Boolean=not existingItem.oclIsUndefined() and existingItem.optionValueInOption=self.optionValue and existingItem.textOptionRating ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet() = self.textOption and existingItem.dateOptionRating ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet() = self.dateOption in if productExists then let i = self.shoppingCart.shoppingCartItem ->any(i|i.product=self.product) in i.quantity = i@pre.quantity + self.quantity else (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre()) ->one(i:ShoppingCartItem | i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and i.shoppingCart = self.shoppingCart and i.product = self.product and i.quantity = self.quantity and i.applyDiscount = true and (self.textOption->notEmpty() implies self.textOption ->forAll(tupleOpt | (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre()) ->exists(r:TextOptionRating | r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and r.textOption = tupleOpt.o and r.value = tupleOpt.text and r.shoppingCartItem = i ) ) ) and (self.dateOption->notEmpty() implies self.dateOption->forAll(tupleOpt| (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre()) ->exists(r:DateOptionRating | r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and r.dateOption = tupleOpt.o and r.value = tupleOpt.date and r.shoppingCartItem = i ) ) ) and i.optionValueInOption = self.optionValue ) endif post decreaseQuantity: StockConfiguration.allInstances() ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies (self.product.quantity = self.product@pre.quantity@pre-self.quantity) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 38 / 42
  • 61. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Focus Set Filtered Schema context AddProductToShoppingCart::effect() event post addProduct: let existingItem:ShoppingCartItem AddProductToShoppingCart = self.shoppingCart@pre.shoppingCartItem@pre quantity:Integer ->any(i|i.product=self.product) textOption:Tuple(o:TextOption, text:String)[0..*] in let productExists:Boolean=not existingItem.oclIsUndefined() and dateOption:Tuple(o:DateOption, date:Date)[0..*] existingItem.optionValueInOption=self.optionValue and * * * existingItem.textOptionRating ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet() = self.textOption and existingItem.dateOptionRating ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet() = self.dateOption 1 1 in if productExists then Product let i = self.shoppingCart.shoppingCartItem ShoppingCart quantity:Real[0..1] ->any(i|i.product=self.product) 1 1 in i.quantity = i@pre.quantity + self.quantity else (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre()) ->one(i:ShoppingCartItem | optionValue * IsAPurchaseOfA i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and i.shoppingCart = self.shoppingCart and i.product = self.product and OptionValueInOption i.quantity = self.quantity and i.applyDiscount = true and * (self.textOption->notEmpty() implies Chooses self.textOption ->forAll(tupleOpt | (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre()) ->exists(r:TextOptionRating | * r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and r.textOption = tupleOpt.o and r.value = tupleOpt.text and ShoppingCartItem * * r.shoppingCartItem = i quantity:Integer[0..1] ) ) ) and (self.dateOption->notEmpty() implies applyDiscount:Boolean self.dateOption->forAll(tupleOpt| * * (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre()) DateOptionRating TextOptionRating ->exists(r:DateOptionRating | r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and value:Date value:String r.dateOption = tupleOpt.o and r.value = tupleOpt.date and * * r.shoppingCartItem = i TextOption DateOption ) ) ) and i.optionValueInOption = self.optionValue ) endif post decreaseQuantity: StockConfiguration.allInstances() StockConfiguration ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies decreaseStockWhenOrderIsPlaced:Boolean (self.product.quantity = self.product@pre.quantity@pre-self.quantity) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 38 / 42
  • 62. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Event Types Focus Set Filtered Schema context AddProductToShoppingCart::effect() event post addProduct: let existingItem:ShoppingCartItem AddProductToShoppingCart = self.shoppingCart@pre.shoppingCartItem@pre quantity:Integer ->any(i|i.product=self.product) textOption:Tuple(o:TextOption, text:String)[0..*] in let productExists:Boolean=not existingItem.oclIsUndefined() and dateOption:Tuple(o:DateOption, date:Date)[0..*] existingItem.optionValueInOption=self.optionValue and * * * existingItem.textOptionRating ->collect(r| Tuple{o=r.textOption,text=r.value})->asSet() = self.textOption and existingItem.dateOptionRating ->collect(r| Tuple{o=r.dateOption,date=r.value})->asSet() = self.dateOption 1 1 in if productExists then Product ShoppingCart ∆ = 0.8 in 3ms let i = self.shoppingCart.shoppingCartItem ->any(i|i.product=self.product) 1 quantity:Real[0..1] 1 in i.quantity = i@pre.quantity + self.quantity else Such schema can be seen as an Effect Correspondence Diagram (ShoppingCartItem.allInstances()-ShoppingCartItem.allInstances@pre()) (ECD) that shows all the entities affected by a given event type. ->one(i:ShoppingCartItem | optionValue * IsAPurchaseOfA i.oclIsNew() and i.oclIsTypeOf(ShoppingCartItem) and i.shoppingCart = self.shoppingCart and i.product = self.product and Systems Analysis OptionValueInOption Structured and Design Method: i.quantity = self.quantity and i.applyDiscount = true and Application and Context. Downs et al. Prentice Hall 1992 * (self.textOption->notEmpty() implies Chooses self.textOption ->forAll(tupleOpt | (TextOptionRating.allInstances()-TextOptionRating.allInstances@pre()) ->exists(r:TextOptionRating | * r.oclIsNew() and r.oclIsTypeOf(TextOptionRating) and r.textOption = tupleOpt.o and r.value = tupleOpt.text and ShoppingCartItem * * r.shoppingCartItem = i quantity:Integer[0..1] ) ) ) and (self.dateOption->notEmpty() implies applyDiscount:Boolean self.dateOption->forAll(tupleOpt| * * (DateOptionRating.allInstances()-DateOptionRating.allInstances@pre()) DateOptionRating TextOptionRating ->exists(r:DateOptionRating | r.oclIsNew() and r.oclIsTypeOf(DateOptionRating) and value:Date value:String r.dateOption = tupleOpt.o and r.value = tupleOpt.date and * * r.shoppingCartItem = i TextOption DateOption ) ) ) and i.optionValueInOption = self.optionValue ) endif post decreaseQuantity: StockConfiguration.allInstances() StockConfiguration ->one(sc | sc.decreaseStockWhenOrderIsPlaced) implies decreaseStockWhenOrderIsPlaced:Boolean (self.product.quantity = self.product@pre.quantity@pre-self.quantity) A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 39 / 42
  • 63. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Outline 1 Introduction 2 Filtering Conceptual Schemas 3 Evaluation 4 Application to Event Types 5 Conclusions A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 40 / 42
  • 64. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 65. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 66. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 67. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 68. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 69. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 70. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Conclusions Conclusions Problem: understanding constraint expressions in large conceptual schemas. Referenced elements may be very distant from each other and embedded in an intricate web of irrelevant elements. Filtering method: users focuses on a set of constraints. The method automatically obtains a filtered schema that includes the smallest subset of the original schema that is needed to understand those expressions. Prototype tool: evaluated by means of its application to 4 real large conceptual schemas. Results (I): size reduction ≥70% in the number of schema elements to explore by using filtered schemas instead of working manually. Results (II): average time per request → short enough for our purpose (ms). Application of the method to help understanding the specification of event types. A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 41 / 42
  • 71. Introduction Filtering Conceptual Schemas Evaluation Application to Event Types Conclusions Understanding Constraint Expressions in Large Conceptual Schemas by Automatic Filtering Antonio Villegas, Antoni Oliv´, and Maria-Ribera Sancho e {avillegas, olive, ribera}@essi.upc.edu Department of Service and Information System Engineering Universitat Polit`cnica de Catalunya e A. Villegas, A. Oliv´, and M.-R. Sancho e ER 2012 October 15, 2012 42 / 42