Getting works, orgs and people for a special Field Of Science (FOS)

Hi all! I’d like to query entities around a Field of Science (FOS) from Datacite Commons (https://api.datacite.org/graphql).

Example: Which works do we have in the PID Graph that have a fieldsOfScience(id: “sociology”).

I couldn’t figure out a query that works, can someone maybe help me or at least tell me if it should work?

thanks for the question - I’m taking @sarala as I think she or someone in her team may be able to help

Hi,
I think the best place to get to understand the way to query the API would be the support docs DataCite GraphQL API Guide.

A query such as the one below would give you works classified as sociology as in the OECD vocabulary as well as a top list of co-authors of such works and repositories of such works.

{
  works(fieldOfScience:"sociology"){
    authors{
      id
      title
    }
    repositories{
      id
      title
    }
		nodes{
      id
      titles{
        title
      }
    }
  }
}

A query that would give you Organisations would be a bit more involved and for that, I would suggest to study the graphql schema of the DataCite Graphql API (and the graphql query language). A starting point would be to list all organizations but filter their “works” for those that are tagged as “sociology”. Remember that is their “works” the ones that have a FieldOfScience rather than the organizations.

{
  organizations {
    nodes {
      works(fieldOfScience: "sociology") {
        nodes {
          id
        }
      }
    }
  }
}

I hope this helps and I look forward to hearing back from your experience using the GraphQL API, maybe you find a better query :slight_smile: