├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── examples
├── simple
│ ├── config.xml
│ ├── data
│ │ └── data0001.xml
│ ├── file_numbers.csv
│ ├── output
│ │ └── .gitkeep
│ ├── parse.sh
│ └── template.sql
└── web-of-science
│ ├── wos_calls.txt
│ ├── wos_config.xml
│ ├── wos_constraints.sql
│ ├── wos_constraints_final.sql
│ ├── wos_file_numbers.csv
│ ├── wos_schema.sql
│ ├── wos_schema_final.sql
│ ├── wos_schema_reduced.sql
│ ├── wos_schema_reduced_2.sql
│ ├── wos_schema_remove_empty.sql
│ └── wos_template.sql
├── generic_parser.py
└── requirements.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | examples/*/output/*.txt
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | Changelog for the generic_parser project.
4 |
5 | ## 1.0.0 - 2015-11-10
6 |
7 | ### Added in 1.0.0
8 |
9 | - Initial version
10 |
11 | ## 1.1.0 - 2018-12-03
12 |
13 | ### Added in 1.1.0
14 |
15 | - Added default value option for attributes
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GENERIC XML PARSER
2 |
3 | The generic XML parser is designed to process XML records into SQL script that can then be uploaded into a relational database. The parser converts XML into a series of insert statements based on a configuration file that specifies the tables and columns that are desired by the user.
4 |
5 | Created at the [Cyberinfrastructure for Network Science Center at Indiana University](https://cns.iu.edu)
6 |
7 | **Contributors:**
8 |
9 | - [Robert Light](https://github.com/lightr)
10 | - [Daniel Halsey](https://github.com/dakmh)
11 | - [Bruce Herr](https://github.com/bherr2) (maintainer)
12 |
13 | ## CHANGELOG
14 |
15 | See [CHANGELOG](CHANGELOG.md)
16 |
17 | ## Example Project
18 |
19 | See the [simple example](examples/simple) for a simple layout and example project. The [parse.sh](examples/simple/parse.sh) file shows how to run the parser on the command line with all the necessary options for that example.
20 |
21 | ## CONFIGURATION OPTIONS
22 |
23 | There are a number of configuration options that will need to be set in order to run the parser.
24 |
25 | ### Input Settings
26 |
27 | One of these must be set to indicate which files to process.
28 |
29 | **-f --file:** Defines a single file to parse.
30 |
31 | **-d --directory:** Defines a directory to parse. All files ending in ".xml" within this directory will be parsed. Subdirectories will NOT be parsed.
32 |
33 | ### Output Settings
34 |
35 | **-o --output:** Defines the output directory to place files in.
36 |
37 | ### Configuration File Settings
38 |
39 | **-c --config:** Defines the configuration file with the map from XML to schema. This must be present. Details on the construction of this file are below.
40 |
41 | **-t --template:** This defines a template file which can be used to create wrappers around the insert statements. This is optional. Details on the construction of this file are below.
42 |
43 | **-l --file_number:** This defines a CSV file with a mapping from file name to file number. This is optional. File numbers are often helpful for maintaining the most current version of a record. Details on the construction of this file are below.
44 |
45 | ### XML Configuration Settings
46 |
47 | These settings define the basic information that the parser needs to define records.
48 |
49 | **-p --parent:** The name of the parent tag of the collection of records to be processed. In many cases, this is the root tag of the entire file, though if only a portion of the file is being processed, this can be defined as a path. (for example: "GreaterFile/CitationSet"). If each file consists of only a single record, this can be the same as the record tag below, but is required.
50 |
51 | **-r --record:** The name of the root tag that indicates each specific record to be parsed. "MedlineCitation", "ClinicalTrial", etc. All data contained within this tag and its children will be presumed to be part of the same document. These must be direct children of the parent tag/path. This setting is required.
52 |
53 | **-i --identifier:** The name of the tag whose value provides the unique identifier for the record. If this is a child of the record tag, the name of the tag is sufficient. Otherwise, give the path beyond the record tag. This setting is required.
54 |
55 | Example:
56 |
57 | ```xml
58 |
59 |
60 | …
61 |
62 | 12345
63 | …
64 |
65 | …
66 |
67 |
68 | …
69 |
70 | 11111
71 | …
72 |
73 | …
74 |
75 | …
76 |
77 | ```
78 |
79 | For this set:
80 |
81 | -p would be MedlineCitationSet
82 |
83 | -r would be MedlineCitation
84 |
85 | -i would be Identifiers/PMID
86 |
87 | ### Other settings
88 |
89 | **-n --namespace:** This setting can be used if the XML has a defined namespace. Currently XML with only one namespace can be managed by the parser. This setting is optional.
90 |
91 | **-s --single_trans:** If True, this setting will place a wrapper around each file creating a single transaction for that file. This may help performance in some settings where statements are otherwise automatically committed. This cannot be used if the template includes a transaction statement.
92 |
93 | ## BUILDING THE CONFIGURATION FILES
94 |
95 | ### Schema Configuration
96 |
97 | The Schema Configuration file tells the parser what sort of database to build out of the XML.
98 |
99 | Consider the following example XML that we want to convert into a database:
100 |
101 | ```xml
102 |
103 |
104 | 12435
105 | Indiana
106 | Red
107 | Ford
108 | Nissan
109 |
110 |
111 | 12435
112 | …and many more people after that
113 |
114 | ```
115 |
116 | where we know that every person has a unique Emp_Id.
117 |
118 | Ideally, a schema should be designed from a DTD or XSD that clearly defines every acceptable tag within the XML schema, but we will assume that the data you see here is a complete record.
119 |
120 | With this in mind, we design a database schema and create the empty database on our DB server.
121 |
122 | Now we need to know our settings. The parent is the `` tag. This is the collection of records. The record tag is ``. The person is our record of interest and everything within that tag refers to the same person. The identifier tag is ``. Our list might include a dozen Joe's, but only one 12345.
123 |
124 | Now we need a configuration file to tell the parser where to put each element of the XML. Here's what that looks like
125 |
126 | ```xml
127 |
128 |
129 |
130 | employee_list:state
131 | employee_list:color
132 | emp_cars:car
133 |
134 |
135 | ```
136 |
137 | `` is our root. We don't have to do anything with it. It defines the section of the file that we're interested in. If there was more to this XML file outside of `…`, it would be ignored. Starting with person, we define the table that matches to the record. This first table, which we name "employee_list" will be central to the database. We also being assigning columns with the name attribute, which we assign to "employee_list:name". We can assign any attribute to a column on a table that has been defined by that tag or one of its ancestors.
138 |
139 | We can do the same with values or the values of children. We assign the value of State to "employee_list:state". Note that this requires some knowledge of the data. If we tried to do the same thing for Car, we're have a big problem, since there is more than one value to write.
140 |
141 | The Car tag is part of a one-to-many relationship, so it requires a new table. We define this by creating a new table attribute, giving the name of the new table "emp_cars", but we also need a counter, which we define with the ctr_id "emp_cars:car_ctr"
142 |
143 | Every new table after the first one MUST have a ctr_id defined. The identifier serves as the counter for the first table. All other counters will be sequential, counting up from 1 within their context. In other words, if Amy has cars, they'll start counting from 1 for her.
144 |
145 | Now, each instance of the `` tag will create a new row in the emp_cars table. Within that tag, we can assign attributes and values to that row, so we assign the color attribute and the value to columns in the emp_cars table.
146 |
147 | There is one more special attribute in the config file, the file_number. This allows the user to insert a file_number into a table, using the File Number Index explained below. This can be very helpful in dealing with records that may be overwritten later in a collection.
148 |
149 | Note that we don't do anything with Emp_Id. Since we named it the identifier, it automatically gets added to every table as the id column. We could reassign it to a second column within the table if we wanted, but that would be redundant.
150 |
151 | Here is the output when the XML for Joe above is run through the config file.
152 |
153 | ```sql
154 | INSERT INTO `employee_list` (`id`, `file_number`, `name`, `state`, `color`) VALUES (12345, 15, 'Joe', 'Indiana', 'Red');
155 | INSERT INTO `emp_cars` (`id`, `car_ctr`, `car`, `color`) VALUES (12345, 1, 'Ford', 'Blue');
156 | INSERT INTO `emp_cars` (`id`, `car_ctr`, `car`, `color`) VALUES (12345, 2, 'Nissan', 'White');
157 | ```
158 |
159 | ### Template File
160 |
161 | The template file is designed to give a wrapper for the INSERT statements generated by the parser. This template is applied once per record.
162 |
163 | The template recognizes three variables for insertion into the template.
164 |
165 | **$data** – The series of INSERT statements generated for that record. It is best to always put this on its own line in the template file.
166 |
167 | **$file_number** – The file number gathered from the File Number Index.
168 |
169 | **$id** – The identifier for the record.
170 |
171 | So a simple template designed to only keep the most current version of a record may look like this:
172 |
173 | ```sql
174 | USE employee_db;
175 |
176 | BEGIN
177 |
178 | DELETE FROM `employee_list` WHERE `id` = $id AND file_number <= $file_number;
179 |
180 | $data
181 |
182 | COMMIT;
183 | ```
184 |
185 | Applying this to our output from above, we might get this:
186 |
187 | ```sql
188 | USE employee_db;
189 |
190 | BEGIN
191 |
192 | DELETE FROM `employee_list` WHERE `id` = 12345 AND file_number <= 15;
193 |
194 | INSERT INTO `employee_list` (`id`, `file_number`, `name`, `state`, `color`) VALUES (12345, 15, 'Joe', 'Indiana', 'Red');
195 |
196 | INSERT INTO `emp_cars` (`id`, `car_ctr`, `car`, `color`) VALUES (12345, 1, 'Ford', 'Blue');
197 |
198 | INSERT INTO `emp_cars` (`id`, `car_ctr`, `car`, `color`) VALUES (12345, 2, 'Nissan', 'White');
199 |
200 | COMMIT;
201 | ```
202 |
203 | Assuming that primary and foreign keys are set up within the database and are set to cascade on deletion, then this script should do the following:
204 |
205 | If there were no older data: Write the new data.
206 |
207 | If there were older data: Delete that and then write in the new data.
208 |
209 | If there were NEWER data: Fail on the first insert and rollback, leaving the more current data intact.
210 |
211 | Exact syntax will vary by DBMS.
212 |
213 | ### File Number Index
214 |
215 | This is the most straightforward of the files to build. It is a simple csv file of the format:
216 |
217 | ```csv
218 | name,file_number
219 | filename1,number
220 | filename2,number
221 | …
222 | ```
223 |
224 | Numbers do not need to be sequential or even unique, to allow maximum flexibility for the user's purposes. The header is not required.
225 |
--------------------------------------------------------------------------------
/examples/simple/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | employee_list:state
5 | employee_list:color
6 | emp_cars:car
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/simple/data/data0001.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 12435
4 | Indiana
5 | Red
6 | Ford
7 | Nissan
8 |
9 |
10 | 12436
11 |
12 |
13 | 12437
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/simple/file_numbers.csv:
--------------------------------------------------------------------------------
1 | name,file_number
2 | data0001.xml,1
3 |
--------------------------------------------------------------------------------
/examples/simple/output/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cns-iu/generic_parser/ae58f4495548d1d95c6c4d5d2a4a677631adb158/examples/simple/output/.gitkeep
--------------------------------------------------------------------------------
/examples/simple/parse.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4 | cd $DIR
5 |
6 | rm -f output/*; touch output/.gitkeep
7 |
8 | ../../generic_parser.py -c config.xml -p People -r Person -i Emp_Id -t template.sql -l file_numbers.csv -d data -o output
9 |
--------------------------------------------------------------------------------
/examples/simple/template.sql:
--------------------------------------------------------------------------------
1 | USE employee_db;
2 |
3 | BEGIN
4 |
5 | DELETE FROM `employee_list` WHERE `id` = $id AND file_number <= $file_number;
6 |
7 | $data
8 |
9 | COMMIT;
10 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_calls.txt:
--------------------------------------------------------------------------------
1 |
2 | python26 ../generic_parser.py -d ../all_xml -p records -r REC -i UID -n {http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord} -o ../output/full -c ../config/wos_config.xml -t ../config/wos_template.sql -l ../config/wos_file_numbers.csv -m Postgres -s True
3 |
4 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | wos_page:page_value
12 |
13 |
14 | wos_titles:title
15 |
16 |
17 |
18 | wos_summary_names:display_name
19 | wos_summary_names:full_name
20 | wos_summary_names:prefix
21 | wos_summary_names:wos_standard
22 | wos_summary_names:first_name
23 | wos_summary_names:middle_name
24 | wos_summary_names:initials
25 | wos_summary_names:last_name
26 | wos_summary_names:suffix
27 | wos_summary_names_email_addr:email_addr
29 |
30 |
31 |
32 | wos_doctypes:doctype
33 |
34 |
35 |
36 |
37 | wos_conf_info:conf_info
38 |
39 |
40 | wos_conf_title:conf_title
41 |
42 |
43 | wos_conf_date:conf_date
44 |
45 |
46 |
47 | wos_conf_location:composite_location
48 | wos_conf_location:conf_host
49 | wos_conf_location:conf_city
50 | wos_conf_location:conf_state
51 |
52 |
53 |
54 | wos_conf_sponsor:sponsor
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | wos_publisher:full_address
63 |
64 | wos_publisher_organizations:organization
65 |
66 |
67 | wos_publisher_suborganizations:suborganization
68 |
69 | wos_publisher_email_addr:email_addr
70 |
71 | wos_publisher:url
72 |
73 | wos_publisher_dois:doi
74 |
75 |
76 | wos_publisher:laboratory
77 | wos_publisher:street
78 | wos_publisher:city
79 | wos_publisher:province
80 | wos_publisher:state
81 | wos_publisher:country
82 | wos_publisher:post_num
83 | wos_publisher_zip:zip
84 |
85 |
86 |
87 | wos_publisher_names:display_name
88 | wos_publisher_names:full_name
89 | wos_publisher_names:prefix
90 | wos_publisher_names:wos_standard
91 | wos_publisher_names:first_name
92 | wos_publisher_names:middle_name
93 | wos_publisher_names:initials
94 | wos_publisher_names:last_name
95 | wos_publisher_names:suffix
96 | wos_publisher_names_email_addr:email_addr
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | wos_languages:language
105 |
106 |
107 | wos_normalized_languages:language
108 |
109 |
110 | wos_normalized_doctypes:doctype
111 |
112 | wos_summary:descriptive_ref_count
113 |
114 |
115 |
116 | wos_references:ref_id
117 | wos_references:cited_author
118 | wos_references:assignee
119 | wos_references:year
120 | wos_references:page
121 | wos_references:volume
122 | wos_references:cited_title
123 | wos_references:cited_work
124 | wos_references:doi
125 | wos_references:art_no
126 | wos_references:patent_no
127 |
128 |
129 |
130 |
131 |
132 | wos_addresses:full_address
133 |
134 | wos_address_organizations:organization
135 |
136 |
137 | wos_address_suborganizations:suborganization
138 |
139 | wos_address_email_addr:email_addr
140 |
141 | wos_addresses:url
142 |
143 | wos_address_dois:doi
144 |
145 |
146 | wos_addresses:laboratory
147 | wos_addresses:street
148 | wos_addresses:city
149 | wos_addresses:province
150 | wos_addresses:state
151 | wos_addresses:country
152 | wos_addresses:post_num
153 | wos_address_zip:zip
154 |
155 |
156 |
157 | wos_address_names:display_name
158 | wos_address_names:full_name
159 | wos_address_names:prefix
160 | wos_address_names:wos_standard
161 | wos_address_names:first_name
162 | wos_address_names:middle_name
163 | wos_address_names:initials
164 | wos_address_names:last_name
165 | wos_address_names:suffix
166 | wos_address_names_email_addr:email_addr
167 |
168 |
169 |
170 |
171 |
172 |
173 | wos_headings:heading
174 |
175 |
176 | wos_subheadings:subheading
177 |
178 |
179 | wos_subjects:subject
180 |
181 |
182 |
183 | wos_summary:fund_ack
184 |
185 |
186 | wos_grants:grant_info
187 | wos_grants:grant_agency
188 |
189 | wos_grant_alt_agencies:alt_agency
190 |
191 |
192 | wos_grant_ids:grant_identifier
193 |
194 | wos_grants:country
195 | wos_grants:acronym
196 | wos_grants:investigator
197 |
198 |
199 |
200 |
201 | wos_keywords:keyword
202 |
203 |
204 |
205 |
206 |
wos_abstract_paragraphs:paragraph_text
207 |
208 | wos_abstracts:copyright_information
209 |
210 |
211 |
212 |
213 | wos_summary:item_ids
214 | wos_summary:bib_id
215 | wos_summary:bib_pagecount
216 |
217 |
218 | wos_reviewed_languages:language
219 |
220 |
221 | wos_reviewed_authors:author
222 |
223 | wos_summary:reviewed_year
224 |
225 |
226 |
227 | wos_reprint_addresses:full_address
228 |
229 | wos_reprint_address_organizations:organization
230 |
231 |
232 | wos_reprint_address_suborganizations:suborganization
233 |
234 | wos_reprint_address_email_addr:email_addr
235 |
236 | wos_reprint_addresses:url
237 |
238 | wos_reprint_address_dois:doi
239 |
240 |
241 | wos_reprint_addresses:laboratory
242 | wos_reprint_addresses:street
243 | wos_reprint_addresses:city
244 | wos_reprint_addresses:province
245 | wos_reprint_addresses:state
246 | wos_reprint_addresses:country
247 | wos_reprint_addresses:post_num
248 | wos_reprint_address_zip:zip
249 |
250 |
251 |
252 | wos_reprint_address_names:display_name
253 | wos_reprint_address_names:full_name
254 | wos_reprint_address_names:prefix
255 | wos_reprint_address_names:wos_standard
256 | wos_reprint_address_names:first_name
257 | wos_reprint_address_names:middle_name
258 | wos_reprint_address_names:initials
259 | wos_reprint_address_names:last_name
260 | wos_reprint_address_names:suffix
261 | wos_reprint_address_names_email_addr:email_addr
262 |
263 |
264 |
265 |
266 | wos_keywords_plus:keyword_plus
267 |
268 | wos_summary:book_chapters
269 | wos_summary:book_pages
270 |
271 | wos_book_notes:book_note
272 |
273 |
274 | wos_book_desc:bk_binding
275 | wos_book_desc:bk_publisher
276 |
277 | wos_book_desc:amount
278 | wos_book_desc:currency
279 | wos_book_desc:price_desc
280 | wos_book_desc:price_volumes
281 |
282 | wos_book_desc:bk_prepay
283 | wos_book_desc:bk_ordering
284 |
285 |
286 | wos_chapters:chapter
287 |
288 |
289 |
290 |
291 |
292 | wos_contributors:display_name
293 | wos_contributors:full_name
294 | wos_contributors:prefix
295 | wos_contributors:wos_standard
296 | wos_contributors:first_name
297 | wos_contributors:middle_name
298 | wos_contributors:initials
299 | wos_contributors:last_name
300 | wos_contributors:suffix
301 | wos_contributor_email_addr:email_addr
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_constraints.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE ONLY public.wos_page
2 | ADD CONSTRAINT unique_page_summary UNIQUE (id, page_id);
3 | ALTER TABLE ONLY public.wos_page
4 | ADD CONSTRAINT fk_page_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
5 |
6 | ALTER TABLE ONLY public.wos_titles
7 | ADD CONSTRAINT unique_titles_summary UNIQUE (id, title_id);
8 | ALTER TABLE ONLY public.wos_titles
9 | ADD CONSTRAINT fk_titles_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
10 |
11 | ALTER TABLE ONLY public.wos_summary_names
12 | ADD CONSTRAINT unique_summary_names UNIQUE (id, name_id);
13 | ALTER TABLE ONLY public.wos_summary_names
14 | ADD CONSTRAINT fk_summary_names_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
15 |
16 | ALTER TABLE ONLY public.wos_summary_names_email_addr
17 | ADD CONSTRAINT unique_summary_names_email_addr UNIQUE (id, name_id, email_id);
18 | ALTER TABLE ONLY public.wos_summary_names_email_addr
19 | ADD CONSTRAINT fk_summary_addr_summary_names FOREIGN KEY (id,name_id) REFERENCES public.wos_summary_names(id,name_id) ON DELETE CASCADE;
20 |
21 | ALTER TABLE ONLY public.wos_summary_name_addr_map
22 | ADD CONSTRAINT unique_summary_name_addr_map UNIQUE (id, name_id, addr_id);
23 | ALTER TABLE ONLY public.wos_summary_name_addr_map
24 | ADD CONSTRAINT fk_summary_name_addr_map_summary_names FOREIGN KEY (id,name_id) REFERENCES public.wos_summary_names(id,name_id) ON DELETE CASCADE;
25 |
26 | ALTER TABLE ONLY public.wos_doctypes
27 | ADD CONSTRAINT unique_doctypes UNIQUE (id, doctype_id);
28 | ALTER TABLE ONLY public.wos_doctypes
29 | ADD CONSTRAINT fk_doctypes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
30 |
31 | ALTER TABLE ONLY public.wos_normalized_doctypes
32 | ADD CONSTRAINT unique_normalized_doctypes UNIQUE (id, doctype_id);
33 | ALTER TABLE ONLY public.wos_normalized_doctypes
34 | ADD CONSTRAINT fk_normalized_doctypes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
35 |
36 | ALTER TABLE ONLY public.wos_languages
37 | ADD CONSTRAINT unique_languages UNIQUE (id, language_id);
38 | ALTER TABLE ONLY public.wos_languages
39 | ADD CONSTRAINT fk_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
40 |
41 | ALTER TABLE ONLY public.wos_normalized_languages
42 | ADD CONSTRAINT unique_normalized_languages UNIQUE (id, language_id);
43 | ALTER TABLE ONLY public.wos_normalized_languages
44 | ADD CONSTRAINT fk_normalized_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
45 |
46 | ALTER TABLE ONLY public.wos_conference
47 | ADD CONSTRAINT unique_conference UNIQUE (id, conf_record_id);
48 | ALTER TABLE ONLY public.wos_conference
49 | ADD CONSTRAINT fk_conference_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
50 |
51 | ALTER TABLE ONLY public.wos_conf_info
52 | ADD CONSTRAINT unique_conf_info UNIQUE (id, conf_record_id, info_id);
53 | ALTER TABLE ONLY public.wos_conf_info
54 | ADD CONSTRAINT fk_conf_info_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
55 |
56 | ALTER TABLE ONLY public.wos_conf_title
57 | ADD CONSTRAINT unique_conf_title UNIQUE (id, conf_record_id, title_id);
58 | ALTER TABLE ONLY public.wos_conf_title
59 | ADD CONSTRAINT fk_conf_title_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
60 |
61 | ALTER TABLE ONLY public.wos_conf_date
62 | ADD CONSTRAINT unique_conf_date UNIQUE (id, conf_record_id, date_id);
63 | ALTER TABLE ONLY public.wos_conf_date
64 | ADD CONSTRAINT fk_conf_date_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
65 |
66 | ALTER TABLE ONLY public.wos_conf_location
67 | ADD CONSTRAINT unique_conf_location UNIQUE (id, conf_record_id, location_id);
68 | ALTER TABLE ONLY public.wos_conf_location
69 | ADD CONSTRAINT fk_conf_location_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
70 |
71 | ALTER TABLE ONLY public.wos_conf_sponsor
72 | ADD CONSTRAINT unique_conf_sponsor UNIQUE (id, conf_record_id, sponsor_id);
73 | ALTER TABLE ONLY public.wos_conf_sponsor
74 | ADD CONSTRAINT fk_conf_sponsor_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
75 |
76 | ALTER TABLE ONLY public.wos_publisher
77 | ADD CONSTRAINT unique_publisher UNIQUE (id, publisher_id);
78 | ALTER TABLE ONLY public.wos_publisher
79 | ADD CONSTRAINT fk_publisher_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
80 |
81 | ALTER TABLE ONLY public.wos_publisher_names
82 | ADD CONSTRAINT unique_publisher_names UNIQUE (id, publisher_id, name_id);
83 | ALTER TABLE ONLY public.wos_publisher_names
84 | ADD CONSTRAINT fk_publisher_names_publisher FOREIGN KEY (id, publisher_id) REFERENCES public.wos_publisher(id, publisher_id) ON DELETE CASCADE;
85 |
86 | ALTER TABLE ONLY public.wos_publisher_names_email_addr
87 | ADD CONSTRAINT unique_publisher_names_email_addr UNIQUE (id, publisher_id, name_id, email_id);
88 | ALTER TABLE ONLY public.wos_publisher_names_email_addr
89 | ADD CONSTRAINT fk_publisher_names_addr_publisher_names FOREIGN KEY (id,publisher_id,name_id) REFERENCES public.wos_publisher_names(id,publisher_id,name_id) ON DELETE CASCADE;
90 |
91 | ALTER TABLE ONLY public.wos_publisher_email_addr
92 | ADD CONSTRAINT unique_publisher_email_addr UNIQUE (id, publisher_id, email_id);
93 | ALTER TABLE ONLY public.wos_publisher_email_addr
94 | ADD CONSTRAINT fk_publisher_addr_publishers FOREIGN KEY (id,publisher_id) REFERENCES public.wos_publisher(id,publisher_id) ON DELETE CASCADE;
95 |
96 | ALTER TABLE ONLY public.wos_publisher_zip
97 | ADD CONSTRAINT unique_publisher_zip UNIQUE (id, publisher_id, zip_id);
98 | ALTER TABLE ONLY public.wos_publisher_zip
99 | ADD CONSTRAINT fk_publisher_zip_publisher FOREIGN KEY (id,publisher_id) REFERENCES public.wos_publisher(id,publisher_id) ON DELETE CASCADE;
100 |
101 | ALTER TABLE ONLY public.wos_publisher_organizations
102 | ADD CONSTRAINT unique_publisher_organizations UNIQUE (id, publisher_id, org_id);
103 | ALTER TABLE ONLY public.wos_publisher_organizations
104 | ADD CONSTRAINT fk_publisher_organizations_publisher FOREIGN KEY (id,publisher_id) REFERENCES public.wos_publisher(id,publisher_id) ON DELETE CASCADE;
105 |
106 | ALTER TABLE ONLY public.wos_publisher_suborganizations
107 | ADD CONSTRAINT unique_publisher_suborganizations UNIQUE (id, publisher_id, suborg_id);
108 | ALTER TABLE ONLY public.wos_publisher_suborganizations
109 | ADD CONSTRAINT fk_publisher_suborganizations_publisher FOREIGN KEY (id,publisher_id) REFERENCES public.wos_publisher(id,publisher_id) ON DELETE CASCADE;
110 |
111 | ALTER TABLE ONLY public.wos_publisher_dois
112 | ADD CONSTRAINT unique_publisher_dois UNIQUE (id, publisher_id, doi_id);
113 | ALTER TABLE ONLY public.wos_publisher_dois
114 | ADD CONSTRAINT fk_publisher_doi_publisher FOREIGN KEY (id,publisher_id) REFERENCES public.wos_publisher(id,publisher_id) ON DELETE CASCADE;
115 |
116 | ALTER TABLE ONLY public.wos_edition
117 | ADD CONSTRAINT unique_edition UNIQUE (id, edition_ctr);
118 | ALTER TABLE ONLY public.wos_edition
119 | ADD CONSTRAINT fk_edition_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
120 |
121 | ALTER TABLE ONLY public.wos_references
122 | ADD CONSTRAINT unique_references UNIQUE (id, ref_id);
123 | ALTER TABLE ONLY public.wos_references
124 | ADD CONSTRAINT fk_references_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
125 |
126 | ALTER TABLE ONLY public.wos_addresses
127 | ADD CONSTRAINT unique_addresses UNIQUE (id, addr_id);
128 | ALTER TABLE ONLY public.wos_addresses
129 | ADD CONSTRAINT fk_addresses_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
130 |
131 | ALTER TABLE ONLY public.wos_address_names
132 | ADD CONSTRAINT unique_address_names UNIQUE (id, addr_id, name_id);
133 | ALTER TABLE ONLY public.wos_address_names
134 | ADD CONSTRAINT fk_address_names_addresses FOREIGN KEY (id, addr_id) REFERENCES public.wos_addresses(id, addr_id) ON DELETE CASCADE;
135 |
136 | ALTER TABLE ONLY public.wos_address_names_email_addr
137 | ADD CONSTRAINT unique_address_names_email_addr UNIQUE (id, addr_id, name_id, email_id);
138 | ALTER TABLE ONLY public.wos_address_names_email_addr
139 | ADD CONSTRAINT fk_address_names_email_addr_address_names FOREIGN KEY (id,addr_id, name_id) REFERENCES public.wos_address_names(id,addr_id, name_id) ON DELETE CASCADE;
140 |
141 | ALTER TABLE ONLY public.wos_address_email_addr
142 | ADD CONSTRAINT unique_address_email_addr UNIQUE (id, addr_id, email_id);
143 | ALTER TABLE ONLY public.wos_address_email_addr
144 | ADD CONSTRAINT fk_address_email_addr_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
145 |
146 | ALTER TABLE ONLY public.wos_address_zip
147 | ADD CONSTRAINT unique_address_zip UNIQUE (id, addr_id, zip_id);
148 | ALTER TABLE ONLY public.wos_address_zip
149 | ADD CONSTRAINT fk_address_zip_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
150 |
151 | ALTER TABLE ONLY public.wos_address_organizations
152 | ADD CONSTRAINT unique_address_organizations UNIQUE (id, addr_id, org_id);
153 | ALTER TABLE ONLY public.wos_address_organizations
154 | ADD CONSTRAINT fk_address_organizations_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
155 |
156 | ALTER TABLE ONLY public.wos_address_suborganizations
157 | ADD CONSTRAINT unique_address_suborganizations UNIQUE (id, addr_id, suborg_id);
158 | ALTER TABLE ONLY public.wos_address_suborganizations
159 | ADD CONSTRAINT fk_address_suborganizations_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
160 |
161 | ALTER TABLE ONLY public.wos_address_dois
162 | ADD CONSTRAINT unique_address_dois UNIQUE (id, addr_id, doi_id);
163 | ALTER TABLE ONLY public.wos_address_dois
164 | ADD CONSTRAINT fk_address_doi_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
165 |
166 | ALTER TABLE ONLY public.wos_headings
167 | ADD CONSTRAINT unique_headings UNIQUE (id, heading_id);
168 | ALTER TABLE ONLY public.wos_headings
169 | ADD CONSTRAINT fk_headings_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
170 |
171 | ALTER TABLE ONLY public.wos_subheadings
172 | ADD CONSTRAINT unique_subheadings UNIQUE (id, subheading_id);
173 | ALTER TABLE ONLY public.wos_subheadings
174 | ADD CONSTRAINT fk_subheadings_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
175 |
176 | ALTER TABLE ONLY public.wos_subjects
177 | ADD CONSTRAINT unique_subjects UNIQUE (id, subject_id);
178 | ALTER TABLE ONLY public.wos_subjects
179 | ADD CONSTRAINT fk_subjects_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
180 |
181 | ALTER TABLE ONLY public.wos_grants
182 | ADD CONSTRAINT unique_grants UNIQUE (id, grant_id);
183 | ALTER TABLE ONLY public.wos_grants
184 | ADD CONSTRAINT fk_grants_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
185 |
186 | ALTER TABLE ONLY public.wos_grant_alt_agencies
187 | ADD CONSTRAINT unique_grant_alt_agencies UNIQUE(id, grant_id, alt_agency_id);
188 | ALTER TABLE ONLY public.wos_grant_alt_agencies
189 | ADD CONSTRAINT fk_grant_alt_agencies_grants FOREIGN KEY (id, grant_id) REFERENCES public.wos_grants(id, grant_id) ON DELETE CASCADE;
190 |
191 | ALTER TABLE ONLY public.wos_grant_ids
192 | ADD CONSTRAINT unique_grant_ids UNIQUE(id, grant_id, id_id);
193 | ALTER TABLE ONLY public.wos_grant_ids
194 | ADD CONSTRAINT fk_grant_ids_grants FOREIGN KEY (id, grant_id) REFERENCES public.wos_grants(id, grant_id) ON DELETE CASCADE;
195 |
196 | ALTER TABLE ONLY public.wos_keywords
197 | ADD CONSTRAINT unique_keywords UNIQUE (id, keyword_id);
198 | ALTER TABLE ONLY public.wos_keywords
199 | ADD CONSTRAINT fk_keywords_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
200 |
201 | ALTER TABLE ONLY public.wos_abstracts
202 | ADD CONSTRAINT unique_abstracts UNIQUE (id, abstract_id);
203 | ALTER TABLE ONLY public.wos_abstracts
204 | ADD CONSTRAINT fk_abstracts_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
205 |
206 | ALTER TABLE ONLY public.wos_abstract_paragraphs
207 | ADD CONSTRAINT unique_abstract_paragraphs UNIQUE(id, abstract_id, paragraph_id);
208 | ALTER TABLE ONLY public.wos_abstract_paragraphs
209 | ADD CONSTRAINT fk_abstract_paragraphs_abstractss FOREIGN KEY (id, abstract_id) REFERENCES public.wos_abstracts(id, abstract_id) ON DELETE CASCADE;
210 |
211 | ALTER TABLE ONLY public.wos_reviewed_languages
212 | ADD CONSTRAINT unique_reviewed_languages UNIQUE (id, language_id);
213 | ALTER TABLE ONLY public.wos_reviewed_languages
214 | ADD CONSTRAINT fk_reviewed_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
215 |
216 | ALTER TABLE ONLY public.wos_reviewed_authors
217 | ADD CONSTRAINT unique_reviewed_authors UNIQUE (id, author_id);
218 | ALTER TABLE ONLY public.wos_reviewed_authors
219 | ADD CONSTRAINT fk_reviewed_authors_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
220 |
221 | ALTER TABLE ONLY public.wos_reprint_addresses
222 | ADD CONSTRAINT unique_reprint_addresses UNIQUE (id, addr_id);
223 | ALTER TABLE ONLY public.wos_reprint_addresses
224 | ADD CONSTRAINT fk_reprint_addresses_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
225 |
226 | ALTER TABLE ONLY public.wos_reprint_address_names
227 | ADD CONSTRAINT unique_reprint_address_names UNIQUE (id, addr_id, name_id);
228 | ALTER TABLE ONLY public.wos_reprint_address_names
229 | ADD CONSTRAINT fk_reprint_address_names_reprint_addresses FOREIGN KEY (id, addr_id) REFERENCES public.wos_reprint_addresses(id, addr_id) ON DELETE CASCADE;
230 |
231 | ALTER TABLE ONLY public.wos_reprint_address_names_email_addr
232 | ADD CONSTRAINT unique_reprint_address_names_email_addr UNIQUE (id, addr_id, name_id, email_id);
233 | ALTER TABLE ONLY public.wos_reprint_address_names_email_addr
234 | ADD CONSTRAINT fk_reprint_address_names_email_addr_reprint_address_names FOREIGN KEY (id,addr_id, name_id) REFERENCES public.wos_reprint_address_names(id,addr_id, name_id) ON DELETE CASCADE;
235 |
236 | ALTER TABLE ONLY public.wos_reprint_address_email_addr
237 | ADD CONSTRAINT unique_reprint_address_email_addr UNIQUE (id, addr_id, email_id);
238 | ALTER TABLE ONLY public.wos_reprint_address_email_addr
239 | ADD CONSTRAINT fk_reprint_address_email_addr_reprint_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
240 |
241 | ALTER TABLE ONLY public.wos_reprint_address_zip
242 | ADD CONSTRAINT unique_reprint_address_zip UNIQUE (id, addr_id, zip_id);
243 | ALTER TABLE ONLY public.wos_reprint_address_zip
244 | ADD CONSTRAINT fk_reprint_address_zip_reprint_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
245 |
246 | ALTER TABLE ONLY public.wos_reprint_address_organizations
247 | ADD CONSTRAINT unique_reprint_address_organizations UNIQUE (id, addr_id, org_id);
248 | ALTER TABLE ONLY public.wos_reprint_address_organizations
249 | ADD CONSTRAINT fk_reprint_address_organizations_reprint_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
250 |
251 | ALTER TABLE ONLY public.wos_reprint_address_suborganizations
252 | ADD CONSTRAINT unique_reprint_address_suborganizations UNIQUE (id, addr_id, suborg_id);
253 | ALTER TABLE ONLY public.wos_reprint_address_suborganizations
254 | ADD CONSTRAINT fk_reprint_address_suborganizations_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
255 |
256 | ALTER TABLE ONLY public.wos_reprint_address_dois
257 | ADD CONSTRAINT unique_reprint_address_dois UNIQUE (id, addr_id, doi_id);
258 | ALTER TABLE ONLY public.wos_reprint_address_dois
259 | ADD CONSTRAINT fk_reprint_address_doi_reprint_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
260 |
261 | ALTER TABLE ONLY public.wos_keywords_plus
262 | ADD CONSTRAINT unique_keywords_plus UNIQUE (id, keyword_id);
263 | ALTER TABLE ONLY public.wos_keywords_plus
264 | ADD CONSTRAINT fk_keywords_plus_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
265 |
266 | ALTER TABLE ONLY public.wos_book_notes
267 | ADD CONSTRAINT unique_book_notes UNIQUE (id, note_id);
268 | ALTER TABLE ONLY public.wos_book_notes
269 | ADD CONSTRAINT fk_book_notes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
270 |
271 | ALTER TABLE ONLY public.wos_book_desc
272 | ADD CONSTRAINT unique_book_desc UNIQUE (id, desc_id);
273 | ALTER TABLE ONLY public.wos_book_desc
274 | ADD CONSTRAINT fk_book_desc_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
275 |
276 | ALTER TABLE ONLY public.wos_chapters
277 | ADD CONSTRAINT unique_chapters UNIQUE (id, chapter_id);
278 | ALTER TABLE ONLY public.wos_chapters
279 | ADD CONSTRAINT fk_chapters_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
280 |
281 | ALTER TABLE ONLY public.wos_dynamic_identifiers
282 | ADD CONSTRAINT unique_dynamic_identifiers UNIQUE (id, dynamic_id);
283 | ALTER TABLE ONLY public.wos_dynamic_identifiers
284 | ADD CONSTRAINT fk_dynamic_identifiers_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
285 |
286 | ALTER TABLE ONLY public.wos_contributors
287 | ADD CONSTRAINT unique_contributors UNIQUE (id, contrib_id);
288 | ALTER TABLE ONLY public.wos_contributors
289 | ADD CONSTRAINT fk_contributors_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
290 |
291 | ALTER TABLE ONLY public.wos_contributor_email_addr
292 | ADD CONSTRAINT unique_contributor_email_addr UNIQUE (id, contrib_id, email_id);
293 | ALTER TABLE ONLY public.wos_contributor_email_addr
294 | ADD CONSTRAINT fk_contributor_addr_contributors FOREIGN KEY (id,contrib_id) REFERENCES public.wos_contributors(id,contrib_id) ON DELETE CASCADE;
295 |
296 |
297 |
298 |
299 |
300 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_constraints_final.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE ONLY public.wos_page
2 | ADD CONSTRAINT unique_page_summary UNIQUE (id, page_id);
3 | ALTER TABLE ONLY public.wos_page
4 | ADD CONSTRAINT fk_page_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
5 |
6 | ALTER TABLE ONLY public.wos_titles
7 | ADD CONSTRAINT unique_titles_summary UNIQUE (id, title_id);
8 | ALTER TABLE ONLY public.wos_titles
9 | ADD CONSTRAINT fk_titles_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
10 |
11 | ALTER TABLE ONLY public.wos_summary_names
12 | ADD CONSTRAINT unique_summary_names UNIQUE (id, name_id);
13 | ALTER TABLE ONLY public.wos_summary_names
14 | ADD CONSTRAINT fk_summary_names_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
15 |
16 | ALTER TABLE ONLY public.wos_summary_names_email_addr
17 | ADD CONSTRAINT unique_summary_names_email_addr UNIQUE (id, name_id, email_id);
18 | ALTER TABLE ONLY public.wos_summary_names_email_addr
19 | ADD CONSTRAINT fk_summary_addr_summary_names FOREIGN KEY (id,name_id) REFERENCES public.wos_summary_names(id,name_id) ON DELETE CASCADE;
20 |
21 | ALTER TABLE ONLY public.wos_doctypes
22 | ADD CONSTRAINT unique_doctypes UNIQUE (id, doctype_id);
23 | ALTER TABLE ONLY public.wos_doctypes
24 | ADD CONSTRAINT fk_doctypes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
25 |
26 | ALTER TABLE ONLY public.wos_normalized_doctypes
27 | ADD CONSTRAINT unique_normalized_doctypes UNIQUE (id, doctype_id);
28 | ALTER TABLE ONLY public.wos_normalized_doctypes
29 | ADD CONSTRAINT fk_normalized_doctypes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
30 |
31 | ALTER TABLE ONLY public.wos_languages
32 | ADD CONSTRAINT unique_languages UNIQUE (id, language_id);
33 | ALTER TABLE ONLY public.wos_languages
34 | ADD CONSTRAINT fk_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
35 |
36 | ALTER TABLE ONLY public.wos_normalized_languages
37 | ADD CONSTRAINT unique_normalized_languages UNIQUE (id, language_id);
38 | ALTER TABLE ONLY public.wos_normalized_languages
39 | ADD CONSTRAINT fk_normalized_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
40 |
41 | ALTER TABLE ONLY public.wos_conference
42 | ADD CONSTRAINT unique_conference UNIQUE (id, conf_record_id);
43 | ALTER TABLE ONLY public.wos_conference
44 | ADD CONSTRAINT fk_conference_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
45 |
46 | ALTER TABLE ONLY public.wos_conf_info
47 | ADD CONSTRAINT unique_conf_info UNIQUE (id, conf_record_id, info_id);
48 | ALTER TABLE ONLY public.wos_conf_info
49 | ADD CONSTRAINT fk_conf_info_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
50 |
51 | ALTER TABLE ONLY public.wos_conf_title
52 | ADD CONSTRAINT unique_conf_title UNIQUE (id, conf_record_id, title_id);
53 | ALTER TABLE ONLY public.wos_conf_title
54 | ADD CONSTRAINT fk_conf_title_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
55 |
56 | ALTER TABLE ONLY public.wos_conf_date
57 | ADD CONSTRAINT unique_conf_date UNIQUE (id, conf_record_id, date_id);
58 | ALTER TABLE ONLY public.wos_conf_date
59 | ADD CONSTRAINT fk_conf_date_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
60 |
61 | ALTER TABLE ONLY public.wos_conf_location
62 | ADD CONSTRAINT unique_conf_location UNIQUE (id, conf_record_id, location_id);
63 | ALTER TABLE ONLY public.wos_conf_location
64 | ADD CONSTRAINT fk_conf_location_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
65 |
66 | ALTER TABLE ONLY public.wos_conf_sponsor
67 | ADD CONSTRAINT unique_conf_sponsor UNIQUE (id, conf_record_id, sponsor_id);
68 | ALTER TABLE ONLY public.wos_conf_sponsor
69 | ADD CONSTRAINT fk_conf_sponsor_conference FOREIGN KEY (id,conf_record_id) REFERENCES public.wos_conference(id,conf_record_id) ON DELETE CASCADE;
70 |
71 | ALTER TABLE ONLY public.wos_publisher
72 | ADD CONSTRAINT unique_publisher UNIQUE (id, publisher_id);
73 | ALTER TABLE ONLY public.wos_publisher
74 | ADD CONSTRAINT fk_publisher_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
75 |
76 | ALTER TABLE ONLY public.wos_publisher_names
77 | ADD CONSTRAINT unique_publisher_names UNIQUE (id, publisher_id, name_id);
78 | ALTER TABLE ONLY public.wos_publisher_names
79 | ADD CONSTRAINT fk_publisher_names_publisher FOREIGN KEY (id, publisher_id) REFERENCES public.wos_publisher(id, publisher_id) ON DELETE CASCADE;
80 |
81 | ALTER TABLE ONLY public.wos_edition
82 | ADD CONSTRAINT unique_edition UNIQUE (id, edition_ctr);
83 | ALTER TABLE ONLY public.wos_edition
84 | ADD CONSTRAINT fk_edition_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
85 |
86 | ALTER TABLE ONLY public.wos_references
87 | ADD CONSTRAINT unique_references UNIQUE (id, ref_ctr);
88 | ALTER TABLE ONLY public.wos_references
89 | ADD CONSTRAINT fk_references_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
90 |
91 | ALTER TABLE ONLY public.wos_addresses
92 | ADD CONSTRAINT unique_addresses UNIQUE (id, addr_id);
93 | ALTER TABLE ONLY public.wos_addresses
94 | ADD CONSTRAINT fk_addresses_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
95 |
96 | ALTER TABLE ONLY public.wos_address_names
97 | ADD CONSTRAINT unique_address_names UNIQUE (id, addr_id, name_id);
98 | ALTER TABLE ONLY public.wos_address_names
99 | ADD CONSTRAINT fk_address_names_addresses FOREIGN KEY (id, addr_id) REFERENCES public.wos_addresses(id, addr_id) ON DELETE CASCADE;
100 |
101 | ALTER TABLE ONLY public.wos_address_names_email_addr
102 | ADD CONSTRAINT unique_address_names_email_addr UNIQUE (id, addr_id, name_id, email_id);
103 | ALTER TABLE ONLY public.wos_address_names_email_addr
104 | ADD CONSTRAINT fk_address_names_email_addr_address_names FOREIGN KEY (id,addr_id, name_id) REFERENCES public.wos_address_names(id,addr_id, name_id) ON DELETE CASCADE;
105 |
106 | ALTER TABLE ONLY public.wos_address_zip
107 | ADD CONSTRAINT unique_address_zip UNIQUE (id, addr_id, zip_id);
108 | ALTER TABLE ONLY public.wos_address_zip
109 | ADD CONSTRAINT fk_address_zip_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
110 |
111 | ALTER TABLE ONLY public.wos_address_organizations
112 | ADD CONSTRAINT unique_address_organizations UNIQUE (id, addr_id, org_id);
113 | ALTER TABLE ONLY public.wos_address_organizations
114 | ADD CONSTRAINT fk_address_organizations_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
115 |
116 | ALTER TABLE ONLY public.wos_address_suborganizations
117 | ADD CONSTRAINT unique_address_suborganizations UNIQUE (id, addr_id, suborg_id);
118 | ALTER TABLE ONLY public.wos_address_suborganizations
119 | ADD CONSTRAINT fk_address_suborganizations_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_addresses(id,addr_id) ON DELETE CASCADE;
120 |
121 | ALTER TABLE ONLY public.wos_headings
122 | ADD CONSTRAINT unique_headings UNIQUE (id, heading_id);
123 | ALTER TABLE ONLY public.wos_headings
124 | ADD CONSTRAINT fk_headings_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
125 |
126 | ALTER TABLE ONLY public.wos_subheadings
127 | ADD CONSTRAINT unique_subheadings UNIQUE (id, subheading_id);
128 | ALTER TABLE ONLY public.wos_subheadings
129 | ADD CONSTRAINT fk_subheadings_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
130 |
131 | ALTER TABLE ONLY public.wos_subjects
132 | ADD CONSTRAINT unique_subjects UNIQUE (id, subject_id);
133 | ALTER TABLE ONLY public.wos_subjects
134 | ADD CONSTRAINT fk_subjects_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
135 |
136 | ALTER TABLE ONLY public.wos_grants
137 | ADD CONSTRAINT unique_grants UNIQUE (id, grant_id);
138 | ALTER TABLE ONLY public.wos_grants
139 | ADD CONSTRAINT fk_grants_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
140 |
141 | ALTER TABLE ONLY public.wos_grant_ids
142 | ADD CONSTRAINT unique_grant_ids UNIQUE(id, grant_id, id_id);
143 | ALTER TABLE ONLY public.wos_grant_ids
144 | ADD CONSTRAINT fk_grant_ids_grants FOREIGN KEY (id, grant_id) REFERENCES public.wos_grants(id, grant_id) ON DELETE CASCADE;
145 |
146 | ALTER TABLE ONLY public.wos_keywords
147 | ADD CONSTRAINT unique_keywords UNIQUE (id, keyword_id);
148 | ALTER TABLE ONLY public.wos_keywords
149 | ADD CONSTRAINT fk_keywords_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
150 |
151 | ALTER TABLE ONLY public.wos_abstracts
152 | ADD CONSTRAINT unique_abstracts UNIQUE (id, abstract_id);
153 | ALTER TABLE ONLY public.wos_abstracts
154 | ADD CONSTRAINT fk_abstracts_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
155 |
156 | ALTER TABLE ONLY public.wos_abstract_paragraphs
157 | ADD CONSTRAINT unique_abstract_paragraphs UNIQUE(id, abstract_id, paragraph_id);
158 | ALTER TABLE ONLY public.wos_abstract_paragraphs
159 | ADD CONSTRAINT fk_abstract_paragraphs_abstractss FOREIGN KEY (id, abstract_id) REFERENCES public.wos_abstracts(id, abstract_id) ON DELETE CASCADE;
160 |
161 | ALTER TABLE ONLY public.wos_reviewed_languages
162 | ADD CONSTRAINT unique_reviewed_languages UNIQUE (id, language_id);
163 | ALTER TABLE ONLY public.wos_reviewed_languages
164 | ADD CONSTRAINT fk_reviewed_languages_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
165 |
166 | ALTER TABLE ONLY public.wos_reviewed_authors
167 | ADD CONSTRAINT unique_reviewed_authors UNIQUE (id, author_id);
168 | ALTER TABLE ONLY public.wos_reviewed_authors
169 | ADD CONSTRAINT fk_reviewed_authors_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
170 |
171 | ALTER TABLE ONLY public.wos_reprint_addresses
172 | ADD CONSTRAINT unique_reprint_addresses UNIQUE (id, addr_id);
173 | ALTER TABLE ONLY public.wos_reprint_addresses
174 | ADD CONSTRAINT fk_reprint_addresses_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
175 |
176 | ALTER TABLE ONLY public.wos_reprint_address_names
177 | ADD CONSTRAINT unique_reprint_address_names UNIQUE (id, addr_id, name_id);
178 | ALTER TABLE ONLY public.wos_reprint_address_names
179 | ADD CONSTRAINT fk_reprint_address_names_reprint_addresses FOREIGN KEY (id, addr_id) REFERENCES public.wos_reprint_addresses(id, addr_id) ON DELETE CASCADE;
180 |
181 | ALTER TABLE ONLY public.wos_reprint_address_names_email_addr
182 | ADD CONSTRAINT unique_reprint_address_names_email_addr UNIQUE (id, addr_id, name_id, email_id);
183 | ALTER TABLE ONLY public.wos_reprint_address_names_email_addr
184 | ADD CONSTRAINT fk_reprint_address_names_email_addr_reprint_address_names FOREIGN KEY (id,addr_id, name_id) REFERENCES public.wos_reprint_address_names(id,addr_id, name_id) ON DELETE CASCADE;
185 |
186 | ALTER TABLE ONLY public.wos_reprint_address_zip
187 | ADD CONSTRAINT unique_reprint_address_zip UNIQUE (id, addr_id, zip_id);
188 | ALTER TABLE ONLY public.wos_reprint_address_zip
189 | ADD CONSTRAINT fk_reprint_address_zip_reprint_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
190 |
191 | ALTER TABLE ONLY public.wos_reprint_address_organizations
192 | ADD CONSTRAINT unique_reprint_address_organizations UNIQUE (id, addr_id, org_id);
193 | ALTER TABLE ONLY public.wos_reprint_address_organizations
194 | ADD CONSTRAINT fk_reprint_address_organizations_reprint_address FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
195 |
196 | ALTER TABLE ONLY public.wos_reprint_address_suborganizations
197 | ADD CONSTRAINT unique_reprint_address_suborganizations UNIQUE (id, addr_id, suborg_id);
198 | ALTER TABLE ONLY public.wos_reprint_address_suborganizations
199 | ADD CONSTRAINT fk_reprint_address_suborganizations_addresses FOREIGN KEY (id,addr_id) REFERENCES public.wos_reprint_addresses(id,addr_id) ON DELETE CASCADE;
200 |
201 | ALTER TABLE ONLY public.wos_keywords_plus
202 | ADD CONSTRAINT unique_keywords_plus UNIQUE (id, keyword_id);
203 | ALTER TABLE ONLY public.wos_keywords_plus
204 | ADD CONSTRAINT fk_keywords_plus_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
205 |
206 | ALTER TABLE ONLY public.wos_book_notes
207 | ADD CONSTRAINT unique_book_notes UNIQUE (id, note_id);
208 | ALTER TABLE ONLY public.wos_book_notes
209 | ADD CONSTRAINT fk_book_notes_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
210 |
211 | ALTER TABLE ONLY public.wos_book_desc
212 | ADD CONSTRAINT unique_book_desc UNIQUE (id, desc_id);
213 | ALTER TABLE ONLY public.wos_book_desc
214 | ADD CONSTRAINT fk_book_desc_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
215 |
216 | ALTER TABLE ONLY public.wos_dynamic_identifiers
217 | ADD CONSTRAINT unique_dynamic_identifiers UNIQUE (id, dynamic_id);
218 | ALTER TABLE ONLY public.wos_dynamic_identifiers
219 | ADD CONSTRAINT fk_dynamic_identifiers_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
220 |
221 | ALTER TABLE ONLY public.wos_contributors
222 | ADD CONSTRAINT unique_contributors UNIQUE (id, contrib_id);
223 | ALTER TABLE ONLY public.wos_contributors
224 | ADD CONSTRAINT fk_contributors_summary FOREIGN KEY (id) REFERENCES public.wos_summary(id) ON DELETE CASCADE;
225 |
226 |
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_file_numbers.csv:
--------------------------------------------------------------------------------
1 | name,file_number
2 | WR_1900_20140702170006_CORE_0001.xml,1
3 | WR_1900_20140702170006_CORE_0002.xml,2
4 | WR_1900_20140702170006_CORE_0003.xml,3
5 | WR_1945_20140602130813_CORE_0001.xml,4
6 | WR_1946_20140602141337_CORE_0001.xml,5
7 | WR_1947_20140602145523_CORE_0001.xml,6
8 | WR_1948_20140602154439_CORE_0001.xml,7
9 | WR_1949_20140602164428_CORE_0001.xml,8
10 | WR_1950_20140602175028_CORE_0001.xml,9
11 | WR_1951_20140602190535_CORE_0001.xml,10
12 | WR_1952_20140602203140_CORE_0001.xml,11
13 | WR_1953_20140602220124_CORE_0001.xml,12
14 | WR_1954_20140602234847_CORE_0001.xml,13
15 | WR_1955_20140603012042_CORE_0001.xml,14
16 | WR_1956_20140603024324_CORE_0001.xml,15
17 | WR_1957_20140603041829_CORE_0001.xml,16
18 | WR_1958_20140603055614_CORE_0001.xml,17
19 | WR_1959_20140603074457_CORE_0001.xml,18
20 | WR_1960_20140602150719_CORE_0001.xml,19
21 | WR_1961_20140602172613_CORE_0001.xml,20
22 | WR_1962_20140602195805_CORE_0001.xml,21
23 | WR_1963_20140602225457_CORE_0001.xml,22
24 | WR_1964_20140603015835_CORE_0001.xml,23
25 | WR_1965_20140603053449_CORE_0001.xml,24
26 | WR_1966_20140603095050_CORE_0001.xml,25
27 | WR_1967_20140603163847_CORE_0001.xml,26
28 | WR_1968_20140603224908_CORE_0001.xml,27
29 | WR_1969_20140604050049_CORE_0001.xml,28
30 | WR_1970_20140602150807_CORE_0001.xml,29
31 | WR_1971_20140602224414_CORE_0001.xml,30
32 | WR_1972_20140603054604_CORE_0001.xml,31
33 | WR_1973_20140603130502_CORE_0001.xml,32
34 | WR_1974_20140603221415_CORE_0001.xml,33
35 | WR_1975_20140604073614_CORE_0001.xml,34
36 | WR_1975_20140604073614_CORE_0002.xml,35
37 | WR_1976_20140604230031_CORE_0001.xml,36
38 | WR_1976_20140604230031_CORE_0002.xml,37
39 | WR_1977_20140605173437_CORE_0001.xml,38
40 | WR_1977_20140605173437_CORE_0002.xml,39
41 | WR_1978_20140606124608_CORE_0001.xml,40
42 | WR_1978_20140606124608_CORE_0002.xml,41
43 | WR_1979_20140612111035_CORE_0001.xml,42
44 | WR_1979_20140612111035_CORE_0002.xml,43
45 | WR_1980_20140602150832_CORE_0001.xml,44
46 | WR_1980_20140602150832_CORE_0002.xml,45
47 | WR_1981_20140603100224_CORE_0001.xml,46
48 | WR_1981_20140603100224_CORE_0002.xml,47
49 | WR_1982_20140604050058_CORE_0001.xml,48
50 | WR_1982_20140604050058_CORE_0002.xml,49
51 | WR_1983_20140605044319_CORE_0001.xml,50
52 | WR_1983_20140605044319_CORE_0002.xml,51
53 | WR_1984_20140613091604_CORE_0001.xml,52
54 | WR_1984_20140613091604_CORE_0002.xml,53
55 | WR_1985_20140607152632_CORE_0001.xml,54
56 | WR_1985_20140607152632_CORE_0002.xml,55
57 | WR_1986_20140608234748_CORE_0001.xml,56
58 | WR_1986_20140608234748_CORE_0002.xml,57
59 | WR_1987_20140610095549_CORE_0001.xml,58
60 | WR_1987_20140610095549_CORE_0002.xml,59
61 | WR_1988_20140611201855_CORE_0001.xml,60
62 | WR_1988_20140611201855_CORE_0002.xml,61
63 | WR_1989_20140613064144_CORE_0001.xml,62
64 | WR_1989_20140613064144_CORE_0002.xml,63
65 | WR_1990_20140603133328_CORE_0001.xml,64
66 | WR_1990_20140603133328_CORE_0002.xml,65
67 | WR_1990_20140603133328_CORE_0003.xml,66
68 | WR_1991_20140605015852_CORE_0001.xml,67
69 | WR_1991_20140605015852_CORE_0002.xml,68
70 | WR_1991_20140605015852_CORE_0003.xml,69
71 | WR_1992_20140616095057_CORE_0001.xml,70
72 | WR_1992_20140616095057_CORE_0002.xml,71
73 | WR_1992_20140616095057_CORE_0003.xml,72
74 | WR_1993_20140608093515_CORE_0001.xml,73
75 | WR_1993_20140608093515_CORE_0002.xml,74
76 | WR_1993_20140608093515_CORE_0003.xml,75
77 | WR_1994_20140610021741_CORE_0001.xml,76
78 | WR_1994_20140610021741_CORE_0002.xml,77
79 | WR_1994_20140610021741_CORE_0003.xml,78
80 | WR_1995_20140612001926_CORE_0001.xml,79
81 | WR_1995_20140612001926_CORE_0002.xml,80
82 | WR_1995_20140612001926_CORE_0003.xml,81
83 | WR_1996_20140614032505_CORE_0001.xml,82
84 | WR_1996_20140614032505_CORE_0002.xml,83
85 | WR_1996_20140614032505_CORE_0003.xml,84
86 | WR_1997_20140616081409_CORE_0001.xml,85
87 | WR_1997_20140616081409_CORE_0002.xml,86
88 | WR_1997_20140616081409_CORE_0003.xml,87
89 | WR_1998_20140618182859_CORE_0001.xml,88
90 | WR_1998_20140618182859_CORE_0002.xml,89
91 | WR_1998_20140618182859_CORE_0003.xml,90
92 | WR_1999_20140621071536_CORE_0001.xml,91
93 | WR_1999_20140621071536_CORE_0002.xml,92
94 | WR_1999_20140621071536_CORE_0003.xml,93
95 | WR_2000_20140806135940_CORE_0001.xml,94
96 | WR_2000_20140806135940_CORE_0002.xml,95
97 | WR_2000_20140806135940_CORE_0003.xml,96
98 | WR_2001_20140618052011_CORE_0001.xml,97
99 | WR_2001_20140618052011_CORE_0002.xml,98
100 | WR_2001_20140618052011_CORE_0003.xml,99
101 | WR_2002_20140609134004_CORE_0001.xml,100
102 | WR_2002_20140609134004_CORE_0002.xml,101
103 | WR_2002_20140609134004_CORE_0003.xml,102
104 | WR_2003_20140612161852_CORE_0001.xml,103
105 | WR_2003_20140612161852_CORE_0002.xml,104
106 | WR_2003_20140612161852_CORE_0003.xml,105
107 | WR_2004_20140621011745_CORE_0001.xml,106
108 | WR_2004_20140621011745_CORE_0002.xml,107
109 | WR_2004_20140621011745_CORE_0003.xml,108
110 | WR_2004_20140621011745_CORE_0004.xml,109
111 | WR_2005_20140608150205_CORE_0001.xml,110
112 | WR_2005_20140608150205_CORE_0002.xml,111
113 | WR_2005_20140608150205_CORE_0003.xml,112
114 | WR_2005_20140608150205_CORE_0004.xml,113
115 | WR_2006_20140612192500_CORE_0001.xml,114
116 | WR_2006_20140612192500_CORE_0002.xml,115
117 | WR_2006_20140612192500_CORE_0003.xml,116
118 | WR_2006_20140612192500_CORE_0004.xml,117
119 | WR_2007_20140617094339_CORE_0001.xml,118
120 | WR_2007_20140617094339_CORE_0002.xml,119
121 | WR_2007_20140617094339_CORE_0003.xml,120
122 | WR_2007_20140617094339_CORE_0004.xml,121
123 | WR_2008_20140616115013_CORE_0001.xml,122
124 | WR_2008_20140616115013_CORE_0002.xml,123
125 | WR_2008_20140616115013_CORE_0003.xml,124
126 | WR_2008_20140616115013_CORE_0004.xml,125
127 | WR_2008_20140616115013_CORE_0005.xml,126
128 | WR_2009_20140621175822_CORE_0001.xml,127
129 | WR_2009_20140621175822_CORE_0002.xml,128
130 | WR_2009_20140621175822_CORE_0003.xml,129
131 | WR_2009_20140625163541_CORE_0001.xml,130
132 | WR_2009_20140625163541_CORE_0002.xml,131
133 | WR_2010_20140806135846_CORE_0001.xml,132
134 | WR_2010_20140806135846_CORE_0002.xml,133
135 | WR_2010_20140806135846_CORE_0003.xml,134
136 | WR_2010_20140806135846_CORE_0004.xml,135
137 | WR_2010_20140806135846_CORE_0005.xml,136
138 | WR_2011_20140627134849_CORE_0001.xml,137
139 | WR_2011_20140627134849_CORE_0002.xml,138
140 | WR_2011_20140627134849_CORE_0003.xml,139
141 | WR_2011_20140627134849_CORE_0004.xml,140
142 | WR_2011_20140627134849_CORE_0005.xml,141
143 | WR_2011_20140707110213_CORE_0001.xml,142
144 | WR_2012_20140818153301_CORE_0001.xml,143
145 | WR_2012_20140819100157_CORE_0001.xml,144
146 | WR_2012_20140819100255_CORE_0001.xml,145
147 | WR_2012_20140819100407_CORE_0001.xml,146
148 | WR_2012_20140819195501_CORE_0001.xml,147
149 | WR_2012_20140819195546_CORE_0001.xml,148
150 | WR_2012_20140819195652_CORE_0001.xml,149
151 | WR_2012_20140820091812_CORE_0001.xml,150
152 | WR_2012_20140820091840_CORE_0001.xml,151
153 | WR_2012_20140820091900_CORE_0001.xml,152
154 | WR_2012_20140820122711_CORE_0001.xml,153
155 | WR_2012_20140820122721_CORE_0001.xml,154
156 | WR_2012_20140820122734_CORE_0001.xml,155
157 | WR_2013_20140820152426_CORE_0001.xml,156
158 | WR_2013_20140820152436_CORE_0001.xml,157
159 | WR_2013_20140820152452_CORE_0001.xml,158
160 | WR_2013_20140820152731_CORE_0001.xml,159
161 | WR_2013_20140820222539_CORE_0001.xml,160
162 | WR_2013_20140820222704_CORE_0001.xml,161
163 | WR_2013_20140820222831_CORE_0001.xml,162
164 | WR_2013_20140821091252_CORE_0001.xml,163
165 | WR_2013_20140821091628_CORE_0001.xml,164
166 | WR_2013_20140821091642_CORE_0001.xml,165
167 | WR_2013_20140821091722_CORE_0001.xml,166
168 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_schema_final.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS public.wos_dynamic_identifiers;
2 | DROP TABLE IF EXISTS public.wos_contributors;
3 | DROP TABLE IF EXISTS public.wos_book_desc;
4 | DROP TABLE IF EXISTS public.wos_book_notes;
5 | DROP TABLE IF EXISTS public.wos_keywords_plus;
6 | DROP TABLE IF EXISTS public.wos_reprint_address_names_email_addr;
7 | DROP TABLE IF EXISTS public.wos_reprint_address_names;
8 | DROP TABLE IF EXISTS public.wos_reprint_address_zip;
9 | DROP TABLE IF EXISTS public.wos_reprint_address_organizations;
10 | DROP TABLE IF EXISTS public.wos_reprint_address_suborganizations;
11 | DROP TABLE IF EXISTS public.wos_reprint_addresses;
12 | DROP TABLE IF EXISTS public.wos_reviewed_authors;
13 | DROP TABLE IF EXISTS public.wos_reviewed_languages;
14 | DROP TABLE IF EXISTS public.wos_abstract_paragraphs;
15 | DROP TABLE IF EXISTS public.wos_abstracts;
16 | DROP TABLE IF EXISTS public.wos_keywords;
17 | DROP TABLE IF EXISTS public.wos_grant_ids;
18 | DROP TABLE IF EXISTS public.wos_grants;
19 | DROP TABLE IF EXISTS public.wos_headings;
20 | DROP TABLE IF EXISTS public.wos_subheadings;
21 | DROP TABLE IF EXISTS public.wos_subjects;
22 | DROP TABLE IF EXISTS public.wos_address_names_email_addr;
23 | DROP TABLE IF EXISTS public.wos_address_names;
24 | DROP TABLE IF EXISTS public.wos_address_zip;
25 | DROP TABLE IF EXISTS public.wos_address_organizations;
26 | DROP TABLE IF EXISTS public.wos_address_suborganizations;
27 | DROP TABLE IF EXISTS public.wos_addresses;
28 | DROP TABLE IF EXISTS public.wos_edition;
29 | DROP TABLE IF EXISTS public.wos_references;
30 | DROP TABLE IF EXISTS public.wos_languages;
31 | DROP TABLE IF EXISTS public.wos_normalized_languages;
32 | DROP TABLE IF EXISTS public.wos_normalized_doctypes;
33 | DROP TABLE IF EXISTS public.wos_page;
34 | DROP TABLE IF EXISTS public.wos_titles;
35 | DROP TABLE IF EXISTS public.wos_doctypes;
36 | DROP TABLE IF EXISTS public.wos_conf_info;
37 | DROP TABLE IF EXISTS public.wos_conf_title;
38 | DROP TABLE IF EXISTS public.wos_conf_date;
39 | DROP TABLE IF EXISTS public.wos_conf_location;
40 | DROP TABLE IF EXISTS public.wos_conf_sponsor;
41 | DROP TABLE IF EXISTS public.wos_conference;
42 | DROP TABLE IF EXISTS public.wos_publisher_names;
43 | DROP TABLE IF EXISTS public.wos_publisher;
44 | DROP TABLE IF EXISTS public.wos_summary_names_email_addr;
45 | DROP TABLE IF EXISTS public.wos_summary_names;
46 | DROP TABLE IF EXISTS public.wos_summary;
47 | DROP SCHEMA IF EXISTS public;
48 |
49 | CREATE SCHEMA public;
50 |
51 | CREATE TABLE public.wos_summary (
52 | id character varying NOT NULL CONSTRAINT wos_summary_pk PRIMARY KEY,
53 | file_number integer NOT NULL,
54 | coll_id character varying,
55 | pubyear character varying,
56 | season character varying,
57 | pubmonth character varying,
58 | pubday character varying,
59 | coverdate character varying,
60 | edate character varying,
61 | vol character varying,
62 | issue character varying,
63 | voliss character varying,
64 | supplement character varying,
65 | special_issue character varying,
66 | part_no character varying,
67 | pubtype character varying,
68 | medium character varying,
69 | model character varying,
70 | indicator character varying,
71 | inpi character varying,
72 | is_archive character varying,
73 | city character varying,
74 | country character varying,
75 | has_abstract character varying,
76 | sortdate character varying,
77 | title_count character varying,
78 | name_count character varying,
79 | doctype_count character varying,
80 | conference_count character varying,
81 | language_count character varying,
82 | normalized_language_count character varying,
83 | normalized_doctype_count character varying,
84 | descriptive_ref_count character varying,
85 | reference_count character varying,
86 | address_count character varying,
87 | headings_count character varying,
88 | subheadings_count character varying,
89 | subjects_count character varying,
90 | fund_ack character varying,
91 | grants_count character varying,
92 | grants_complete character varying,
93 | keyword_count character varying,
94 | abstract_count character varying,
95 | item_coll_id character varying,
96 | item_ids character varying,
97 | item_ids_avail character varying,
98 | bib_id character varying,
99 | bib_pagecount character varying,
100 | bib_pagecount_type character varying,
101 | reviewed_language_count character varying,
102 | reviewed_author_count character varying,
103 | reviewed_year character varying,
104 | keywords_plus_count character varying,
105 | book_chapters character varying,
106 | book_pages character varying,
107 | book_notes_count character varying,
108 | chapterlist_count character varying,
109 | contributor_count character varying
110 | );
111 |
112 | COMMENT ON TABLE public.wos_summary IS 'Summary Record Data';
113 | COMMENT ON COLUMN public.wos_summary.id IS 'WoS ID (internal primary key)';
114 | COMMENT ON COLUMN public.wos_summary.file_number IS 'File number';
115 | COMMENT ON COLUMN public.wos_summary.coll_id IS 'Collection ID';
116 | COMMENT ON COLUMN public.wos_summary.pubyear IS 'Publication Year';
117 | COMMENT ON COLUMN public.wos_summary.season IS 'Publication Season';
118 | COMMENT ON COLUMN public.wos_summary.pubmonth IS 'Publication Month';
119 | COMMENT ON COLUMN public.wos_summary.pubday IS 'Publication Day';
120 | COMMENT ON COLUMN public.wos_summary.coverdate IS 'Concatenation of pubyear and pubmonth';
121 | COMMENT ON COLUMN public.wos_summary.edate IS 'Undocumented';
122 | COMMENT ON COLUMN public.wos_summary.vol IS 'Volume';
123 | COMMENT ON COLUMN public.wos_summary.issue IS 'Issue';
124 | COMMENT ON COLUMN public.wos_summary.voliss IS 'Volume + issue';
125 | COMMENT ON COLUMN public.wos_summary.supplement IS 'Journal supplement';
126 | COMMENT ON COLUMN public.wos_summary.special_issue IS 'Journal special issue';
127 | COMMENT ON COLUMN public.wos_summary.part_no IS 'Journal part number';
128 | COMMENT ON COLUMN public.wos_summary.pubtype IS 'Undocumented';
129 | COMMENT ON COLUMN public.wos_summary.medium IS 'Undocumented';
130 | COMMENT ON COLUMN public.wos_summary.model IS 'Medline''s Article@PubModel';
131 | COMMENT ON COLUMN public.wos_summary.indicator IS 'Undocumented';
132 | COMMENT ON COLUMN public.wos_summary.inpi IS 'Indicator that source of chemical reaction data is INPI (Institut national de la propriete industriellee)';
133 | COMMENT ON COLUMN public.wos_summary.is_archive IS 'Archive record';
134 | COMMENT ON COLUMN public.wos_summary.city IS 'City of Publication';
135 | COMMENT ON COLUMN public.wos_summary.country IS 'Country of Publication';
136 | COMMENT ON COLUMN public.wos_summary.has_abstract IS 'Undocumented';
137 | COMMENT ON COLUMN public.wos_summary.sortdate IS 'Undocumented';
138 | COMMENT ON COLUMN public.wos_summary.title_count IS 'Title count (number of source title variations)';
139 | COMMENT ON COLUMN public.wos_summary.name_count IS 'Name count';
140 | COMMENT ON COLUMN public.wos_summary.doctype_count IS 'Document type count';
141 | COMMENT ON COLUMN public.wos_summary.conference_count IS 'Conference count';
142 | COMMENT ON COLUMN public.wos_summary.language_count IS 'Language count';
143 | COMMENT ON COLUMN public.wos_summary.normalized_language_count IS 'Normalized language count';
144 | COMMENT ON COLUMN public.wos_summary.normalized_doctype_count IS 'Normalized document type count';
145 | COMMENT ON COLUMN public.wos_summary.descriptive_ref_count IS 'Descriptive reference count. Used for qualitative reference count. e.g. "Many refs".';
146 | COMMENT ON COLUMN public.wos_summary.reference_count IS 'Reference count';
147 | COMMENT ON COLUMN public.wos_summary.address_count IS 'Address count';
148 | COMMENT ON COLUMN public.wos_summary.headings_count IS 'Heading count';
149 | COMMENT ON COLUMN public.wos_summary.subheadings_count IS 'Subheadings count';
150 | COMMENT ON COLUMN public.wos_summary.subjects_count IS 'Subjects count';
151 | COMMENT ON COLUMN public.wos_summary.fund_ack IS 'Text of funding acknowledgement';
152 | COMMENT ON COLUMN public.wos_summary.grants_count is 'Grant count';
153 | COMMENT ON COLUMN public.wos_summary.grants_complete IS 'Grants complete';
154 | COMMENT ON COLUMN public.wos_summary.keyword_count IS 'Keyword count';
155 | COMMENT ON COLUMN public.wos_summary.item_coll_id IS 'Item record collection ID';
156 | COMMENT ON COLUMN public.wos_summary.item_ids IS 'ISI Document Solution identifier';
157 | COMMENT ON COLUMN public.wos_summary.item_ids_avail IS 'IDS availability flag';
158 | COMMENT ON COLUMN public.wos_summary.bib_id IS 'Concatenation of volume, issue, page span, date';
159 | COMMENT ON COLUMN public.wos_summary.bib_pagecount IS 'Page count of source.public.tion';
160 | COMMENT ON COLUMN public.wos_summary.bib_pagecount_type IS 'Undocumented';
161 | COMMENT ON COLUMN public.wos_summary.reviewed_language_count IS 'Count of langauges of reviewed work';
162 | COMMENT ON COLUMN public.wos_summary.reviewed_author_count IS 'Count of authors of reviewed work';
163 | COMMENT ON COLUMN public.wos_summary.reviewed_year IS 'Reviewed work year';
164 | COMMENT ON COLUMN public.wos_summary.keywords_plus_count IS 'Keywords Plus count';
165 | COMMENT ON COLUMN public.wos_summary.book_chapters IS 'Book chapter count';
166 | COMMENT ON COLUMN public.wos_summary.book_pages IS 'Book pages';
167 | COMMENT ON COLUMN public.wos_summary.book_notes_count IS 'Count of book notes';
168 | COMMENT ON COLUMN public.wos_summary.chapterlist_count IS 'Listed chapters';
169 | COMMENT ON COLUMN public.wos_summary.contributor_count IS 'Contributor count';
170 |
171 | REVOKE ALL ON TABLE public.wos_summary FROM PUBLIC;
172 | REVOKE ALL ON TABLE public.wos_summary FROM postgres;
173 | GRANT ALL ON TABLE public.wos_summary TO postgres;
174 |
175 | CREATE TABLE public.wos_page (
176 | id character varying NOT NULL,
177 | page_id integer NOT NULL,
178 | page_value character varying,
179 | page_begin character varying,
180 | page_end character varying,
181 | page_count character varying
182 | );
183 |
184 |
185 | COMMENT ON TABLE public.wos_page IS 'Pagination Data';
186 | COMMENT ON COLUMN public.wos_page.id IS 'Record ID (internal primary key)';
187 | COMMENT ON COLUMN public.wos_page.page_id IS 'Order of pagination record (internal primary key)';
188 | COMMENT ON COLUMN public.wos_page.page_value IS 'Pagination.public text';
189 | COMMENT ON COLUMN public.wos_page.page_begin IS 'Starting page number';
190 | COMMENT ON COLUMN public.wos_page.page_end IS 'Ending page number';
191 | COMMENT ON COLUMN public.wos_page.page_count IS 'Page count';
192 |
193 | REVOKE ALL ON TABLE public.wos_page FROM PUBLIC;
194 | REVOKE ALL ON TABLE public.wos_page FROM postgres;
195 | GRANT ALL ON TABLE public.wos_page TO postgres;
196 |
197 | CREATE TABLE public.wos_titles (
198 | id character varying NOT NULL,
199 | title_id integer NOT NULL,
200 | title character varying,
201 | title_type character varying,
202 | lang_id character varying,
203 | translated character varying,
204 | non_english character varying
205 | );
206 |
207 |
208 | COMMENT ON TABLE public.wos_titles IS 'Title Data';
209 | COMMENT ON COLUMN public.wos_titles.id IS 'Record ID (internal primary key)';
210 | COMMENT ON COLUMN public.wos_titles.title_id IS 'Order of title record (internal primary key)';
211 | COMMENT ON COLUMN public.wos_titles.title_type IS 'Title type';
212 | COMMENT ON COLUMN public.wos_titles.lang_id IS 'Language identifier';
213 | COMMENT ON COLUMN public.wos_titles.translated IS 'Translated flag (title has been translated into English)';
214 | COMMENT ON COLUMN public.wos_titles.non_english IS 'Non-English flag (original title not in English)';
215 |
216 | REVOKE ALL ON TABLE public.wos_titles FROM PUBLIC;
217 | REVOKE ALL ON TABLE public.wos_titles FROM postgres;
218 | GRANT ALL ON TABLE public.wos_titles TO postgres;
219 |
220 | CREATE TABLE public.wos_summary_names (
221 | id character varying NOT NULL,
222 | name_id integer NOT NULL,
223 | role character varying NOT NULL,
224 | seq_no character varying,
225 | addr_no_raw character varying,
226 | reprint character varying,
227 | lang_id character varying,
228 | r_id character varying,
229 | r_id_tr character varying,
230 | orcid_id character varying,
231 | orcid_id_tr character varying,
232 | dais_id character varying,
233 | display character varying,
234 | display_name character varying,
235 | full_name character varying,
236 | wos_standard character varying,
237 | prefix character varying,
238 | first_name character varying,
239 | middle_name character varying,
240 | initials character varying,
241 | last_name character varying,
242 | suffix character varying
243 | );
244 |
245 | COMMENT ON TABLE public.wos_summary_names IS 'Name Data from Record Summary';
246 | COMMENT ON COLUMN public.wos_summary_names.id IS 'Record ID (internal primary key)';
247 | COMMENT ON COLUMN public.wos_summary_names.name_id IS 'Sequence number of name in list';
248 | COMMENT ON COLUMN public.wos_summary_names.role IS 'Role of the person or entity identified by the name';
249 | COMMENT ON COLUMN public.wos_summary_names.seq_no IS 'Sequence number of name in list';
250 | COMMENT ON COLUMN public.wos_summary_names.addr_no_raw IS 'Raw address numbers, may be more than one separated by space';
251 | COMMENT ON COLUMN public.wos_summary_names.reprint IS 'Reprint author flag';
252 | COMMENT ON COLUMN public.wos_summary_names.lang_id IS 'Language of the name';
253 | COMMENT ON COLUMN public.wos_summary_names.r_id IS 'ResearcherID identifier';
254 | COMMENT ON COLUMN public.wos_summary_names.r_id_tr IS 'ResearcherID identifier as captured by TR';
255 | COMMENT ON COLUMN public.wos_summary_names.orcid_id IS 'ORCID identifier';
256 | COMMENT ON COLUMN public.wos_summary_names.orcid_id_tr IS 'ORCID identifier as captured by TR';
257 | COMMENT ON COLUMN public.wos_summary_names.dais_id IS 'Distinct Author Identification System identifier';
258 | COMMENT ON COLUMN public.wos_summary_names.display IS 'Display flag. Used to indicate whether a name is displayed in full record.';
259 | COMMENT ON COLUMN public.wos_summary_names.display_name IS 'Name as displayed in record retrieved from database';
260 | COMMENT ON COLUMN public.wos_summary_names.full_name IS 'Full name';
261 | COMMENT ON COLUMN public.wos_summary_names.wos_standard IS 'Name in Web of Science standard format';
262 | COMMENT ON COLUMN public.wos_summary_names.prefix IS 'Name prefix';
263 | COMMENT ON COLUMN public.wos_summary_names.first_name IS 'First (given) name';
264 | COMMENT ON COLUMN public.wos_summary_names.middle_name IS 'Middle name';
265 | COMMENT ON COLUMN public.wos_summary_names.initials IS 'Initials';
266 | COMMENT ON COLUMN public.wos_summary_names.last_name IS 'Last name (surname)';
267 | COMMENT ON COLUMN public.wos_summary_names.suffix IS 'Name suffix';
268 |
269 | REVOKE ALL ON TABLE public.wos_summary_names FROM PUBLIC;
270 | REVOKE ALL ON TABLE public.wos_summary_names FROM postgres;
271 | GRANT ALL ON TABLE public.wos_summary_names TO postgres;
272 |
273 | CREATE TABLE public.wos_summary_names_email_addr (
274 | id character varying NOT NULL,
275 | name_id integer NOT NULL,
276 | email_id integer NOT NULL,
277 | email_addr character varying NOT NULL,
278 | lang_id character varying
279 | );
280 |
281 | COMMENT ON TABLE public.wos_summary_names_email_addr IS 'Email Address Data from Record Summary Names';
282 | COMMENT ON COLUMN public.wos_summary_names_email_addr.id IS 'Record ID (internal primary key)';
283 | COMMENT ON COLUMN public.wos_summary_names_email_addr.name_id IS 'Sequence number of associated name in list';
284 | COMMENT ON COLUMN public.wos_summary_names_email_addr.email_id IS 'Sequence number of email address';
285 | COMMENT ON COLUMN public.wos_summary_names_email_addr.email_addr IS 'Email address';
286 | COMMENT ON COLUMN public.wos_summary_names_email_addr.lang_id IS 'Language of email address';
287 |
288 | REVOKE ALL ON TABLE public.wos_summary_names_email_addr FROM PUBLIC;
289 | REVOKE ALL ON TABLE public.wos_summary_names_email_addr FROM postgres;
290 | GRANT ALL ON TABLE public.wos_summary_names_email_addr TO postgres;
291 |
292 | CREATE TABLE public.wos_doctypes (
293 | id character varying NOT NULL,
294 | doctype_id integer NOT NULL,
295 | doctype character varying,
296 | code character varying
297 | );
298 |
299 | COMMENT ON TABLE public.wos_doctypes IS 'Summary Document Type Data';
300 | COMMENT ON COLUMN public.wos_doctypes.id IS 'Record ID (internal primary key)';
301 | COMMENT ON COLUMN public.wos_doctypes.doctype_id IS 'Order of document type record (internal primary key)';
302 | COMMENT ON COLUMN public.wos_doctypes.doctype IS 'Document type';
303 | COMMENT ON COLUMN public.wos_doctypes.code IS 'Undocumented';
304 |
305 | REVOKE ALL ON TABLE public.wos_doctypes FROM PUBLIC;
306 | REVOKE ALL ON TABLE public.wos_doctypes FROM postgres;
307 | GRANT ALL ON TABLE public.wos_doctypes TO postgres;
308 |
309 | CREATE TABLE public.wos_normalized_doctypes (
310 | id character varying NOT NULL,
311 | doctype_id integer NOT NULL,
312 | doctype character varying,
313 | code character varying
314 | );
315 |
316 | COMMENT ON TABLE public.wos_normalized_doctypes IS 'Full Record Metadata Normalized Document Type Data';
317 | COMMENT ON COLUMN public.wos_normalized_doctypes.id IS 'Record ID (internal primary key)';
318 | COMMENT ON COLUMN public.wos_normalized_doctypes.doctype_id IS 'Order of document type record (internal primary key)';
319 | COMMENT ON COLUMN public.wos_normalized_doctypes.doctype IS 'Normalized_document type';
320 | COMMENT ON COLUMN public.wos_normalized_doctypes.code IS 'Undocumented';
321 |
322 | REVOKE ALL ON TABLE public.wos_normalized_doctypes FROM PUBLIC;
323 | REVOKE ALL ON TABLE public.wos_normalized_doctypes FROM postgres;
324 | GRANT ALL ON TABLE public.wos_normalized_doctypes TO postgres;
325 |
326 | CREATE TABLE public.wos_languages (
327 | id character varying NOT NULL,
328 | language_id integer NOT NULL,
329 | language character varying,
330 | language_type character varying,
331 | status character varying
332 | );
333 |
334 | COMMENT ON TABLE public.wos_languages IS 'Full Record Metadata Language Data';
335 | COMMENT ON COLUMN public.wos_languages.id IS 'Record ID (internal primary key)';
336 | COMMENT ON COLUMN public.wos_languages.language_id IS 'Order of document type record (internal primary key)';
337 | COMMENT ON COLUMN public.wos_languages.language IS 'Language';
338 | COMMENT ON COLUMN public.wos_languages.language_type IS 'Undocumented';
339 | COMMENT ON COLUMN public.wos_languages.status IS 'Undocumented';
340 |
341 | REVOKE ALL ON TABLE public.wos_languages FROM PUBLIC;
342 | REVOKE ALL ON TABLE public.wos_languages FROM postgres;
343 | GRANT ALL ON TABLE public.wos_languages TO postgres;
344 |
345 | CREATE TABLE public.wos_normalized_languages (
346 | id character varying NOT NULL,
347 | language_id integer NOT NULL,
348 | language character varying,
349 | language_type character varying,
350 | status character varying
351 | );
352 |
353 | COMMENT ON TABLE public.wos_normalized_languages IS 'Full Record Metadata Normalized Language Data';
354 | COMMENT ON COLUMN public.wos_normalized_languages.id IS 'Record ID (internal primary key)';
355 | COMMENT ON COLUMN public.wos_normalized_languages.language_id IS 'Order of document type record (internal primary key)';
356 | COMMENT ON COLUMN public.wos_normalized_languages.language IS 'Normalized Language';
357 | COMMENT ON COLUMN public.wos_normalized_languages.language_type IS 'Undocumented';
358 | COMMENT ON COLUMN public.wos_normalized_languages.status IS 'Undocumented';
359 |
360 | REVOKE ALL ON TABLE public.wos_normalized_languages FROM PUBLIC;
361 | REVOKE ALL ON TABLE public.wos_normalized_languages FROM postgres;
362 | GRANT ALL ON TABLE public.wos_normalized_languages TO postgres;
363 |
364 | CREATE TABLE public.wos_conference (
365 | id character varying NOT NULL,
366 | conf_record_id integer NOT NULL,
367 | conf_id character varying,
368 | conf_info_count character varying,
369 | conf_title_count character varying,
370 | conf_date_count character varying,
371 | conf_location_count character varying,
372 | sponsor_count character varying,
373 | conf_type character varying,
374 | lang_id character varying
375 | );
376 |
377 |
378 | COMMENT ON TABLE public.wos_conference IS 'Summary Conference Data';
379 | COMMENT ON COLUMN public.wos_conference.id IS 'Record ID (internal primary key)';
380 | COMMENT ON COLUMN public.wos_conference.conf_record_id IS 'Order of conference record (internal primary key)';
381 | COMMENT ON COLUMN public.wos_conference.conf_id IS 'Conference identifier';
382 | COMMENT ON COLUMN public.wos_conference.conf_info_count IS 'conf_info count. There may be multiple variations of conference information for one conference.';
383 | COMMENT ON COLUMN public.wos_conference.conf_title_count IS 'Conference title count';
384 | COMMENT ON COLUMN public.wos_conference.conf_date_count IS 'Conference date count';
385 | COMMENT ON COLUMN public.wos_conference.conf_location_count IS 'Conference location count';
386 | COMMENT ON COLUMN public.wos_conference.sponsor_count IS 'Conference sponsors count';
387 | COMMENT ON COLUMN public.wos_conference.conf_type IS 'Undocumented';
388 | COMMENT ON COLUMN public.wos_conference.lang_id IS 'Undocumented';
389 |
390 | REVOKE ALL ON TABLE public.wos_conference FROM PUBLIC;
391 | REVOKE ALL ON TABLE public.wos_conference FROM postgres;
392 | GRANT ALL ON TABLE public.wos_conference TO postgres;
393 |
394 | CREATE TABLE public.wos_conf_info (
395 | id character varying NOT NULL,
396 | conf_record_id integer NOT NULL,
397 | info_id integer NOT NULL,
398 | conf_info character varying,
399 | lang_id character varying
400 | );
401 |
402 |
403 | COMMENT ON TABLE public.wos_conf_info IS 'Summary Conference Info Data';
404 | COMMENT ON COLUMN public.wos_conf_info.id IS 'Record ID (internal primary key)';
405 | COMMENT ON COLUMN public.wos_conf_info.conf_record_id IS 'Sequence number of associated conference';
406 | COMMENT ON COLUMN public.wos_conf_info.info_id IS 'Order of conference info record (internal primary key)';
407 | COMMENT ON COLUMN public.wos_conf_info.conf_info IS 'Concatenation of conference title, conference date and conference location';
408 | COMMENT ON COLUMN public.wos_conf_info.lang_id IS 'Undocumented';
409 |
410 | REVOKE ALL ON TABLE public.wos_conf_info FROM PUBLIC;
411 | REVOKE ALL ON TABLE public.wos_conf_info FROM postgres;
412 | GRANT ALL ON TABLE public.wos_conf_info TO postgres;
413 |
414 | CREATE TABLE public.wos_conf_title (
415 | id character varying NOT NULL,
416 | conf_record_id integer NOT NULL,
417 | title_id integer NOT NULL,
418 | conf_title character varying,
419 | lang_id character varying
420 | );
421 |
422 |
423 | COMMENT ON TABLE public.wos_conf_title IS 'Summary Conference Title Data';
424 | COMMENT ON COLUMN public.wos_conf_title.id IS 'Record ID (internal primary key)';
425 | COMMENT ON COLUMN public.wos_conf_title.conf_record_id IS 'Sequence number of associated conference';
426 | COMMENT ON COLUMN public.wos_conf_title.title_id IS 'Order of conference info record (internal primary key)';
427 | COMMENT ON COLUMN public.wos_conf_title.conf_title IS 'Conference title';
428 | COMMENT ON COLUMN public.wos_conf_title.lang_id IS 'Language of conference title';
429 |
430 | REVOKE ALL ON TABLE public.wos_conf_title FROM PUBLIC;
431 | REVOKE ALL ON TABLE public.wos_conf_title FROM postgres;
432 | GRANT ALL ON TABLE public.wos_conf_title TO postgres;
433 |
434 | CREATE TABLE public.wos_conf_date (
435 | id character varying NOT NULL,
436 | conf_record_id integer NOT NULL,
437 | date_id integer NOT NULL,
438 | conf_date character varying,
439 | conf_start character varying,
440 | conf_end character varying,
441 | display_date character varying,
442 | lang_id character varying
443 | );
444 |
445 | COMMENT ON TABLE public.wos_conf_date IS 'Summary Conference Date Data';
446 | COMMENT ON COLUMN public.wos_conf_date.id IS 'Record ID (internal primary key)';
447 | COMMENT ON COLUMN public.wos_conf_date.conf_record_id IS 'Sequence number of associated conference';
448 | COMMENT ON COLUMN public.wos_conf_date.date_id IS 'Order of conference info record (internal primary key)';
449 | COMMENT ON COLUMN public.wos_conf_date.conf_date IS 'Conference date';
450 | COMMENT ON COLUMN public.wos_conf_date.conf_start IS 'Conference start date';
451 | COMMENT ON COLUMN public.wos_conf_date.conf_end IS 'Conference end date';
452 | COMMENT ON COLUMN public.wos_conf_date.display_date IS 'Display date from source item';
453 | COMMENT ON COLUMN public.wos_conf_date.lang_id IS 'Language of conference date';
454 |
455 | REVOKE ALL ON TABLE public.wos_conf_date FROM PUBLIC;
456 | REVOKE ALL ON TABLE public.wos_conf_date FROM postgres;
457 | GRANT ALL ON TABLE public.wos_conf_date TO postgres;
458 |
459 | CREATE TABLE public.wos_conf_location (
460 | id character varying NOT NULL,
461 | conf_record_id integer NOT NULL,
462 | location_id integer NOT NULL,
463 | composite_location character varying,
464 | composite_lang_id character varying,
465 | conf_host character varying,
466 | host_lang_id character varying,
467 | conf_city character varying,
468 | city_lang_id character varying,
469 | conf_state character varying,
470 | state_lang_id character varying
471 | );
472 |
473 | COMMENT ON TABLE public.wos_conf_location IS 'Summary Conference Location Data';
474 | COMMENT ON COLUMN public.wos_conf_location.id IS 'Record ID (internal primary key)';
475 | COMMENT ON COLUMN public.wos_conf_location.conf_record_id IS 'Sequence number of associated conference';
476 | COMMENT ON COLUMN public.wos_conf_location.location_id IS 'Order of conference info record (internal primary key)';
477 | COMMENT ON COLUMN public.wos_conf_location.composite_location IS 'Full conference location';
478 | COMMENT ON COLUMN public.wos_conf_location.composite_lang_id IS 'Language of conference location';
479 | COMMENT ON COLUMN public.wos_conf_location.conf_host IS 'Conference location host';
480 | COMMENT ON COLUMN public.wos_conf_location.host_lang_id IS 'Language of conference host data';
481 | COMMENT ON COLUMN public.wos_conf_location.conf_city IS 'Conference city';
482 | COMMENT ON COLUMN public.wos_conf_location.city_lang_id IS 'Language of conference city data';
483 | COMMENT ON COLUMN public.wos_conf_location.conf_state IS 'U.S. State or Canadian province';
484 | COMMENT ON COLUMN public.wos_conf_location.city_lang_id IS 'Language of conference state data';
485 |
486 | REVOKE ALL ON TABLE public.wos_conf_location FROM PUBLIC;
487 | REVOKE ALL ON TABLE public.wos_conf_location FROM postgres;
488 | GRANT ALL ON TABLE public.wos_conf_location TO postgres;
489 |
490 | CREATE TABLE public.wos_conf_sponsor (
491 | id character varying NOT NULL,
492 | conf_record_id integer NOT NULL,
493 | sponsor_id integer NOT NULL,
494 | sponsor character varying,
495 | lang_id character varying
496 | );
497 |
498 |
499 | COMMENT ON TABLE public.wos_conf_sponsor IS 'Summary Conference Sponsor Data';
500 | COMMENT ON COLUMN public.wos_conf_sponsor.id IS 'Record ID (internal primary key)';
501 | COMMENT ON COLUMN public.wos_conf_sponsor.conf_record_id IS 'Sequence number of associated conference';
502 | COMMENT ON COLUMN public.wos_conf_sponsor.sponsor_id IS 'Order of conference info record (internal primary key)';
503 | COMMENT ON COLUMN public.wos_conf_sponsor.sponsor IS 'Conference sponsor';
504 | COMMENT ON COLUMN public.wos_conf_sponsor.lang_id IS 'Language of conference sponsor data';
505 |
506 | REVOKE ALL ON TABLE public.wos_conf_sponsor FROM PUBLIC;
507 | REVOKE ALL ON TABLE public.wos_conf_sponsor FROM postgres;
508 | GRANT ALL ON TABLE public.wos_conf_sponsor TO postgres;
509 |
510 | CREATE TABLE public.wos_publisher (
511 | id character varying NOT NULL,
512 | publisher_id integer NOT NULL,
513 | addr_type character varying,
514 | addr_no character varying,
515 | full_address character varying,
516 | full_address_lang_id character varying,
517 | organization_count character varying,
518 | suborganization_count character varying,
519 | email_addr_count character varying,
520 | url_type character varying,
521 | url_date_info character varying,
522 | url_create_date character varying,
523 | url_revised_date character varying,
524 | url_cited_date character varying,
525 | url character varying,
526 | doi_count character varying,
527 | laboratory character varying,
528 | laboratory_lang_id character varying,
529 | street character varying,
530 | street_lang_id character varying,
531 | city character varying,
532 | city_lang_id character varying,
533 | province character varying,
534 | province_lang_id character varying,
535 | state character varying,
536 | state_lang_id character varying,
537 | country character varying,
538 | country_lang_id character varying,
539 | post_num character varying,
540 | post_num_lang_id character varying,
541 | name_count character varying
542 | );
543 |
544 |
545 | COMMENT ON TABLE public.wos_publisher IS 'Summary Publisher Data';
546 | COMMENT ON COLUMN public.wos_publisher.id IS 'Record ID (internal primary key)';
547 | COMMENT ON COLUMN public.wos_publisher.publisher_id IS 'Order of publisher record (internal primary key)';
548 | COMMENT ON COLUMN public.wos_publisher.addr_type IS 'Address type';
549 | COMMENT ON COLUMN public.wos_publisher.addr_no IS 'Address number. Used to link a specific author/publisher to a specific address.';
550 | COMMENT ON COLUMN public.wos_publisher.full_address IS 'Full address';
551 | COMMENT ON COLUMN public.wos_publisher.full_address_lang_id IS 'Language of full address data';
552 | COMMENT ON COLUMN public.wos_publisher.organization_count IS 'Organizations count';
553 | COMMENT ON COLUMN public.wos_publisher.suborganization_count IS 'Suborganizations count';
554 | COMMENT ON COLUMN public.wos_publisher.email_addr_count IS 'Email address count';
555 | COMMENT ON COLUMN public.wos_publisher.url_type IS 'URL type';
556 | COMMENT ON COLUMN public.wos_publisher.url_date_info IS 'Unstructured URL date information';
557 | COMMENT ON COLUMN public.wos_publisher.url_create_date IS 'URL create date';
558 | COMMENT ON COLUMN public.wos_publisher.url_revised_date IS 'Last date the URL was revised';
559 | COMMENT ON COLUMN public.wos_publisher.url_cited_date IS 'Date the URL was cited';
560 | COMMENT ON COLUMN public.wos_publisher.url IS 'URL';
561 | COMMENT ON COLUMN public.wos_publisher.doi_count IS 'Count of URL related DOIs';
562 | COMMENT ON COLUMN public.wos_publisher.laboratory IS 'Laboratory';
563 | COMMENT ON COLUMN public.wos_publisher.laboratory_lang_id IS 'Language of laboratory data';
564 | COMMENT ON COLUMN public.wos_publisher.street IS 'Street address';
565 | COMMENT ON COLUMN public.wos_publisher.street_lang_id IS 'Language of street address';
566 | COMMENT ON COLUMN public.wos_publisher.city IS 'City';
567 | COMMENT ON COLUMN public.wos_publisher.city_lang_id IS 'Language of city data';
568 | COMMENT ON COLUMN public.wos_publisher.province IS 'Province';
569 | COMMENT ON COLUMN public.wos_publisher.province_lang_id IS 'Language of province data';
570 | COMMENT ON COLUMN public.wos_publisher.state IS 'U.S. state or Canadian province';
571 | COMMENT ON COLUMN public.wos_publisher.state_lang_id IS 'Language of state data';
572 | COMMENT ON COLUMN public.wos_publisher.country IS 'Country';
573 | COMMENT ON COLUMN public.wos_publisher.country_lang_id IS 'Language of country data';
574 | COMMENT ON COLUMN public.wos_publisher.post_num IS 'Postal number';
575 | COMMENT ON COLUMN public.wos_publisher.post_num_lang_id IS 'Language of postal number';
576 | COMMENT ON COLUMN public.wos_publisher.name_count IS 'Count of publisher names';
577 |
578 | REVOKE ALL ON TABLE public.wos_publisher FROM PUBLIC;
579 | REVOKE ALL ON TABLE public.wos_publisher FROM postgres;
580 | GRANT ALL ON TABLE public.wos_publisher TO postgres;
581 |
582 | CREATE TABLE public.wos_publisher_names (
583 | id character varying NOT NULL,
584 | publisher_id integer NOT NULL,
585 | name_id integer NOT NULL,
586 | role character varying NOT NULL,
587 | seq_no character varying,
588 | reprint character varying,
589 | lang_id character varying,
590 | addr_no_raw character varying,
591 | r_id character varying,
592 | r_id_tr character varying,
593 | orcid_id character varying,
594 | orcid_id_tr character varying,
595 | dais_id character varying,
596 | display character varying,
597 | display_name character varying,
598 | full_name character varying,
599 | wos_standard character varying,
600 | prefix character varying,
601 | first_name character varying,
602 | middle_name character varying,
603 | initials character varying,
604 | last_name character varying,
605 | suffix character varying
606 | );
607 |
608 | COMMENT ON TABLE public.wos_publisher_names IS 'Name Data from Publishers';
609 | COMMENT ON COLUMN public.wos_publisher_names.id IS 'Record ID (internal primary key)';
610 | COMMENT ON COLUMN public.wos_publisher_names.publisher_id IS 'Sequence number of associated publisher';
611 | COMMENT ON COLUMN public.wos_publisher_names.name_id IS 'Sequence number of name in list';
612 | COMMENT ON COLUMN public.wos_publisher_names.role IS 'Role of the person or entity identified by the name';
613 | COMMENT ON COLUMN public.wos_publisher_names.reprint IS 'Reprint author flag';
614 | COMMENT ON COLUMN public.wos_publisher_names.lang_id IS 'Language of the name';
615 | COMMENT ON COLUMN public.wos_publisher_names.addr_no_raw IS 'Number that links a specific author to a specific address.';
616 | COMMENT ON COLUMN public.wos_publisher_names.r_id IS 'ResearcherID identifier';
617 | COMMENT ON COLUMN public.wos_publisher_names.r_id_tr IS 'ResearcherID identifier as captured by TR';
618 | COMMENT ON COLUMN public.wos_publisher_names.orcid_id IS 'ORCID identifier';
619 | COMMENT ON COLUMN public.wos_publisher_names.orcid_id_tr IS 'ORCID identifier as captured by TR';
620 | COMMENT ON COLUMN public.wos_publisher_names.dais_id IS 'Distinct Author Identification System identifier';
621 | COMMENT ON COLUMN public.wos_publisher_names.display IS 'Display flag. Used to indicate whether a name is displayed in full record.';
622 | COMMENT ON COLUMN public.wos_publisher_names.display_name IS 'Name as displayed in record retrieved from database';
623 | COMMENT ON COLUMN public.wos_publisher_names.full_name IS 'Full name';
624 | COMMENT ON COLUMN public.wos_publisher_names.wos_standard IS 'Name in Web of Science standard format';
625 | COMMENT ON COLUMN public.wos_publisher_names.prefix IS 'Name prefix';
626 | COMMENT ON COLUMN public.wos_publisher_names.first_name IS 'First (given) name';
627 | COMMENT ON COLUMN public.wos_publisher_names.middle_name IS 'Middle name';
628 | COMMENT ON COLUMN public.wos_publisher_names.initials IS 'Initials';
629 | COMMENT ON COLUMN public.wos_publisher_names.last_name IS 'Last name (surname)';
630 | COMMENT ON COLUMN public.wos_publisher_names.suffix IS 'Name suffix';
631 |
632 | REVOKE ALL ON TABLE public.wos_publisher_names FROM PUBLIC;
633 | REVOKE ALL ON TABLE public.wos_publisher_names FROM postgres;
634 | GRANT ALL ON TABLE public.wos_publisher_names TO postgres;
635 |
636 | CREATE TABLE public.wos_edition (
637 | id character varying NOT NULL,
638 | edition_ctr integer NOT NULL,
639 | edition character varying
640 | );
641 |
642 |
643 | COMMENT ON TABLE public.wos_edition IS 'Web Of Science database editions';
644 | COMMENT ON COLUMN public.wos_edition.id IS 'Record ID (internal primary key)';
645 | COMMENT ON COLUMN public.wos_edition.edition IS 'Associated Database Edition';
646 | REVOKE ALL ON TABLE public.wos_edition FROM PUBLIC;
647 | REVOKE ALL ON TABLE public.wos_edition FROM postgres;
648 | GRANT ALL ON TABLE public.wos_edition TO postgres;
649 |
650 | CREATE TABLE public.wos_references (
651 | id character varying NOT NULL,
652 | ref_ctr integer NOT NULL,
653 | ref_id character varying,
654 | cited_author character varying,
655 | assignee character varying,
656 | year character varying,
657 | page character varying,
658 | volume character varying,
659 | cited_title character varying,
660 | cited_work character varying,
661 | doi character varying,
662 | art_no character varying,
663 | patent_no character varying
664 | );
665 |
666 |
667 | COMMENT ON TABLE public.wos_references IS 'Reference Details';
668 | COMMENT ON COLUMN public.wos_references.id IS 'Record ID (internal primary key)';
669 | COMMENT ON COLUMN public.wos_references.ref_ctr IS 'Order of Reference Record';
670 | COMMENT ON COLUMN public.wos_references.ref_id IS 'Unique WoS Identifier (within a collection)';
671 | COMMENT ON COLUMN public.wos_references.cited_author IS 'Cited Author';
672 | COMMENT ON COLUMN public.wos_references.assignee IS 'Assignee';
673 | COMMENT ON COLUMN public.wos_references.year IS 'Year';
674 | COMMENT ON COLUMN public.wos_references.page IS 'Page';
675 | COMMENT ON COLUMN public.wos_references.volume IS 'Volume';
676 | COMMENT ON COLUMN public.wos_references.cited_title IS 'Cited Title - Cited Title is only available is the cited reference clusters with a source iteam, or if a "full Cited Reference" capture provided one';
677 | COMMENT ON COLUMN public.wos_references.cited_work IS 'Cited Work';
678 | COMMENT ON COLUMN public.wos_references.doi IS 'Digital Object Identifier';
679 | COMMENT ON COLUMN public.wos_references.art_no IS 'Art No (Undocumented)';
680 | COMMENT ON COLUMN public.wos_references.patent_no IS 'Patent Number';
681 |
682 | REVOKE ALL ON TABLE public.wos_references FROM PUBLIC;
683 | REVOKE ALL ON TABLE public.wos_references FROM postgres;
684 | GRANT ALL ON TABLE public.wos_references TO postgres;
685 |
686 | CREATE TABLE public.wos_addresses (
687 | id character varying NOT NULL,
688 | addr_id integer NOT NULL,
689 | addr_type character varying,
690 | addr_no character varying,
691 | full_address character varying,
692 | full_address_lang_id character varying,
693 | organization_count character varying,
694 | suborganization_count character varying,
695 | url_type character varying,
696 | url_date_info character varying,
697 | url_create_date character varying,
698 | url_revised_date character varying,
699 | url_cited_date character varying,
700 | url character varying,
701 | laboratory character varying,
702 | laboratory_lang_id character varying,
703 | street character varying,
704 | street_lang_id character varying,
705 | city character varying,
706 | city_lang_id character varying,
707 | province character varying,
708 | province_lang_id character varying,
709 | state character varying,
710 | state_lang_id character varying,
711 | country character varying,
712 | country_lang_id character varying,
713 | post_num character varying,
714 | post_num_lang_id character varying,
715 | name_count character varying
716 | );
717 |
718 |
719 | COMMENT ON TABLE public.wos_addresses is 'Full Record Metadata Address Data';
720 | COMMENT ON COLUMN public.wos_addresses.id IS 'Record ID (internal primary key)';
721 | COMMENT ON COLUMN public.wos_addresses.addr_id IS 'Order of address record (internal primary key)';
722 | COMMENT ON COLUMN public.wos_addresses.addr_type IS 'Address type';
723 | COMMENT ON COLUMN public.wos_addresses.addr_no IS 'Address number. Used to link a specific author/publisher to a specific address.';
724 | COMMENT ON COLUMN public.wos_addresses.full_address IS 'Full address';
725 | COMMENT ON COLUMN public.wos_addresses.full_address_lang_id IS 'Language of full address data';
726 | COMMENT ON COLUMN public.wos_addresses.organization_count IS 'Organizations count';
727 | COMMENT ON COLUMN public.wos_addresses.suborganization_count IS 'Suborganizations count';
728 | COMMENT ON COLUMN public.wos_addresses.url_type IS 'URL type';
729 | COMMENT ON COLUMN public.wos_addresses.url_date_info IS 'Unstructured URL date information';
730 | COMMENT ON COLUMN public.wos_addresses.url_create_date IS 'URL create date';
731 | COMMENT ON COLUMN public.wos_addresses.url_revised_date IS 'Last date the URL was revised';
732 | COMMENT ON COLUMN public.wos_addresses.url_cited_date IS 'Date the URL was cited';
733 | COMMENT ON COLUMN public.wos_addresses.url IS 'URL';
734 | COMMENT ON COLUMN public.wos_addresses.laboratory IS 'Laboratory';
735 | COMMENT ON COLUMN public.wos_addresses.laboratory_lang_id IS 'Language of laboratory data';
736 | COMMENT ON COLUMN public.wos_addresses.street IS 'Street address';
737 | COMMENT ON COLUMN public.wos_addresses.street_lang_id IS 'Language of street address';
738 | COMMENT ON COLUMN public.wos_addresses.city IS 'City';
739 | COMMENT ON COLUMN public.wos_addresses.city_lang_id IS 'Language of city data';
740 | COMMENT ON COLUMN public.wos_addresses.province IS 'Province';
741 | COMMENT ON COLUMN public.wos_addresses.province_lang_id IS 'Language of province data';
742 | COMMENT ON COLUMN public.wos_addresses.state IS 'U.S. state or Canadian province';
743 | COMMENT ON COLUMN public.wos_addresses.state_lang_id IS 'Language of state data';
744 | COMMENT ON COLUMN public.wos_addresses.country IS 'Country';
745 | COMMENT ON COLUMN public.wos_addresses.country_lang_id IS 'Language of country data';
746 | COMMENT ON COLUMN public.wos_addresses.post_num IS 'Postal number';
747 | COMMENT ON COLUMN public.wos_addresses.post_num_lang_id IS 'Language of postal number';
748 | COMMENT ON COLUMN public.wos_addresses.name_count IS 'Count of related names';
749 |
750 | REVOKE ALL ON TABLE public.wos_addresses FROM PUBLIC;
751 | REVOKE ALL ON TABLE public.wos_addresses FROM postgres;
752 | GRANT ALL ON TABLE public.wos_addresses TO postgres;
753 |
754 | CREATE TABLE public.wos_address_names (
755 | id character varying NOT NULL,
756 | addr_id integer NOT NULL,
757 | name_id integer NOT NULL,
758 | addr_no_raw character varying,
759 | seq_no character varying,
760 | role character varying,
761 | reprint character varying,
762 | lang_id character varying,
763 | addr_no character varying,
764 | r_id character varying,
765 | r_id_tr character varying,
766 | orcid_id character varying,
767 | orcid_id_tr character varying,
768 | dais_id character varying,
769 | display character varying,
770 | display_name character varying,
771 | full_name character varying,
772 | wos_standard character varying,
773 | prefix character varying,
774 | first_name character varying,
775 | middle_name character varying,
776 | initials character varying,
777 | last_name character varying,
778 | suffix character varying
779 | );
780 |
781 | COMMENT ON TABLE public.wos_address_names IS 'Name Data from Addresses';
782 | COMMENT ON COLUMN public.wos_address_names.id IS 'Record ID (internal primary key)';
783 | COMMENT ON COLUMN public.wos_address_names.addr_id IS 'Sequence number of associated address';
784 | COMMENT ON COLUMN public.wos_address_names.name_id IS 'Sequence number of name in list';
785 | COMMENT ON COLUMN public.wos_address_names.role IS 'Role of the person or entity identified by the name';
786 | COMMENT ON COLUMN public.wos_address_names.reprint IS 'Reprint author flag';
787 | COMMENT ON COLUMN public.wos_address_names.lang_id IS 'Language of the name';
788 | COMMENT ON COLUMN public.wos_address_names.addr_no IS 'Number that links a specific author to a specific address.';
789 | COMMENT ON COLUMN public.wos_address_names.r_id IS 'ResearcherID identifier';
790 | COMMENT ON COLUMN public.wos_address_names.r_id_tr IS 'ResearcherID identifier as captured by TR';
791 | COMMENT ON COLUMN public.wos_address_names.orcid_id IS 'ORCID identifier';
792 | COMMENT ON COLUMN public.wos_address_names.orcid_id_tr IS 'ORCID identifier as captured by TR';
793 | COMMENT ON COLUMN public.wos_address_names.dais_id IS 'Distinct Author Identification System identifier';
794 | COMMENT ON COLUMN public.wos_address_names.display IS 'Display flag. Used to indicate whether a name is displayed in full record.';
795 | COMMENT ON COLUMN public.wos_address_names.display_name IS 'Name as displayed in record retrieved from database';
796 | COMMENT ON COLUMN public.wos_address_names.full_name IS 'Full name';
797 | COMMENT ON COLUMN public.wos_address_names.wos_standard IS 'Name in Web of Science standard format';
798 | COMMENT ON COLUMN public.wos_address_names.prefix IS 'Name prefix';
799 | COMMENT ON COLUMN public.wos_address_names.first_name IS 'First (given) name';
800 | COMMENT ON COLUMN public.wos_address_names.middle_name IS 'Middle name';
801 | COMMENT ON COLUMN public.wos_address_names.initials IS 'Initials';
802 | COMMENT ON COLUMN public.wos_address_names.last_name IS 'Last name (surname)';
803 | COMMENT ON COLUMN public.wos_address_names.suffix IS 'Name suffix';
804 |
805 | REVOKE ALL ON TABLE public.wos_address_names FROM PUBLIC;
806 | REVOKE ALL ON TABLE public.wos_address_names FROM postgres;
807 | GRANT ALL ON TABLE public.wos_address_names TO postgres;
808 |
809 | CREATE TABLE public.wos_address_names_email_addr (
810 | id character varying NOT NULL,
811 | addr_id integer NOT NULL,
812 | name_id integer NOT NULL,
813 | email_id integer NOT NULL,
814 | email_addr character varying,
815 | lang_id character varying
816 | );
817 |
818 | COMMENT ON TABLE public.wos_address_names_email_addr IS 'Email Address Data from Address Names';
819 | COMMENT ON COLUMN public.wos_address_names_email_addr.id IS 'Record ID (internal primary key)';
820 | COMMENT ON COLUMN public.wos_address_names_email_addr.addr_id IS 'Sequence number of associated address';
821 | COMMENT ON COLUMN public.wos_address_names_email_addr.name_id IS 'Sequence number of associated name';
822 | COMMENT ON COLUMN public.wos_address_names_email_addr.email_addr IS 'Email address';
823 | COMMENT ON COLUMN public.wos_address_names_email_addr.lang_id IS 'Language ID';
824 |
825 | REVOKE ALL ON TABLE public.wos_address_names_email_addr FROM PUBLIC;
826 | REVOKE ALL ON TABLE public.wos_address_names_email_addr FROM postgres;
827 | GRANT ALL ON TABLE public.wos_address_names_email_addr TO postgres;
828 |
829 | CREATE TABLE public.wos_address_zip (
830 | id character varying NOT NULL,
831 | addr_id integer NOT NULL,
832 | zip_id integer NOT NULL,
833 | zip character varying,
834 | lang_id character varying,
835 | location character varying
836 | );
837 |
838 | COMMENT ON TABLE public.wos_address_zip IS 'Zip Code Data from Addresses';
839 | COMMENT ON COLUMN public.wos_address_zip.id IS 'Record ID (internal primary key)';
840 | COMMENT ON COLUMN public.wos_address_zip.addr_id IS 'Sequence number of associated address';
841 | COMMENT ON COLUMN public.wos_address_zip.zip IS 'Zip code or postal code';
842 | COMMENT ON COLUMN public.wos_address_zip.lang_id IS 'Language of zip code data';
843 | COMMENT ON COLUMN public.wos_address_zip.location IS 'Undocumented';
844 |
845 | REVOKE ALL ON TABLE public.wos_address_zip FROM PUBLIC;
846 | REVOKE ALL ON TABLE public.wos_address_zip FROM postgres;
847 | GRANT ALL ON TABLE public.wos_address_zip TO postgres;
848 |
849 | CREATE TABLE public.wos_address_organizations (
850 | id character varying NOT NULL,
851 | addr_id integer NOT NULL,
852 | org_id integer NOT NULL,
853 | organization character varying,
854 | lang_id character varying
855 | );
856 |
857 | COMMENT ON TABLE public.wos_address_organizations IS 'Organizations Data from Addresses';
858 | COMMENT ON COLUMN public.wos_address_organizations.id IS 'Record ID (internal primary key)';
859 | COMMENT ON COLUMN public.wos_address_organizations.addr_id IS 'Sequence number of associated address';
860 | COMMENT ON COLUMN public.wos_address_organizations.organization IS 'Organization';
861 | COMMENT ON COLUMN public.wos_address_organizations.lang_id IS 'Language of organization data';
862 |
863 | REVOKE ALL ON TABLE public.wos_address_organizations FROM PUBLIC;
864 | REVOKE ALL ON TABLE public.wos_address_organizations FROM postgres;
865 | GRANT ALL ON TABLE public.wos_address_organizations TO postgres;
866 |
867 | CREATE TABLE public.wos_address_suborganizations (
868 | id character varying NOT NULL,
869 | addr_id integer NOT NULL,
870 | suborg_id integer NOT NULL,
871 | suborganization character varying,
872 | lang_id character varying
873 | );
874 |
875 | COMMENT ON TABLE public.wos_address_suborganizations IS 'Suborganizations Data from Addresses';
876 | COMMENT ON COLUMN public.wos_address_suborganizations.id IS 'Record ID (internal primary key)';
877 | COMMENT ON COLUMN public.wos_address_suborganizations.addr_id IS 'Sequence number of associated address';
878 | COMMENT ON COLUMN public.wos_address_suborganizations.suborganization IS 'Suborganization';
879 | COMMENT ON COLUMN public.wos_address_suborganizations.lang_id IS 'Language of suborganization data';
880 |
881 | REVOKE ALL ON TABLE public.wos_address_suborganizations FROM PUBLIC;
882 | REVOKE ALL ON TABLE public.wos_address_suborganizations FROM postgres;
883 | GRANT ALL ON TABLE public.wos_address_suborganizations TO postgres;
884 |
885 | CREATE TABLE public.wos_headings (
886 | id character varying NOT NULL,
887 | heading_id integer NOT NULL,
888 | heading character varying
889 | );
890 |
891 | COMMENT ON TABLE public.wos_headings IS 'High Level Subject Headings';
892 | COMMENT ON COLUMN public.wos_headings.id IS 'Record ID (internal primary key)';
893 | COMMENT ON COLUMN public.wos_headings.heading_id IS 'Order of heading record (internal primary key)';
894 | COMMENT ON COLUMN public.wos_headings.heading IS 'High-level subject heading';
895 |
896 | REVOKE ALL ON TABLE public.wos_headings FROM PUBLIC;
897 | REVOKE ALL ON TABLE public.wos_headings FROM postgres;
898 | GRANT ALL ON TABLE public.wos_headings TO postgres;
899 |
900 | CREATE TABLE public.wos_subheadings (
901 | id character varying NOT NULL,
902 | subheading_id integer NOT NULL,
903 | subheading character varying
904 | );
905 |
906 | COMMENT ON TABLE public.wos_subheadings IS 'Subject category subheadings';
907 | COMMENT ON COLUMN public.wos_subheadings.id IS 'Record ID (internal primary key)';
908 | COMMENT ON COLUMN public.wos_subheadings.subheading_id IS 'Order of subheading record (internal primary key)';
909 | COMMENT ON COLUMN public.wos_subheadings.subheading IS 'Subject category subheading';
910 |
911 | REVOKE ALL ON TABLE public.wos_subheadings FROM PUBLIC;
912 | REVOKE ALL ON TABLE public.wos_subheadings FROM postgres;
913 | GRANT ALL ON TABLE public.wos_subheadings TO postgres;
914 |
915 | CREATE TABLE public.wos_subjects (
916 | id character varying NOT NULL,
917 | subject_id integer NOT NULL,
918 | subject character varying,
919 | ascatype character varying,
920 | code character varying,
921 | edition character varying
922 | );
923 |
924 | COMMENT ON TABLE public.wos_subjects IS 'Subject categories';
925 | COMMENT ON COLUMN public.wos_subjects.id IS 'Record ID (internal primary key)';
926 | COMMENT ON COLUMN public.wos_subjects.subject_id IS 'Order of subjects record (internal primary key)';
927 | COMMENT ON COLUMN public.wos_subjects.subject IS 'Subject category';
928 | COMMENT ON COLUMN public.wos_subjects.ascatype IS 'Defines the two collection of subject categories used to classify journals in Web of Knowledge';
929 | COMMENT ON COLUMN public.wos_subjects.code IS 'Undocumented';
930 | COMMENT ON COLUMN public.wos_subjects.edition IS 'Undocumented';
931 |
932 | REVOKE ALL ON TABLE public.wos_subjects FROM PUBLIC;
933 | REVOKE ALL ON TABLE public.wos_subjects FROM postgres;
934 | GRANT ALL ON TABLE public.wos_subjects TO postgres;
935 |
936 | CREATE TABLE public.wos_grants (
937 | id character varying NOT NULL,
938 | grant_id integer NOT NULL,
939 | grant_info character varying,
940 | grant_info_language character varying,
941 | grant_agency character varying,
942 | grant_agency_language character varying,
943 | grant_agency_preferred character varying,
944 | alt_agency_count character varying,
945 | grant_id_count character varying,
946 | country character varying,
947 | acronym character varying,
948 | investigator character varying
949 | );
950 |
951 | COMMENT ON TABLE public.wos_grants IS 'Grant data';
952 | COMMENT ON COLUMN public.wos_grants.id IS 'Record ID (internal primary key)';
953 | COMMENT ON COLUMN public.wos_grants.grant_id IS 'Order of grant record (internal primary key)';
954 | COMMENT ON COLUMN public.wos_grants.grant_info IS 'Unparsed grant information';
955 | COMMENT ON COLUMN public.wos_grants.grant_info_language IS 'Language of grant information';
956 | COMMENT ON COLUMN public.wos_grants.grant_agency IS 'Grant agency';
957 | COMMENT ON COLUMN public.wos_grants.grant_agency_language IS 'Language of grant agency';
958 | COMMENT ON COLUMN public.wos_grants.grant_agency_preferred IS 'Preferred agency flag';
959 | COMMENT ON COLUMN public.wos_grants.alt_agency_count IS 'Alternate agency count';
960 | COMMENT ON COLUMN public.wos_grants.grant_id_count IS 'Grant ID count';
961 | COMMENT ON COLUMN public.wos_grants.country IS 'Grant country';
962 | COMMENT ON COLUMN public.wos_grants.acronym IS 'Grant acronym';
963 | COMMENT ON COLUMN public.wos_grants.investigator IS 'Principal investigator';
964 |
965 | REVOKE ALL ON TABLE public.wos_grants FROM PUBLIC;
966 | REVOKE ALL ON TABLE public.wos_grants FROM postgres;
967 | GRANT ALL ON TABLE public.wos_grants TO postgres;
968 |
969 | CREATE TABLE public.wos_grant_ids (
970 | id character varying NOT NULL,
971 | grant_id integer NOT NULL,
972 | id_id integer NOT NULL,
973 | grant_identifier character varying
974 | );
975 |
976 | COMMENT ON TABLE public.wos_grant_ids IS 'Alternate grant agencies';
977 | COMMENT ON COLUMN public.wos_grant_ids.id IS 'Record ID (internal primary key)';
978 | COMMENT ON COLUMN public.wos_grant_ids.grant_id IS 'Order of associated grant record (internal primary key)';
979 | COMMENT ON COLUMN public.wos_grant_ids.id_id IS 'Order of grant ID record (internal primary key)';
980 | COMMENT ON COLUMN public.wos_grant_ids.grant_identifier IS 'Grant ID';
981 |
982 | REVOKE ALL ON TABLE public.wos_grant_ids FROM PUBLIC;
983 | REVOKE ALL ON TABLE public.wos_grant_ids FROM postgres;
984 | GRANT ALL ON TABLE public.wos_grant_ids TO postgres;
985 |
986 | CREATE TABLE public.wos_keywords (
987 | id character varying NOT NULL,
988 | keyword_id integer NOT NULL,
989 | keyword character varying,
990 | keyword_language character varying
991 | );
992 |
993 | COMMENT ON TABLE public.wos_keywords IS 'Keywords';
994 | COMMENT ON COLUMN public.wos_keywords.id IS 'Record ID (internal primary key)';
995 | COMMENT ON COLUMN public.wos_keywords.keyword_id IS 'Order of keyword record (internal primary key)';
996 | COMMENT ON COLUMN public.wos_keywords.keyword IS 'Keyword';
997 | COMMENT ON COLUMN public.wos_keywords.keyword_language IS 'Language of keyword';
998 |
999 | REVOKE ALL ON TABLE public.wos_keywords FROM PUBLIC;
1000 | REVOKE ALL ON TABLE public.wos_keywords FROM postgres;
1001 | GRANT ALL ON TABLE public.wos_keywords TO postgres;
1002 |
1003 | CREATE TABLE public.wos_abstracts (
1004 | id character varying NOT NULL,
1005 | abstract_id integer NOT NULL,
1006 | abstract_language character varying,
1007 | abstract_type character varying,
1008 | provider character varying,
1009 | copyright_information character varying,
1010 | paragraph_count character varying
1011 | );
1012 |
1013 | COMMENT ON TABLE public.wos_abstracts IS 'Abstracts';
1014 | COMMENT ON COLUMN public.wos_abstracts.id IS 'Record ID (internal primary key)';
1015 | COMMENT ON COLUMN public.wos_abstracts.abstract_id IS 'Order of abstract record (internal primary key)';
1016 | COMMENT ON COLUMN public.wos_abstracts.abstract_type IS 'Abstract type';
1017 | COMMENT ON COLUMN public.wos_abstracts.abstract_language IS 'Language of abstract';
1018 | COMMENT ON COLUMN public.wos_abstracts.provider IS 'Abstract provider';
1019 | COMMENT ON COLUMN public.wos_abstracts.paragraph_count IS 'Number of paragraphs in abstract';
1020 |
1021 | REVOKE ALL ON TABLE public.wos_abstracts FROM PUBLIC;
1022 | REVOKE ALL ON TABLE public.wos_abstracts FROM postgres;
1023 | GRANT ALL ON TABLE public.wos_abstracts TO postgres;
1024 |
1025 | CREATE TABLE public.wos_abstract_paragraphs (
1026 | id character varying NOT NULL,
1027 | abstract_id integer NOT NULL,
1028 | paragraph_id integer NOT NULL,
1029 | paragraph_label character varying,
1030 | paragraph_text character varying
1031 | );
1032 |
1033 | COMMENT ON TABLE public.wos_abstract_paragraphs IS 'Abstract Paragraphs';
1034 | COMMENT ON COLUMN public.wos_abstract_paragraphs.id IS 'Record ID (internal primary key)';
1035 | COMMENT ON COLUMN public.wos_abstract_paragraphs.abstract_id IS 'Order of associated abstract record (internal primary key)';
1036 | COMMENT ON COLUMN public.wos_abstract_paragraphs.paragraph_id IS 'Order of abstract paragraph record (internal primary key)';
1037 | COMMENT ON COLUMN public.wos_abstract_paragraphs.paragraph_label IS 'Abstract paragraph label';
1038 | COMMENT ON COLUMN public.wos_abstract_paragraphs.paragraph_text IS 'Abstract paragraph text';
1039 |
1040 | REVOKE ALL ON TABLE public.wos_abstract_paragraphs FROM PUBLIC;
1041 | REVOKE ALL ON TABLE public.wos_abstract_paragraphs FROM postgres;
1042 | GRANT ALL ON TABLE public.wos_abstract_paragraphs TO postgres;
1043 |
1044 | CREATE TABLE public.wos_reviewed_languages (
1045 | id character varying NOT NULL,
1046 | language_id integer NOT NULL,
1047 | language character varying NOT NULL
1048 | );
1049 |
1050 | COMMENT ON TABLE public.wos_reviewed_languages IS 'Item Record Language of Reviewed Work Data';
1051 | COMMENT ON COLUMN public.wos_reviewed_languages.id IS 'Record ID (internal primary key)';
1052 | COMMENT ON COLUMN public.wos_reviewed_languages.language_id IS 'Order of language record (internal primary key)';
1053 | COMMENT ON COLUMN public.wos_reviewed_languages.language IS 'Language';
1054 |
1055 | REVOKE ALL ON TABLE public.wos_reviewed_languages FROM PUBLIC;
1056 | REVOKE ALL ON TABLE public.wos_reviewed_languages FROM postgres;
1057 | GRANT ALL ON TABLE public.wos_reviewed_languages TO postgres;
1058 |
1059 | CREATE TABLE public.wos_reviewed_authors (
1060 | id character varying NOT NULL,
1061 | author_id integer NOT NULL,
1062 | author character varying
1063 | );
1064 |
1065 | COMMENT ON TABLE public.wos_reviewed_authors IS 'Item Record Authors of Reviewed Work Data';
1066 | COMMENT ON COLUMN public.wos_reviewed_authors.id IS 'Record ID (internal primary key)';
1067 | COMMENT ON COLUMN public.wos_reviewed_authors.author_id IS 'Order of author record (internal primary key)';
1068 | COMMENT ON COLUMN public.wos_reviewed_authors.author IS 'Reviewed work author';
1069 |
1070 | REVOKE ALL ON TABLE public.wos_reviewed_authors FROM PUBLIC;
1071 | REVOKE ALL ON TABLE public.wos_reviewed_authors FROM postgres;
1072 | GRANT ALL ON TABLE public.wos_reviewed_authors TO postgres;
1073 |
1074 | CREATE TABLE public.wos_reprint_addresses (
1075 | id character varying NOT NULL,
1076 | addr_id integer NOT NULL,
1077 | addr_type character varying,
1078 | addr_no character varying,
1079 | full_address character varying,
1080 | full_address_lang_id character varying,
1081 | organization_count character varying,
1082 | suborganization_count character varying,
1083 | email_addr_count character varying,
1084 | url_type character varying,
1085 | url_date_info character varying,
1086 | url_create_date character varying,
1087 | url_revised_date character varying,
1088 | url_cited_date character varying,
1089 | url character varying,
1090 | doi_count character varying,
1091 | laboratory character varying,
1092 | laboratory_lang_id character varying,
1093 | street character varying,
1094 | street_lang_id character varying,
1095 | city character varying,
1096 | city_lang_id character varying,
1097 | province character varying,
1098 | province_lang_id character varying,
1099 | state character varying,
1100 | state_lang_id character varying,
1101 | country character varying,
1102 | country_lang_id character varying,
1103 | post_num character varying,
1104 | post_num_lang_id character varying,
1105 | name_count character varying
1106 | );
1107 |
1108 |
1109 | COMMENT ON TABLE public.wos_reprint_addresses is 'Item Record Reprint Address Data';
1110 | COMMENT ON COLUMN public.wos_reprint_addresses.id IS 'Record ID (internal primary key)';
1111 | COMMENT ON COLUMN public.wos_reprint_addresses.addr_id IS 'Order of reprint_address record (internal primary key)';
1112 | COMMENT ON COLUMN public.wos_reprint_addresses.addr_type IS 'Address type';
1113 | COMMENT ON COLUMN public.wos_reprint_addresses.addr_no IS 'Address number. Used to link a specific author/publisher to a specific address.';
1114 | COMMENT ON COLUMN public.wos_reprint_addresses.full_address IS 'Full address';
1115 | COMMENT ON COLUMN public.wos_reprint_addresses.full_address_lang_id IS 'Language of full address data';
1116 | COMMENT ON COLUMN public.wos_reprint_addresses.organization_count IS 'Organizations count';
1117 | COMMENT ON COLUMN public.wos_reprint_addresses.suborganization_count IS 'Suborganizations count';
1118 | COMMENT ON COLUMN public.wos_reprint_addresses.email_addr_count IS 'Email address count';
1119 | COMMENT ON COLUMN public.wos_reprint_addresses.url_type IS 'URL type';
1120 | COMMENT ON COLUMN public.wos_reprint_addresses.url_date_info IS 'Unstructured URL date information';
1121 | COMMENT ON COLUMN public.wos_reprint_addresses.url_create_date IS 'URL create date';
1122 | COMMENT ON COLUMN public.wos_reprint_addresses.url_revised_date IS 'Last date the URL was revised';
1123 | COMMENT ON COLUMN public.wos_reprint_addresses.url_cited_date IS 'Date the URL was cited';
1124 | COMMENT ON COLUMN public.wos_reprint_addresses.url IS 'URL';
1125 | COMMENT ON COLUMN public.wos_reprint_addresses.doi_count IS 'Count of URL related DOIs';
1126 | COMMENT ON COLUMN public.wos_reprint_addresses.laboratory IS 'Laboratory';
1127 | COMMENT ON COLUMN public.wos_reprint_addresses.laboratory_lang_id IS 'Language of laboratory data';
1128 | COMMENT ON COLUMN public.wos_reprint_addresses.street IS 'Street address';
1129 | COMMENT ON COLUMN public.wos_reprint_addresses.street_lang_id IS 'Language of street address';
1130 | COMMENT ON COLUMN public.wos_reprint_addresses.city IS 'City';
1131 | COMMENT ON COLUMN public.wos_reprint_addresses.city_lang_id IS 'Language of city data';
1132 | COMMENT ON COLUMN public.wos_reprint_addresses.province IS 'Province';
1133 | COMMENT ON COLUMN public.wos_reprint_addresses.province_lang_id IS 'Language of province data';
1134 | COMMENT ON COLUMN public.wos_reprint_addresses.state IS 'U.S. state or Canadian province';
1135 | COMMENT ON COLUMN public.wos_reprint_addresses.state_lang_id IS 'Language of state data';
1136 | COMMENT ON COLUMN public.wos_reprint_addresses.country IS 'Country';
1137 | COMMENT ON COLUMN public.wos_reprint_addresses.country_lang_id IS 'Language of country data';
1138 | COMMENT ON COLUMN public.wos_reprint_addresses.post_num IS 'Postal number';
1139 | COMMENT ON COLUMN public.wos_reprint_addresses.post_num_lang_id IS 'Language of postal number';
1140 | COMMENT ON COLUMN public.wos_reprint_addresses.name_count IS 'Count of related names';
1141 |
1142 | REVOKE ALL ON TABLE public.wos_reprint_addresses FROM PUBLIC;
1143 | REVOKE ALL ON TABLE public.wos_reprint_addresses FROM postgres;
1144 | GRANT ALL ON TABLE public.wos_reprint_addresses TO postgres;
1145 |
1146 | CREATE TABLE public.wos_reprint_address_names (
1147 | id character varying NOT NULL,
1148 | addr_id integer NOT NULL,
1149 | name_id integer NOT NULL,
1150 | seq_no character varying,
1151 | addr_no_raw character varying,
1152 | role character varying,
1153 | reprint character varying,
1154 | lang_id character varying,
1155 | addr_no character varying,
1156 | r_id character varying,
1157 | r_id_tr character varying,
1158 | orcid_id character varying,
1159 | orcid_id_tr character varying,
1160 | dais_id character varying,
1161 | display character varying,
1162 | display_name character varying,
1163 | full_name character varying,
1164 | wos_standard character varying,
1165 | prefix character varying,
1166 | first_name character varying,
1167 | middle_name character varying,
1168 | initials character varying,
1169 | last_name character varying,
1170 | suffix character varying
1171 | );
1172 |
1173 | COMMENT ON TABLE public.wos_reprint_address_names IS 'Name Data from Reprint Addresses';
1174 | COMMENT ON COLUMN public.wos_reprint_address_names.id IS 'Record ID (internal primary key)';
1175 | COMMENT ON COLUMN public.wos_reprint_address_names.addr_id IS 'Sequence number of associated address';
1176 | COMMENT ON COLUMN public.wos_reprint_address_names.name_id IS 'Sequence number of name in list';
1177 | COMMENT ON COLUMN public.wos_reprint_address_names.role IS 'Role of the person or entity identified by the name';
1178 | COMMENT ON COLUMN public.wos_reprint_address_names.reprint IS 'Reprint author flag';
1179 | COMMENT ON COLUMN public.wos_reprint_address_names.lang_id IS 'Language of the name';
1180 | COMMENT ON COLUMN public.wos_reprint_address_names.addr_no IS 'Number that links a specific author to a specific address.';
1181 | COMMENT ON COLUMN public.wos_reprint_address_names.r_id IS 'ResearcherID identifier';
1182 | COMMENT ON COLUMN public.wos_reprint_address_names.r_id_tr IS 'ResearcherID identifier as captured by TR';
1183 | COMMENT ON COLUMN public.wos_reprint_address_names.orcid_id IS 'ORCID identifier';
1184 | COMMENT ON COLUMN public.wos_reprint_address_names.orcid_id_tr IS 'ORCID identifier as captured by TR';
1185 | COMMENT ON COLUMN public.wos_reprint_address_names.dais_id IS 'Distinct Author Identification System identifier';
1186 | COMMENT ON COLUMN public.wos_reprint_address_names.display IS 'Display flag. Used to indicate whether a name is displayed in full record.';
1187 | COMMENT ON COLUMN public.wos_reprint_address_names.display_name IS 'Name as displayed in record retrieved from database';
1188 | COMMENT ON COLUMN public.wos_reprint_address_names.full_name IS 'Full name';
1189 | COMMENT ON COLUMN public.wos_reprint_address_names.wos_standard IS 'Name in Web of Science standard format';
1190 | COMMENT ON COLUMN public.wos_reprint_address_names.prefix IS 'Name prefix';
1191 | COMMENT ON COLUMN public.wos_reprint_address_names.first_name IS 'First (given) name';
1192 | COMMENT ON COLUMN public.wos_reprint_address_names.middle_name IS 'Middle name';
1193 | COMMENT ON COLUMN public.wos_reprint_address_names.initials IS 'Initials';
1194 | COMMENT ON COLUMN public.wos_reprint_address_names.last_name IS 'Last name (surname)';
1195 | COMMENT ON COLUMN public.wos_reprint_address_names.suffix IS 'Name suffix';
1196 |
1197 | REVOKE ALL ON TABLE public.wos_reprint_address_names FROM PUBLIC;
1198 | REVOKE ALL ON TABLE public.wos_reprint_address_names FROM postgres;
1199 | GRANT ALL ON TABLE public.wos_reprint_address_names TO postgres;
1200 |
1201 | CREATE TABLE public.wos_reprint_address_names_email_addr (
1202 | id character varying NOT NULL,
1203 | addr_id integer NOT NULL,
1204 | name_id integer NOT NULL,
1205 | email_id integer NOT NULL,
1206 | email_addr character varying,
1207 | lang_id character varying
1208 | );
1209 |
1210 | COMMENT ON TABLE public.wos_reprint_address_names_email_addr IS 'Email Address Data from Reprint Address Names';
1211 | COMMENT ON COLUMN public.wos_reprint_address_names_email_addr.id IS 'Record ID (internal primary key)';
1212 | COMMENT ON COLUMN public.wos_reprint_address_names_email_addr.addr_id IS 'Sequence number of associated address';
1213 | COMMENT ON COLUMN public.wos_reprint_address_names_email_addr.name_id IS 'Sequence number of associated name';
1214 | COMMENT ON COLUMN public.wos_reprint_address_names_email_addr.email_addr IS 'Email address';
1215 | COMMENT ON COLUMN public.wos_reprint_address_names_email_addr.lang_id IS 'Language of email address';
1216 |
1217 | REVOKE ALL ON TABLE public.wos_reprint_address_names_email_addr FROM PUBLIC;
1218 | REVOKE ALL ON TABLE public.wos_reprint_address_names_email_addr FROM postgres;
1219 | GRANT ALL ON TABLE public.wos_reprint_address_names_email_addr TO postgres;
1220 |
1221 | CREATE TABLE public.wos_reprint_address_zip (
1222 | id character varying NOT NULL,
1223 | addr_id integer NOT NULL,
1224 | zip_id integer NOT NULL,
1225 | zip character varying,
1226 | lang_id character varying,
1227 | location character varying
1228 | );
1229 |
1230 | COMMENT ON TABLE public.wos_reprint_address_zip IS 'Zip Code Data from Reprint Addresses';
1231 | COMMENT ON COLUMN public.wos_reprint_address_zip.id IS 'Record ID (internal primary key)';
1232 | COMMENT ON COLUMN public.wos_reprint_address_zip.addr_id IS 'Sequence number of associated address';
1233 | COMMENT ON COLUMN public.wos_reprint_address_zip.zip IS 'Zip code or postal code';
1234 | COMMENT ON COLUMN public.wos_reprint_address_zip.lang_id IS 'Language of zip code data';
1235 | COMMENT ON COLUMN public.wos_reprint_address_zip.location IS 'Undocumented';
1236 |
1237 | REVOKE ALL ON TABLE public.wos_reprint_address_zip FROM PUBLIC;
1238 | REVOKE ALL ON TABLE public.wos_reprint_address_zip FROM postgres;
1239 | GRANT ALL ON TABLE public.wos_reprint_address_zip TO postgres;
1240 |
1241 | CREATE TABLE public.wos_reprint_address_organizations (
1242 | id character varying NOT NULL,
1243 | addr_id integer NOT NULL,
1244 | org_id integer NOT NULL,
1245 | organization character varying,
1246 | lang_id character varying
1247 | );
1248 |
1249 | COMMENT ON TABLE public.wos_reprint_address_organizations IS 'Organizations Data from Reprint Addresses';
1250 | COMMENT ON COLUMN public.wos_reprint_address_organizations.id IS 'Record ID (internal primary key)';
1251 | COMMENT ON COLUMN public.wos_reprint_address_organizations.addr_id IS 'Sequence number of associated address';
1252 | COMMENT ON COLUMN public.wos_reprint_address_organizations.organization IS 'Organization';
1253 | COMMENT ON COLUMN public.wos_reprint_address_organizations.lang_id IS 'Language of organization data';
1254 |
1255 | REVOKE ALL ON TABLE public.wos_reprint_address_organizations FROM PUBLIC;
1256 | REVOKE ALL ON TABLE public.wos_reprint_address_organizations FROM postgres;
1257 | GRANT ALL ON TABLE public.wos_reprint_address_organizations TO postgres;
1258 |
1259 | CREATE TABLE public.wos_reprint_address_suborganizations (
1260 | id character varying NOT NULL,
1261 | addr_id integer NOT NULL,
1262 | suborg_id integer NOT NULL,
1263 | suborganization character varying,
1264 | lang_id character varying
1265 | );
1266 |
1267 | COMMENT ON TABLE public.wos_reprint_address_suborganizations IS 'Suborganizations Data from Reprint Addresses';
1268 | COMMENT ON COLUMN public.wos_reprint_address_suborganizations.id IS 'Record ID (internal primary key)';
1269 | COMMENT ON COLUMN public.wos_reprint_address_suborganizations.addr_id IS 'Sequence number of associated address';
1270 | COMMENT ON COLUMN public.wos_reprint_address_suborganizations.suborganization IS 'Suborganization';
1271 | COMMENT ON COLUMN public.wos_reprint_address_suborganizations.lang_id IS 'Language of suborganization data';
1272 |
1273 | REVOKE ALL ON TABLE public.wos_reprint_address_suborganizations FROM PUBLIC;
1274 | REVOKE ALL ON TABLE public.wos_reprint_address_suborganizations FROM postgres;
1275 | GRANT ALL ON TABLE public.wos_reprint_address_suborganizations TO postgres;
1276 |
1277 | CREATE TABLE public.wos_keywords_plus (
1278 | id character varying NOT NULL,
1279 | keyword_id integer NOT NULL,
1280 | keyword_plus character varying,
1281 | keyword_language character varying
1282 | );
1283 |
1284 | COMMENT ON TABLE public.wos_keywords_plus IS 'Keywords Plus. Keywords generated from the titles of cited references';
1285 | COMMENT ON COLUMN public.wos_keywords_plus.id IS 'Record ID (internal primary key)';
1286 | COMMENT ON COLUMN public.wos_keywords_plus.keyword_id IS 'Order of keyword record (internal primary key)';
1287 | COMMENT ON COLUMN public.wos_keywords_plus.keyword_plus IS 'Keyword Plus.';
1288 | COMMENT ON COLUMN public.wos_keywords_plus.keyword_language IS 'Language of keyword';
1289 |
1290 | REVOKE ALL ON TABLE public.wos_keywords_plus FROM PUBLIC;
1291 | REVOKE ALL ON TABLE public.wos_keywords_plus FROM postgres;
1292 | GRANT ALL ON TABLE public.wos_keywords_plus TO postgres;
1293 |
1294 | CREATE TABLE public.wos_book_notes (
1295 | id character varying NOT NULL,
1296 | note_id integer NOT NULL,
1297 | book_note character varying
1298 | );
1299 |
1300 | COMMENT ON TABLE public.wos_book_notes IS 'Book notes';
1301 | COMMENT ON COLUMN public.wos_book_notes.id IS 'Record ID (internal primary key)';
1302 | COMMENT ON COLUMN public.wos_book_notes.note_id IS 'Order of book note record (internal primary key)';
1303 | COMMENT ON COLUMN public.wos_book_notes.book_note IS 'Book note';
1304 |
1305 | REVOKE ALL ON TABLE public.wos_book_notes FROM PUBLIC;
1306 | REVOKE ALL ON TABLE public.wos_book_notes FROM postgres;
1307 | GRANT ALL ON TABLE public.wos_book_notes TO postgres;
1308 |
1309 | CREATE TABLE public.wos_book_desc (
1310 | id character varying NOT NULL,
1311 | desc_id integer NOT NULL,
1312 | bk_binding character varying,
1313 | bk_publisher character varying,
1314 | amount character varying,
1315 | currency character varying,
1316 | price_desc character varying,
1317 | price_volumes character varying,
1318 | bk_prepay character varying,
1319 | bk_ordering character varying
1320 | );
1321 |
1322 | COMMENT ON TABLE public.wos_book_desc IS 'Book description';
1323 | COMMENT ON COLUMN public.wos_book_desc.id IS 'Record ID (internal primary key)';
1324 | COMMENT ON COLUMN public.wos_book_desc.desc_id IS 'Order of book description record (internal primary key)';
1325 | COMMENT ON COLUMN public.wos_book_desc.bk_binding IS 'Book binding';
1326 | COMMENT ON COLUMN public.wos_book_desc.bk_publisher IS 'Book publisher';
1327 | COMMENT ON COLUMN public.wos_book_desc.amount IS 'Book price amount';
1328 | COMMENT ON COLUMN public.wos_book_desc.currency IS 'Currency of book price';
1329 | COMMENT ON COLUMN public.wos_book_desc.price_desc IS 'Book price description';
1330 | COMMENT ON COLUMN public.wos_book_desc.price_volumes IS 'Book price volumes - price of specified number of volumes';
1331 | COMMENT ON COLUMN public.wos_book_desc.bk_prepay IS 'Book prepayment information';
1332 | COMMENT ON COLUMN public.wos_book_desc.bk_ordering IS 'Book ordering information';
1333 |
1334 | REVOKE ALL ON TABLE public.wos_book_desc FROM PUBLIC;
1335 | REVOKE ALL ON TABLE public.wos_book_desc FROM postgres;
1336 | GRANT ALL ON TABLE public.wos_book_desc TO postgres;
1337 |
1338 | CREATE TABLE public.wos_dynamic_identifiers (
1339 | id character varying NOT NULL,
1340 | dynamic_id integer NOT NULL,
1341 | identifier_type character varying,
1342 | identifier_value character varying,
1343 | self_ind character varying
1344 | );
1345 |
1346 |
1347 | COMMENT ON TABLE public.wos_dynamic_identifiers IS 'Dynamically-defined Identifier Data';
1348 | COMMENT ON COLUMN public.wos_dynamic_identifiers.id IS 'Record ID (internal primary key)';
1349 | COMMENT ON COLUMN public.wos_dynamic_identifiers.dynamic_id IS 'Order of identifier record (internal primary key)';
1350 | COMMENT ON COLUMN public.wos_dynamic_identifiers.identifier_type IS 'Identifier type';
1351 | COMMENT ON COLUMN public.wos_dynamic_identifiers.identifier_value IS 'Identifier value';
1352 |
1353 | REVOKE ALL ON TABLE public.wos_dynamic_identifiers FROM PUBLIC;
1354 | REVOKE ALL ON TABLE public.wos_dynamic_identifiers FROM postgres;
1355 | GRANT ALL ON TABLE public.wos_dynamic_identifiers TO postgres;
1356 |
1357 |
1358 | CREATE TABLE public.wos_contributors (
1359 | id character varying NOT NULL,
1360 | contrib_id integer NOT NULL,
1361 | role character varying,
1362 | reprint character varying,
1363 | lang_id character varying,
1364 | addr_no character varying,
1365 | r_id character varying,
1366 | r_id_tr character varying,
1367 | orcid_id character varying,
1368 | orcid_id_tr character varying,
1369 | dais_id character varying,
1370 | display character varying,
1371 | seq_no character varying,
1372 | display_name character varying,
1373 | full_name character varying,
1374 | wos_standard character varying,
1375 | prefix character varying,
1376 | first_name character varying,
1377 | middle_name character varying,
1378 | initials character varying,
1379 | last_name character varying,
1380 | suffix character varying
1381 | );
1382 |
1383 | COMMENT ON TABLE public.wos_contributors IS 'Contributors';
1384 | COMMENT ON COLUMN public.wos_contributors.id IS 'Record ID (internal primary key)';
1385 | COMMENT ON COLUMN public.wos_contributors.contrib_id IS 'Sequence number of name in list';
1386 | COMMENT ON COLUMN public.wos_contributors.role IS 'Role of the person or entity identified by the name';
1387 | COMMENT ON COLUMN public.wos_contributors.reprint IS 'Reprint author flag';
1388 | COMMENT ON COLUMN public.wos_contributors.lang_id IS 'Language of the name';
1389 | COMMENT ON COLUMN public.wos_contributors.addr_no IS 'Number that links a specific author to a specific address.';
1390 | COMMENT ON COLUMN public.wos_contributors.r_id IS 'ResearcherID identifier';
1391 | COMMENT ON COLUMN public.wos_contributors.r_id_tr IS 'ResearcherID identifier as captured by TR';
1392 | COMMENT ON COLUMN public.wos_contributors.orcid_id IS 'ORCID identifier';
1393 | COMMENT ON COLUMN public.wos_contributors.orcid_id_tr IS 'ORCID identifier as captured by TR';
1394 | COMMENT ON COLUMN public.wos_contributors.dais_id IS 'Distinct Author Identification System identifier';
1395 | COMMENT ON COLUMN public.wos_contributors.display IS 'Display flag. Used to indicate whether a name is displayed in full record.';
1396 | COMMENT ON COLUMN public.wos_contributors.seq_no IS 'Sequence number.';
1397 | COMMENT ON COLUMN public.wos_contributors.display_name IS 'Name as displayed in record retrieved from database';
1398 | COMMENT ON COLUMN public.wos_contributors.full_name IS 'Full name';
1399 | COMMENT ON COLUMN public.wos_contributors.wos_standard IS 'Name in Web of Science standard format';
1400 | COMMENT ON COLUMN public.wos_contributors.prefix IS 'Name prefix';
1401 | COMMENT ON COLUMN public.wos_contributors.first_name IS 'First (given) name';
1402 | COMMENT ON COLUMN public.wos_contributors.middle_name IS 'Middle name';
1403 | COMMENT ON COLUMN public.wos_contributors.initials IS 'Initials';
1404 | COMMENT ON COLUMN public.wos_contributors.last_name IS 'Last name (surname)';
1405 | COMMENT ON COLUMN public.wos_contributors.suffix IS 'Name suffix';
1406 |
1407 | REVOKE ALL ON TABLE public.wos_contributors FROM PUBLIC;
1408 | REVOKE ALL ON TABLE public.wos_contributors FROM postgres;
1409 | GRANT ALL ON TABLE public.wos_contributors TO postgres;
1410 |
1411 | GRANT SELECT ON ALL TABLES IN SCHEMA public TO wos_admin;
1412 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_schema_remove_empty.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS public.wos_contributor_email_addr;
2 | DROP TABLE IF EXISTS public.wos_chapters;
3 | DROP TABLE IF EXISTS public.wos_reprint_address_dois;
4 | DROP TABLE IF EXISTS public.wos_reprint_address_email_addr;
5 | DROP TABLE IF EXISTS public.wos_grant_alt_agencies;
6 | DROP TABLE IF EXISTS public.wos_address_dois;
7 | DROP TABLE IF EXISTS public.wos_address_email_addr;
8 | DROP TABLE IF EXISTS public.wos_publisher_email_addr;
9 | DROP TABLE IF EXISTS public.wos_publisher_names_email_addr;
10 | DROP TABLE IF EXISTS public.wos_publisher_zip;
11 | DROP TABLE IF EXISTS public.wos_publisher_organizations;
12 | DROP TABLE IF EXISTS public.wos_publisher_suborganizations;
13 | DROP TABLE IF EXISTS public.wos_publisher_dois;
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/web-of-science/wos_template.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | $data
4 |
5 |
--------------------------------------------------------------------------------
/generic_parser.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | #A generic XML to SQL query parser
4 |
5 | #Designed to convert an XML file into a set of queries based on a configuration file.
6 |
7 | #TO DO - Warning/error logging
8 | #TO DO - Database mode toggle between MySQL and postgreSQL
9 | #TO DO - More intensive testing, ensure record numbers match, spot checking full records, etc
10 |
11 | import lxml.etree as etree
12 | import os
13 | import sys
14 | import datetime
15 | import csv
16 | from string import Template
17 | from optparse import OptionParser
18 | reload(sys)
19 | sys.setdefaultencoding('utf-8')
20 |
21 | #Set up the dictionaries as global so we're not endlessly passing them back and forth. We write these in the ReadConfig process, then just read from there on in.
22 |
23 | table_dict = {}
24 | value_dict = {}
25 | ctr_dict = {}
26 | attrib_dict = {}
27 | attrib_defaults = {}
28 | file_number_dict = {}
29 |
30 | #Set these globally, but may need to change them via options between MySQL and PostgreSQL
31 |
32 | table_quote = '"'
33 | value_quote = "'"
34 |
35 | def main():
36 | #STEP 1 - process the options
37 |
38 | usage = "usage: %prog [options] arg"
39 | parser = OptionParser(usage)
40 | parser.add_option("-f", "--file", dest="filename", help="parse a single file")
41 | #-f optional, but must be either -f or -d, defines a single file to parse
42 | parser.add_option("-d", "--directory", dest="directory", help="a directory in which all XML files will be parsed.")
43 | #-d optional, but must be either -f or -d, defines a directory in which every xml file should be parsed. Not recursive into subdirectories
44 | parser.add_option("-c", "--config", dest="config_file", help="configuration file")
45 | #-c REQUIRED, defines the configuration file mapping from XML to DB
46 | parser.add_option("-t", "--template", dest="template_file", help="template file")
47 | #-t REQUIRED, defined the SQL template to write into
48 | #make this optional?
49 | parser.add_option("-o", "--output", dest="output", help="output file or directory")
50 | #-o REQUIRED, can be either a directory, or if a single-file run, a file name.
51 | parser.add_option("-p", "--parent", dest="parent", help="Name of the parent tag (tag containing the group of records")
52 | #-p optional, marks the container tag for a collection of records, would not be used for single record files
53 | parser.add_option("-r", "--record", dest="record", help="Name of the tag that defines a single record")
54 | #-r REQUIRED, the tag that defines an individual record
55 | parser.add_option("-n", "--namespace", dest="namespace", help="Namespace of the XML file")
56 | #-n optional, if the XML has a namespace, give it here. Assumes a single namespace for the entire file
57 | parser.add_option("-i", "--identifier", dest="identifier", help="Name of the tag whose value contains the unique identifier for the record")
58 | #-i REQUIRED, the tag that gives the unique identifier for the record. If this is a direct child of the record root, just give the child name, otherwise, starting at that level, give the path.
59 | parser.add_option("-l", "--file_number", dest="file_number_sheet", help="CSV file with the file name to file number lookup")
60 | #-l optional, ran out of good letters, required to use file numbers\
61 | parser.add_option("-m", "--database_mode", dest="database_mode", help="MySQL or Postgres, defaults to Postgres")
62 | #-m, database mode, a toggle between MySQL and PostgreSQL?
63 | parser.add_option("-s", "--single_trans", dest="single_trans", help="If true, will enable one transaction per file, cannot have transaction statements in the template, if so")
64 | #-s, wraps the entire file's output into a single transaction, good for speed if DB has an autocommit that you can't disable.
65 | parser.add_option("-z", "--recurse", dest="recurse", help="If true and a directory is set, the parser will search subdirectories for XML files to parse as well, ignored for single file parse")
66 | #-z, gives the option to recurse through a directory as opposed to just reading the core output.
67 | (options, args) = parser.parse_args()
68 | #Read the configuration
69 |
70 | #need to fail if these are blank
71 | template_file = options.template_file
72 | config_file = options.config_file
73 | if options.single_trans is None:
74 | single_trans = False
75 | else:
76 | single_trans = options.single_trans
77 |
78 | #process -f and -d as a pair, create a file list and prepare for output.
79 |
80 | if options.filename is None and options.directory is None:
81 | print("ERROR: No target to parse")
82 |
83 | if options.filename is not None and options.directory is not None:
84 | print("ERROR: Both target file and directory specified")
85 |
86 | if options.filename is not None:
87 | mode = "file"
88 | filelist = [options.filename]
89 | if os.path.isdir(options.output):
90 | output_file = None
91 | output_dir = options.output
92 | else:
93 | output_dir = None
94 | output_file = options.output
95 |
96 | if options.directory is not None:
97 | mode = "directory"
98 | output_file = None
99 | filelist = getXmlFiles(options.directory, options.recurse)
100 |
101 | if os.path.isfile(options.output):
102 | print("ERROR: Directory run requires directory for output.")
103 | else:
104 | output_dir = options.output
105 |
106 | #DO NOT LIKE THIS, don't really want to keep passing it around either, though. Not sure how to handle this one.
107 | global table_quote
108 | if str(options.database_mode).lower()== "mysql":
109 | db_mode = "mysql"
110 | table_quote = "`"
111 | else:
112 | db_mode = "postgres"
113 | table_quote = '"'
114 |
115 | #is it possible to get the namespace from the XML directly? It'd save a configuration option
116 | #test with a blank namespace
117 | if options.namespace is not None:
118 | namespace = options.namespace
119 | else:
120 | namespace = ''
121 |
122 | #root tag can be empty, but rec and id need to be present
123 |
124 | root_tag = options.parent
125 | rec_tag = options.record
126 | id_tag = options.identifier
127 |
128 | #convert the file number sheet to a dictionary for speedy lookup
129 |
130 | if options.file_number_sheet is not None:
131 | print("File numbers found")
132 | #convert this into a dictionary
133 | with open(options.file_number_sheet, mode='r') as infile:
134 | reader = csv.reader(infile)
135 | file_number_lookup = dict((rows[0],rows[1]) for rows in reader)
136 | infile.close()
137 | else:
138 | file_number_lookup={}
139 |
140 | #STEP 2 - Convert the config file into lookup tables
141 | #write lookup tables for table creation, counters, value and attribute parsing
142 |
143 | root = etree.parse(open(config_file)).getroot()
144 |
145 | root_element = root.tag
146 | ReadConfig(root, "", namespace)
147 | #we have our lookups, so we no longer need the XML config file, get it out of memory
148 | del root
149 |
150 | #get the template from the file
151 | tfile = open(template_file)
152 | template = Template(tfile.read())
153 |
154 | #STEO 3 - Parse the file(s)
155 | #now that we have lookups, we start with the files themselves
156 |
157 | for filename in filelist:
158 | #set the outputtarget
159 | if mode == "file":
160 | if output_file is not None:
161 | outputtarget = output_file
162 | else:
163 | outputtarget = os.path.join(output_dir, os.path.split(filename)[1][:-4] + "-queries.txt")
164 | else:
165 | outputtarget = os.path.join(output_dir, os.path.split(filename)[1][:-4] + "-queries.txt")
166 | #if options-output is a file, just use that name
167 | #otherwise, get the file name, remove .xml and append -queries.txt, then join that to the output directory
168 | #if it's part of a directory run
169 |
170 | #test the input file
171 | try:
172 | with open(filename): pass
173 | except IOError:
174 | try:
175 | with open(filename): pass
176 | except IOError:
177 | print("Error")
178 | continue
179 |
180 | #open the output file
181 | #disable unique constraint checking
182 |
183 | output = open(outputtarget, "w")
184 | if db_mode == "mysql":
185 | output.write("SET unique_checks=0;\n")
186 | output.write("SET autocommit=0;\n")
187 | if single_trans:
188 | output.write("BEGIN;\n")
189 |
190 | #get file number
191 | shortfilename = os.path.split(filename)[1]
192 | if shortfilename in file_number_lookup:
193 | file_number = file_number_lookup[shortfilename]
194 | else:
195 | file_number = -1
196 |
197 | print ("Parsing file: %s") % (filename)
198 | print ("Start time: %s") % (datetime.datetime.now())
199 | events=("start", "end")
200 | path_note = []
201 | #the root of what we're processing may not be the root of the file itself
202 | #we need to know what portion of the file to process
203 | #we assume that there is only one of these, but it need not necessarily be true, I think.
204 |
205 | if root_tag is None:
206 | #if there is no root tag, then we've only got one record and we process everything
207 | process= True
208 | else:
209 | #we need to split this into a list of tags by "/".
210 | root_path = root_tag.split("/")
211 | root_path = [namespace + s for s in root_path]
212 | process = False
213 |
214 | #The recover ability may or may not be available based on the version of lxml installed. Try to use it, but if not, go without
215 | try:
216 | parser= etree.iterparse(filename, remove_comments=True, recover=True, events=events)
217 | except:
218 | parser= etree.iterparse(filename, remove_comments=True, events=events)
219 |
220 | for event, elem in parser:
221 | #Here we keep an eye on our path.
222 | #If we have a root path defined, then we build a path as we go
223 | #If we are opening a tag that matches the root path, then we set processing to true
224 | #If we close a tag that matches the root path, then we set processing to false
225 |
226 | #if there is no root path, then we set process to true earlier and just leave it that way
227 | if root_tag is not None:
228 | if event == "start":
229 | #add the new element to the current path
230 | path_note.append(elem.tag)
231 | #if the path matches the root path, then we have reached an area of interest, set processing to true
232 | if path_note == root_path:
233 | process = True
234 | elif event == "end":
235 | #if the path equals the root path, then we are leaving an area of itnerest, set processing to false
236 | if path_note == root_path:
237 | process = False
238 | #remove the last element from the current path
239 | path_note.pop()
240 |
241 | #iteratively parse through the XML, focusing on the tag that starts a record
242 | #pass over things outside the processing area. Only process end tags.
243 | if event=="end" and process == True:
244 | if elem.tag == "%s%s" % (namespace, rec_tag):
245 |
246 | #you've got a record, now parse it
247 |
248 | tableList = TableList()
249 | statementList = []
250 |
251 | #lookups are by full path, so we need to maintain knowledge of that path
252 | #by definition, we must by on the root path, then the record tag
253 |
254 | if root_tag is not None:
255 | path = "%s%s/%s" % (namespace, root_tag, rec_tag)
256 | else:
257 | path = "%s%s" % (namespace, rec_tag)
258 | table_path = "%s/%s" % (path, 'table')
259 | file_number_path = "%s/%s" % (path, 'file_number')
260 | valuepath = path + "/"
261 |
262 | #get the core table name from the lookup
263 | core_table_name = table_dict[table_path]
264 |
265 | #create the core table
266 | tableList.AddTable(core_table_name, None, path)
267 |
268 | #get the primary key
269 | #the head tag may be the identifier, if so, just grab it, otherwise, seek it out
270 | if id_tag != rec_tag:
271 | id_seek = "%s%s" % (namespace, id_tag)
272 | id_node = elem.find(id_seek)
273 | id_value = "'" + id_node.text + "'"
274 | else:
275 | id_value = "'" + elem.text + "'"
276 |
277 | #set the primary key
278 | tableList.AddIdentifier(core_table_name, 'id', id_value)
279 |
280 | #see if this table needs a file number
281 | if file_number_path in file_number_dict:
282 | file_number_name = file_number_dict[file_number_path]
283 | tableList.AddCol(file_number_name.split(":",1)[0],file_number_name.split(":",1)[1], file_number)
284 |
285 | attribSeen = set()
286 | #process the attributes
287 | for attribName, attribValue in elem.attrib.items():
288 | attribpath = path+ "/"+attribName
289 | if attribpath in attrib_dict:
290 | tableName, colName = attrib_dict[attribpath].split(":")[:2]
291 | tableList.AddCol(tableName, colName, str(attribValue))
292 | attribSeen.add(attribName)
293 |
294 | #process default attribute values
295 | for attribName, attribValueAll in attrib_defaults.get(path, {}).items():
296 | if attribName not in attribSeen:
297 | tableName, colName, attribValue = attribValueAll.split(":")[:3]
298 | tableList.AddCol(tableName, colName, str(attribValue))
299 |
300 | #process the value
301 | if valuepath in value_dict:
302 | if node.text is not None:
303 | tableList.AddCol(value_dict[valuepath].split(":",1)[0],value_dict[valuepath].split(":",1)[1], str(node.text))
304 |
305 | #process the children
306 | for child in elem:
307 | ParseNode(child, path, tableList, core_table_name, statementList)
308 |
309 | #close the primary table
310 | tableList.CloseTable(core_table_name, statementList)
311 |
312 | #write out the statements in reverse order to ensure key compliance
313 |
314 | data = ""
315 | for statement in reversed(statementList):
316 | data = data + (str(statement) + "\n")
317 |
318 | #set the values that might be used in the template
319 |
320 | template_dict={}
321 | template_dict['data'] = data
322 | template_dict['file_number'] = file_number
323 | template_dict['id'] = id_value
324 |
325 | #write the data out intpo the template and write to file
326 |
327 | final = template.substitute(template_dict)
328 | output.write(final)
329 |
330 | #clear memory
331 |
332 | output.flush()
333 | elem.clear()
334 | #finished individual record
335 | if elem.getparent() is None and event == "end":
336 | break
337 | #some versions of lxml run off the end of the file. This forces the for loop to break at the root.
338 |
339 | #reenable unique constraint checking and close the output file
340 | if db_mode == "mysql":
341 | output.write("SET unique_checks=1;\n")
342 | output.write("SET autocommit=1;\n")
343 | if single_trans:
344 | output.write("COMMIT;\n")
345 | output.close()
346 | print("End time: %s") % (datetime.datetime.now())
347 |
348 |
349 | def ParseNode(node, path, tableList, last_opened, statementList):
350 | #recursive node parser
351 | #given a node in a tree known not to be the record tag, prase it and its children
352 |
353 | #first, update the path from parent, for use in lookups
354 | if node.tag.find("}") >-1:
355 | tag = node.tag.split("}",1)[1]
356 | else:
357 | tag = node.tag
358 | newpath = path + "/" + tag
359 | #see if we need a new table, make sure children inherit the right parent
360 | table_path = newpath + "/" + "table"
361 | valuepath = newpath + "/"
362 | #See if this tag requires a new table
363 |
364 | if table_path in table_dict:
365 | new_table = True
366 | table_name = table_dict[table_path]
367 | tableList.AddTable(table_name, last_opened, newpath)
368 | else:
369 | new_table = False
370 | table_name = last_opened
371 |
372 | #See if this tag calls for a file number
373 |
374 | if newpath in file_number_dict:
375 | file_number_name = file_number_dict[newpath]
376 | tableList.AddCol(file_number_name.split(":",1)[0],file_number_name.split(":",1)[1], file_number)
377 |
378 | #process attributes
379 | attribSeen = set()
380 | for attribName, attribValue in node.attrib.items():
381 | attribpath = newpath+ "/"+attribName
382 | if attribpath in attrib_dict:
383 | tableName, colName = attrib_dict[attribpath].split(":")[:2]
384 | tableList.AddCol(tableName, colName, str(attribValue))
385 | attribSeen.add(attribName)
386 |
387 | #process default attribute values
388 | for attribName, attribValueAll in attrib_defaults.get(newpath, {}).items():
389 | if attribName not in attribSeen:
390 | tableName, colName, attribValue = attribValueAll.split(":")[:3]
391 | tableList.AddCol(tableName, colName, str(attribValue))
392 |
393 | #process value
394 | if valuepath in value_dict:
395 | if node.text is not None:
396 | tableList.AddCol(value_dict[valuepath].split(":",1)[0],value_dict[valuepath].split(":",1)[1], str(node.text))
397 |
398 | #process children
399 | for child in node:
400 | ParseNode(child, newpath, tableList, table_name, statementList)
401 |
402 | #if we created a new table for this tag, now it's time to close it.
403 | if new_table == True:
404 | tableList.CloseTable(table_name, statementList)
405 |
406 |
407 | def ReadConfig(node, path, namespace):
408 |
409 | #This recursive function will go through the config file, reading each tag and attribute and create the needed lookup tables
410 | #All tags and attributes are recorded by full path, so name reusage shouldn't be a problem
411 |
412 | newpath = path+ node.tag+ "/"
413 |
414 | #write the value lookup for the tag
415 | if node.text is not None:
416 | if str(node.text).strip() > '':
417 | value_dict["%s%s" % (namespace, newpath)] = node.text
418 |
419 | #go through the attributes in the config file
420 | #specialized ones like table and ctr_id go into their own lookups, the rest go into the attribute lookup
421 | for attribName, attribValueAll in node.attrib.items():
422 | attribValue = ':'.join(attribValueAll.split(':')[:2])
423 |
424 | attrib_path = newpath + attribName
425 | if attribName == "table":
426 | table_dict["%s%s" % (namespace, attrib_path)]= attribValue
427 | elif attribName == "ctr_id":
428 | ctr_dict["%s%s" % (namespace, attrib_path)] = attribValue
429 | elif attribName == "file_number":
430 | file_number_dict["%s%s" % (namespace, attrib_path)] = attribValue
431 | else:
432 | attrib_dict["%s%s" % (namespace, attrib_path)] = attribValue
433 |
434 | # Providing a third tuple item specifies the default value for that attribute
435 | # If the attribute isn't found in the data, use the default value instead.
436 | if len(attribValueAll.split(':')) == 3:
437 | defaults = attrib_defaults.setdefault(("%s%s" % (namespace, newpath)).strip('/'), {})
438 | defaults[attribName] = attribValueAll
439 |
440 | #Now recurse for the children of the node
441 | for child in node:
442 | ReadConfig(child, newpath, namespace)
443 |
444 |
445 | class TableList:
446 | #The TableList is the memory structure that stores the data as we read it out of XML
447 | #This is the only way that we handle the Tables that we're creating during the main process.
448 | #We can never have more than one instance of a table with the same name
449 | #When a tag that needs a table opens, we call AddTable.
450 | #AddIdentifier should only be needed for the master table. Identifiers are added automatically after that.
451 | #AddCol is used for each value that we detect
452 | #When a tag that created a table closes, we call CloseTable for that table. This kicks the insert statement out to the stack and frees up that table name if needed again.
453 |
454 | def __init__(self):
455 | self.tlist = []
456 | def AddTable (self, tableName, parentName, tablePath):
457 | t = Table(tableName, parentName, self, tablePath)
458 | self.tlist.append(t)
459 | def AddCol (self, tableName, colName, colValue):
460 | for t in self.tlist:
461 | if t.name == tableName:
462 | t.AddCol(colName, colValue)
463 | def AddIdentifier (self, tableName, colName, colValue):
464 | for t in self.tlist:
465 | if t.name == tableName:
466 | t.AddIdentifier(colName, colValue)
467 | def CloseTable (self, tableName, statementList):
468 | for t in self.tlist:
469 | if t.name == tableName:
470 | statementList.append(t.createInsert())
471 | self.tlist.remove(t)
472 | del t
473 |
474 |
475 | class Table:
476 | #The Table structure simulates a DB Table
477 | #It has a name, a parent, columns and values.
478 | #We have some specialized columns called identifiers. These start with the id, then add in the automated counters.
479 | #The table also maintains a list of counters for its children. This allows the children to call back to the parent and ask for the next number in that counter.
480 |
481 | def __init__(self, name, parent_name, table_list, tablePath):
482 | #initialization gets the parent
483 | #If there is a parent, the table first inherits the parent's identifiers
484 | #It then asks the parent for the next value in it's own identifier and adds that to the identifier list.
485 | #I could rewrite the later half as a function going through the TableList and it may be more correct, but this works well enough
486 | self.name = name
487 | self.columns=[]
488 | self.identifiers=[]
489 | self.counters =[]
490 | self.parent_name=parent_name
491 | if parent_name is not None:
492 | for table in table_list.tlist:
493 | if table.name == parent_name:
494 | parent = table
495 | for identifier in parent.GetIdentifiers():
496 | self.AddIdentifier(identifier.name, identifier.value)
497 | new_id = parent.GetCounter(tablePath)
498 | self.AddIdentifier(new_id.name, new_id.value)
499 | def AddCol(self,colName, colValue):
500 | #Simply adds a column name, value name pair to the list to be output, called via TableList.AddCol
501 | newcol = Column(colName, colValue)
502 | self.columns.append(newcol)
503 | def AddIdentifier(self,colName, colValue):
504 | #Adds a new column, value to the identifier list. Can be called via TableList.AddIdentifier, but that should only happen at the start of a record
505 | newcol = Column(colName, colValue)
506 | self.identifiers.append(newcol)
507 | def GetCounter(self, name):
508 | #This accepts a counter name and returns the next value for that counter
509 | #This would be invoked by a Table's children (see in __init__).
510 | #The parent Table will look for the name in the list of Counters
511 | # if found, add 1 and report the [name, number]
512 | #else, create a new Counter in the list and report [name, 1]
513 | ctr_id = ctr_dict[name+ "/ctr_id"].split(":",1)[1]
514 | for counter in self.counters:
515 | if counter.name == ctr_id:
516 | counter.value = counter.value + 1
517 | return(counter)
518 | newcounter = Column(ctr_id,1)
519 | self.counters.append(newcounter)
520 | return(newcounter)
521 |
522 | def GetIdentifiers(self):
523 | #This returns the set of identifiers for the table, used when a child table is created to copy down the identifiers for the foreign key
524 | return(self.identifiers)
525 |
526 | def PrintCols(self):
527 | #Testing only
528 | print(len(self.columns))
529 | for col in self.columns:
530 | print(col.name)
531 | print(col.value)
532 |
533 | def createInsert(self):
534 | #Generates the insert statement for this table.
535 | #This is invoked when the table is closed. It goes through first the identifier list, then the column list and creates the insert statement.
536 | #The statement string is returned. This is then pushed onto a stack.
537 | colList = ""
538 | valList = ""
539 | for col in self.identifiers:
540 | if colList <> "":
541 | colList = colList + ","
542 | valList = valList + ","
543 | colList = colList + table_quote + col.name + table_quote
544 | valList = valList + str(col.value)
545 | for col in self.columns:
546 | if colList <> "":
547 | colList = colList + ","
548 | valList = valList + ","
549 | colList = colList + table_quote + col.name + table_quote
550 | valList = valList + value_quote + db_string(col.value) + value_quote
551 | statement = "INSERT INTO %s%s%s (%s) VALUES (%s);" % (table_quote, self.name, table_quote, colList, valList)
552 | return(statement)
553 |
554 |
555 | class Column:
556 | #A simple storage for a column in a table entry. Name and value.
557 | def __init__(self, name, value):
558 | self.name=name
559 | self.value=value
560 |
561 |
562 | #set up strings for DB insertion, copied from the old parser, may vary by DB software?
563 | def db_string(s):
564 | if s is not None:
565 | return str(s).replace("'","''").replace('\\', '\\\\')
566 | else:
567 | return "NULL"
568 |
569 | def getXmlFiles(directory, recurse):
570 | filelist=[]
571 | if recurse:
572 | for root, _, files in os.walk(directory):
573 | for file in files:
574 | if file.endswith('.xml'):
575 | filelist.append(os.path.join(root, file))
576 | else:
577 | for filename in sorted(os.listdir(directory)):
578 | if filename.endswith('.xml'):
579 | filelist.append(os.path.join(directory, filename))
580 | filelist.sort()
581 |
582 | return filelist
583 |
584 | if __name__ == "__main__":
585 | sys.exit(main())
586 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | lxml
2 |
--------------------------------------------------------------------------------