Hoard: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==About==
==About==
All the things I need to track tie together in various ways, it seems. [[Hoard]] is the database that ties them together. It also has a number of ''ad hoc'' uses.
All the things I need to track tie together in various ways, it seems. [[Hoard]] is the database that ties them together. It also has a number of ''ad hoc'' uses.
==Pages==
* [[/Data]]
==Schemae==
==Schemae==
===Things===
===Things===
This keeps track of all the things.
This keeps track of all the things -- a {{l/wp|taxonomy}} in the form of a branching {{l/wp|hierarchy}}. One guideline to remember: there's no need to put a thing under another thing ''unless'' that's necessary in order to disambiguate between two homonymous things.
<syntaxhighlight lang=SQL>
<syntaxhighlight lang=SQL>
CREATE TABLE
CREATE TABLE
Line 16: Line 18:
</syntaxhighlight>
</syntaxhighlight>
===Stuff===
===Stuff===
This keeps track of stuff about the things. (still designing; not functional yet)
This keeps track of stuff about the things -- a set of semantic values that can be set for any Thing.
<syntaxhighlight lang=SQL>
<syntaxhighlight lang=SQL>
CREATE TABLE
CREATE TABLE
Line 26: Line 28:
   ) ENGINE = InnoDB
   ) ENGINE = InnoDB
</syntaxhighlight>
</syntaxhighlight>
===Extern===
===Extern===
This tracks external data repositories.
This tracks external data repositories.

Revision as of 16:44, 12 August 2024

About

All the things I need to track tie together in various ways, it seems. Hoard is the database that ties them together. It also has a number of ad hoc uses.

Pages

Schemae

Things

This keeps track of all the things -- a taxonomy in the form of a branching hierarchy. One guideline to remember: there's no need to put a thing under another thing unless that's necessary in order to disambiguate between two homonymous things.

CREATE TABLE
  `things` (
    `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenNew`    timestamp NOT NULL DEFAULT current_timestamp(),
    `ID_Base`    int(11) DEFAULT NULL COMMENT 'ID of parent record',
    `ID_Extern`  int(11) DEFAULT NULL COMMENT 'external reference, if any',
    `Name`       varchar(255) DEFAULT NULL COMMENT 'label, e.g. for using in lists',
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB

Stuff

This keeps track of stuff about the things -- a set of semantic values that can be set for any Thing.

CREATE TABLE
  `stuff` (
    `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenNew`    timestamp NOT NULL DEFAULT current_timestamp(),
    `Name`       varchar(255) DEFAULT NULL COMMENT 'name of attribute',
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB

Extern

This tracks external data repositories.

CREATE TABLE
  `extern` (
    `ID`       int(10) unsigned NOT NULL AUTO_INCREMENT,
    `WhenNew`  timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when this record was added',
    `SID_Type` varchar(255) DEFAULT NULL COMMENT 'slug for thing-type (matches coded external data)',
    `Name`     varchar(255) DEFAULT NULL COMMENT 'single line for lists',
    PRIMARY KEY (`ID`)
  ) ENGINE = InnoDB