db schema

Scott Wheeler wheeler at kde.org
Tue Nov 16 00:20:53 CET 2004


Ok, just checked in a first version of a DB schema.  I'll convert it to SQL 
shortly.  There's a lot still up in the air, specifically the link grouping 
sutff and there will probably be an additional type for words that 
represented as a trie, but in the first mock-up I think I'll just stick to 
standard varchars since that will make things simpler.

Again, all of this will likely change in the future, but I'm kind of trying to 
throw things together in the next two weeks so that I can at least have some 
basic indexing working.

There aren't really any comments in here, but I'll probably also create and 
accompanying document (or just add to the API docs) stuff on how the various 
tables should be used.

-Scott

-- 
I support the American war on intelligence.
-------------- next part --------------
================================================================================
= Graph Elements                                                               =
================================================================================

|--------------------------------------|
| Nodes                                |
|--------------------------------------|
| serial            | ID               |
|--------------------------------------|


|--------------------------------------|
| Links                                |
|--------------------------------------|
| serial            | ID               |
| integer           | Source           | <- Nodes::ID
| integer           | Target           | <- Nodes::ID
|--------------------------------------|


|--------------------------------------|
| LinkGroups                           |
|--------------------------------------|
| serial            | ID               |
| varchar(255)      | Name             |
|--------------------------------------|
 \
  \
   |--------------------------------------|
   | LinkGroupMembers                     |
   |--------------------------------------|
   | integer           | GroupID          | <- LinkGroups::ID
   | integer           | LinkID           | <- Links::ID
   |--------------------------------------|


================================================================================
= Properties                                                                   =
================================================================================


|--------------------------------------|
| PropertyDataTypes                    |
|--------------------------------------|
| serial            | ID               |
| varchar(255)      | Name             |
|--------------------------------------|


|--------------------------------------|
| NodeProperties                       |
|--------------------------------------|
| serial            | ID               |
| integer           | DataType         | <- PropertyDataTypes::ID
| varchar(255)      | Name             |
|--------------------------------------|
 \
  \
   |--------------------------------------|
   | NodeIntegerProperties                |
   |--------------------------------------|
   | integer           | Node             | <- Nodes::ID
   | integer           | Property         | <- NodeProperties::ID
   | integer           | Value            |
   |--------------------------------------|

   |--------------------------------------|
   | NodeStringProperties                 |
   |--------------------------------------|
   | integer           | Node             | <- Nodes::ID
   | integer           | Property         | <- NodeProperties::ID
   | varchar(255)      | Value            |
   |--------------------------------------|

   |--------------------------------------|
   | NodeByteArrayProperties              |
   |--------------------------------------|
   | integer           | Node             | <- Nodes::ID
   | integer           | Property         | <- NodeProperties::ID
   | bytea             | Value            |
   |--------------------------------------|

   [ other types as appropriate ]


|--------------------------------------|
| LinkProperties                       |
|--------------------------------------|
| serial            | ID               |
| integer           | DataType         | <- PropertyDataTypes::ID
| varchar(255)      | Name             |
|--------------------------------------|
 \
  \
   |--------------------------------------|
   | LinkIntegerProperties                |
   |--------------------------------------|
   | integer           | Link             | <- Links::ID
   | integer           | Property         | <- LinkProperties::ID
   | integer           | Value            |
   |--------------------------------------|

   |--------------------------------------|
   | LinkStringProperties                 |
   |--------------------------------------|
   | integer           | Link             | <- Links::ID
   | integer           | Property         | <- LinkProperties::ID
   | varchar(255)      | Value            |
   |--------------------------------------|

   |--------------------------------------|
   | LinkByteArrayProperties              |
   |--------------------------------------|
   | integer           | Link             | <- Links::ID
   | integer           | Property         | <- LinkProperties::ID
   | bytea             | Value            |
   |--------------------------------------|

   [ other types as appropriate ]


More information about the Klink mailing list