cwrc / Islandora-CWRC-Writer

Islandora wrapper for the CWRC-Writer.
https://github.com/cwrc/CWRC-Writer
GNU General Public License v3.0
0 stars 3 forks source link

DBPedia lookup fails: returns XML whereas the expectation is JSON #61

Open jefferya opened 3 years ago

jefferya commented 3 years ago

Current Behaviour

Current API request is returning and XML response instead of a JSON formatted response.

Test: using curl to talk directly with DBpedia, the accept header doesn't seem to trigger a JSON response as the documentation here suggests https://github.com/dbpedia/lookup#json-support (and I seem to remember functioning):

curl -i -H "Accept: application/json" https://lookup.dbpedia.org/api/search/KeywordSearch?QueryClass=person&MaxHits=5&QueryString=Keller

Possible Solution

There appears to be a new API https://github.com/dbpedia/lookup#important-note

Or perhaps the problem is temporary

Steps to Reproduce (for bugs)

  1. Within CWRC-Writer: select text and click on the find a person button
  2. select the DBPedia
  3. result SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Maybe some more details in the forum.

lucaju commented 2 years ago

This was solved by adding format=json parameter to the request. curl -i -H "Accept: application/json" https://lookup.dbpedia.org/api/search/KeywordSearch?QueryClass=person&MaxHits=5&QueryString=Keller&format=json