How many {place of detention} are for {James I of Scotland} ?
Provide the location where James I of Scotland is arrested.
What's the place where James I of Scotland is detained?
SELECT ( COUNT ( ?r ) AS ?o ) { resource:James_I_of_Scotland property:place_of_detention ?r }
SELECT (COUNT(?obj) AS ?objs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q235234> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P2632> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
} 

SELECT (COUNT(?obj) AS ?value ) { wd:Q235234 wdt:P2632 ?obj }
5