VirtualFlyBrain / VFB_neo4j

A python package for writing schema-compliant content to VFB neo4J DBs
Apache License 2.0
0 stars 1 forks source link

Pull metadata for pubs with only a DOI #10

Open dosumis opened 8 years ago

dosumis commented 8 years ago

~EuroPMC API can be used for metadata on PMIDs.~

Cross ref API can be used for DOIs.

http://api.crossref.org/works/10.1371/journal.pbio.1000461

But be careful of figure DOIs. Metadata on these appears to be pretty useless:

http://api.crossref.org/works/10.1371/journal.pbio.1000461.g002

dosumis commented 8 years ago

Snippet of EuroPMC API lookup code for reference:


    url_base = 'http://www.ebi.ac.uk/europepmc/webservices/rest/search?'
    q = requests.get(url_base + urlencode({ 'query' : 'ext_id:' + pmid_accession + ' src:med', 'format' : 'json'}))
    if q.status_code == 200:
        if q.json()['hitCount']:
            return q.json()['resultList']['result'][0]
        else:
            warnings.warn("No results returned in response to query for PMID:%s" % pmid_accession)
            return False
    else:
        warnings.warn("Query failed for '%s' lookup: %s (%s)" % (pmid_accession, q.status_code, q.reason))
        return False
dosumis commented 8 years ago

This looks useful: PMCID - PMID - Manuscript ID - DOI Converter

dosumis commented 6 years ago

For some datasets, we need to link to preprints which means we need DOIs. For everything else, we need will make sure FlyBase has a record and use FBrf.