what is the {including} for {Mediterranean Sea} has {basin country} as {Spain} ?
The Mediterranean Sea is part of what Spanish basin country?
What is the basin country of Spain which is including Mediterranean Sea?
SELECT ?f WHERE { resource:Mediterranean_Sea property:basin_country ?e . ?e property:including ?f . ?e property:basin_country resource:Spain }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q4918> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P205> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q29> .
?statement <http://www.wikidata.org/entity/P1012> ?value. 
} 

SELECT ?value WHERE { wd:Q4918 p:P205 ?s . ?s ps:P205 wd:Q29 . ?s pq:P1012 ?value}