As Rob and Damian have already noted:

 "It should be noted that as per functions, aggregate expressions are
  required to be aliased (again, similar to the BIND clause, using the
  keyword 'AS') in order to project them from queries or subqueries."
  -- http://www.w3.org/TR/sparql11-query/#aggregateExample

Paolo

PS:
I bet we will see this question again, and again, and again... ;-)

朱曼 wrote:
> Dear list,
> 
> The following code causes "com.hp.hpl.jena.query.QueryParseException". Is
> count function supported?
> 
> import com.hp.hpl.jena.query.*;
> String queDBPedia = "select count(?inst)\n"
>                         + "from <http://dbpedia.org>\n"
>                         + "where {?inst a <
> http://dbpedia.org/ontology/Activity>}";
> Query query = QueryFactory.create(queDBPedia);
> 
> Or do I need to count the total number after I get all the instances?
> Thanks for your time!
> 
> Best regards
> 
> June
> 

Reply via email to