WissDB [ 2011, Jun 18 ] . Documents . Presentations . Index . Resources . UNDEFs



Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL


Please note: The first four tables - the Meta Schema - may not yet be part of your database schema.
However, if you want to make your database self-describing, you should implement also the meta schema.

As far as your application only supports a small set of specific values for a given table attribute, the corresponding domain should be specified in SQL already.
The syntax would be (here an example):

CREATE DOMAIN Event_ID AS VARCHAR(14) NOT NULL ;

Actually supported values of type Event_ID should then be documented in the E_DomainValue table.

For databases not implementing the Meta Schema, developers are to maintain such information elsewhere (but usually forget to do so).


{
Begin MetaSchema:


E_Entity . . SQL


          .pk  D_EntClass              a_Name
          .    D_Comment               a_Semantics

          <--  is target of:  E_Attribute.ent


E_Attribute . . SQL


       ref.pk  E_Entity               a_ent
          .pk  D_AttrName              a_Name
          .    D_AttrConstraint        a_Constraint_
          .    D_Comment               a_Semantics
       ref.nn  E_Domain               a_Domain


E_Domain . . SQL


          .pk  D_DomainName            a_Name
          .    D_Comment               a_Semantics
          .nn  D_TypeDescr             a_Type_in_SQL
          .    D_TypeDescr             a_Type_in_Cpp
          .    D_TypeDescr             a_Type_in_Java
          .    D_TypeDescr             a_Type_in_Delphi
          .    D_TypeDescr             a_Type_in_CSharp

          <--  is target of:  E_DomainValue.Domain
          <--  is target of:  E_Attribute.Domain


E_DomainValue . . SQL


       ref.pk  E_Domain               a_Domain
          .pk  D_ValueName             a_ValueAsStr
          .    D_ValueNumber           a_ValueAsNr
          .    D_Comment               a_Semantics
          .    D_Date                  a_ObsoleteSince



end MetaSchema
}


E_Alias . . SQL


          .pk  D_ProjectLocator       a_Nr
          .    D_Locator              a_Loc


E_Process . . SQL


          .pk  D_Locator              a_Loc
       ref.nn  E_KnowledgeItem        a_Description
       ref.    E_Role                 a_Role

          <--  is target of:  E_Result.of


E_Role . . SQL


          .pk  D_Locator              a_Loc
       ref.nn  E_KnowledgeItem        a_Description

          <--  is target of:  E_Process.Role


E_KnowledgeItem . . SQL


          .pk  D_Locator              a_Loc
          .nn  D_ItemType             a_Type_
          .    BLOB                   a_NodeValue

          <--  is target of:  R_Is_keyword_for.for
          <--  is target of:  R_Is_related_to.B
          <--  is target of:  R_Is_related_to.A
          <--  is target of:  E_Role.Description
          <--  is target of:  E_Process.Description

....   E_Result . SQL
               |    E_KnowledgeItem     
               .nn  D_ViewType             a_View
               .nn  D_AbstractionType      a_Abstraction
               .nn  D_UsageType            a_Usage
            ref.    E_Process              a_of
               .nn  D_EMailAddress          a_from
               .nn  D_Date                  a_since
               .nn  D_Date                  a_LastUpdate

....   .   E_Practice . SQL
                    |    E_KnowledgeItem     
                    |    E_Result            
                    .    INT                    a_PracticeType
                    .    D_Counter               a_reuse_0
                    .    D_Counter               a_reuse_1
                    .    D_Counter               a_reuse_2
                    .    D_Counter               a_reuse_3

....   E_Candidate . SQL
               |    E_KnowledgeItem     
               .nn  D_EMailAddress          a_from
               .nn  D_Date                  a_since


R_Is_related_to . . SQL


       ref.pk  E_KnowledgeItem        a_A
       ref.pk  E_KnowledgeItem        a_B
          .pk  D_CorrelationType      a_Correlation


R_Is_keyword_for . . SQL


       ref.pk  E_Aspect               a_keyword
       ref.pk  E_KnowledgeItem        a_for


E_Aspect . . SQL


          .pk  D_Locator              a_Loc

          <--  is target of:  R_Is_keyword_for.keyword


end of WissDB.er1 ERD




How to read the ERD


: Notation Semantics: ------------------ Prefixes E_, R_, S_, A_, e_ in front of a name show what kind of concept the name x in question is denoting: E_x is an entity class. Note however: We write e_x instead of E_x where we want to say that E_x is occurring in the role of a superclass. If a class E_x1 is a specialization of another class E_x , i.e. if each instance of E_x1 can be also be seen as an instance of type E_x , then e_x is meant to be the group of all attributes of E_x1 defined in E_x already (the set of all inherited attributes). R_x is entity class E_x representing entity associations that are not of cardinality 1:n or n:1 (they need not even be binary relations). A_x is an attribute of an entity class, same as a_x() in C++ or Java. S_x is a complex attribute (i.e. a set of attributes), same as a_x() in C++ or Java. We write a_x where we do not care to see whether attribute x is complex or not. D_x is a domain, i.e. an attribute type. pk says that this attribute is part of the entity's primary key. nn says that this is a NOT NULL attribute. c: is to mark core entity types (types that do not specialize any other type). Types not marked as core entity types inherit structure from their - always unique - direct supertype). A Core Type is an entity type that is not a specialization of another entity type in the model shown. : Specialisation hierarchies are shown in this form: ------------------------------------------------- | E_x3 | e_x1 | e_x2 . E_x3 structure not inherited means: E_x3 specializes E_x2 (so that all structure of E_x2 is also structure of E_x3). E_x3 is a direct subtype of E_x2, and E_x2 is a direct subtype of E_x1. : Entity Relationship Structure is shown as follows: ------------------------------------------------- : E_x1 ->> set of E_x2 a_Name means: Given any object x1 of type E_x1, x1.a_Name() is an instance of a List h_Name defined in the ERD (the Name can be seen as describing the role of the list members in relation to x1). : E_x1 . E_x2 x3 (to be read as: <-- E_x2.x3 ) means: Each value E_x1.A_x3 is primary key of an entity of type E_x2, so that ( E_x1, E_x2 ) is a relation of cardinality (m:1) or (1:1). : E_x1 . D_x2 x3 . S_x2 x3 means: Each value E_x1.A_x3 is an attribute of type D_x2 (resp. S_x2, S_x2 a set of attributes such that records of type S_x2 make sense in themselves). R_x1 is a type E_x1 that can be interpreted as a relationship type of a specific dimension n, 2 <= n. Note: Classes E_x without relation structure --> or <<- tend to be superflous. They form a self-contained ERD model which quite often does not make sense in isolation. Here is an example: Classes meant to be enumerations such as e.g. : E_Category . A_Value D_ValueName . A_Semantics D_Comment . A_ObsoleteSince D_Date need usually not exist in form of a separate table. To model it in form of a domain D_Category together with an attribute A_ObsoleteSince in the table E_DomainValues would be better: : E_DomainValues . A_Domain D_DomainName . A_Value D_ValueName . A_Semantics D_Comment . A_ObsoleteSince D_Date To have such a table - and fill it with a description of all values of enumeration domains - is recommended anyway in order to have easy to maintain documentation for such values. To maintain such documentation in the database already is to make its content self-describing. Not to have a table E_DomainValues would be acceptable only if the constants were not coded to be - in their physical presentation - integer values.

Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL


All Entity Types
( grouped - goto sorted by Name )

Please note: The first four tables allow to reconstruct the object-oriented logical database design (i.e. the *.er1 file).

      E_Entity
      E_Attribute
      E_Domain
      E_DomainValue
      |
      E_Alias
      E_Process
      E_Role
      E_KnowledgeItem
      .   E_Result
      .   .   E_Practice
      .   E_Candidate
      R_Is_related_to
      R_Is_keyword_for
      E_Aspect
Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL


All Entity Types
( sorted by Name - goto grouped )



A D E I K P R

      E_Alias
      E_Aspect
      E_Attribute
      |
      E_Domain
      E_DomainValue
      |
      E_Entity
      |
      E_KnowledgeItem
      |
      E_Process
      |
      E_Role
      |
      R_Is_keyword_for
      R_Is_related_to

These are 11 Entity Types



Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL


Our Physical Domain Implementation


Domain          
 
        Datatype
 
D_AbstractionTypeINT
D_AttrConstraint VARCHAR2(10)
D_AttrName VARCHAR2(30)
D_Comment VARCHAR2(4000)
D_CorrelationTypeINT
D_Counter INT
D_Date DATE
D_DateTime DATE
D_DomainName VARCHAR2(30)
D_EMailAddress VARCHAR(80)
D_EntClass VARCHAR2(30)
D_EntConstraint VARCHAR2(10)
D_ItemTypeINT
D_LocatorVARCHAR(255)
D_NameVARCHAR(80)
D_NodeValue BLOB
D_PracticeTypeINT
D_ProjectLocatorINT
D_TypeDescr VARCHAR2(40)
D_UpdateNr INT
D_UsRoRes VARCHAR2(40)
D_UsageTypeINT
D_ValueName VARCHAR2(240)
D_ValueNumber INT
D_ViewTypeINT


Named Domain Values are:

D_AbstractionType:   Pattern
D_AbstractionType:   Solution
D_AbstractionType:   Strategy
D_AbstractionType:   Template

D_CorrelationType:   B is Code implementing Concept A
D_CorrelationType:   B is Solution Concept for Requirement A
D_CorrelationType:   B is a Solution Concept based on Technology A

D_ItemType:   Advice
D_ItemType:   Business
D_ItemType:   Description of Practice Candidate (in XML)
D_ItemType:   Description of Process
D_ItemType:   Description of Result
D_ItemType:   Description of Role
D_ItemType:   Information
D_ItemType:   Practice Candidate
D_ItemType:   Solution Code
D_ItemType:   Solution Concept
D_ItemType:   Solution Requirement
D_ItemType:   Technology

D_PracticeType:   Best Practice
D_PracticeType:   Lesson Learned

D_UsageType:   Reference
D_UsageType:   Sample
D_UsageType:   Use after customization
D_UsageType:   Use as is

D_ViewType:   Concept
D_ViewType:   Implementation


Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL


Where Domains are actually used


 
        Domain : Used in Entity Classes E_..
 
AbstractionType :
.   E_Practice
.   E_Result
|
AttrConstraint :
.   E_Attribute
|
AttrName :
.   E_Attribute
|
Comment :
.   E_Attribute
.   E_Domain
.   E_DomainValue
.   E_Entity
|
CorrelationType :
.   E_Is_related_to
|
Counter :
.   E_Practice
|
Date :
.   E_Candidate
.   E_DomainValue
.   E_Practice
.   E_Result
|
DomainName :
.   E_Attribute
.   E_Domain
.   E_DomainValue
|
EMailAddress :
.   E_Candidate
.   E_Practice
.   E_Result
|
EntClass :
.   E_Attribute
.   E_Entity
|
ItemType :
.   E_Candidate
.   E_KnowledgeItem
.   E_Practice
.   E_Result
|
Locator :
.   E_Alias
.   E_Aspect
.   E_Candidate
.   E_Is_keyword_for
.   E_Is_related_to
.   E_KnowledgeItem
.   E_Practice
.   E_Process
.   E_Result
.   E_Role
|
NodeValue :
.   E_Candidate
.   E_KnowledgeItem
.   E_Practice
.   E_Result
|
PracticeType :
.   E_Practice
|
ProjectLocator :
.   E_Alias
|
TypeDescr :
.   E_Domain
|
UsageType :
.   E_Practice
.   E_Result
|
ValueName :
.   E_DomainValue
|
ValueNumber :
.   E_DomainValue
|
ViewType :
.   E_Practice
.   E_Result


Notation Semantics - ERD - Entities - Domains - Domain Usage - SQL

, 11 Tables




End of Document ...