SPARQL:无法使用FactForge端点 [英] SPARQL: unable to use FactForge endpoint

查看:66
本文介绍了SPARQL:无法使用FactForge端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python来运行一些sparql查询.我想从 http://factforge.net/sparql

I am using python to run some sparql queries. I want to extract information from 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.

This query works on the factforge website but locally I receive the following error EndPointNotFound: it was impossible to connect with the endpoint in that address, check if it is correct.

推荐答案

GraphDB公开了RDF4J样式的API.这正是帮助" 页面上所说的.

GraphDB exposes RDF4J-style API. This is exactly what is said on the Help page.

SPARQL端点地址应为http://factforge.net/repositories/{repositoryID}.

The SPARQL endpoint address should be http://factforge.net/repositories/{repositoryID}.

不幸的是,无法从GraphDB中的SPARQL确定使用哪个存储库.

Unfortunately, it is impossible to determine which repository is used from SPARQL in GraphDB.

为此,您可以在浏览器中使用F12开发人员工具.或关于页面说:

You could use F12 Developer Tools in your browser for this purpose. Or the About page says:

应用程序可以通过以下位置的SPARQL访问FactForge: http://factforge.net/repositories/ff-news .
这也是用于联合SPARQL查询的服务地址.

Applications can access FactForge via SPARQL at http://factforge.net/repositories/ff-news.
This is also the service address to be used for federated SPARQL queries.

这篇关于SPARQL:无法使用FactForge端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆