The DataCite GraphQL API is now open for (pre-release) business

#1

From the DataCite Blog:

DataCite DOIs describe resources such as datasets, samples, software and publications with rich metadata. An important part of this metadata is the description of connections between resources that use persistent identifiers (PIDs) provided by DataCite and others (Crossref, ORCID, ROR, ISNI, IGSN, etc.). Together these resources and their connections form a graph, the PID Graph.

Accessing information available in this PID Graph, while preserving the rich connections between resources, is not trivial, and the JSON REST APIs that most PID service providers including DataCite are providing to users, while having a very good track record allowing users to access a single resource or a list of similar resources, might not be the best fit for more complex queries of the PID Graph.

Enter GraphQL, a query language that uses a graph as the underlying data model and aligns well with the kinds of queries that need to be supported in the PID Graph. GraphQL was started by Facebook in 2012, made available as Open Source software in 2015, and in 2019 has become a mainstream technology with broad support in terms of libraries, tools and services.

Today DataCite is announcing the pre-release version of the DataCite GraphQL API, and we invite you to try it out at https://api.datacite.org/graphql. GraphQL works very differently from the REST APIs that most of us are familiar with: you need a special client application (e.g. this one or this one) to use a GraphQL API, and all API calls are done to the same URL and using the POST method.

4 Likes
#2

Hi

It looks very interesting and playing with it on https://www.graphqlbin.com/v2/new , I think I kinda get the idea.

But I wonder if it would be helpful to post some more complicated sample queries , perhaps some of those posted in the PID stories.

For example, given an ORCID, give me via Datacite, records with resource type dataset?

A similar one by organzation (using ror) might be useful but I guess there won’t be many so far.

Some sample queries for us not very technical types to play with would be very helpful.

#3

Aaron, here is an example starting with an ORCID ID, and returning all datasets (that DataCite knows about) authored by that person:

{
  researcher(id: "https://orcid.org/0000-0003-0159-013X") {
    givenName
    familyName
    datasets {
      totalCount
      nodes {
        id
        titles {
          title
        }
        publisher
        publicationYear
        relatedIdentifiers {
          relationType
          relatedIdentifier
        }
      }
    }
  }
}
1 Like