How many {anatomical location} are to/by {thymus} ?
By the thymus how many anatomical locations are there?
How many anatomical locations are by the thymus?
SELECT ( COUNT ( ?x ) AS ?f ) { ?x property:anatomical_location resource:Thymus }
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/P927> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q163987 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P927 wd:Q163987 }
14