How many {shape} are to/by {rectangle} ?
Describe the shape of a rectangle.
What shape is a rectangle?
SELECT ( COUNT ( ?i ) AS ?n ) { ?i property:shape resource:rectangle }
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/P1419> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q209 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P1419 wd:Q209 }
53