def _output(self, url):
"""
Downloads and returns the output avoiding w3.org error
"""
response = requests.get(url)
html = response.text
html = html.replace('w3.org', 'www.w3.org')
graph = rdflib.Graph()
parsed_graph = graph.parse(data=html, format="xml")
result = []
stresult = []
for s, p, o in parsed_graph:
if type(o) == rdflib.term.Literal:
result.append(o.toPython())
else:
stresult.append(o.toPython())
return result, stresult
评论列表
文章目录