How many {constellation} are to/by {Scorpius} ?
What is the number of constellations near Scorpius?
How many constellations are by Scorpius?
SELECT ( COUNT ( ?u ) AS ?p ) { ?u property:constellation resource:Scorpius }
SELECT (COUNT(?sub) AS ?subs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?sub .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P59> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q8865 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P59 wd:Q8865 }
184517