Easy to recreate - try selecting and running this subquery:
# 12-albums-dates-subselect.sparql
prefix : <http://stardog.com/tutorial/>
SELECT (avg(?count) AS ?avgCount)
{
SELECT ?year (count(?album) AS ?count)
{
?album a :Album ;
:date ?date ;
BIND (year(?date) AS ?year)
}
GROUP BY ?year
}
returns no rows - because of the lack of default prefix
However when you run this subquery it works:
# 12-albums-dates-subselect.sparql
prefix : <http://stardog.com/tutorial/>
SELECT (avg(?count) AS ?avgCount)
{
prefix : <http://stardog.com/tutorial/>
SELECT ?year (count(?album) AS ?count)
{
?album a :Album ;
:date ?date ;
BIND (year(?date) AS ?year)
}
GROUP BY ?year
}