How many {home world} are to/by {Earth} ?
What number of homes belong to the Earth?
How many home world does the Earth has?
SELECT ( COUNT ( ?z ) AS ?a ) { ?z property:home_world resource:Earth }
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/P1165> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q2 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P1165 wd:Q2 }
93