Author Publications and Citations by Year with REST and JSON
Created: 2016-05-09 11:33:34
This small workflow demonstrates how to connect to and use Europe PMC (http://europepmc.org/RestfulWebService) to count the number of publications and citations per year for one author. Two REST calls are made. First, we "searchPublications" to retrieve the bibliographic records for all published work of a single author. Then, we "getCitations" to extract the year of all articles citing the work of this author. A conditional JSONPath is here used to only look up citing articles for cited work as $.resultList.result[?(@.citedByCount>0)].id. The pubYear fields is extracted from the raw Web Service results and fed to an Rshell that produces two histograms as output, one for publications and one for citations, very similar to the "Citation Report" in the Thomson Reuters Web of Science. This is a REST and JSON verion of the SOAP and XML workflow www.myexperiment.org/workflows/4720.html.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Author Publications and Citations by Year with REST and JSON |
Descriptions (1)
This small workflow demonstrates how to connect to and use Europe PMC (http://europepmc.org/RestfulWebService) to count the number of publications and citations per year for one author. Two REST calls are made. First, we "searchPublications" to retrieve the bibliographic records for all published work of a single author. Then, we "getCitations" to extract the year of all articles citing the work of this author. A conditional JSONPath is here used to only look up citing articles for cited work as $.resultList.result[?(@.citedByCount>0)].id. The pubYear fields is extracted from the raw Web Service results and fed to an Rshell that produces two histograms as output, one for publications and one for citations, very similar to the "Citation Report" in the Thomson Reuters Web of Science. This is a REST and JSON verion of the SOAP and XML workflow www.myexperiment.org/workflows/4720.html. |
Dependencies (0)
Inputs (1)
Name |
Description |
author_name |
The name of an author
|
Processors (13)
Name |
Type |
Description |
build_query |
beanshell |
The build_query BeanShell constructs the Europe PMC search query for a single author, sorting the results by year. ScriptqueryString = "auth:\"" + author_name + "\" sort_date:y"; // generate query string
|
Flatten_List |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
PubMed_and_MEDLINE |
stringconstant |
ValueMED |
citing_articles_to_retrieve |
stringconstant |
Value100 |
articles_to_retrieve |
stringconstant |
Value1000 |
resultType_lite |
stringconstant |
Valuelite |
offSet_zero |
stringconstant |
Value0 |
draw_chart |
rshell |
This Rshell takes as input (flattened) lists of years for the publications and citations of author_name and outputs two histograms, one for the publications and one for the citations, per year. Scriptpng("chart.png", width=1024, height=480);
span<-max(publications, citations)-min(publications);
par(mfrow=c(1,2));
hist(publications, col="red", breaks=span, right=F, main="PubMed Publications", las=1, xlab="Year", ylab="Publications");
hist(citations, col="green", breaks=span, right=F, main="PubMed Citations", las=1, xlab="Year", ylab="Citations");
dev.off();
R Serverlocalhost:6311 |
searchPublications |
rest |
|
getCitations |
rest |
|
extract_pubYear_for_all_work |
jsonpath |
|
extract_id_for_cited_work |
jsonpath |
|
extract_pubYear_for_citing_articles |
jsonpath |
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
build_query |
The build_query BeanShell constructs the Europe PMC search query for a single author, sorting the results by year. |
author_name
|
queryString
|
Datalinks (15)
Source |
Sink |
author_name |
build_query:author_name |
extract_pubYear_for_citing_articles:nodelist |
Flatten_List:inputlist |
Flatten_List:outputlist |
draw_chart:citations |
extract_pubYear_for_all_work:nodelist |
draw_chart:publications |
build_query:queryString |
searchPublications:queryString |
offSet_zero:value |
searchPublications:offSet |
articles_to_retrieve:value |
searchPublications:pageSize |
resultType_lite:value |
searchPublications:resultType |
citing_articles_to_retrieve:value |
getCitations:pageSize |
PubMed_and_MEDLINE:value |
getCitations:source |
extract_id_for_cited_work:nodelist |
getCitations:id |
searchPublications:responseBody |
extract_pubYear_for_all_work:json_text |
searchPublications:responseBody |
extract_id_for_cited_work:json_text |
getCitations:responseBody |
extract_pubYear_for_citing_articles:json_text |
draw_chart:chart |
chart |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (2)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment