 END;
 /
 
-insert into evidence(pubmed_id, sentence) select distinct pubmed_id, 'Pathway publication' from zstg_pid_interactionreference minus select distinct pubmed_id, to_char(dbms_lob.substr(sentence, 1, 4000)) from evidence;
+--insert into evidence(pubmed_id, sentence) select distinct pubmed_id, 'Pathway publication' from zstg_pid_interactionreference minus select distinct pubmed_id, to_char(dbms_lob.substr(sentence, 1, 4000)) from evidence;
+
+insert into evidence(pubmed_id, sentence)
+select distinct pubmed_id, 'Pathway publication' from zstg_pid_reference_pubmed minus select distinct pubmed_id, to_char(dbms_lob.substr(sentence, 50,1)) from evidence;
 commit;
 
 SELECT MAX(ID) + 1 AS V_MAXROW


commit;

insert into pid_interaction_evidence(interaction_id, evidence_id) select distinct i.id, e.id from pid_interaction i, evidence e, zstg_pid_interactionreference z where z.interaction_id = i.pid_interaction_id and z.pubmed_id=e.pubmed_id and to_char(substr(e.sentence, 1, 4000))='Pathway publication';
commit;

-- load into pid_entityName and pid_entityAccession

commit; 

-- association between SmallMoleculeEntity and Agent
--insert into pid_entity_agent(physical_entity_id, agent_id) select distinct p.ID, g.AGENT_ID from pid_physical_entity p, pid_entity_name a , agent g where p.PID_PHYSICALENTITY_ID = a.PID_PHYSICALENTITY_ID and p.DISCRIMINATOR = 'SmallMoleculeEntity' and lower(trim(a.NAME)) = lower(trim(g.AGENT_NAME));
--commit;


-- See if one can add agents on the basis of Unigene cluster number
