Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving DOI for a combination of author, title and date/year #578

Open
bnoushin7 opened this issue Nov 18, 2022 · 6 comments
Open

Retrieving DOI for a combination of author, title and date/year #578

bnoushin7 opened this issue Nov 18, 2022 · 6 comments

Comments

@bnoushin7
Copy link

bnoushin7 commented Nov 18, 2022

Hi there!

I want to retrieve the DOI for a combination of a title, the first author, and the year. I wanted to use the query method, but there is no date or year filed in it. It also does not allow me to use a title. Here is the example article I want to get its DOI:
title: "The generic name Mediocris (Cetacea: Delphinoidea: Kentriodontidae),
belongs to a foraminiferan"
author : Mark D Uhen
Year: 2006

I tried this but it failed (although I could not find any filed name for the year):

last_name='Uhen'
title = 'The generic nameMediocris (Cetacea: Delphinoidea: Kentriodontidae), belongs to a foraminiferan'

q = works.query(author=last_name, title = title)

Here is the error I got:
UrlSyntaxError: Field query title specified but there is no such field query for this route. Valid field queries for this route are: affiliation, author, bibliographic, chair, container_title, contributor, editor, event_acronym, event_location, event_name, event_sponsor, event_theme, funder_name, publisher_location, publisher_name, translator

Is there any other way or method we can use?
I appreciate any help!
Thanks

@andreaspacher
Copy link

What software are you using? Should you change the field name title to bibliographic?

In the browser, the link https://api.crossref.org/works?query.author=Uhen&query.bibliographic=The%20generic%20name&filter=from-pub-date:2006-01-01,until-pub-date:2006-12-31 works for me.

@fabiobatalha
Copy link

For the date you can use the method filter combined with query.

@bnoushin7
Copy link
Author

The generic name

Thank you. But could you please help me how can I integrate filter in julyer notebook(Python)?

last_name='Uhen'
title = 'The+generic+name'
#filter=from-pub-date:2008-08-13,until-pub-date:2008-08-13
q = works.query(author=last_name,bibliographic=title)
print(q.url)

@bnoushin7
Copy link
Author

For the date you can use the method filter combined with query.

Could you please provide an example for how to combine filter with query?

@fabiobatalha
Copy link

fabiobatalha commented Nov 22, 2022

I'm assuming you are using the crossrefapi library (https://github.com/fabiobatalha/crossrefapi).

from crossref.restful import Works
works = Works()
last_name='Uhen'
title = 'The+generic+name'
q = works.query(author=last_name,bibliographic=title).filter(from_pub_date="2008-08-13", until_pub_date="2008-08-13")

@bnoushin7
Copy link
Author

I'm assuming you are using the crossrefapi library (fabiobatalha/crossrefapi).

from crossref.restful import Works
works = Works()
last_name='Uhen'
title = 'The+generic+name'
q = works.query(author=last_name,bibliographic=title).filter(from_pub_date="2008-08-13", until_pub_date="2008-08-13")

Thank you so much. I really appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants