PREFIX : SELECT ?v (str(?v) as ?str) { ?x a :X . OPTIONAL { ?x :p ?v } }