SparqlWrapper错误-urllib.error.HTTPError:HTTP错误406:不可接受

时间:2019-02-27 20:17:00

标签: python sparql sparqlwrapper

请找到以下查询,当我尝试查询sparql端点时,它会显示406错误。我不知道为什么。有人可以帮我吗?预先感谢。

from SPARQLWrapper import SPARQLWrapper, JSON, POST, DIGEST
import json

sparql = SPARQLWrapper("http://losd.staging.derilinx.com:8890/")
sparql.setCredentials("*******", "********")

query = """
        prefix concpt: <http://ld.linked-open-statistics.org/data/conceptscheme/>
        prefix vocb: <http://ld.linked-open-statistics.org/vocab/>
        prefix data: <http://ld.linked-open-statistics.org/data/>

        select * where {
        ?s ?p ?o .
        }
    """
sparql.addDefaultGraph("http://unemp_rate.italy..staging.derilinx.com")
sparql.setHTTPAuth(DIGEST)
sparql.setQuery(query)
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

错误:

raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 406: Unacceptable

0 个答案:

没有答案