簡體   English   中英

SPARQL:無法使用FactForge端點

[英]SPARQL: unable to use FactForge endpoint

我正在使用python運行一些sparql查詢。 我想從http://factforge.net/sparql提取信息

sparql = SPARQLWrapper("http://factforge.net/sparql")
query = """
# F02: Big Cities in Eastern Europe

PREFIX onto: <http://www.ontotext.com/>
PREFIX gn: <http://www.geonames.org/ontology#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT * FROM onto:disable-sameAs
WHERE {
    SERVICE <http://factforge.net/sparql>{
    ?loc gn:parentFeature dbr:Eastern_Europe ; 
         gn:featureClass  gn:P;
         gn:featureCode gn:A.ADM2.
    ?loc dbo:populationTotal ?population ; dbo:country ?country .
    ?country a dbo:Country .
    }
    FILTER(?population > 300000 )
    ?country skos:prefLabel ?country_name . 

} ORDER BY ?country_name DESC(?population)

"""
sparql.setQuery(query)
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

該查詢在factforge網站上有效,但在本地我收到以下錯誤EndPointNotFound: it was impossible to connect with the endpoint in that address, check if it is correct.

GraphDB公開了RDF4J樣式的API。 這正是“ 幫助”頁面上所說的。

SPARQL端點地址應為http://factforge.net/repositories/{repositoryID}

不幸的是,無法從GraphDB中的SPARQL確定使用哪個存儲庫。

為此,您可以在瀏覽器中使用F12開發人員工具。 關於頁面顯示:

應用程序可以通過http://factforge.net/repositories/ff-news上的SPARQL訪問FactForge。
這也是用於聯合SPARQL查詢的服務地址。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM