PREFIX ex: SELECT ?s ?o WHERE { VALUES ?s { ex:S } LATERAL { { VALUES ?o { ex:O } } { FILTER(BOUND(?s) && !BOUND(?o)) } } }