fabiobatalha / crossrefapi

A python library that implements the Crossref API.
BSD 2-Clause "Simplified" License
280 stars 44 forks source link

Could one use the crossrefapi to construct an author search with both first and last name? #30

Closed russelljjarvis closed 4 years ago

russelljjarvis commented 4 years ago

Could one use the crossrefapi to construct an author search with both first and last name?

I have tried that a bit but the results are very imprecise.

fabiobatalha commented 4 years ago

Hello @russelljjarvis

Can you give an example of your attempts?

russelljjarvis commented 4 years ago

Sorry yes,

NAME is a string first name, last name, separated by " ", and entered from a GUI.

https://github.com/russelljjarvis/ScienceAccess/blob/master/science_access/online_app_backend.py#L182-L186

        queries = {'query.author': NAME}
        ar = []
        bi =[p for p in iterate_publications_as_json(max_results=100, queries=queries)]   
        for p in bi[0:9]:    
            res = str('https://api.unpaywall.org/v2/')+str(p['DOI'])+str('?email=YOUR_EMAIL')
russelljjarvis commented 4 years ago

I just updated the file. For example if NAME="Patrick McGurrin" Do you think the problem is that I am not filtering the result enough? Like

If I restrict the year https://github.com/russelljjarvis/ScienceAccess/blob/master/science_access/online_app_backend.py#L203

   works = Works()
   ww =  works.query(author=NAME).filter(from_online_pub_date='2000')

@mcgurrgurr

fabiobatalha commented 4 years ago

@russelljjarvis

It seems you are doing everything correct, the issue is the results of this query using the author name is not enouth to identify the DOI's of the given author.

Queries run in a similarity match mode and we can not change this behaviour, it means anything minimaly similar to Patrick or McGurrin will be retrived.

The best approach to identify authors is to use unique identifiers, as for example ORCID ID's.

If you have the ORCID ID of one author you can do something like:

works = Works()
works.filter(orcid='1234-12343-1234')
russelljjarvis commented 4 years ago

Great, thanks so much @fabiobatalha. Do you know of any other tools that can help you to go from author name to orcid-ID? The goal is that a user of our program types in just author name, our code finds their ORCID ID, uses cross-ref to find OADOIs and then uses unpaywall to get texts.

@mcgurrgurr

fabiobatalha commented 4 years ago

hello @russelljjarvis

You should use the ORCID API : https://orcid.org/organizations/integrators/API