简体   繁体   English

如何使用SPARQL查询从dbpedia获取有关德国体育的信息

[英]How can get information about sport in Germany from dbpedia using SPARQL query

How can I get information about sports in Germany from DBpedia using SPARQL? 我如何使用SPARQL从DBpedia获得有关德国体育的信息? What SPARQL query can get that information? 哪些SPARQL查询可以获取该信息? I used this SPARQL query, but I get no results! 我使用了这个SPARQL查询,但是没有结果!

SELECT * WHERE { 
  ?c a dbpedia.org/ontology/Country . 
  ?c rdfs:label dbpedia:Germany .
}

Fixing the Query 修正查询

The query you posted is malformed. 您发布的查询格式不正确。 Attempting to run it on the public DBpedia SPARQL endpoint produces an error. 尝试在公共DBpedia SPARQL端点上运行它会产生错误。 The reference dbpedia.org/ontology/Country should be dbpedia-owl:Country , and rdfs:label s are usually strings, so "Germany"@en should replace dbpedia:Germany . 参考dbpedia.org/ontology/Country应该是dbpedia-owl:Country ,而rdfs:label通常是字符串,因此"Germany"@en dbpedia:Germany应该替换dbpedia:Germany The corrected query, however, just returns a single result, http://dbpedia.org/resource/Germany . 但是,更正后的查询仅返回一个结果,即http://dbpedia.org/resource/Germany

SELECT * WHERE { 
  ?c a dbpedia-owl:Country . 
  ?c rdfs:label "Germany"@en .
}

SPARQL results SPARQL结果

Asking about sport in Germany 询问德国的体育运动

Without more information about what kind of data you're trying to obtain, the simplest answer for querying about sport in Germany is that you should ask DBpedia to describe sport in Germany for you, almost literally. 在没有更多关于您要获取哪种数据的信息的情况下,查询德国运动的最简单答案就是,您应该要求DBpedia几乎从字面上描述德国的运动。 The following query is legal SPARQL that you can paste into the public DBpedia endpoint . 以下查询是合法的SPARQL,您可以将其粘贴到公共DBpedia端点中

describe dbpedia:Sport_in_Germany

SPARQL results SPARQL结果

There is a Wikipedia article Sport in Germany , and DBpedia's naming convention is such that there is a corresponding DBpedia resource, dbpedia:Sport_in_Germany , which the previous query describes. 在Wikipedia上有一篇德国的文章Sport ,并且DBpedia的命名约定是这样的,即存在一个对应的DBpedia资源dbpedia:Sport_in_Germany ,上一查询对此进行了描述。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用DBPEDIA中的SPARQL以简单的方式获取有关一个国家的资本,货币,语言,人口等信息 - How to get information like capital, currency, language, population about a country in simple way using SPARQL from DBPEDIA 如何使用 sparql 查询从 dbpedia 获取导演的电影列表 - How can I get the list of movies by a director from dbpedia using sparql query 如何编写SPARQL查询以从DBpedia检索有关旅游业的数据? - How to write SPARQL Query to retrieve data about Tourism from DBpedia? 使用SPARQL从DBpedia获取有关景点和景点的数据 - Get data about attractions and point of interest from DBpedia using SPARQL 我可以使用 SPARQL 查询 DBPedia 以获取有关 Wiki 页面的信息,例如页面长度或文章被访问次数吗? - Can I use SPARQL to query DBPedia for information about Wiki pages such as page length or number of times an article was accessed? 无法使用SPARQL查询从dbpedia中获取数据 - Can't fetch data from dbpedia using SPARQL Query DBpedia:使用 SPARQL 查询特定人员的一些信息 - DBpedia: Query some information about a specific person with SPARQL 如何使用sparql查询进入dbpedia中的特定页面? - How to get to a particular page in dbpedia using sparql query? 我该如何构建更好的SPARQL查询,以仅从DBpedia中获取我想要的数据? (原为:“如何使用DBPEDIA SPARQL消除多行”) - How can I build a better SPARQL query, to get only the data I want from DBpedia? (was: “How to get rid of multiple rows with DBPEDIA SPARQL”) 无法使用 sparql 从 dbpedia 查询 - can't query from dbpedia with a sparql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM