Skip to content

Commit

Permalink
Support provider id back from API
Browse files Browse the repository at this point in the history
Now the DataCite API supports provider relations in the response, we can correctly parse this and instead use this.
This fixes final part of #53
  • Loading branch information
richardhallett committed Nov 5, 2020
1 parent 6c65064 commit 292e891
Show file tree
Hide file tree
Showing 6 changed files with 10,658 additions and 10,577 deletions.
1 change: 1 addition & 0 deletions tests/integration/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ class Meta:
rights = []
sizes = []
client = 'DATACITE.DATACITE'
provider = 'DATACITE'
active = True
338 changes: 169 additions & 169 deletions tests/integration/fixtures/datacite_api_doi.json
Original file line number Diff line number Diff line change
@@ -1,181 +1,181 @@
{
"data": {
"id": "10.5438/prvv-nv23",
"type": "dois",
"data": {
"id": "10.5438/prvv-nv23",
"type": "dois",
"attributes": {
"doi": "10.5438/prvv-nv23",
"prefix": "10.5438",
"suffix": "prvv-nv23",
"identifiers": [
{
"identifier": "https://doi.org/10.5438/prvv-nv23",
"identifierType": "DOI"
}
],
"creators": [
{
"name": "Fenner, Martin",
"nameType": "Personal",
"givenName": "Martin",
"familyName": "Fenner",
"affiliation": ["DataCite"],
"nameIdentifiers": [
{
"schemeUri": "https://orcid.org",
"nameIdentifier": "https://orcid.org/0000-0003-1419-2405",
"nameIdentifierScheme": "ORCID"
}
]
},
{
"name": "Hallett, Richard",
"nameType": "Personal",
"givenName": "Richard",
"familyName": "Hallett",
"affiliation": ["DataCite"],
"nameIdentifiers": [
{
"schemeUri": "https://orcid.org",
"nameIdentifier": "https://orcid.org/0000-0002-8599-0773",
"nameIdentifierScheme": "ORCID"
}
]
}
],
"titles": [
{
"title": "Welcome to the DataCite Team, Richard!"
}
],
"publisher": "DataCite",
"container": {},
"publicationYear": 2018,
"subjects": [
{
"subject": "datacite"
}
],
"contributors": [],
"dates": [
{
"date": "2018-01-18",
"dateType": "Issued"
},
{
"date": "2018-01-18",
"dateType": "Created"
},
{
"date": "2018-01-18",
"dateType": "Updated"
}
],
"language": null,
"types": {
"ris": "GEN",
"bibtex": "article",
"citeproc": "post-weblog",
"schemaOrg": "BlogPosting",
"resourceTypeGeneral": "Text"
},
"relatedIdentifiers": [
{
"relationType": "IsPartOf",
"relatedIdentifier": "10.5438/0000-00ss",
"resourceTypeGeneral": "Text",
"relatedIdentifierType": "DOI"
}
],
"sizes": [],
"formats": null,
"version": "1.0",
"rightsList": [
{
"rights": null,
"rightsUri": null
}
],
"descriptions": [
{
"lang": null,
"description": "DataCite is pleased to welcome Richard Hallett to our team. Richard joined DataCite as application developer in December. Get to know him better via this interview. Richard Hallett Can you tell us a little bit about what you did before you started...",
"descriptionType": "Abstract"
}
],
"geoLocations": [{}],
"fundingReferences": null,
"xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHJlc291cmNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC00L21ldGFkYXRhLnhzZCI+CiAgPGlkZW50aWZpZXIgaWRlbnRpZmllclR5cGU9IkRPSSI+MTAuNTQzOC9QUlZWLU5WMjM8L2lkZW50aWZpZXI+CiAgPGNyZWF0b3JzPgogICAgPGNyZWF0b3I+CiAgICAgIDxjcmVhdG9yTmFtZSBuYW1lVHlwZT0iUGVyc29uYWwiPkZlbm5lciwgTWFydGluPC9jcmVhdG9yTmFtZT4KICAgICAgPGdpdmVuTmFtZT5NYXJ0aW48L2dpdmVuTmFtZT4KICAgICAgPGZhbWlseU5hbWU+RmVubmVyPC9mYW1pbHlOYW1lPgogICAgICA8bmFtZUlkZW50aWZpZXIgbmFtZU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ub3cgaGltIGJldHRlciB2aWEgdGhpcyBpbnRlcnZpZXcuIFJpY2hhcmQgSGFsbGV0dCBDYW4geW91IHRlbGwgdXMgYSBsaXR0bGUgYml0IGFib3V0IHdoYXQgeW91IGRpZCBiZWZvcmUgeW91IHN0YXJ0ZWQuLi48L2Rlc2NyaXB0aW9uPgogIDwvZGVzY3JpcHRpb25zPgogIDxnZW9Mb2NhdGlvbnM+CiAgICA8Z2VvTG9jYXRpb24vPgogIDwvZ2VvTG9jYXRpb25zPgo8L3Jlc291cmNlPgo=",
"url": "https://blog.datacite.org/welcome-to-team-richard/",
"contentUrl": null,
"metadataVersion": 5,
"schemaVersion": null,
"source": null,
"isActive": true,
"state": "findable",
"reason": null,
"created": "2018-03-17T06:33:00.000Z",
"registered": "2018-10-17T05:48:57.000Z",
"published": "2018",
"updated": "2019-08-10T08:02:12.000Z"
},
"relationships": {
"client": {
"data": {
"id": "datacite.blog",
"type": "clients"
}
},
"provider": {
"data": {
"id": "dryad",
"type": "providers"
}
},
"media": {
"data": {
"id": "10.5438/prvv-nv23",
"type": "media"
}
}
}
},
"included": [
{
"id": "datacite.blog",
"type": "clients",
"attributes": {
"doi": "10.5438/prvv-nv23",
"prefix": "10.5438",
"suffix": "prvv-nv23",
"identifiers": [
{
"identifier": "https://doi.org/10.5438/prvv-nv23",
"identifierType": "DOI"
}
],
"creators": [
{
"name": "Fenner, Martin",
"nameType": "Personal",
"givenName": "Martin",
"familyName": "Fenner",
"affiliation": [
"DataCite"
],
"nameIdentifiers": [
{
"schemeUri": "https://orcid.org",
"nameIdentifier": "https://orcid.org/0000-0003-1419-2405",
"nameIdentifierScheme": "ORCID"
}
]
},
{
"name": "Hallett, Richard",
"nameType": "Personal",
"givenName": "Richard",
"familyName": "Hallett",
"affiliation": [
"DataCite"
],
"nameIdentifiers": [
{
"schemeUri": "https://orcid.org",
"nameIdentifier": "https://orcid.org/0000-0002-8599-0773",
"nameIdentifierScheme": "ORCID"
}
]
}
],
"titles": [
{
"title": "Welcome to the DataCite Team, Richard!"
}
],
"publisher": "DataCite",
"container": {},
"publicationYear": 2018,
"subjects": [
{
"subject": "datacite"
}
],
"contributors": [],
"dates": [
{
"date": "2018-01-18",
"dateType": "Issued"
},
{
"date": "2018-01-18",
"dateType": "Created"
},
{
"date": "2018-01-18",
"dateType": "Updated"
}
],
"name": "DataCite Blog",
"symbol": "DATACITE.BLOG",
"year": 2019,
"contactEmail": "[email protected]",
"alternateName": null,
"description": null,
"language": null,
"types": {
"ris": "GEN",
"bibtex": "article",
"citeproc": "post-weblog",
"schemaOrg": "BlogPosting",
"resourceTypeGeneral": "Text"
},
"relatedIdentifiers": [
{
"relationType": "IsPartOf",
"relatedIdentifier": "10.5438/0000-00ss",
"resourceTypeGeneral": "Text",
"relatedIdentifierType": "DOI"
}
],
"sizes": [],
"formats": null,
"version": "1.0",
"rightsList": [
{
"rights": null,
"rightsUri": null
}
],
"descriptions": [
{
"lang": null,
"description": "DataCite is pleased to welcome Richard Hallett to our team. Richard joined DataCite as application developer in December. Get to know him better via this interview. Richard Hallett Can you tell us a little bit about what you did before you started...",
"descriptionType": "Abstract"
}
],
"geoLocations": [
{}
],
"fundingReferences": null,
"xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHJlc291cmNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC00L21ldGFkYXRhLnhzZCI+CiAgPGlkZW50aWZpZXIgaWRlbnRpZmllclR5cGU9IkRPSSI+MTAuNTQzOC9QUlZWLU5WMjM8L2lkZW50aW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lzdD4KICA8ZGVzY3JpcHRpb25zPgogICAgPGRlc2NyaXB0aW9uIGRlc2NyaXB0aW9uVHlwZT0iQWJzdHJhY3QiPkRhdGFDaXRlIGlzIHBsZWFzZWQgdG8gd2VsY29tZSBSaWNoYXJkIEhhbGxldHQgdG8gb3VyIHRlYW0uIFJpY2hhcmQgam9pbmVkIERhdGFDaXRlIGFzIGFwcGxpY2F0aW9uIGRldmVsb3BlciBpbiBEZWNlbWJlci4gR2V0IHRvIGtub3cgaGltIGJldHRlciB2aWEgdGhpcyBpbnRlcnZpZXcuIFJpY2hhcmQgSGFsbGV0dCBDYW4geW91IHRlbGwgdXMgYSBsaXR0bGUgYml0IGFib3V0IHdoYXQgeW91IGRpZCBiZWZvcmUgeW91IHN0YXJ0ZWQuLi48L2Rlc2NyaXB0aW9uPgogIDwvZGVzY3JpcHRpb25zPgogIDxnZW9Mb2NhdGlvbnM+CiAgICA8Z2VvTG9jYXRpb24vPgogIDwvZ2VvTG9jYXRpb25zPgo8L3Jlc291cmNlPgo=",
"url": "https://blog.datacite.org/welcome-to-team-richard/",
"contentUrl": null,
"metadataVersion": 5,
"schemaVersion": null,
"source": null,
"clientType": "repository",
"domains": "*",
"issn": null,
"url": "https://blog.datacite.org",
"created": "2019-01-02T14:27:23.000Z",
"updated": "2019-01-02T17:22:42.000Z",
"isActive": true,
"state": "findable",
"reason": null,
"created": "2018-03-17T06:33:00.000Z",
"registered": "2018-10-17T05:48:57.000Z",
"published": "2018",
"updated": "2019-08-10T08:02:12.000Z"
"hasPassword": true
},
"relationships": {
"client": {
"provider": {
"data": {
"id": "datacite.blog",
"type": "clients"
"id": "datacite",
"type": "providers"
}
},
"media": {
"data": {
"id": "10.5438/prvv-nv23",
"type": "media"
}
}
}
},
"included": [
{
"id": "datacite.blog",
"type": "clients",
"attributes": {
"name": "DataCite Blog",
"symbol": "DATACITE.BLOG",
"year": 2019,
"contactEmail": "[email protected]",
"alternateName": null,
"description": null,
"language": null,
"clientType": "repository",
"domains": "*",
"issn": null,
"url": "https://blog.datacite.org",
"created": "2019-01-02T14:27:23.000Z",
"updated": "2019-01-02T17:22:42.000Z",
"isActive": true,
"hasPassword": true
},
"relationships": {
"provider": {
"data": {
"id": "datacite",
"type": "providers"
"prefixes": {
"data": [
{
"id": "10.5438",
"type": "prefixes"
}
},
"prefixes": {
"data": [
{
"id": "10.5438",
"type": "prefixes"
}
]
}
]
}
}
]
}
}
]
}
Loading

0 comments on commit 292e891

Please sign in to comment.