How many books are there whose author's tomb is in Madrid?
SELECT DISTINCT COUNT(?uri) WHERE { ?x <http://dbpedia.org/ontology/restingPlace> <http://dbpedia.org/resource/Madrid> . ?uri <http://dbpedia.org/ontology/author> ?x  . ?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Book>}
Madrid