Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

Commit c62d122

Browse files
committed
corrected errors
1 parent 774fd10 commit c62d122

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

Analysis/affymetrix/garfield_import_dmet_twog.sql

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ FROM wos_publications WHERE source_id IN
1515
(select distinct wos_id from garfield_hgraph2) AND
1616
publication_year <= 1992;
1717

18-
-- get first gen of citing references
18+
-- get first gen of citing references (note target:cited_source_uid polarity to preserve a cites b)
19+
-- the 9 endrefs are cited by gen1 pubs
20+
1921
DROP TABLE IF EXISTS garfield_gen1;
2022
CREATE TABLE garfield_gen1 AS
2123
SELECT source_id AS source, cited_source_uid AS target,
@@ -34,7 +36,7 @@ FROM wos_references WHERE cited_source_uid IN
3436
CREATE INDEX garfield_gen2_idx ON garfield_gen2(source);
3537

3638
--Citation starting point is publications DMET Plus keyword search
37-
-- get one generation of cited references
39+
-- get two generations of cited references not reversed polarity since this is cited reference not citing
3840
DROP TABLE IF EXISTS garfield_dmet_begina;
3941
CREATE TABLE garfield_dmet_begina AS
4042
SELECT source_id AS source, cited_source_uid AS target,
@@ -98,7 +100,7 @@ SELECT DISTINCT 'n'||substring(target,5),target,ttype
98100
FROM garfield_dmet_begin;
99101

100102
-- gen1_cited
101-
INSERT INTO garfield_node_assembly(node_id,node_name,ttype)
103+
INSERT INTO garfield_node_assembly(node_id,node_name,stype)
102104
SELECT DISTINCT 'n'||substring(source,5),source,stype
103105
FROM garfield_dmet_twog;
104106

@@ -141,8 +143,12 @@ CREATE INDEX garfield_edgelist_idx ON garfield_edgelist(source,target);
141143

142144
-- create formatted nodelist with unique node_ids
143145
DROP TABLE IF EXISTS garfield_nodelist_formatted_a;
144-
CREATE TABLE garfield_nodelist_formatted_a (node_id varchar(16), node_name varchar(19), stype varchar(10), ttype varchar(10), startref varchar(10), endref varchar(10));
145-
INSERT INTO garfield_nodelist_formatted_a (node_id,node_name,stype,ttype) SELECT DISTINCT * FROM garfield_nodelist;
146+
CREATE TABLE garfield_nodelist_formatted_a (node_id varchar(16), node_name varchar(19),
147+
stype varchar(10), ttype varchar(10),
148+
startref varchar(10), endref varchar(10));
149+
INSERT INTO garfield_nodelist_formatted_a (node_id,node_name,stype,ttype)
150+
SELECT DISTINCT * FROM garfield_nodelist;
151+
146152
UPDATE garfield_nodelist_formatted_a SET startref=1 WHERE stype='startref';
147153
UPDATE garfield_nodelist_formatted_a SET startref=0 WHERE stype='source' OR stype IS NULL;
148154
UPDATE garfield_nodelist_formatted_a SET endref=1 WHERE ttype='endref';

0 commit comments

Comments
 (0)