0

我必须运行以下查询

query = """
PREFIX schema: <http://schema.org/>
PREFIX gn: <http://www.geonames.org/ontology#>
select ?Municipality ?Name ?Population
where
{
?Municipality a gn:A.ADM3 .
?Municipality schema:name ?Name .
?Municipality gn:population ?Population .
?Municipality <http://purl.org/dc/terms/issued> ?Date .
FILTER (?Date = "2016-01-01"^^xsd:date)
}
ORDER BY DESC(?Population)
LIMIT 5
"""

如果我在这里运行该查询https://sparql.geo.admin.ch/sparql它可以工作,但是如果我尝试在以下位置运行它Python

from SPARQLWrapper import SPARQLWrapper, JSON 
sparql = SPARQLWrapper("https://sparql.geo.admin.ch/sparql")  
sparql.setQuery(query)
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

我收到以下错误

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
4

0 回答 0