Package: richcontext-scholapi
richcontext.scholapiRich ContextAPI integrations for federating discovery services and metadata
exchange across multiple scholarly infrastructure providers.Development of the Rich Context knowledge graph uses this library to:identify dataset links to research publicationslocate open access publicationsreconcile journal referencesreconcile author profilesreconcile keyword taxonomyThis library has been guided by collaborative work on community
building and metadata exchange to improve Scholarly Infrastructure,
held at the2019 Rich Context Workshop.InstallationPrerequisites:Python 3.xBeautiful SoupBiopython.EntrezCrossref CommonsDimensions CLIRequestsRequests-CacheSeleniumxmltodictTo install fromPyPi:pip install richcontext.scholapiIf you install directly from this Git repo, be sure to install the
dependencies as well:pip install -r requirements.txtThen copy the configuration file templaterc_template.cfgtorc.cfgand populate it with your credentials.NB: be careful not to commit therc.cfgfile in Git since by
definition it will contain sensitive data, e.g., your passwords.Parameters used in the configuration file include:parametervaluechrome_exe_pathpath/to/chrome.execore_apikeyCORE API keydimensions_passwordDimensions API passwordelsevier_api_keyElsvier API keyemailpersonal email addressorcid_secretORCID API keyrepec_tokenRePEc API tokenDownload theChromeDriverwebdriver for theChromebrower to enable use of Selenium.
This will be run in a "headless" mode.For a good (though slightly dated) tutorial for installing and testing
Selenium on Ubuntu Linux, see:https://christopher.su/2015/selenium-chromedriver-ubuntu/Usagefrom 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)TestingFirst, be sure that you're testing the source and not from an
installed library.Then run unit tests on the APIs for which you have credentials and
generate a coverage report:coverage run -m unittest discoverThen create GitHub issues among the submodules for any failed tests.Also, you can generate a coverage report and upload that via:coverage report
bash <(curl -s https://codecov.io/bash) -t @.cc_tokenTest coverage reports can be viewed athttps://codecov.io/gh/Coleridge-Initiative/RCApiAPI IntegrationsAPIs used to retrieve metadata:PubMed familyPubMedEuropePMCScholix familyOpenAIRECrossrefDataCiteOA familyUnpaywalldisseminSemantic ScholarMisc.RePEcNSF-PARORCIDCOREDimensionsSSRNSee the coding examples in thetest.pyunit test for usage patterns
per supported API.TroubleshootingChromeDriverIf you encounter an exception about theChromeDriverversion, for
example:selenium.common.exceptions.SessionNotCreatedException: Message: session not created:
  This version of ChromeDriver only supports Chrome version 78Then check your instance of theChromebrowser to find its release
number, then go tohttps://chromedriver.chromium.org/downloadsto
download the corresponding required version ofChromeDriver.LiteratureFor more background aboutopen access publicationssee: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 articlesPeerJ Preprints5:e3119v1https://doi.org/10.7287/peerj.preprints.3119v1ContributionsIf you'd like to contribute, please see our listings ofgood first issues.For info about joining the AI team working on Rich Context, seehttps://github.com/Coleridge-Initiative/RCGraph/blob/master/SKILLS.mdKudosContributors:@ceteri,@IanMulvany,@srand525,@ernestogimeno,@lobodemonte,
plus many thanks for the inspiring2019 Rich Context Workshopnotes by@metasj,
and guidance from@claytonrsh,@Juliaingridlane.