Title: | Client for the Open Citations Corpus |
---|---|
Description: | Client for the Open Citations Corpus (<http://opencitations.net/>). Includes a set of functions for getting one identifier type from another, as well as getting references and citations for a given identifier. |
Authors: | Scott Chamberlain [aut] , David Selby [cre, aut] , rOpenSci [fnd] (https://ropensci.org/) |
Maintainer: | David Selby <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.2.9000 |
Built: | 2024-12-09 12:41:44 UTC |
Source: | https://github.com/ropensci/citecorp |
Client for the Open Citations Corpus http://opencitations.net/
Scott Chamberlain [email protected]
David Selby [email protected]
Useful links:
Report bugs at https://github.com/ropensci/citecorp/issues
AFAICT this API is a REST wrapper around the SPARQL service
oc_coci_refs(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_cites(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_meta(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_citation(oci, ...)
oc_coci_refs(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_cites(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_meta(doi, exclude = NULL, filter = NULL, sort = NULL, ...) oc_coci_citation(oci, ...)
doi |
(character) one or more Digital Object Identifiers (DOIs) |
exclude |
(character) a field_name; all the rows that have an empty value in the field_name specified are removed from the result set |
filter |
|
sort |
|
... |
curl options passed on to crul::verb-GET |
oci |
(character) one or more Open Citation Identifiers (OCIs) |
data.frame, see http://opencitations.net/index/coci/api/v1 for explanation of the resulting columns
http://opencitations.net/index/coci/api/v1, https://github.com/opencitations/api-coci
doi1 <- "10.1108/jd-12-2013-0166" doi2 <- "10.1371/journal.pgen.1005937" oci1 <- "02001010806360107050663080702026306630509-0200101080636102704000806" oci2 <- "0200101000836191363010263020001036300010606-020010003083604090301050910" if ( crul::ok( "http://opencitations.net/index/coci/api/v1/references/10.1108/jd-12-2013-0166", timeout_ms = 1000L) ) { try( oc_coci_cites(doi1), silent = TRUE ) } ### More examples ## Not run: # references oc_coci_refs(doi1, exclude = "oci") oc_coci_refs(doi1, filter = "date:>2016-05", verbose = TRUE) oc_coci_refs(doi2) oc_coci_refs(c(doi1, doi2)) # citations oc_coci_cites(doi1, exclude = "oci") oc_coci_cites(doi2) oc_coci_cites(c(doi1, doi2)) # metadata oc_coci_meta(doi2) oc_coci_meta(c(doi1, doi2)) # citation - an OCI instead of a DOI oc_coci_citation(oci1) oc_coci_citation(c(oci1, oci2)) ## End(Not run)
doi1 <- "10.1108/jd-12-2013-0166" doi2 <- "10.1371/journal.pgen.1005937" oci1 <- "02001010806360107050663080702026306630509-0200101080636102704000806" oci2 <- "0200101000836191363010263020001036300010606-020010003083604090301050910" if ( crul::ok( "http://opencitations.net/index/coci/api/v1/references/10.1108/jd-12-2013-0166", timeout_ms = 1000L) ) { try( oc_coci_cites(doi1), silent = TRUE ) } ### More examples ## Not run: # references oc_coci_refs(doi1, exclude = "oci") oc_coci_refs(doi1, filter = "date:>2016-05", verbose = TRUE) oc_coci_refs(doi2) oc_coci_refs(c(doi1, doi2)) # citations oc_coci_cites(doi1, exclude = "oci") oc_coci_cites(doi2) oc_coci_cites(c(doi1, doi2)) # metadata oc_coci_meta(doi2) oc_coci_meta(c(doi1, doi2)) # citation - an OCI instead of a DOI oc_coci_citation(oci1) oc_coci_citation(c(oci1, oci2)) ## End(Not run)
To be used in examples, etc. for oc_lookup and oc_coci methods
Methods for getting IDs from other IDs
oc_doi2ids(id, ...) oc_pmid2ids(id, ...) oc_pmcid2ids(id, ...)
oc_doi2ids(id, ...) oc_pmid2ids(id, ...) oc_pmcid2ids(id, ...)
id |
One or more digital object identifiers (DOI), PMID, or PMCID, depending on the function |
... |
curl options passed on to crul::verb-GET |
data.frame, with four columns:
doi: digital object identifier
pmid: pubmed identifier
pmcid: pubmed central identifier
paper: open citations corpus url
An empty data.frame (no columns or rows) when no results found
Column order will always be the same; note though that some columns may be missing if, for example, there's no PMID for a DOI search.
if (oc_lookup_check()) { try( oc_doi2ids("10.1097/igc.0000000000000609", timeout_ms=10), silent = TRUE ) } ### More examples ## Not run: oc_doi2ids('10.1093/biomet/80.3.527') oc_doi2ids('10.1093/biomet/79.3.531') oc_pmid2ids("31857888") oc_pmcid2ids("PMC6422012") oc_doi2ids(id = oc_dois[1:3]) oc_pmid2ids(id = oc_pmids[1:3]) oc_pmcid2ids(id = oc_pmcids[1:3]) ## End(Not run)
if (oc_lookup_check()) { try( oc_doi2ids("10.1097/igc.0000000000000609", timeout_ms=10), silent = TRUE ) } ### More examples ## Not run: oc_doi2ids('10.1093/biomet/80.3.527') oc_doi2ids('10.1093/biomet/79.3.531') oc_pmid2ids("31857888") oc_pmcid2ids("PMC6422012") oc_doi2ids(id = oc_dois[1:3]) oc_pmid2ids(id = oc_pmids[1:3]) oc_pmcid2ids(id = oc_pmcids[1:3]) ## End(Not run)
To be used in examples, etc. for oc_lookup and oc_coci methods
To be used in examples, etc. for oc_lookup and oc_coci methods