[Biopython-dev] Entrez ELink history - XML/DTD or Biopython bug?
Peter
biopython at maubp.freeserve.co.uk
Fri Sep 18 07:40:06 EDT 2009
On Fri, Sep 18, 2009 at 12:09 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hi Michiel (et al),
>
> I've been trying to get an example working using the Entrez history
> for ELink. Strangely here the URL doesn't use history=y but instead
> cmd=neighbor_history (while the default is cmd=neighbor).
>
> However, this appears to show a bug in the Bio.Entrez parser. Consider:
>
> from Bio import Entrez
> pmid = "14630660"
> print Entrez.elink(dbfrom="pubmed", db="pmc", LinkName="pubmed_pmc_refs",
> from_uid=pmid, cmd="neighbor_history").read()
>
> This gives:
>
> <?xml version="1.0"?>
> <!DOCTYPE eLinkResult PUBLIC "-//NLM//DTD eLinkResult, 11 May 2002//EN"
> "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/eLink_020511.dtd">
> <eLinkResult>
> <LinkSet>
> <DbFrom>pubmed</DbFrom>
> <IdList>
> <Id>14630660</Id>
> </IdList>
> <LinkSetDbHistory>
> <DbTo>pmc</DbTo>
> <LinkName>pubmed_pmc_refs</LinkName>
> <QueryKey>1</QueryKey>
> </LinkSetDbHistory>
> <WebEnv>NCID_1_2657216_130.14.18.53_9001_1253271778</WebEnv>
> </LinkSet>
> </eLinkResult>
>
> The XML looks reasonable by eye - although quite different from
> the non-history version... but my initial guess is
> the problem lies in the XML itself versus the eLink_020511.dtd
> file, which does not mention the LinkSetDbHistory element at
> all. Do you agree that this looks like an NCBI problem?
I should have done this earlier - but two different XML validators
both agree that the "history" version of the NCBI's ELink XML is
invalid, while the default is fine.
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?db=pmc&dbfrom=pubmed&LinkName=pubmed_pmc_refs&id=14630660&cmd=neighbor_history
versus
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?db=pmc&dbfrom=pubmed&LinkName=pubmed_pmc_refs&id=14630660&cmd=neighbor
or:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?db=pmc&dbfrom=pubmed&LinkName=pubmed_pmc_refs&id=14630660
I will get in touch with the NCBI...
Peter
More information about the Biopython-dev
mailing list