SELECT ?s (STR(?o) AS ?w) WHERE { ?s ?p ?o } GROUP BY ?s VALUES ?v { 1 }