Skip to content

Extracting Abstracts #34

Description

@sgalla32

My hope is to develop a script that extract just the abstract information to a vector of character strings from an rscopus search. To start this code, I have created an if statement that creates the search, and extracts a list of just rscopus ID numbers:

if(have_api_key()) {
  #First, the scopus search, with a high max_count. If I increase the count#, I usually get an error.
  res = scopus_search(query = "conservation AND translocation", 
                      max_count = 20, count = 10)
  
  #Then, list some data frames from these entries
  df = gen_entries_to_df(res$entries)
  head(df$df)
  
  #Just extract the scopus identifier
  Scopus_IDs <- df$df$`dc:identifier`
  head(Scopus_IDs)
  
  #Take SCOPUS_ID: off these numbers, so we just have the ID numbers. 
  Scopus_IDs_Clean <- str_remove(Scopus_IDs, "SCOPUS_ID:")
  head(Scopus_IDs_Clean)
}

Before I write a loop that can take each scopus ID and extract just the abstract, I want to test it with just one entry to make sure the function can provide just one abstract:

#Call just one abstract:
  x = abstract_retrieval("85081719894", identifier = "scopus_id")
  data = jsonlite::fromJSON(httr::content(x$get_statement, as = "text"), flatten=TRUE)
  
  data = data$`abstracts-retrieval-response`
  names(data)
  data$coredata
  data$coredata$`dc:description`

However, when I use this code, it comes NULL for the abstract information.

> x = abstract_retrieval("85081719894", identifier = "scopus_id")
HTTP specified is:https://api.elsevier.com/content/abstract/scopus_id/85081719894

>   data = jsonlite::fromJSON(httr::content(x$get_statement, as = "text"), flatten=TRUE)
>   
>   data = data$`abstracts-retrieval-response`
>   names(data)
[1] "affiliation" "coredata"   
>   data$coredata
$srctype
[1] "j"

$`prism:issueIdentifier`
[1] "1"

$eid
[1] "2-s2.0-85081719894"

$`pubmed-id`
[1] "32165659"

$`prism:coverDate`
[1] "2020-12-01"

$`prism:aggregationType`
[1] "Journal"

$`prism:url`
[1] "https://api.elsevier.com/content/abstract/scopus_id/85081719894"

$subtypeDescription
[1] "Article"

$`dc:creator`
$`dc:creator`$author
  ce:given-name @seq ce:initials @_fa ce:surname      @auid
1        Wricha    1          W. true      Tyagi 8675093800
                                                    author-url ce:indexed-name
1 https://api.elsevier.com/content/author/author_id/8675093800        Tyagi W.
  preferred-name.ce:given-name preferred-name.ce:initials preferred-name.ce:surname
1                       Wricha                         W.                     Tyagi
  preferred-name.ce:indexed-name affiliation.@id
1                       Tyagi W.       109874624
                                                      affiliation.@href
1 https://api.elsevier.com/content/affiliation/affiliation_id/109874624

$link
  @_fa           @rel
1 true           self
2 true         scopus
3 true scopus-citedby
                                                                                       @href
1                            https://api.elsevier.com/content/abstract/scopus_id/85081719894
2  https://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=85081719894&origin=inward
3 https://www.scopus.com/inward/citedby.uri?partnerID=HzOxMe3b&scp=85081719894&origin=inward

$`prism:publicationName`
[1] "Scientific Reports"

$`source-id`
[1] "21100200805"

$`citedby-count`
[1] "0"

$`prism:volume`
[1] "10"

$subtype
[1] "ar"

$`dc:title`
[1] "Root transcriptome reveals efficient cell signaling and energy conservation key to aluminum toxicity tolerance in acidic soil adapted rice genotype"

$openaccess
[1] "1"

$openaccessFlag
[1] "true"

$`prism:doi`
[1] "10.1038/s41598-020-61305-7"

$`prism:issn`
[1] "20452322"

$`article-number`
[1] "4580"

$`dc:identifier`
[1] "SCOPUS_ID:85081719894"

$`dc:publisher`
[1] "Nature Research"

>   data$coredata$`dc:description`
NULL

It should be stated that names(data) only retrieves the fields 'affiliation' and 'coredata'. Is there something that I have missed? I have attached
Session_Info_9June2020.txt
, for more detail.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions