WissDB [ 2011, Jun 18 ] . Documents . Presentations . Index . Resources . UNDEFs
CREATE TABLE Entity .. ERD
(
Name VARCHAR2(30) NOT NULL
, Semantics VARCHAR2(4000)
,
CONSTRAINT pk_Entity
PRIMARY KEY (
Name
)
)
;
CREATE TABLE Domain .. ERD
(
Name VARCHAR2(30) NOT NULL
, Semantics VARCHAR2(4000)
, Type_in_SQL VARCHAR2(40) NOT NULL
, Type_in_Cpp VARCHAR2(40)
, Type_in_Java VARCHAR2(40)
, Type_in_Delphi VARCHAR2(40)
, Type_in_CSharp VARCHAR2(40)
,
CONSTRAINT pk_Domain
PRIMARY KEY (
Name
)
)
;
CREATE TABLE DomainValue .. ERD
(
Domain VARCHAR2(30) NOT NULL
, ValueAsStr VARCHAR2(240) NOT NULL
, ValueAsNr INTEGER
, Semantics VARCHAR2(4000)
, ObsoleteSince DATE
,
CONSTRAINT pk_DomainValue
PRIMARY KEY (
Domain
, ValueAsStr
)
,
CONSTRAINT fk1_DomainValue
FOREIGN KEY (
Domain
)
REFERENCES Domain
(
Name
)
)
;
CREATE TABLE Alias .. ERD
(
Nr INTEGER NOT NULL
, Loc VARCHAR(255)
,
CONSTRAINT pk_Alias
PRIMARY KEY (
Nr
)
)
;
CREATE TABLE Aspect .. ERD
(
Loc VARCHAR(255) NOT NULL
,
CONSTRAINT pk_Aspect
PRIMARY KEY (
Loc
)
)
;
CREATE TABLE Attribute .. ERD
(
ent VARCHAR2(30) NOT NULL
, Name VARCHAR2(30) NOT NULL
, Constraint_ VARCHAR2(10)
, Semantics VARCHAR2(4000)
, Domain VARCHAR2(30) NOT NULL
,
CONSTRAINT pk_Attribute
PRIMARY KEY (
ent
, Name
)
,
CONSTRAINT fk1_Attribute
FOREIGN KEY (
ent
)
REFERENCES Entity
(
Name
)
,
CONSTRAINT fk2_Attribute
FOREIGN KEY (
Domain
)
REFERENCES Domain
(
Name
)
)
;
CREATE TABLE Process .. ERD
(
Loc VARCHAR(255) NOT NULL
, Description VARCHAR(255) NOT NULL
, Role VARCHAR(255)
,
CONSTRAINT pk_Process
PRIMARY KEY (
Loc
)
,
CONSTRAINT fk1_Process
FOREIGN KEY (
Description
)
REFERENCES KnowledgeItem
(
Loc
)
,
CONSTRAINT fk2_Process
FOREIGN KEY (
Role
)
REFERENCES Role
(
Loc
)
)
;
CREATE TABLE Role .. ERD
(
Loc VARCHAR(255) NOT NULL
, Description VARCHAR(255) NOT NULL
,
CONSTRAINT pk_Role
PRIMARY KEY (
Loc
)
,
CONSTRAINT fk1_Role
FOREIGN KEY (
Description
)
REFERENCES KnowledgeItem
(
Loc
)
)
;
CREATE TABLE Is_related_to .. ERD
(
A VARCHAR(255) NOT NULL
, B VARCHAR(255) NOT NULL
, Correlation INTEGER NOT NULL
,
CONSTRAINT pk_Is_related_to
PRIMARY KEY (
A
, B
, Correlation
)
,
CONSTRAINT fk1_Is_related_to
FOREIGN KEY (
A
)
REFERENCES KnowledgeItem
(
Loc
)
,
CONSTRAINT fk2_Is_related_to
FOREIGN KEY (
B
)
REFERENCES KnowledgeItem
(
Loc
)
)
;
CREATE TABLE Is_keyword_for .. ERD
(
keyword VARCHAR(255) NOT NULL
, for VARCHAR(255) NOT NULL
,
CONSTRAINT pk_Is_keyword_for
PRIMARY KEY (
keyword
, for
)
,
CONSTRAINT fk1_Is_keyword_for
FOREIGN KEY (
keyword
)
REFERENCES Aspect
(
Loc
)
,
CONSTRAINT fk2_Is_keyword_for
FOREIGN KEY (
for
)
REFERENCES KnowledgeItem
(
Loc
)
)
;
CREATE TABLE Union_KnowledgeItem .. ERD
(
Loc VARCHAR(255) NOT NULL
, Type_ INTEGER NOT NULL
, NodeValue B_BLOB
, View INTEGER NOT NULL
, Abstraction INTEGER NOT NULL
, Usage INTEGER NOT NULL
, ofLoc VARCHAR(255)
, from VARCHAR(80) NOT NULL
, since DATE NOT NULL
, LastUpdate DATE NOT NULL
, OfType VARCHAR2(100)
, PracticeType INTEGER
, reuse_0 INTEGER
, reuse_1 INTEGER
, reuse_2 INTEGER
, reuse_3 INTEGER
,
CONSTRAINT pk_Union_KnowledgeItem
PRIMARY KEY (
Loc
)
,
CONSTRAINT fk1_Union_KnowledgeItem
FOREIGN KEY (
Loc
)
REFERENCES Result
(
Loc
)
,
CONSTRAINT fk2_Union_KnowledgeItem
FOREIGN KEY (
ofLoc
)
REFERENCES Process
(
Loc
)
)
;
DROP VIEW KnowledgeItem
CREATE VIEW KnowledgeItem .. ERD
AS SELECT
Loc
, Type_
, NodeValue
FROM Union_KnowledgeItem
WHERE OfType = Candidate
OR OfType = Result
OR OfType = Practice ;
DROP VIEW Candidate
CREATE VIEW Candidate .. ERD
AS SELECT
Loc
, Type_
, NodeValue
, from
, since
FROM Union_KnowledgeItem
WHERE OfType = Candidate ;
DROP VIEW Result
CREATE VIEW Result .. ERD
AS SELECT
Loc
, Type_
, NodeValue
, View
, Abstraction
, Usage
, ofLoc
, from
, since
, LastUpdate
FROM Union_KnowledgeItem
WHERE OfType = Result
OR OfType = Practice ;
DROP VIEW Practice
CREATE VIEW Practice .. ERD
AS SELECT
Loc
, Type_
, NodeValue
, View
, Abstraction
, Usage
, ofLoc
, from
, since
, LastUpdate
, PracticeType
, reuse_0
, reuse_1
, reuse_2
, reuse_3
FROM Union_KnowledgeItem
WHERE OfType = Practice ;
show Logical Data Model