Thread:Semantic-mediawiki.org:Community portal/Wrapping a compound query around a loop.

I'm trying to combine a compound query (from the compound query extension) with a loop (from the ParserFunctions Loop extension) without much luck.

This occurs in a template:

Basically, I want this to generate a compound query, including each of the items passed in from the template. The template is called with the following:

Once the loops have been expanded, it should look something like this:

Which works perfectly, just not within the loop function.

I'm using the loop elsewhere without problems.

Anything obvious I'm missing??