@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.com/>.

:workflowA a :Workflow ;
    :includes :taskA , :taskB .
:taskA a :Completed .
:taskB a :Completed .

{ ?workflow a :Workflow.
  (?task { ?workflow :includes ?task . ?task a :Completed } ?completed) log:collectAllIn _:x .

} => { ?workflow :completed ?completed } .
