SPARQL - Max() 不工作

SPARQL - Max() isn't working

我正在尝试在 PROTEGE 2000 中执行此 SPARQL 查询,但 MAX 函数不起作用。就像 Max() 不接受 ?cpt.

的类型
SELECT  ?searcher (COUNT(?publication) AS ?cpt)
WHERE {ont:GradeP ont:isFor ?searcher.
    ?publication ont:isPublishedBy ?searcher.}
GROUP BY ?searcher 
HAVING (MAX(?cpt))

这里是个例外:

SparqlReasonerException: org.openrdf.query.QueryEvaluationException: Unsupported value expr type: class org.openrdf.query.algebra.Max

The request is working without HAVING, so i guess there is no problem with my ontology. So can please anyone tell me where is the issue. Thanks!

我不确定你为什么在这里使用 group by,但也许你有理由。一种方法是使用 order by。我在 dbpedia 上提供了一个示例。

select distinct ?x count(?y) as ?count
where{
    ?x a dbpedia-owl:Person.
    ?x dbpprop:author  ?y
}
order by desc(?count)
limit 1

结果是here