What is {position held} of {Benito Pérez Galdós} that is {electoral district} is {Guayama} ?
What office does Benito Perez Galdos hold in the electoral district of Guayama?
What is the position held by Benito Pérez Galdós whose electoral district is Guayama?
SELECT ?b WHERE { ?g property:electoral_district resource:Guayama . resource:Benito_Pérez_Galdós property:position_held ?g . ?g property:position_held ?b }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q189869> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P768> <http://wikidata.dbpedia.org/resource/Q1870997>
} 

SELECT ?obj WHERE { wd:Q189869 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P768 wd:Q1870997 }