How many {father} are to/by {Frederick I} ?
For Frederick I, how many fathers are there?
How many fathers are for Frederick I} ?
SELECT ( COUNT ( ?r ) AS ?i ) { ?r property:father resource:Frederick_I }
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/P22> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q79789 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P22 wd:Q79789 }
7