SPARQL - Unknown namespace prefix error
问题 I have a python file with imported rdflib and some SPARQL query implemented from rdflib import Graph import html5lib if __name__ == '__main__': g = Graph() g.parse('http://localhost:8085/weather-2.html', format='rdfa') res1 = g.parse('http://localhost:8085/weather-2.html', format='rdfa') print(res1.serialize(format='pretty-xml').decode("utf-8")) print() res2 = g.query("""SELECT ?obj WHERE { <http://localhost:8085/weather-2.html> weather:region ?obj . } """) for row in res2: print(row) res1