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 version information not returned by Search API results #6396

Closed
tainguyenbui opened this issue Nov 22, 2019 · 5 comments · Fixed by #6441
Closed

dataset version information not returned by Search API results #6396

tainguyenbui opened this issue Nov 22, 2019 · 5 comments · Fixed by #6441
Assignees

Comments

@tainguyenbui
Copy link
Contributor

tainguyenbui commented Nov 22, 2019

API Version
v. 4.18.1 build 267-a91d370

Description
The results returned by Dataverse when an authenticated Search is performed through the Search API are missing vital information to identify the version of the results.

This search is meant to return published and unpublished data

Current response

{
    "status": "OK",
    "data": {
        "q": "test",
        "total_count": 2,
        "start": 0,
        "spelling_alternatives": {},
        "items": [
            {
                "name": "Test",
                "type": "dataset",
                "url": "https://doi.org/10.70122/FK2/B3DD2U",
                "global_id": "doi:10.70122/FK2/B3DD2U",
                "description": "Some test",
                "published_at": "2019-11-21T10:31:07Z",
                "citationHtml": "Nguyen, Tai, 2019, \"Test\", <a href=\"https://doi.org/10.70122/FK2/B3DD2U\" target=\"_blank\">https://doi.org/10.70122/FK2/B3DD2U</a>, Demo Dataverse, V24, UNF:6:3P92OI0LZBPjC03KGIzYdg== [fileUNF]",
                "identifier_of_dataverse": "theam",
                "name_of_dataverse": "Theam Dataverse",
                "citation": "Nguyen, Tai, 2019, \"Test\", https://doi.org/10.70122/FK2/B3DD2U, Demo Dataverse, V24, UNF:6:3P92OI0LZBPjC03KGIzYdg== [fileUNF]",
                "authors": [
                    "Nguyen, Tai"
                ]
            },
            {
                "name": "test",
                "type": "dataset",
                "url": "https://doi.org/10.70122/FK2/21YOAO",
                "global_id": "doi:10.70122/FK2/21YOAO",
                "published_at": "2019-10-08T13:59:26Z",
                "citationHtml": "2019, \"test\", <a href=\"https://doi.org/10.70122/FK2/21YOAO\" target=\"_blank\">https://doi.org/10.70122/FK2/21YOAO</a>, Demo Dataverse, V1",
                "identifier_of_dataverse": "theam",
                "name_of_dataverse": "Theam Dataverse",
                "citation": "2019, \"test\", https://doi.org/10.70122/FK2/21YOAO, Demo Dataverse, V1"
            }
        ],
        "count_in_response": 2
    }
}

The problem we find is the fact that it is not possible to know what version of the dataset is each result unless we citationHtml or citation properties of each item.

Steps to reproduce

  • Create a dataset or use an existing one
  • Make a modification in the dataset, e.g. adding a new file, and DO NOT Publish the new version
  • Perform an authenticated search, providing your API token, where the dataset just modified appears

Expected behaviour

  • Version information is provided, for instance, versionState, and version numbers.

It would be great if it could also return the id of the dataset

Actual Behaviour

  • No information about the dataset is provided
{
                "name": "test",
                "type": "dataset",
                "url": "https://doi.org/10.70122/FK2/21YOAO",
                "global_id": "doi:10.70122/FK2/21YOAO",
                "published_at": "2019-10-08T13:59:26Z",
                "citationHtml": "2019, \"test\", <a href=\"https://doi.org/10.70122/FK2/21YOAO\" target=\"_blank\">https://doi.org/10.70122/FK2/21YOAO</a>, Demo Dataverse, V1",
                "identifier_of_dataverse": "theam",
                "name_of_dataverse": "Theam Dataverse",
                "citation": "2019, \"test\", https://doi.org/10.70122/FK2/21YOAO, Demo Dataverse, V1"
            }
@pdurbin
Copy link
Member

pdurbin commented Nov 22, 2019

Hmm, good point. I assume you'd want "draft" or "1.1" rather than the database id from the "datasetversion" table. We could provide both.

It would be great if it could also return the id of the dataset

This is already possible if you set "show_entity_ids" to true. Please see http://guides.dataverse.org/en/4.18.1/api/search.html#parameters

@tainguyenbui
Copy link
Contributor Author

tainguyenbui commented Nov 22, 2019

@pdurbin thanks for the id suggestion, I definitely missed tat one.

In terms of the version, I think the versionState is displayed, as it is displayed for other endpoints such as the ones retrieving dataset information, where the possible values for versionState is DRAFT, RELEASED, etc. would be great. And then, if it is RELEASED then company it with the minor and major version, e.g. majorVersion 1, minorVersion 0

@pdurbin
Copy link
Member

pdurbin commented Nov 22, 2019

@tainguyenbui makes sense. Can you please update the title of this issue to be a bit more specific about the scope? So far all these suggestions seem easy to implement. Thanks in advance!

@tainguyenbui tainguyenbui changed the title Problem with Search API results when performing an authenticated request dataset version information not returned by Search API results when performing an authenticated request Nov 22, 2019
@tainguyenbui tainguyenbui changed the title dataset version information not returned by Search API results when performing an authenticated request dataset version information not returned by Search API results Nov 22, 2019
@tainguyenbui
Copy link
Contributor Author

tainguyenbui commented Nov 22, 2019

title updated, thanks a lot

@pdurbin
Copy link
Member

pdurbin commented Dec 5, 2019

We discussed this issue at tech hours on Tuesday and estimated it independently from #6300 but said it might be worth rolling these changes into a single pull request for both issues.

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