{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/2110","repository_url":"https://api.github.com/repos/IQSS/dataverse","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/2110/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/2110/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/2110/events","html_url":"https://github.com/IQSS/dataverse/issues/2110","id":71833262,"number":2110,"title":"Easier way to get dataset title","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20API","name":"Component: API","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Metadata","name":"Component: Metadata","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Status:%20Triaged","name":"Status: Triaged","color":"66cc66"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-04-29T10:02:48Z","updated_at":"2016-10-15T13:24:13Z","closed_at":null,"body":"At the moment, there is no way to **easily** get the title of a dataset from the JSON response:\r\n\r\n```\r\n{'authority': '10.5072/FK2',\r\n 'id': 177,\r\n 'identifier': 'JIGZKZ',\r\n 'latestVersion': {'createTime': '2015-04-28T15:44:09Z',\r\n                   'files': [{'datafile': {'contentType': 'application/fits',\r\n                                           'description': 'This is a '\r\n                                                          'FITS file '\r\n                                                          'with 1 '\r\n                                                          '(primary) '\r\n                                                          'HDU.\\n'\r\n                                                          'The following '\r\n                                                          'recognized '\r\n                                                          'metadata keys '\r\n                                                          'have been '\r\n                                                          'found in the '\r\n                                                          'FITS file:\\n'\r\n                                                          'INSTRUME; '\r\n                                                          'NAXIS0; '\r\n                                                          'NAXIS1; '\r\n                                                          'TELESCOP; '\r\n                                                          'NAXIS; \\n',\r\n                                           'filename': '%2Fusr%2Flocal%2Fglassfish4%2Fglassfish%2Fdomains%2Fdomain1%2Ffiles%2F10.5072%2FFK2%2FJIGZKZ%2F14d00b49b54-9b3f57881c5d',\r\n                                           'id': 178,\r\n                                           'md5': 'd7a4341002ff45c218ebefd073fe3438',\r\n                                           'name': 'MSX_E.fits',\r\n                                           'originalFormatLabel': 'UNKNOWN'},\r\n                              'datasetVersionId': 56,\r\n                              'description': 'This is a FITS file with 1 '\r\n                                             '(primary) HDU.\\n'\r\n                                             'The following recognized '\r\n                                             'metadata keys have been '\r\n                                             'found in the FITS file:\\n'\r\n                                             'INSTRUME; NAXIS0; NAXIS1; '\r\n                                             'TELESCOP; NAXIS; \\n',\r\n                              'label': 'MSX_E.fits',\r\n                              'version': 1}],\r\n                   'id': 56,\r\n                   'lastUpdateTime': '2015-04-28T15:46:39Z',\r\n                   'metadataBlocks': {'astrophysics': {'displayName': 'Astronomy '\r\n                                                                      'and '\r\n                                                                      'Astrophysics '\r\n                                                                      'Metadata',\r\n                                                       'fields': [{'multiple': True,\r\n                                                                   'typeClass': 'controlledVocabulary',\r\n                                                                   'typeName': 'astroType',\r\n                                                                   'value': ['Image']},\r\n                                                                  {'multiple': True,\r\n                                                                   'typeClass': 'primitive',\r\n                                                                   'typeName': 'astroFacility',\r\n                                                                   'value': ['MSX']},\r\n                                                                  {'multiple': True,\r\n                                                                   'typeClass': 'primitive',\r\n                                                                   'typeName': 'astroInstrument',\r\n                                                                   'value': ['SPIRITIII']}]},\r\n                                      'citation': {'displayName': 'Citation '\r\n                                                                  'Metadata',\r\n                                                   'fields': [{'multiple': False,\r\n                                                               'typeClass': 'primitive',\r\n                                                               'typeName': 'title',\r\n                                                               'value': 'MSX '\r\n                                                                        'Band '\r\n                                                                        'E '\r\n                                                                        'image '\r\n                                                                        'of '\r\n                                                                        'the '\r\n                                                                        'Galactic '\r\n                                                                        'Center'},\r\n                                                              {'multiple': True,\r\n                                                               'typeClass': 'compound',\r\n                                                               'typeName': 'author',\r\n                                                               'value': [{'authorName': {'multiple': False,\r\n                                                                                         'typeClass': 'primitive',\r\n                                                                                         'typeName': 'authorName',\r\n                                                                                         'value': 'Onymous, '\r\n                                                                                                  'A. '\r\n                                                                                                  'N.'}}]},\r\n                                                              {'multiple': True,\r\n                                                               'typeClass': 'compound',\r\n                                                               'typeName': 'datasetContact',\r\n                                                               'value': [{'datasetContactEmail': {'multiple': False,\r\n                                                                                                  'typeClass': 'primitive',\r\n                                                                                                  'typeName': 'datasetContactEmail',\r\n                                                                                                  'value': 'trobitaille@cfa.harvard.edu'},\r\n                                                                          'datasetContactName': {'multiple': False,\r\n                                                                                                 'typeClass': 'primitive',\r\n                                                                                                 'typeName': 'datasetContactName',\r\n                                                                                                 'value': 'Robitaille, '\r\n                                                                                                          'Thomas'}}]},\r\n                                                              {'multiple': True,\r\n                                                               'typeClass': 'compound',\r\n                                                               'typeName': 'dsDescription',\r\n                                                               'value': [{'dsDescriptionValue': {'multiple': False,\r\n                                                                                                 'typeClass': 'primitive',\r\n                                                                                                 'typeName': 'dsDescriptionValue',\r\n                                                                                                 'value': 'Test '\r\n                                                                                                          'MSX '\r\n                                                                                                          'dataset'}}]},\r\n                                                              {'multiple': True,\r\n                                                               'typeClass': 'controlledVocabulary',\r\n                                                               'typeName': 'subject',\r\n                                                               'value': ['Astronomy '\r\n                                                                         'and '\r\n                                                                         'Astrophysics']},\r\n                                                              {'multiple': False,\r\n                                                               'typeClass': 'primitive',\r\n                                                               'typeName': 'depositor',\r\n                                                               'value': 'Robitaille, '\r\n                                                                        'Thomas'},\r\n                                                              {'multiple': False,\r\n                                                               'typeClass': 'primitive',\r\n                                                               'typeName': 'dateOfDeposit',\r\n                                                               'value': '2015-04-28'}]}},\r\n                   'productionDate': 'Production Date',\r\n                   'versionState': 'DRAFT'},\r\n 'persistentUrl': 'http://dx.doi.org/10.5072/FK2/JIGZKZ',\r\n 'protocol': 'doi'}\r\n```\r\n\r\nI basically have to do something like:\r\n\r\n```python\r\n    info =response['latestVersion']\r\n    for field in info['metadataBlocks']['citation']['fields']:\r\n        if field['typeName'] == 'title':\r\n            title = field['value']\r\n            break\r\n    else:\r\n        title = None\r\n```\r\n\r\nWould it not be possible to add the main title of the dataset at the root level of the response?"},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/253984073","html_url":"https://github.com/IQSS/dataverse/issues/2110#issuecomment-253984073","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/2110","id":253984073,"user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T13:24:12Z","updated_at":"2016-10-15T13:24:12Z","body":"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:\r\n\r\n` curl -s 'https://dataverse.harvard.edu/api/datasets/export?exporter=dcterms&persistentId=doi:10.7910/DVN/FAZJE4' | xpath -e '//dcterms:title/text()' `\r\n\r\n```\r\nFound 1 nodes in stdin:\r\n-- NODE --\r\nReplication data for: Roads, Railroads and Decentralization of Chinese Cities\r\n```\r\n\r\nIt'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."}}
{"actor":{"display_login":"pdurbin"}}