WissDB . since Jun 15 . Index . DOCs TOP TOC

WissDB: The Physical Data Model


From the formal specification given in section 2, the following physical data model is derived.

The reader may wonder why there is an additional table DomainValues. Its content is meant to document

–      which values are actually allowed in a domain that is an enumeration of constants

–      and also what these constants mean (semantics). 

To have such documentation in the database already is to make its content self-describing. Not to have a table DomainValues would be acceptable only if the constants were not coded to be – in their physical presentation – integer values.

 

 

 

   CREATE TABLE   DomainValues

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              DomName              CHAR(20)       NOT NULL

   ,              DomValue             CHAR(240)      NOT NULL

   ,              ValueAsNr            INTEGER        NOT NULL

   ,              Semantics            CHAR(240)     

   ,              ObsoleteSince        DATE         

   ,

 

   PRIMARY KEY    (

                  DomName

   ,              DomValue

                  )

   )

   ;

 

 

 

   CREATE TABLE   Aspect

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              Loc                  VARCHAR(255)   NOT NULL

   ,

 

   PRIMARY KEY    (

                  Loc

                  )

   )

   ;

 


 

   CREATE TABLE   Process

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              Loc                  VARCHAR(255)   NOT NULL

   ,              DescriptionLoc       VARCHAR(255)   NOT NULL

   ,              RoleLoc              VARCHAR(255) 

   ,

 

   PRIMARY KEY    (

                  Loc

                  )

   )

   ;

 

 

   CREATE TABLE   Role

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              Loc                  VARCHAR(255)   NOT NULL

   ,              DescriptionLoc       VARCHAR(255)   NOT NULL

   ,

 

   PRIMARY KEY    (

                  Loc

                  )

   )

   ;

 

 

   CREATE TABLE   Is_related_to

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              ALoc                 VARCHAR(255)   NOT NULL

   ,              BLoc                 VARCHAR(255)   NOT NULL

   ,              Correlation          INTEGER        NOT NULL

   ,

 

   PRIMARY KEY    (

                  ALoc

   ,              BLoc

   ,              Correlation

                  )

   ,

 

   CONSTRAINT     fk1_Is_related_to

   FOREIGN KEY    (

                  ALoc

                  )

   REFERENCES     KnowledgeItem

                  (

                  Loc

                  )

   ON DELETE SET NULL

   ,

 

   CONSTRAINT     fk2_Is_related_to

   FOREIGN KEY    (

                  BLoc

                  )

   REFERENCES     KnowledgeItem

                  (

                  Loc

                  )

   ON DELETE SET NULL

   )

   ;

 


 

   CREATE TABLE   Is_keyword_for

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              keywordLoc           VARCHAR(255)   NOT NULL

   ,              forLoc               VARCHAR(255)   NOT NULL

   ,

 

   PRIMARY KEY    (

                  keywordLoc

   ,              forLoc

                  )

   ,

 

   CONSTRAINT     fk1_Is_keyword_for

   FOREIGN KEY    (

                  keywordLoc

                  )

   REFERENCES     Aspect

                  (

                  Loc

                  )

   ON DELETE SET NULL

   ,

 

   CONSTRAINT     fk2_Is_keyword_for

   FOREIGN KEY    (

                  forLoc

                  )

   REFERENCES     KnowledgeItem

                  (

                  Loc

                  )

   ON DELETE SET NULL

   )

   ;

 

 

   CREATE TABLE   Union_KnowledgeItem

   (               

                  UpdateNr             INTEGER        NOT NULL

   ,              OfType               CHAR(100)     

   ,              Loc                  VARCHAR(255)   NOT NULL

   ,              Type                 INTEGER        NOT NULL

   ,              NodeValue            BLOB         

   ,              View                 INTEGER        NOT NULL

   ,              Abstraction          INTEGER        NOT NULL

   ,              Usage                INTEGER        NOT NULL

   ,              ofLoc                VARCHAR(255) 

   ,              PracticeType         INTEGER       

   ,              reuse_0              INTEGER       

   ,              reuse_1              INTEGER       

   ,              reuse_2              INTEGER       

   ,              reuse_3              INTEGER       

   ,

 

   PRIMARY KEY    (

                  Loc

                  )

   )

   ;

 


 

   CREATE VIEW    KnowledgeItem

   AS SELECT *   

                  UpdateNr           

   ,              Loc                 

   ,              Type               

   ,              NodeValue           

 

   FROM           Union_KnowledgeItem

   WHERE          OfType = Result

   OR             OfType = Practice ;

 

 

 

   CREATE VIEW    Result

   AS SELECT *   

                  UpdateNr           

   ,              Loc                 

   ,              Type               

   ,              NodeValue           

   ,              View               

   ,              Abstraction         

   ,              Usage               

   ,              ofLoc               

 

   FROM           Union_KnowledgeItem

   WHERE          OfType = Result

   OR             OfType = Practice ;

 

 

 

   CREATE VIEW    Practice

   AS SELECT *   

                  UpdateNr           

   ,              Loc                 

   ,              Type               

   ,              NodeValue           

   ,              View               

   ,              Abstraction         

   ,              Usage               

   ,              ofLoc               

   ,              PracticeType       

   ,              reuse_0             

   ,              reuse_1             

   ,              reuse_2             

   ,              reuse_3             

 

   FROM           Union_KnowledgeItem

   WHERE          OfType = Practice ;

 

 

 

   CREATE VIEW    Candidate

   AS SELECT *   

                  UpdateNr           

   ,              Loc                 

   ,              Type               

   ,              NodeValue           

   ,              from               

 

   FROM           Union_KnowledgeItem

   WHERE          OfType = Candidate ;

 

 


 

Note: The attribute UpdateNr found in each record is a record-specific version number. It is helpful to detect conflicts in the context of semi-transactions (i.e. non-atomic, so-called long transactions).

Note also: Because the WissDB database must not allow different objects to have the same D_Locator value in their A_Loc attribute, we need to implement an index guaranteeing this restriction database- wide. It must be an index containing normed versions of the D_Locator values because locator values, when used to represent file paths, may not be case-sensitive: They are not case-sensitive under MS Windows, WissDB however is to store them respecting case (as Unix does).

This index should also know the case-sensitive version of each locator (which is defined to be the first version given to the database) and should be used to guarantee, that – if a locator X is a first part of another locator Y, this substring of Y is always shown exactly as X itself is shown.


 

WissDB . Index . DOCs . TOC