# # MySQL Schema for Redland, v2004.04 # # Copyright (C) 2003-2004 Morten Frederiksen and Dave Beckett # # NOTE: This definition should not be used to create tables for an actual # Redland/MySQL store, as each model/graph is stored in a separate table # - create the tables from within Redland instead. # # Changes from v2004.03: # - Each model now has its own statements table, named Statements. # Changes from v2004.01: # - All tables now created with DELAY_KEY_WRITE, MAX_ROWS and AVG_ROW_LENGTH. # Changes from v2003.09: # - Language attribute is now text instead of varchar(6). # - 8 byte hashes instead of 16. # - No statement id, uses extra connection(s) instead. # - Model id is now also a hash instead of a sequence number. # - Various index changes. # DROP TABLE IF EXISTS Statements; CREATE TABLE Statements ( Subject bigint unsigned NOT NULL, Predicate bigint unsigned NOT NULL, Object bigint unsigned NOT NULL, Context bigint unsigned NOT NULL, KEY Context (Context), KEY SubjectPredicate (Subject,Predicate), KEY PredicateObject (Predicate,Object), KEY ObjectSubject (Object,Subject) ) TYPE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33; DROP TABLE IF EXISTS Literals; CREATE TABLE Literals ( ID bigint unsigned NOT NULL, Value longtext NOT NULL, Language text NOT NULL, Datatype text NOT NULL, PRIMARY KEY ID (ID), FULLTEXT KEY Value (Value) ) TYPE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=44; DROP TABLE IF EXISTS Resources; CREATE TABLE Resources ( ID bigint unsigned NOT NULL, URI text NOT NULL, PRIMARY KEY ID (ID) ) TYPE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=63; DROP TABLE IF EXISTS Bnodes; CREATE TABLE Bnodes ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) TYPE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33; DROP TABLE IF EXISTS Models; CREATE TABLE Models ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) TYPE=MyISAM DELAY_KEY_WRITE=1;