I have this JSON string that has keys in the form of a URL:
"{\n \"http:\/\/it.dbpedia.org\/resource\/Pasadena\" : {
\"http:\/\/www.w3.org\/2002\/07\/owl#sameAs\" : [ { \"type\" : \"uri\", \"value\" :
\"http:\/\/dbpedia.org\/resource\/Pasadena\" } ] } ,\n
\"http:\/\/cs.dbpedia.org\/resource\/Pasadena_(rozcestn\\u00EDk)\" : {
\"http:\/\/www.w3.org\/2002\/07\/owl#sameAs\" : [ { \"type\" : \"uri\", \"value\" :
\"http:\/\/dbpedia.org\/resource\/Pasadena\" } ] } ,\n
\"http:\/\/de.dbpedia.org\/resource\/Pasadena\" : {
\"http:\/\/www.w3.org\/2002\/07\/owl#sameAs\" : [ { \"type\" : \"uri\", \"value\" :
\"http:\/\/dbpedia.org\/resource\/Pasadena\" } ] } ...
I need to get the array with "http:\/\/www.w3.org\/2002\/07\/owl#sameAs\"
as key.
I parsed it in JS with JSON.parse()
. But unable to locate this key.
var doc = JSON.parse(req.responseText);
var str = "http://dbpedia.org/ontology/populationTotal";
var popTotal = doc.str;
var population = popTotal[0].value;
But this gives undefined as expected. How do I get the values with these characters?