SELECT (?x + 1 AS ?result) WHERE { ?s ?p ?x } GROUP BY ?x