SELECT ?s ( MAX( ?o ) AS ?m ) WHERE { ?s ?p ?o . } VALUES ?s { }