group by

SPARQL group by only one variable

In semantic web, sparql is a powerful language which can among others query for specific knowledge from provided rdf databases. Recently I tried to find out the largest lake in each country in the world from dbpedia. I came up with a query which resulted in the country and the area of its largest lake but without the name of the lake. I wanted to list the name of the lake in the table. So when I added a new variable to the select clause without putting it in group by clause, it complained that "Variable ?label is used in the result set outside aggregate and not mentioned in GROUP BY clause".

Calais Tags:

Subscribe to group by