Instantly share code, notes, and snippets.
Last active
June 11, 2024 16:32
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save digitaldogsbody/4d88405c46f0a481a0b95641e32ca06a to your computer and use it in GitHub Desktop.
Get related works from DataCite GraphQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write your query or mutation here | |
query getRelatedContentDoiQuery( | |
$id: ID! | |
$filterQuery: String | |
$cursor: String | |
$published: String | |
$resourceTypeId: String | |
$fieldOfScience: String | |
$language: String | |
$license: String | |
$registrationAgency: String | |
$repositoryId: String | |
) { | |
work(id: $id) { | |
doi | |
types { | |
resourceTypeGeneral | |
resourceType | |
__typename | |
} | |
type | |
publisher { | |
name | |
} | |
publicationYear | |
titles { | |
title | |
} | |
creators { | |
id | |
name | |
affiliation { | |
id | |
name | |
} | |
} | |
citations( | |
first: 25 | |
query: $filterQuery | |
after: $cursor | |
published: $published | |
resourceTypeId: $resourceTypeId | |
fieldOfScience: $fieldOfScience | |
language: $language | |
license: $license | |
registrationAgency: $registrationAgency | |
repositoryId: $repositoryId | |
) { | |
...WorkConnectionFragment | |
nodes { | |
...WorkFragment | |
__typename | |
} | |
__typename | |
} | |
references( | |
first: 25 | |
query: $filterQuery | |
after: $cursor | |
published: $published | |
resourceTypeId: $resourceTypeId | |
fieldOfScience: $fieldOfScience | |
language: $language | |
license: $license | |
registrationAgency: $registrationAgency | |
repositoryId: $repositoryId | |
) { | |
...WorkConnectionFragment | |
nodes { | |
...WorkFragment | |
__typename | |
} | |
__typename | |
} | |
parts( | |
first: 25 | |
query: $filterQuery | |
after: $cursor | |
published: $published | |
resourceTypeId: $resourceTypeId | |
fieldOfScience: $fieldOfScience | |
language: $language | |
license: $license | |
registrationAgency: $registrationAgency | |
repositoryId: $repositoryId | |
) { | |
...WorkConnectionFragment | |
nodes { | |
...WorkFragment | |
__typename | |
} | |
__typename | |
} | |
partOf( | |
first: 25 | |
query: $filterQuery | |
after: $cursor | |
published: $published | |
resourceTypeId: $resourceTypeId | |
fieldOfScience: $fieldOfScience | |
language: $language | |
license: $license | |
registrationAgency: $registrationAgency | |
repositoryId: $repositoryId | |
) { | |
...WorkConnectionFragment | |
nodes { | |
...WorkFragment | |
__typename | |
} | |
__typename | |
} | |
otherRelated( | |
first: 25 | |
query: $filterQuery | |
after: $cursor | |
published: $published | |
resourceTypeId: $resourceTypeId | |
fieldOfScience: $fieldOfScience | |
language: $language | |
license: $license | |
registrationAgency: $registrationAgency | |
repositoryId: $repositoryId | |
) { | |
...WorkConnectionFragment | |
nodes { | |
...WorkFragment | |
__typename | |
} | |
__typename | |
} | |
__typename | |
} | |
} | |
fragment WorkConnectionFragment on WorkConnectionWithTotal { | |
totalCount | |
totalContentUrl | |
totalOpenLicenses | |
pageInfo { | |
endCursor | |
hasNextPage | |
__typename | |
} | |
resourceTypes { | |
id | |
title | |
count | |
__typename | |
} | |
openLicenseResourceTypes { | |
id | |
title | |
count | |
__typename | |
} | |
published { | |
id | |
title | |
count | |
__typename | |
} | |
languages { | |
id | |
title | |
count | |
__typename | |
} | |
fieldsOfScience { | |
id | |
title | |
count | |
__typename | |
} | |
licenses { | |
id | |
title | |
count | |
__typename | |
} | |
registrationAgencies { | |
id | |
title | |
count | |
__typename | |
} | |
authors { | |
id | |
title | |
count | |
__typename | |
} | |
creatorsAndContributors { | |
id | |
title | |
count | |
__typename | |
} | |
personToWorkTypesMultilevel { | |
id | |
title | |
count | |
inner { | |
id | |
title | |
count | |
__typename | |
} | |
__typename | |
} | |
__typename | |
} | |
fragment WorkFragment on Work { | |
id | |
doi | |
identifiers { | |
identifier | |
identifierType | |
identifierUrl | |
__typename | |
} | |
types { | |
resourceTypeGeneral | |
resourceType | |
__typename | |
} | |
titles { | |
title | |
__typename | |
} | |
creators { | |
id | |
name | |
givenName | |
familyName | |
affiliation { | |
id | |
name | |
__typename | |
} | |
__typename | |
} | |
descriptions { | |
description | |
descriptionType | |
__typename | |
} | |
publicationYear | |
publisher { | |
name | |
__typename | |
} | |
version | |
container { | |
identifier | |
identifierType | |
title | |
__typename | |
} | |
repository { | |
id: uid | |
name | |
__typename | |
} | |
rights { | |
rights | |
rightsUri | |
rightsIdentifier | |
__typename | |
} | |
claims { | |
state | |
__typename | |
} | |
fieldsOfScience { | |
id | |
name | |
__typename | |
} | |
language { | |
id | |
name | |
__typename | |
} | |
registrationAgency { | |
id | |
name | |
__typename | |
} | |
registered | |
citationCount | |
viewCount | |
downloadCount | |
__typename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment