What is the {election to the Parliament of Catalonia} with the {MIN(total valid votes)} whose {country} is {Spain}  ?
What was the election to the Parliament of Catalonia that had the fewest legitimate votes in Spain?
What Spanish election to the Parliament of Catalonia had the fewest legitimate votes?
SELECT ?c WHERE { ?c rdf:type ontology:election_to_the_Parliament_of_Catalonia . ?c property:country resource:Spain . . ?c property:total_valid_votes ?d }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q5116010>.

?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1697>.
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj1.

?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P17> .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q29> .

}
ORDER BY ASC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q5116010 . ?ent wdt:P1697 ?obj . ?ent wdt:P17 wd:Q29. } ORDER BY ASC(?obj)LIMIT 5 
Catalan regional election 2015 in Gisclareny Catalan regional election 2015 in Sant Jaume de Frontanyà Catalan regional election 2015 in Fígols Catalan regional election 2015 in la Febró Catalan regional election 2015 in Senan