You can get JSON without having to create custom headers with simpy requesting
If you are only interested in the rdfs:label object, you can request the endpoint using the template request URL:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select*%7Bdbpedia%3ALos_Angeles+rdfs%3Alabel+%3Flabel%7D&format=json
which matches the request
select*{dbpedia:Los_Angeles rdfs:label ?label}
SPARQL Results
which generates JSON:
{ "head": { "link": [], "vars": ["label"] }, "results": { "distinct": false, "ordered": true, "bindings": [ { "label": { "type": "literal", "xml:lang": "uk", "value": "\u041B\u043E\u0441-\u0410\u043D\u0434\u0436\u0435\u043B\u0435\u0441" }}, { "label": { "type": "literal", "xml:lang": "vi", "value": "Los Angeles" }}, { "label": { "type": "literal", "xml:lang": "zh", "value": "\u6D1B\u6749\u77F6" }}, { "label": { "type": "literal", "xml:lang": "ca", "value": "Los Angeles" }}, { "label": { "type": "literal", "xml:lang": "cs", "value": "Los Angeles" }}, { "label": { "type": "literal", "xml:lang": "de", "value": "Los Angeles" }}, { "label": { "type": "literal", "xml:lang": "en", "value": "Los Angeles" }} ] } }
source share