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

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

Open
jefferya opened this issue Apr 9, 2021 · 1 comment
Open

Comments

@jefferya
Copy link
Collaborator

jefferya commented Apr 9, 2021

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
Copy link
Contributor

lucaju commented Mar 29, 2022

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

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

No branches or pull requests

2 participants