Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset id not being returned when retrieving specific version of a dataset #6397

Closed
tainguyenbui opened this issue Nov 22, 2019 · 2 comments · Fixed by #6511
Closed

Dataset id not being returned when retrieving specific version of a dataset #6397

tainguyenbui opened this issue Nov 22, 2019 · 2 comments · Fixed by #6511

Comments

@tainguyenbui
Copy link
Contributor

API version
v4.18

Description
When retrieving dataset information for as specific version, for instance, :latest-published, the dataset id is not returned, instead, dataset version id is returned, which is referenced in the files of the dataset.

The endpoint being used is:
https://demo.dataverse.org/api/datasets/389605/versions/:latest-published

Current response

{
    "status": "OK",
    "data": {
        "id": 52869,
        "storageIdentifier": "file://10.70122/FK2/B3DD2U",
        "versionNumber": 24,
        "versionMinorNumber": 0,
        "versionState": "RELEASED",
        "productionDate": "Production Date",
        "UNF": "UNF:6:3P92OI0LZBPjC03KGIzYdg==",
        "lastUpdateTime": "2019-11-21T10:31:07Z",
        "releaseTime": "2019-11-21T10:31:07Z",
        "createTime": "2019-11-21T10:31:02Z",
        "license": "CC0",
        "termsOfUse": "CC0 Waiver",
        "fileAccessRequest": false,
        "metadataBlocks": {
            "citation": {
                "displayName": "Citation Metadata",
                "fields": [
                    {
                        "typeName": "title",
                        "multiple": false,
                        "typeClass": "primitive",
                        "value": "Test"
                    },
                    {
                        "typeName": "author",
                        "multiple": true,
                        "typeClass": "compound",
                        "value": [
                            {
                                "authorName": {
                                    "typeName": "authorName",
                                    "multiple": false,
                                    "typeClass": "primitive",
                                    "value": "Nguyen, Tai"
                                }
                            }
                        ]
                    },
                    {
                        "typeName": "datasetContact",
                        "multiple": true,
                        "typeClass": "compound",
                        "value": [
                            {
                                "datasetContactName": {
                                    "typeName": "datasetContactName",
                                    "multiple": false,
                                    "typeClass": "primitive",
                                    "value": "Nguyen, Tai"
                                },
                                "datasetContactEmail": {
                                    "typeName": "datasetContactEmail",
                                    "multiple": false,
                                    "typeClass": "primitive",
                                    "value": "tai@theagilemonkeys.com"
                                }
                            }
                        ]
                    },
                    {
                        "typeName": "dsDescription",
                        "multiple": true,
                        "typeClass": "compound",
                        "value": [
                            {
                                "dsDescriptionValue": {
                                    "typeName": "dsDescriptionValue",
                                    "multiple": false,
                                    "typeClass": "primitive",
                                    "value": "Some test"
                                }
                            }
                        ]
                    },
                    {
                        "typeName": "subject",
                        "multiple": true,
                        "typeClass": "controlledVocabulary",
                        "value": [
                            "Other"
                        ]
                    },
                    {
                        "typeName": "depositor",
                        "multiple": false,
                        "typeClass": "primitive",
                        "value": "Nguyen, Tai"
                    },
                    {
                        "typeName": "dateOfDeposit",
                        "multiple": false,
                        "typeClass": "primitive",
                        "value": "2019-09-03"
                    }
                ]
            }
        },
        "files": [
            {
                "label": "original.csv",
                "restricted": false,
                "version": 1,
                "datasetVersionId": 52869,
                "dataFile": {
                    "id": 395739,
                    "persistentId": "",
                    "pidURL": "",
                    "filename": "original.csv",
                    "contentType": "text/csv",
                    "filesize": 1246005,
                    "storageIdentifier": "16e8d83dd38-3787d72dc0c9",
                    "rootDataFileId": 395739,
                    "md5": "573eca15875947a70551a75b2f55aa70",
                    "checksum": {
                        "type": "MD5",
                        "value": "573eca15875947a70551a75b2f55aa70"
                    },
                    "creationDate": "2019-11-21"
                }
            }
        ]
    }
}

Desired response:
Same response as above with some extra properties:

  • dataset id (not dataset version id)
  • doi
@scolapasta
Copy link
Contributor

Since it is a specific API to get a version, we should leave the id there, but also add dataset_id. (or we could add a block for dataset and id be part of that). Additionally, we should be careful about DOI - we still eventually want version DOIs, so we should make sure it is dataset_doi (or if we go with the block approach, put it in there). Might be worth looking at an API that gets the file metadata and how/if we refer to the dataset there.

@pdurbin
Copy link
Member

pdurbin commented Jan 13, 2020

I just created pull request #6511 for this issue.

Might be worth looking at an API that gets the file metadata and how/if we refer to the dataset there.

When someone calls .get("api/files/" + fileId + "/metadata/?key=" + apiToken); this is what's returned:

{
  "label": "acoollabel.tab",
  "description": "A description.",
  "restricted": false,
  "provFreeForm": "provenance is great",
  "categories": [
    "A category"
  ],
  "id": 710
}

That is to say, neither the dataset id nor DOI is shown.

@pdurbin pdurbin removed their assignment Jan 13, 2020
kcondon added a commit that referenced this issue Jan 21, 2020
expose dataset ID and DOI/Handle in version response #6397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants