无法通过SPARQL检索Wikidata项目

发布于 2025-01-29 16:43:03 字数 577 浏览 6 评论 0 原文

我试图搜索并获取具有特定标签的项目的ID: teodor bogdanov 。我可以通过在这里

我还在这里复制了它:

SELECT distinct ?item ?itemLabel ?itemDescription WHERE{  
  ?item ?label "Teodor Bogdanov".
}

félixanaut

有人可以帮助我解决此问题吗?先感谢您。

I tried to search and get the ID of a item with a certain label: Teodor Bogdanov. I can search this name successfully through wikidata website. However, I failed to do so by searching through SPARQL. The code is here.

I also copied it here:

SELECT distinct ?item ?itemLabel ?itemDescription WHERE{  
  ?item ?label "Teodor Bogdanov".
}

The same thing happens for Félix Anaut

Could anyone help me fix this issue? Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

述情 2025-02-05 16:43:03

查询中有两个问题。三重模式中的谓词是一个变量,而它应该是常数, rdfs:label 。它询问与“ Teodor Bogdanov”相关的所有项目和属性。第二个问题是缺少的语言标签。当这两个修复时,您会得到以下

SELECT distinct ?item  {
  ?item rdfs:label "Teodor Bogdanov"@en .
}

“FélixAnaut”的查询,而这种带有急性口音的拼写在英语Wikipedia中使用,在Wikidata中并非如此。

THere are two issues in your query. The predicate in your triple pattern is a variable, while it should be a constant, rdfs:label. It asks about all items and properties linked to "Teodor Bogdanov". The second issue is the missing language tag. When these two are fixed, you get the following query

SELECT distinct ?item  {
  ?item rdfs:label "Teodor Bogdanov"@en .
}

For "Félix Anaut", while this spelling with an acute accent is used in English Wikipedia, that's not the case in Wikidata.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文