what is the {statement is subject of} for {Germany} has {shares border with} as {Poland} ?
When did Germany declare they were going to share a border with Poland?
When the statement was declared that German is sharing its border with the Poland?
SELECT ?h WHERE { resource:Germany property:shares_border_with ?q . ?q property:shares_border_with resource:Poland . ?q property:statement_is_subject_of ?h }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q183> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P47> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q36> .
?statement <http://www.wikidata.org/entity/P805> ?value. 
} 

SELECT ?value WHERE { wd:Q183 p:P47 ?s . ?s ps:P47 wd:Q36 . ?s pq:P805 ?value}