How many {parent organization} are to/by {OJSC Russian Railways} ?
OJSC Russia Railways is a parent organization of how many companies?
How many companies have OJSC Russian Railways as a parent organization?
SELECT ( COUNT ( ?v ) AS ?r ) { ?v property:parent_organization resource:Russian_Railways }
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/P749> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q660770 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P749 wd:Q660770 }
20