Related to another question (see: SPARQL functions in CONSTRUCT/WHERE) where the answer leads to having a SPARQL CONSTRUCT query with a aggregate SELECT inside, I now would like to know how to use BIND in this construct.
My current query looks like this (simplified):
PREFIXES
CONSTRUCT { ?s rdfs:label ?var . }
WHERE {
SELECT ?s (AVG(?single) as ?agg) ...
WHERE {
...
}
GROUP BY ?s ...
}
The question is: Where to place a BIND statement which is used to bind values to variables, which are then used in the CONSTRUCT statement (e.g. ?var
)?
I tried to do it similar as is shown in this message: http://mail-archives.apache.org/mod_mbox/jena-users/201111.mbox/%3C4ED66723.7030506@googlemail.com%3E. But the difference is, that there is no nested SELECT in this example.