SELECT * WHERE { { SELECT (1 AS ?x) WHERE { ?s ?p ?x } } UNION { ?s ?p ?o } }