-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreaxys_schema
276 lines (241 loc) · 5.8 KB
/
reaxys_schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: reaxys; Type: SCHEMA; Schema: -; Owner: -
--
DROP SCHEMA IF EXISTS REAXYS_TEMP CASCADE;
CREATE SCHEMA REAXYS_TEMP;
SET default_tablespace = '';
SET default_with_oids = false;
create table REAXYS_TEMP.version (
load_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
version text
);
--
-- Name: citation; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.citation (
citation_id bigint NOT NULL,
type text,
author text,
title text,
journal text,
year text,
vol text,
page text,
keyword text,
doi text,
patent_country text,
patent_number text,
patent_assignee text,
patent_kind_code text,
patent_pub_date text,
abstract text,
comments text
);
--
-- Name: conditions; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.conditions (
condition_id bigint NOT NULL,
atmosphere text,
ph numrange,
preparation text,
pressure numrange,
reaction_molarity numrange,
reflux text,
temperature numrange,
"time" numrange,
total_volume numrange
);
--
-- Name: molecule; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.molecule (
molecule_id bigint NOT NULL,
smiles text,
sdfile text,
mw real,
clp real,
psa real,
hev integer,
rtb integer,
hbd integer,
hba integer,
noc integer,
rng integer,
cc_id text,
cas text[],
comments text[],
identifiers text[],
links text[],
synonyms text[],
calculated text[],
cit_id bigint[],
cit_id_parent bigint[],
name text,
rx_file_id integer,
molecule public.mol
);
--
-- Name: rdfile; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.rdfile (
rx_id bigint NOT NULL,
rx_rank integer,
rx_myd text,
rx_typ text,
rx_rxrn bigint[],
rx_pxrn bigint[],
rx_rdfile text,
rxnsmiles text,
rx_trans text,
rx_qry0 text,
rx_qry1 text,
rx_qry2 text,
rx_qry3 text,
rx_qry4 text,
rx_qry5 text,
rx_file_id integer,
reaction public.reaction
);
--
-- Name: reaction; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.reaction (
reaction_id bigint NOT NULL,
reaxys_reaction_id bigint,
rxnstructure text,
rank integer,
mw_largest_product real,
sort_creation_date date,
sort_reaction_scale real,
sort_total_volume real,
reactant_id bigint[],
metabolite_id bigint[],
product_id bigint[],
variations bigint[]
);
--
-- Name: stages; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.stages (
stage_id bigint NOT NULL,
reactants bigint[],
products bigint[],
reagents bigint[],
catalysts bigint[],
solvents bigint[],
conditions bigint[],
metabolites bigint[]
);
--
-- Name: variation; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.variation (
variation_id bigint NOT NULL,
creation_date date,
experiment_id text,
experiment_type text,
modification_date date,
project_name text,
qualification text,
source text,
destination text,
conclusion_phrase text,
created_at_site text,
duplicate_exp_ref text,
preparative boolean,
eln_citation text,
reaction_scale real,
nextmove_reaction_type text,
rxno_reaction_type text,
analytical_data_exists boolean,
technology text[],
scientist text[],
resp_scientist text,
keywords text[],
reactants bigint[],
products bigint[],
reagents bigint[],
catalysts bigint[],
solvents bigint[],
conditions bigint[],
metabolites bigint[],
stages bigint[],
comments text[],
identifiers text[],
links text[],
groups text[],
animals text[],
cit_id bigint[],
excretion text,
route text,
species text,
amount real,
color text,
conversion real,
form text,
volume real,
purity real,
enantiomeric_purity real,
sample_id text,
sample_ref text,
compound_name text,
equivalents real
);
--
-- Name: rxn_conditions_multistage; Type: VIEW; Schema: reaxys; Owner: -
--
CREATE VIEW REAXYS_TEMP.rxn_conditions_multistage AS
SELECT rdfile.rx_id,
stages.stage_id,
reaction.reaction_id,
variation.variation_id,
unnest(stages.conditions) AS condition_id
FROM REAXYS_TEMP.rdfile,
REAXYS_TEMP.reaction,
REAXYS_TEMP.variation,
REAXYS_TEMP.stages
WHERE ((reaction.reaxys_reaction_id = rdfile.rx_id) AND (variation.variation_id = ANY (reaction.variations)) AND (variation.stages IS NOT NULL) AND (stages.stage_id = ANY (variation.stages)));
--
-- Name: rxn_conditions_singlestage; Type: VIEW; Schema: reaxys; Owner: -
--
CREATE VIEW REAXYS_TEMP.rxn_conditions_singlestage AS
SELECT rdfile.rx_id,
NULL::text AS stage_id,
reaction.reaction_id,
variation.variation_id,
unnest(variation.conditions) AS condition_id
FROM REAXYS_TEMP.rdfile,
REAXYS_TEMP.reaction,
REAXYS_TEMP.variation
WHERE ((variation.variation_id = ANY (reaction.variations)) AND (variation.stages IS NULL) AND (reaction.reaxys_reaction_id = rdfile.rx_id));
--
-- Name: substance; Type: TABLE; Schema: reaxys; Owner: -
--
CREATE TABLE REAXYS_TEMP.substance (
substance_id bigint NOT NULL,
reaxys_id bigint,
name text,
amount real,
form text,
color text,
yield real,
conversion real,
purity real,
enantiomeric_purity real,
volume real,
equivalents real,
sample_id text[],
sample_ref text[],
compound_name text[],
comments text
);