SELECT ?o ( COUNT( * ) AS ?c ) WHERE { ?s ?p ?o . } GROUP BY ?s VALUES ?o { "1"^^ }