SELECT (COUNT(EXISTS { { SELECT (COUNT(?o) AS ?c) { ?s ?p ?o } } }) AS ?n) { ?s ?p ?o }