-
Notifications
You must be signed in to change notification settings - Fork 494
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
Easier way to get dataset title #2110
Comments
This reminds me of #761. |
I'm still annoyed by this but at least I found a good way to do it with
Here's the JSON for the dataset: https://github.com/IQSS/dataverse/blob/306bf7ff9fb22c7fd94a4c412198deec22eb1660/scripts/search/tests/data/dataset-finch1.json |
Painful to watch... Let's switch the metadata schema from relational to nosql soon--even if just putting JSON into a postgres field--e.g. the main operations is reading it for the dataset page. |
Note that, strictly speaking, there is no such thing as a "dataset title". A title is a property of a version of a Dataset. So that's one level of indirection that will alway see there (at least, until the application logic changes). |
@michbarsinai sure, but once we're within a dataset version I'm just saying I would prefer something like...
... rather than what we have to do now:
|
fyi: This will re-impact #3241 -- primarily taking time to write "efficient" code to pull the title out of every dataset's version w/o repeating. e.g. need to write custom SQL similar to metrics and not use the ORM layer |
How about adding a "dataset summary" endpoint with easy representation at Open questions: what fields will be included, and what the JSON schema will be. I assume it's not that hard to answer. |
I'm well aware that this issue is about JSON and that people don't like XML very much but I'd like to point out that now that we have export (#907) it isn't too tough to get the title out XML representations of datasets such as Dublin Core:
It's still quite painful to get the title out of the JSON representation. I'm cool with a summary or whatever, as @michbarsinai suggests. Is there any standard, JSON Schema or otherwise, for representing minimal information about a dataset in JSON? Let's implement a standard if there is one. |
This still drives me crazy. I'm hoping that we work on #3599 some day and that it helps in this area. For now, I recommend getting the title via the SWORD API, I guess. Rather than JSON it's XML (bleh!) but at least it's easy to get the title. |
@pdurbin : the unofficial JSON puts the title at the top--as well as keeping it within the citation metadata block: source: https://services.dataverse.harvard.edu/static/swagger-ui/index.html |
@astrofrog these days Dataverse supports exporting in Schema.org JSON-LD so you can get the title ("name"), like this:
(The title is "Block and Block Longitudinal Study, 1969 - 1999" in this example.) Does this help? I don't know why I didn't mention this earlier, but you can also get the title/name from the Search API, like this:
Please let us know if either option helps. |
Closing this, as it appears this space has matured a bit and there are now options/workarounds. |
At the moment, there is no way to easily get the title of a dataset from the JSON response:
I basically have to do something like:
Would it not be possible to add the main title of the dataset at the root level of the response?
The text was updated successfully, but these errors were encountered: