丰富的上下文API集成,用于跨多个学术基础设施提供商联合发现服务和元数据交换
richcontext-scholapi的Python项目详细描述
在richcontext.scholapi公司在
Rich Context 用于联合发现服务和元数据的API集成 跨多个学术基础设施提供商进行交流。在
丰富上下文知识图的开发使用此库:
- 确定指向研究出版物的数据集链接
- 查找开放存取出版物
- 对帐日记帐引用
- 协调作者配置文件
- 协调关键字分类法
这个图书馆一直以社区合作为指导 建设和元数据交换以改善学术基础设施, 在2019丰富背景研讨会上举行。在
安装
先决条件:
- Python 3.x
- Beautiful Soup
- Biopython.Entrez
- Crossref Commons
- Dimensions CLI
- Requests
- Requests-Cache
- Selenium
- xmltodict
从PyPi安装:
pip install richcontext.scholapi
如果直接从此Git repo安装,请确保安装 依赖关系也:
^{pr2}$然后将配置文件模板rc_template.cfg
复制到rc.cfg
然后用你的证书填充它。在
注意:注意不要在Git中提交rc.cfg
文件,因为
定义它将包含敏感数据,例如您的密码。在
配置文件中使用的参数包括:
parameter | value |
---|---|
^{ | path/to/chrome.exe |
^{ | CORE API key |
^{ | Dimensions API password |
^{ | Elsvier API key |
^{ | personal email address |
^{ | ORCID API key |
^{ | RePEc API token |
下载^{Chrome
浏览器的webdriver,以启用Selenium的使用。
这将以“无头”模式运行。在
一个好的(虽然有点过时)安装和测试教程 Ubuntu Linux上的Selenium,请参阅: https://christopher.su/2015/selenium-chromedriver-ubuntu/
使用
from richcontext import scholapi as rc_scholapi
# initialize the federated API access
schol = rc_scholapi.ScholInfraAPI(config_file="rc.cfg", logger=None)
source = schol.openaire
# search parameters for example publications
title = "Deal or no deal? The prevalence and nutritional quality of price promotions among U.S. food and beverage purchases."
# run it...
if source.has_credentials():
response = source.title_search(title)
# report results
if response.message:
# error case
print(response.message)
else:
print(response.meta)
source.report_perf(response.timing)
测试
首先,确保您是在测试源代码,而不是从 已安装库。在
然后在您拥有其凭据和 生成覆盖率报告:
coverage run -m unittest discover
然后在所有失败测试的子模块之间创建GitHub问题。在
此外,您还可以生成覆盖率报告并通过以下方式上载:
coverage report
bash <(curl -s https://codecov.io/bash) -t @.cc_token
测试覆盖率报告可以在 https://codecov.io/gh/Coleridge-Initiative/RCApi
API集成
用于检索元数据的API:
- 在
PubMed family
在 - 在
{ScholemIx家族
在 - 在
OA家族
在 - 在
Misc。
在
有关使用模式,请参阅test.py
单元测试中的编码示例
每个支持的API。在
故障排除
ChromeDriver
如果遇到ChromeDriver
版本的异常,则
示例:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created:
This version of ChromeDriver only supports Chrome version 78
然后检查您的Chrome浏览器实例以找到其版本
数字,然后转到https://chromedriver.chromium.org/downloadsto
下载相应的所需版本ChromeDriver
。在
文学
有关open access publications的更多背景信息,请参阅:
Piwowar H, Priem J, Larivière V, Alperin JP, Matthias L, Norlander B, Farley A, West J, Haustein S. 2017.
The State of OA: A large-scale analysis of the prevalence and impact of Open Access articles
PeerJ Preprints 5:e3119v1
https://doi.org/10.7287/peerj.preprints.3119v1
捐款
如果您愿意参与,请查看我们的列表 good first issues。在
有关加入人工智能团队处理丰富上下文的信息,请参阅 https://github.com/Coleridge-Initiative/RCGraph/blob/master/SKILLS.md
荣誉
贡献者: @ceteri, @IanMulvany, @srand525, @ernestogimeno, @lobodemonte, 再加上对2019年富有启发性的^{em1}2019年丰富背景研讨会的感谢 @metasj, 指导 @claytonrsh, @Juliaingridlane。在
- 项目
标签: