curl
Get the Person ontology class definition
curl 'http://dbpedia.org/ontology/Person' \
-d '"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>406 Not Acceptable</title>\n</head><body>\n<h1>406 Not Acceptable</h1>\n<p>An appropriate representation of the requested resource Person could not be found on this server.</p>\nAvailable variant(s):\n<ul>\n<li><a href=\"Person\">Person</a> , type text/html, charset UTF-8</li>\n</ul>\n</body></html>\n"'
import requests
resp = requests.get(
"http://dbpedia.org/ontology/Person",
json="<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>406 Not Acceptable</title>\n</head><body>\n<h1>406 Not Acceptable</h1>\n<p>An appropriate representation of the requested resource Person could not be found on this server.</p>\nAvailable variant(s):\n<ul>\n<li><a href=\"Person\">Person</a> , type text/html, charset UTF-8</li>\n</ul>\n</body></html>\n",
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("dbpedia")
result = api.fetch("ontology/{class}")
for item in result:
print(item)
const body = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>406 Not Acceptable</title>\n</head><body>\n<h1>406 Not Acceptable</h1>\n<p>An appropriate representation of the requested resource Person could not be found on this server.</p>\nAvailable variant(s):\n<ul>\n<li><a href=\"Person\">Person</a> , type text/html, charset UTF-8</li>\n</ul>\n</body></html>\n";
const resp = await fetch("http://dbpedia.org/ontology/Person", {
body: JSON.stringify(body),
});
const data = await resp.json();