relation type
Morbus Iff
morbus at disobey.com
Fri Nov 3 06:57:52 EST 2006
>> I have read the mysql-init.sql file and I wonder if you have
>> considered establishing a table of relation types (with
In my MySQL schema for FRBR [1], relationships were
only two tables (sorry for the poor formatting here):
CREATE TABLE libdb_relationships (
id CHAR(20) NOT NULL,
referer_table VARCHAR(50) NOT NULL,
referer_id CHAR(20) NOT NULL,
relationship_type_id CHAR(20) NOT NULL,
referent_table VARCHAR(50) NOT NULL,
referent_id CHAR(20) NOT NULL,
INDEX (referer_id,referent_id) ) TYPE=MyISAM;
CREATE TABLE libdb_relationships_types (
id CHAR(20) NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
subject VARCHAR(100) NOT NULL,
object VARCHAR(100) NOT NULL,
description TINYTEXT NOT NULL ) TYPE=MyISAM;
INSERT INTO libdb_relationships_types VALUES ( 'EPFxZ1WjoTD2xCT9dm2c',
'Work <=> Work', 'is related to', 'is related to', 'This
defines a relationship \(of an indeterminate nature\) between two
works.' );
INSERT INTO libdb_relationships_types VALUES ( 'maQE6fKhSdeIejeVuB1h',
'Concept <=> Entity', 'is a concept of', 'has concept', 'This
relationships defines the connection between a concept and another
entity.' );
INSERT INTO libdb_relationships_types VALUES ( 'RmRHNJZVJgGvYzjDm3a1',
'Object <=> Entity', 'is an object of', 'has object', 'This
relationships defines the connection between an object and another
entity.' );
INSERT INTO libdb_relationships_types VALUES ( 'P25g2NMfd9lmNpU876gr',
'Place <=> Entity', 'is a place of', 'has place', 'This
relationships defines the connection between a place and another
entity.' );
INSERT INTO libdb_relationships_types VALUES ( 'A1Bt2vIYQbd7aOdakHGC',
'Event <=> Entity', 'is an event of', 'has event', 'This
relationships defines the connection between an event and another
entity.' );
[1] http://cvs.drupal.org/viewcvs/drupal/contributions/
modules/libdb/libdb.mysql?view=markup - Denton's probably
already seen this.
--
Morbus Iff ( strive for mediocrity )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
More information about the openfrbr-devel
mailing list