Date filter in graphql query, for extracting work entries since X from a query

Hi. I would like to run a query on datacite (the grapql api or any other) that returns me all ids of registered works since date X. Then in a second step I would like to extract the registered metadata records.
I like the graph because it finds more connected works then if one queries the REST API for a certain ror id.

So far I have a query returning the ids related to a certain organization:

{organization(id: "https://ror.org/02nv7yv05") {
  id name
  works (first:3)
{totalCount pageInfo {endCursor hasNextPage} 
nodes {id doi relatedIdentifiers{relatedIdentifier relationType}}}}}

But I did not figure out how to set a date filter, to only receive datacite records updated since a certain date.

There is the registered date on the node site and the published key by the work class.

Or would you recommend to do this differently over other APIs?
I could also get all ids all the time and then go over OAI-PMH for these ids.

Thanks!

Hi @jbroeder, I’m checking on whether this is possible in GraphQL.

You can sort and filter by date updated via the REST API. For example: https://api.datacite.org/dois?sort=-updated&query=updated:>2023-11-18 retrieves DOIs updated since 2023-11-18, sorted by most recently to least recently updated.

@jbroeder Here is a GraphQL query with the “updated” filter applied:

{
  organization(id: "https://ror.org/02nv7yv05") {
    id
    name
    works(first: 3, query: "updated:>2023-11-18") {
      totalCount
      pageInfo {
        endCursor
        hasNextPage
      }
      nodes {
        id
        doi
        relatedIdentifiers {
          relatedIdentifier
          relationType
        }
      }
    }
  }
}