PID Graph GraphQL Example Grant-funded Outputs

User story

As a funder, we want to be able to find all the outputs related to our awarded grants, including block grants such as doctoral training grants, for management info and looking at impact.

Query strategy

We use the award number of the grant we are interested in (FREYA in this case) to find all research outputs funded by this grant. We then fetch information about these research outputs. We also fetch metadata about each of these research outputs in bibtex format, which can be used to import them into a reference manager, e.g. to generate a report.

Why GraphQL

GraphQL allows us to only fetch information we need, and to combine information from multiple backend services, which would otherwise require multiple API calls. In this example we fetch a number of fields for all 60+ research outputs returned by the query, plus all returned outputs in bibtex format. Thiw would normally require content negotiation, with a separate API calls for each research output.

Use the following query in the GraphQL client at https://api.datacite.org/graphql

{
  works(query: "fundingReferences.awardNumber:777523", first: 75) {
    totalCount
    nodes {
      id
      type
      bibtex
      titles {
        title
      }
      descriptions {
        description
      }
      creators {
        id
        name
        affiliation {
          id
          name
        }
      }
      fundingReferences {
        funderIdentifier
        funderName
        awardNumber
        awardTitle
      }
      citationCount
      viewCount
      downloadCount
    }
  }
}

Related GitHub issues from 2018 FREYA workshop:

@Ricarda_Braukmann and @maddenfc this query could be used to generate a bibtex file of FREYA outputs, e.g. via a simple Jupyter notebook.

1 Like