what is the {country} for {August} has {named after} as {Alp Arslan} ?
Alp Arslan is named for what country?
which is the  country for August has named after as Alp Arslan?
SELECT ?o WHERE { ?b property:named_after resource:Alp_Arslan . resource:August property:named_after ?b . ?b property:country ?o }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q122> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P138> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q200193> .
?statement <http://www.wikidata.org/entity/P17> ?value. 
} 

SELECT ?value WHERE { wd:Q122 p:P138 ?s . ?s ps:P138 wd:Q200193 . ?s pq:P17 ?value}