What is the {railroad line} for {terminus location} of {Bruges}
Which railroad tracks lead to Bruges?
Which railroad tracks lead to Bruges?
SELECT DISTINCT ?e WHERE { ?e property:terminus_location resource:Bruges . ?e rdf:type ontology:railway_line }
select distinct ?subj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?subj . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P609> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q12994> . ?subj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q728937> } 
 select distinct ?sbj where { ?sbj wdt:P609 wd:Q12994 . ?sbj wdt:P31 wd:Q728937 } 
Line 51 (Infrabel)