rtm-ontopia 0.3.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/DISCLAIMER +15 -0
  2. data/LICENSE +201 -0
  3. data/README +8 -0
  4. data/lib/rtm-ontopia.rb +4 -0
  5. data/lib/rtm/ontopia.rb +271 -0
  6. data/lib/rtm/ontopia/io/to_cxtm.rb +40 -0
  7. data/lib/rtm/ontopia/javalibs/antlr-2.7.7.jar +0 -0
  8. data/lib/rtm/ontopia/javalibs/avalon-framework-4.1.3.jar +0 -0
  9. data/lib/rtm/ontopia/javalibs/backport-util-concurrent-3.1.jar +0 -0
  10. data/lib/rtm/ontopia/javalibs/commons-dbcp-1.3.jar +0 -0
  11. data/lib/rtm/ontopia/javalibs/commons-fileupload-1.1.jar +0 -0
  12. data/lib/rtm/ontopia/javalibs/commons-io-1.1.jar +0 -0
  13. data/lib/rtm/ontopia/javalibs/commons-pool-1.5.4.jar +0 -0
  14. data/lib/rtm/ontopia/javalibs/concurrent-1.3.4.jar +0 -0
  15. data/lib/rtm/ontopia/javalibs/dom4j-1.6.1.jar +0 -0
  16. data/lib/rtm/ontopia/javalibs/fontbox-1.1.0.jar +0 -0
  17. data/lib/rtm/ontopia/javalibs/geronimo-stax-api_1.0_spec-1.0.jar +0 -0
  18. data/lib/rtm/ontopia/javalibs/icu4j-3.4.4.jar +0 -0
  19. data/lib/rtm/ontopia/javalibs/iri-0.8.jar +0 -0
  20. data/lib/rtm/ontopia/javalibs/java-getopt-1.0.9.jar +0 -0
  21. data/lib/rtm/ontopia/javalibs/jempbox-1.1.0.jar +0 -0
  22. data/lib/rtm/ontopia/javalibs/jena-2.6.2.jar +0 -0
  23. data/lib/rtm/ontopia/javalibs/jflex-1.4.3.jar +0 -0
  24. data/lib/rtm/ontopia/javalibs/jgroups-2.6.10.GA.jar +0 -0
  25. data/lib/rtm/ontopia/javalibs/joda-time-1.6.jar +0 -0
  26. data/lib/rtm/ontopia/javalibs/jsp-api-2.0.jar +0 -0
  27. data/lib/rtm/ontopia/javalibs/jstl-1.1.2.jar +0 -0
  28. data/lib/rtm/ontopia/javalibs/jtidy-r8-20060801.jar +0 -0
  29. data/lib/rtm/ontopia/javalibs/logkit-1.0.1.jar +0 -0
  30. data/lib/rtm/ontopia/javalibs/ontopia-engine-5.1.0.jar +0 -0
  31. data/lib/rtm/ontopia/javalibs/ontopia-mio-0.1.0-SNAPSHOT.jar +0 -0
  32. data/lib/rtm/ontopia/javalibs/opencsv-1.8.jar +0 -0
  33. data/lib/rtm/ontopia/javalibs/pdfbox-1.1.0.jar +0 -0
  34. data/lib/rtm/ontopia/javalibs/poi-3.6.jar +0 -0
  35. data/lib/rtm/ontopia/javalibs/poi-ooxml-3.6.jar +0 -0
  36. data/lib/rtm/ontopia/javalibs/poi-ooxml-schemas-3.6.jar +0 -0
  37. data/lib/rtm/ontopia/javalibs/poi-scratchpad-3.6.jar +0 -0
  38. data/lib/rtm/ontopia/javalibs/saxon-6.5.3.jar +0 -0
  39. data/lib/rtm/ontopia/javalibs/servlet-api-2.4.jar +0 -0
  40. data/lib/rtm/ontopia/javalibs/standard-1.1.2.jar +0 -0
  41. data/lib/rtm/ontopia/javalibs/stax-api-1.0.1.jar +0 -0
  42. data/lib/rtm/ontopia/javalibs/tagsoup-1.2.jar +0 -0
  43. data/lib/rtm/ontopia/javalibs/velocity-1.3.jar +0 -0
  44. data/lib/rtm/ontopia/javalibs/wicket-1.4.8.jar +0 -0
  45. data/lib/rtm/ontopia/javalibs/wicket-datetime-1.4.8.jar +0 -0
  46. data/lib/rtm/ontopia/javalibs/wicket-extensions-1.4.8.jar +0 -0
  47. data/lib/rtm/ontopia/javalibs/xercesImpl-2.7.1.jar +0 -0
  48. data/lib/rtm/ontopia/javalibs/xml-apis-1.0.b2.jar +0 -0
  49. data/lib/rtm/ontopia/javalibs/xmlbeans-2.3.0.jar +0 -0
  50. data/lib/rtm/ontopia/ontopia_example.props +14 -0
  51. data/lib/rtm/ontopia/rdbms/properties.rb +149 -0
  52. data/lib/rtm/ontopia/rdbms/store.rb +39 -0
  53. data/res/rdbms/config/db.h2.props +8 -0
  54. data/res/rdbms/config/db.mysql.props +8 -0
  55. data/res/rdbms/config/db.oracle8.props +8 -0
  56. data/res/rdbms/config/db.oracle9i.props +8 -0
  57. data/res/rdbms/config/db.postgresql.props +8 -0
  58. data/res/rdbms/config/db.sqlserver.props +8 -0
  59. data/res/rdbms/setup/generic.create.sql +154 -0
  60. data/res/rdbms/setup/generic.drop.sql +16 -0
  61. data/res/rdbms/setup/h2.create.sql +154 -0
  62. data/res/rdbms/setup/h2.drop.sql +16 -0
  63. data/res/rdbms/setup/mysql.create.sql +170 -0
  64. data/res/rdbms/setup/mysql.drop.sql +16 -0
  65. data/res/rdbms/setup/mysql.force_drop.sql +16 -0
  66. data/res/rdbms/setup/oracle10g.create.sql +202 -0
  67. data/res/rdbms/setup/oracle10g.drop.sql +59 -0
  68. data/res/rdbms/setup/oracle8.create.sql +202 -0
  69. data/res/rdbms/setup/oracle8.drop.sql +59 -0
  70. data/res/rdbms/setup/oracle9i.create.sql +202 -0
  71. data/res/rdbms/setup/oracle9i.drop.sql +59 -0
  72. data/res/rdbms/setup/postgresql.create.sql +191 -0
  73. data/res/rdbms/setup/postgresql.drop.sql +53 -0
  74. data/res/rdbms/setup/sqlserver.create.sql +154 -0
  75. data/res/rdbms/setup/sqlserver.drop.sql +16 -0
  76. metadata +152 -0
@@ -0,0 +1,59 @@
1
+
2
+
3
+ drop index CLOB_TM_OCCURRENCE;
4
+ drop index CLOB_TM_VARIANT_NAME;
5
+ drop function tm_clob_value;
6
+
7
+
8
+ /*
9
+ alter table TM_SUBJECT_LOCATORS drop constraint FK_TM_SUBJECT_LOCATORS_1;
10
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_1;
11
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_2;
12
+ alter table TM_SUBJECT_IDENTIFIERS drop constraint FK_TM_SUBJECT_IDENTIFIERS_1;
13
+ alter table TM_TOPIC_MAP drop constraint FK_TM_TOPIC_MAP_1;
14
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_1;
15
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_2;
16
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_1;
17
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_2;
18
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_3;
19
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_4;
20
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_1;
21
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_2;
22
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_3;
23
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_4;
24
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_1;
25
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_2;
26
+ alter table TM_ITEM_IDENTIFIERS drop constraint FK_TM_ITEM_IDENTIFIERS_1;
27
+ alter table TM_TOPIC drop constraint FK_TM_TOPIC_1;
28
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_1;
29
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_2;
30
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_1;
31
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_2;
32
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_3;
33
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_1;
34
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_2;
35
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_3;
36
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_1;
37
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_2;
38
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_3;
39
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_4;
40
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_5;
41
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_1;
42
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_2;
43
+ */
44
+ drop table TM_SUBJECT_LOCATORS cascade constraints;
45
+ drop table TM_VARIANT_NAME_SCOPE cascade constraints;
46
+ drop table TM_SUBJECT_IDENTIFIERS cascade constraints;
47
+ drop table TM_TOPIC_MAP cascade constraints;
48
+ drop table TM_TOPIC_NAME_SCOPE cascade constraints;
49
+ drop table TM_TOPIC_NAME cascade constraints;
50
+ drop table TM_OCCURRENCE cascade constraints;
51
+ drop table TM_ASSOCIATION_SCOPE cascade constraints;
52
+ drop table TM_ITEM_IDENTIFIERS cascade constraints;
53
+ drop table TM_ADMIN_SEQUENCE cascade constraints;
54
+ drop table TM_TOPIC cascade constraints;
55
+ drop table TM_OCCURRENCE_SCOPE cascade constraints;
56
+ drop table TM_VARIANT_NAME cascade constraints;
57
+ drop table TM_ASSOCIATION cascade constraints;
58
+ drop table TM_ASSOCIATION_ROLE cascade constraints;
59
+ drop table TM_TOPIC_TYPES cascade constraints;
@@ -0,0 +1,202 @@
1
+ create table TM_SUBJECT_LOCATORS (
2
+ topic_id integer not null,
3
+ address varchar2(512) not null
4
+ );
5
+
6
+ create table TM_VARIANT_NAME_SCOPE (
7
+ scoped_id integer not null,
8
+ theme_id integer not null,
9
+ constraint TM_VARIANT_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
10
+ );
11
+
12
+ create table TM_SUBJECT_IDENTIFIERS (
13
+ topic_id integer not null,
14
+ address varchar2(512) not null
15
+ );
16
+
17
+ create table TM_TOPIC_MAP (
18
+ id integer not null,
19
+ reifier_id integer,
20
+ title varchar2(128),
21
+ base_address varchar2(512),
22
+ comments varchar2(4000),
23
+ constraint TM_TOPIC_MAP_pkey primary key (id)
24
+ );
25
+
26
+ create table TM_TOPIC_NAME_SCOPE (
27
+ scoped_id integer not null,
28
+ theme_id integer not null,
29
+ constraint TM_TOPIC_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
30
+ );
31
+
32
+ create table TM_TOPIC_NAME (
33
+ id integer not null,
34
+ topic_id integer not null,
35
+ topicmap_id integer not null,
36
+ reifier_id integer,
37
+ type_id integer,
38
+ content varchar2(4000),
39
+ constraint TM_TOPIC_NAME_pkey primary key (id)
40
+ );
41
+
42
+ create table TM_OCCURRENCE (
43
+ id integer not null,
44
+ topic_id integer not null,
45
+ topicmap_id integer not null,
46
+ reifier_id integer,
47
+ type_id integer,
48
+ datatype_address varchar2(512),
49
+ length integer,
50
+ hashcode integer,
51
+ content clob,
52
+ constraint TM_OCCURRENCE_pkey primary key (id)
53
+ );
54
+
55
+ create table TM_ASSOCIATION_SCOPE (
56
+ scoped_id integer not null,
57
+ theme_id integer not null,
58
+ constraint TM_ASSOCIATION_SCOPE_pkey primary key (scoped_id, theme_id)
59
+ );
60
+
61
+ create table TM_ITEM_IDENTIFIERS (
62
+ class varchar2(1) not null,
63
+ tmobject_id integer not null,
64
+ topicmap_id integer not null,
65
+ address varchar2(512) not null
66
+ );
67
+
68
+ create table TM_ADMIN_SEQUENCE (
69
+ seq_name varchar2(32) not null,
70
+ seq_count integer not null,
71
+ constraint TM_ADMIN_SEQUENCE_pkey primary key (seq_name)
72
+ );
73
+
74
+ create table TM_TOPIC (
75
+ id integer not null,
76
+ topicmap_id integer not null,
77
+ reified_id varchar2(32),
78
+ constraint TM_TOPIC_pkey primary key (id)
79
+ );
80
+
81
+ create table TM_OCCURRENCE_SCOPE (
82
+ scoped_id integer not null,
83
+ theme_id integer not null,
84
+ constraint TM_OCCURRENCE_SCOPE_pkey primary key (scoped_id, theme_id)
85
+ );
86
+
87
+ create table TM_VARIANT_NAME (
88
+ id integer not null,
89
+ name_id integer not null,
90
+ topicmap_id integer not null,
91
+ reifier_id integer,
92
+ datatype_address varchar2(512),
93
+ length integer,
94
+ hashcode integer,
95
+ content clob,
96
+ constraint TM_VARIANT_NAME_pkey primary key (id)
97
+ );
98
+
99
+ create table TM_ASSOCIATION (
100
+ id integer not null,
101
+ topicmap_id integer not null,
102
+ reifier_id integer,
103
+ type_id integer,
104
+ constraint TM_ASSOCIATION_pkey primary key (id)
105
+ );
106
+
107
+ create table TM_ASSOCIATION_ROLE (
108
+ id integer not null,
109
+ assoc_id integer not null,
110
+ topicmap_id integer not null,
111
+ reifier_id integer,
112
+ type_id integer,
113
+ player_id integer,
114
+ constraint TM_ASSOCIATION_ROLE_pkey primary key (id)
115
+ );
116
+
117
+ create table TM_TOPIC_TYPES (
118
+ topic_id integer not null,
119
+ type_id integer not null,
120
+ constraint TM_TOPIC_TYPES_pkey primary key (topic_id, type_id)
121
+ );
122
+
123
+
124
+ /*
125
+ alter table TM_SUBJECT_LOCATORS add constraint FK_TM_SUBJECT_LOCATORS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
126
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_1 foreign key (scoped_id) references TM_VARIANT_NAME (id) deferrable initially deferred;
127
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
128
+ alter table TM_SUBJECT_IDENTIFIERS add constraint FK_TM_SUBJECT_IDENTIFIERS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
129
+ alter table TM_TOPIC_MAP add constraint FK_TM_TOPIC_MAP_1 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
130
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_1 foreign key (scoped_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
131
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
132
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
133
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
134
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
135
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
136
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
137
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
138
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
139
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
140
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_1 foreign key (scoped_id) references TM_ASSOCIATION (id) deferrable initially deferred;
141
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
142
+ alter table TM_ITEM_IDENTIFIERS add constraint FK_TM_ITEM_IDENTIFIERS_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
143
+ alter table TM_TOPIC add constraint FK_TM_TOPIC_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
144
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_1 foreign key (scoped_id) references TM_OCCURRENCE (id) deferrable initially deferred;
145
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
146
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_1 foreign key (name_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
147
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
148
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
149
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
150
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_2 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
151
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_3 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
152
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_1 foreign key (assoc_id) references TM_ASSOCIATION (id) deferrable initially deferred;
153
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
154
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
155
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
156
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_5 foreign key (player_id) references TM_TOPIC (id) deferrable initially deferred;
157
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
158
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_2 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
159
+ */
160
+
161
+ create index TM_SUBJECT_LOCATORS_IX_oa on TM_SUBJECT_LOCATORS(topic_id, address);
162
+ create index TM_SUBJECT_LOCATORS_IX_am on TM_SUBJECT_LOCATORS(address, topic_id);
163
+ create index TM_VARIANT_NAME_SCOPE_IX_hs on TM_VARIANT_NAME_SCOPE(theme_id, scoped_id);
164
+ create index TM_SUBJECT_IDENTIFIERS_IX_oa on TM_SUBJECT_IDENTIFIERS(topic_id, address);
165
+ create index TM_SUBJECT_IDENTIFIERS_IX_am on TM_SUBJECT_IDENTIFIERS(address, topic_id);
166
+ create index TM_TOPIC_MAP_IX_ai on TM_TOPIC_MAP(base_address, id);
167
+ create index TM_TOPIC_NAME_SCOPE_IX_hs on TM_TOPIC_NAME_SCOPE(theme_id, scoped_id);
168
+ create index TM_TOPIC_NAME_IX_o on TM_TOPIC_NAME(topic_id);
169
+ create index TM_TOPIC_NAME_IX_myi on TM_TOPIC_NAME(topicmap_id, type_id, id);
170
+ create index TM_TOPIC_NAME_IX_mvi on TM_TOPIC_NAME(topicmap_id, content, id);
171
+ create index TM_OCCURRENCE_IX_o on TM_OCCURRENCE(topic_id);
172
+ create index TM_OCCURRENCE_IX_myi on TM_OCCURRENCE(topicmap_id, type_id, id);
173
+ create index TM_OCCURRENCE_IX_mhi on TM_OCCURRENCE(topicmap_id, hashcode, id);
174
+ create index TM_ASSOCIATION_SCOPE_IX_hs on TM_ASSOCIATION_SCOPE(theme_id, scoped_id);
175
+ create index TM_ITEM_IDENTIFIERS_IX_o on TM_ITEM_IDENTIFIERS(tmobject_id);
176
+ create index TM_ITEM_IDENTIFIERS_IX_maco on TM_ITEM_IDENTIFIERS(topicmap_id, address, class, tmobject_id);
177
+ create index TM_TOPIC_IX_im on TM_TOPIC(id, topicmap_id);
178
+ create index TM_OCCURRENCE_SCOPE_IX_hs on TM_OCCURRENCE_SCOPE(theme_id, scoped_id);
179
+ create index TM_VARIANT_NAME_IX_o on TM_VARIANT_NAME(name_id);
180
+ create index TM_VARIANT_NAME_IX_mhi on TM_VARIANT_NAME(topicmap_id, hashcode, id);
181
+ create index TM_ASSOCIATION_IX_myi on TM_ASSOCIATION(topicmap_id, type_id, id);
182
+ create index TM_ASSOCIATION_ROLE_IX_o on TM_ASSOCIATION_ROLE(assoc_id);
183
+ create index TM_ASSOCIATION_ROLE_IX_io on TM_ASSOCIATION_ROLE(id, assoc_id);
184
+ create index TM_ASSOCIATION_ROLE_IX_t on TM_ASSOCIATION_ROLE(player_id);
185
+ create index TM_ASSOCIATION_ROLE_IX_it on TM_ASSOCIATION_ROLE(id, player_id);
186
+ create index TM_ASSOCIATION_ROLE_IX_myi on TM_ASSOCIATION_ROLE(topicmap_id, type_id, id);
187
+ create index TM_ASSOCIATION_ROLE_IX_mtyio on TM_ASSOCIATION_ROLE(topicmap_id, player_id, type_id, id, assoc_id);
188
+ create index TM_TOPIC_TYPES_IX_yt on TM_TOPIC_TYPES(type_id, topic_id);
189
+
190
+ insert into TM_ADMIN_SEQUENCE values ('<GLOBAL>', 0);
191
+
192
+ create or replace function tm_clob_value(val clob)
193
+ return varchar2 deterministic as
194
+ retval varchar2(4000);
195
+ begin
196
+ retval := dbms_lob.substr(val, 4000, 1);
197
+ return retval;
198
+ end;
199
+ /
200
+ create index CLOB_TM_OCCURRENCE on TM_OCCURRENCE(tm_clob_value(content));
201
+ create index CLOB_TM_VARIANT_NAME on TM_VARIANT_NAME(tm_clob_value(content));
202
+
@@ -0,0 +1,59 @@
1
+
2
+
3
+ drop index CLOB_TM_OCCURRENCE;
4
+ drop index CLOB_TM_VARIANT_NAME;
5
+ drop function tm_clob_value;
6
+
7
+
8
+ /*
9
+ alter table TM_SUBJECT_LOCATORS drop constraint FK_TM_SUBJECT_LOCATORS_1;
10
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_1;
11
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_2;
12
+ alter table TM_SUBJECT_IDENTIFIERS drop constraint FK_TM_SUBJECT_IDENTIFIERS_1;
13
+ alter table TM_TOPIC_MAP drop constraint FK_TM_TOPIC_MAP_1;
14
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_1;
15
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_2;
16
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_1;
17
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_2;
18
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_3;
19
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_4;
20
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_1;
21
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_2;
22
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_3;
23
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_4;
24
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_1;
25
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_2;
26
+ alter table TM_ITEM_IDENTIFIERS drop constraint FK_TM_ITEM_IDENTIFIERS_1;
27
+ alter table TM_TOPIC drop constraint FK_TM_TOPIC_1;
28
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_1;
29
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_2;
30
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_1;
31
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_2;
32
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_3;
33
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_1;
34
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_2;
35
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_3;
36
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_1;
37
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_2;
38
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_3;
39
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_4;
40
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_5;
41
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_1;
42
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_2;
43
+ */
44
+ drop table TM_SUBJECT_LOCATORS cascade constraints;
45
+ drop table TM_VARIANT_NAME_SCOPE cascade constraints;
46
+ drop table TM_SUBJECT_IDENTIFIERS cascade constraints;
47
+ drop table TM_TOPIC_MAP cascade constraints;
48
+ drop table TM_TOPIC_NAME_SCOPE cascade constraints;
49
+ drop table TM_TOPIC_NAME cascade constraints;
50
+ drop table TM_OCCURRENCE cascade constraints;
51
+ drop table TM_ASSOCIATION_SCOPE cascade constraints;
52
+ drop table TM_ITEM_IDENTIFIERS cascade constraints;
53
+ drop table TM_ADMIN_SEQUENCE cascade constraints;
54
+ drop table TM_TOPIC cascade constraints;
55
+ drop table TM_OCCURRENCE_SCOPE cascade constraints;
56
+ drop table TM_VARIANT_NAME cascade constraints;
57
+ drop table TM_ASSOCIATION cascade constraints;
58
+ drop table TM_ASSOCIATION_ROLE cascade constraints;
59
+ drop table TM_TOPIC_TYPES cascade constraints;
@@ -0,0 +1,202 @@
1
+ create table TM_SUBJECT_LOCATORS (
2
+ topic_id integer not null,
3
+ address varchar2(512) not null
4
+ );
5
+
6
+ create table TM_VARIANT_NAME_SCOPE (
7
+ scoped_id integer not null,
8
+ theme_id integer not null,
9
+ constraint TM_VARIANT_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
10
+ );
11
+
12
+ create table TM_SUBJECT_IDENTIFIERS (
13
+ topic_id integer not null,
14
+ address varchar2(512) not null
15
+ );
16
+
17
+ create table TM_TOPIC_MAP (
18
+ id integer not null,
19
+ reifier_id integer,
20
+ title varchar2(128),
21
+ base_address varchar2(512),
22
+ comments varchar2(4000),
23
+ constraint TM_TOPIC_MAP_pkey primary key (id)
24
+ );
25
+
26
+ create table TM_TOPIC_NAME_SCOPE (
27
+ scoped_id integer not null,
28
+ theme_id integer not null,
29
+ constraint TM_TOPIC_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
30
+ );
31
+
32
+ create table TM_TOPIC_NAME (
33
+ id integer not null,
34
+ topic_id integer not null,
35
+ topicmap_id integer not null,
36
+ reifier_id integer,
37
+ type_id integer,
38
+ content varchar2(4000),
39
+ constraint TM_TOPIC_NAME_pkey primary key (id)
40
+ );
41
+
42
+ create table TM_OCCURRENCE (
43
+ id integer not null,
44
+ topic_id integer not null,
45
+ topicmap_id integer not null,
46
+ reifier_id integer,
47
+ type_id integer,
48
+ datatype_address varchar2(512),
49
+ length integer,
50
+ hashcode integer,
51
+ content clob,
52
+ constraint TM_OCCURRENCE_pkey primary key (id)
53
+ );
54
+
55
+ create table TM_ASSOCIATION_SCOPE (
56
+ scoped_id integer not null,
57
+ theme_id integer not null,
58
+ constraint TM_ASSOCIATION_SCOPE_pkey primary key (scoped_id, theme_id)
59
+ );
60
+
61
+ create table TM_ITEM_IDENTIFIERS (
62
+ class varchar2(1) not null,
63
+ tmobject_id integer not null,
64
+ topicmap_id integer not null,
65
+ address varchar2(512) not null
66
+ );
67
+
68
+ create table TM_ADMIN_SEQUENCE (
69
+ seq_name varchar2(32) not null,
70
+ seq_count integer not null,
71
+ constraint TM_ADMIN_SEQUENCE_pkey primary key (seq_name)
72
+ );
73
+
74
+ create table TM_TOPIC (
75
+ id integer not null,
76
+ topicmap_id integer not null,
77
+ reified_id varchar2(32),
78
+ constraint TM_TOPIC_pkey primary key (id)
79
+ );
80
+
81
+ create table TM_OCCURRENCE_SCOPE (
82
+ scoped_id integer not null,
83
+ theme_id integer not null,
84
+ constraint TM_OCCURRENCE_SCOPE_pkey primary key (scoped_id, theme_id)
85
+ );
86
+
87
+ create table TM_VARIANT_NAME (
88
+ id integer not null,
89
+ name_id integer not null,
90
+ topicmap_id integer not null,
91
+ reifier_id integer,
92
+ datatype_address varchar2(512),
93
+ length integer,
94
+ hashcode integer,
95
+ content clob,
96
+ constraint TM_VARIANT_NAME_pkey primary key (id)
97
+ );
98
+
99
+ create table TM_ASSOCIATION (
100
+ id integer not null,
101
+ topicmap_id integer not null,
102
+ reifier_id integer,
103
+ type_id integer,
104
+ constraint TM_ASSOCIATION_pkey primary key (id)
105
+ );
106
+
107
+ create table TM_ASSOCIATION_ROLE (
108
+ id integer not null,
109
+ assoc_id integer not null,
110
+ topicmap_id integer not null,
111
+ reifier_id integer,
112
+ type_id integer,
113
+ player_id integer,
114
+ constraint TM_ASSOCIATION_ROLE_pkey primary key (id)
115
+ );
116
+
117
+ create table TM_TOPIC_TYPES (
118
+ topic_id integer not null,
119
+ type_id integer not null,
120
+ constraint TM_TOPIC_TYPES_pkey primary key (topic_id, type_id)
121
+ );
122
+
123
+
124
+ /*
125
+ alter table TM_SUBJECT_LOCATORS add constraint FK_TM_SUBJECT_LOCATORS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
126
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_1 foreign key (scoped_id) references TM_VARIANT_NAME (id) deferrable initially deferred;
127
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
128
+ alter table TM_SUBJECT_IDENTIFIERS add constraint FK_TM_SUBJECT_IDENTIFIERS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
129
+ alter table TM_TOPIC_MAP add constraint FK_TM_TOPIC_MAP_1 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
130
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_1 foreign key (scoped_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
131
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
132
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
133
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
134
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
135
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
136
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
137
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
138
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
139
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
140
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_1 foreign key (scoped_id) references TM_ASSOCIATION (id) deferrable initially deferred;
141
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
142
+ alter table TM_ITEM_IDENTIFIERS add constraint FK_TM_ITEM_IDENTIFIERS_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
143
+ alter table TM_TOPIC add constraint FK_TM_TOPIC_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
144
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_1 foreign key (scoped_id) references TM_OCCURRENCE (id) deferrable initially deferred;
145
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
146
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_1 foreign key (name_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
147
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
148
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
149
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
150
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_2 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
151
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_3 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
152
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_1 foreign key (assoc_id) references TM_ASSOCIATION (id) deferrable initially deferred;
153
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
154
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
155
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
156
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_5 foreign key (player_id) references TM_TOPIC (id) deferrable initially deferred;
157
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
158
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_2 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
159
+ */
160
+
161
+ create index TM_SUBJECT_LOCATORS_IX_oa on TM_SUBJECT_LOCATORS(topic_id, address);
162
+ create index TM_SUBJECT_LOCATORS_IX_am on TM_SUBJECT_LOCATORS(address, topic_id);
163
+ create index TM_VARIANT_NAME_SCOPE_IX_hs on TM_VARIANT_NAME_SCOPE(theme_id, scoped_id);
164
+ create index TM_SUBJECT_IDENTIFIERS_IX_oa on TM_SUBJECT_IDENTIFIERS(topic_id, address);
165
+ create index TM_SUBJECT_IDENTIFIERS_IX_am on TM_SUBJECT_IDENTIFIERS(address, topic_id);
166
+ create index TM_TOPIC_MAP_IX_ai on TM_TOPIC_MAP(base_address, id);
167
+ create index TM_TOPIC_NAME_SCOPE_IX_hs on TM_TOPIC_NAME_SCOPE(theme_id, scoped_id);
168
+ create index TM_TOPIC_NAME_IX_o on TM_TOPIC_NAME(topic_id);
169
+ create index TM_TOPIC_NAME_IX_myi on TM_TOPIC_NAME(topicmap_id, type_id, id);
170
+ create index TM_TOPIC_NAME_IX_mvi on TM_TOPIC_NAME(topicmap_id, content, id);
171
+ create index TM_OCCURRENCE_IX_o on TM_OCCURRENCE(topic_id);
172
+ create index TM_OCCURRENCE_IX_myi on TM_OCCURRENCE(topicmap_id, type_id, id);
173
+ create index TM_OCCURRENCE_IX_mhi on TM_OCCURRENCE(topicmap_id, hashcode, id);
174
+ create index TM_ASSOCIATION_SCOPE_IX_hs on TM_ASSOCIATION_SCOPE(theme_id, scoped_id);
175
+ create index TM_ITEM_IDENTIFIERS_IX_o on TM_ITEM_IDENTIFIERS(tmobject_id);
176
+ create index TM_ITEM_IDENTIFIERS_IX_maco on TM_ITEM_IDENTIFIERS(topicmap_id, address, class, tmobject_id);
177
+ create index TM_TOPIC_IX_im on TM_TOPIC(id, topicmap_id);
178
+ create index TM_OCCURRENCE_SCOPE_IX_hs on TM_OCCURRENCE_SCOPE(theme_id, scoped_id);
179
+ create index TM_VARIANT_NAME_IX_o on TM_VARIANT_NAME(name_id);
180
+ create index TM_VARIANT_NAME_IX_mhi on TM_VARIANT_NAME(topicmap_id, hashcode, id);
181
+ create index TM_ASSOCIATION_IX_myi on TM_ASSOCIATION(topicmap_id, type_id, id);
182
+ create index TM_ASSOCIATION_ROLE_IX_o on TM_ASSOCIATION_ROLE(assoc_id);
183
+ create index TM_ASSOCIATION_ROLE_IX_io on TM_ASSOCIATION_ROLE(id, assoc_id);
184
+ create index TM_ASSOCIATION_ROLE_IX_t on TM_ASSOCIATION_ROLE(player_id);
185
+ create index TM_ASSOCIATION_ROLE_IX_it on TM_ASSOCIATION_ROLE(id, player_id);
186
+ create index TM_ASSOCIATION_ROLE_IX_myi on TM_ASSOCIATION_ROLE(topicmap_id, type_id, id);
187
+ create index TM_ASSOCIATION_ROLE_IX_mtyio on TM_ASSOCIATION_ROLE(topicmap_id, player_id, type_id, id, assoc_id);
188
+ create index TM_TOPIC_TYPES_IX_yt on TM_TOPIC_TYPES(type_id, topic_id);
189
+
190
+ insert into TM_ADMIN_SEQUENCE values ('<GLOBAL>', 0);
191
+
192
+ create or replace function tm_clob_value(val clob)
193
+ return varchar2 deterministic as
194
+ retval varchar2(4000);
195
+ begin
196
+ retval := dbms_lob.substr(val, 4000, 1);
197
+ return retval;
198
+ end;
199
+ /
200
+ create index CLOB_TM_OCCURRENCE on TM_OCCURRENCE(tm_clob_value(content));
201
+ create index CLOB_TM_VARIANT_NAME on TM_VARIANT_NAME(tm_clob_value(content));
202
+