如何通过标题、第一作者及年份检索文献DOI?
解决:通过标题、作者及年份检索文献DOI
问题背景
需要检索目标文献的DOI,已知信息:
- 标题:
The generic name Mediocris (Cetacea: Delphinoidea: Kentriodontidae), belongs to a foraminiferan - 第一作者:Mark D Uhen
- 年份:2006
尝试使用works.query方法时失败,原代码:
last_name='Uhen' title = 'The generic nameMediocris (Cetacea: Delphinoidea: Kentriodontidae), belongs to a foraminiferan' q = works.query(author=last_name, title = title)
报错信息:
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
解决方案
works.query不支持直接传入title和year字段,但可以使用报错提示里的**bibliographic字段**——它支持整合标题、作者、年份的复合查询,能精准缩小搜索范围定位目标文献。
修改后的代码示例:
last_name='Uhen' title = 'The generic name Mediocris (Cetacea: Delphinoidea: Kentriodontidae), belongs to a foraminiferan' year = 2006 # 整合标题、作者、年份为bibliographic查询字符串 query_content = f"{title} {last_name} {year}" q = works.query(bibliographic=query_content) # 遍历查询结果,提取目标文献的DOI for work in q: print(work.doi)
如果你的API支持通用搜索参数q,也可以直接用:
q = works.query(q=query_content)
内容的提问来源于stack exchange,提问作者Noushin
相关产品推荐
相关产品推荐

