我正在尝试列出所有完成3件以上工作的所有作者-DBpedia Sparql [英] I am trying to get list of all the authors who have had more than 3 piece of work - DBpedia Sparql
本文介绍了我正在尝试列出所有完成3件以上工作的所有作者-DBpedia Sparql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试列出所有完成3件或以上工作的作者(在DBpedia中).
I am trying to get list of all the authors who have had 3 or more piece of work done (in DBpedia).
我的示例可以在以下计算机上运行: http://dbpedia.org/sparql
my example can be run on : http://dbpedia.org/sparql
select (count(?work) as ?totalWork), ?author
Where
{
?work dbo:author ?author.
}
GROUP BY ?author
我让每个作者完成全部工作.但是,当我尝试过滤以仅显示具有3件以上作品的作者列表时.我收到错误消息:
I get each authors total amount of piece of work done. But when I try to filter to show only list of author that have more than 3 piece of work. I get error:
我尝试使用HAVING关键字或使用FILTER关键字.
I tried HAVING keyword or using FILTER keyword.
使用过滤器
select (count(?work) as ?tw), ?author
Where
{
?work dbo:author ?author.
FILTER (?work > 3).
}
GROUP BY ?author
error: Virtuoso 22023 Error VECDT: SR066: Unsupported case in CONVERT (INTEGER -> IRI_ID)
使用HAVING关键字
select (count(?work) as ?tw), ?author
Where
{
?work dbo:author ?author.
}
GROUP BY ?author
HAVING (?tw > 3)
Virtuoso 37000 Error SP031: SPARQL compiler: Variable ?tw is used in the result set outside aggregate and not mentioned in GROUP BY clause
推荐答案
Using HAVING
is correct, but there is a limitation in SPARQL with indirectly referring to aggregates.
此作品有效:
SELECT (count(?work) as ?tw) ?author
WHERE
{
?work dbo:author ?author.
}
GROUP BY ?author
HAVING (count(?work) > 3)
这篇关于我正在尝试列出所有完成3件以上工作的所有作者-DBpedia Sparql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文