prefix ex: prefix in: select ?x ?max where { {select (max(?y) as ?max) where {?x ex:p ?y} } ?x ex:p ?max }