How many {located on astronomical body} are to/by {Mimas} ?
An atronomical body contains how many Mimas?
How many Mimas located on astronomical body?
SELECT ( COUNT ( ?s ) AS ?a ) { ?s property:located_on_astronomical_body resource:Mimas }
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/P376> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q15034 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P376 wd:Q15034 }
42