While trying to create a wikidata query to find the coordinates of locations based on user input I ran into multiple issues. The main issue is that not all cities are actually classified as cities. Querying for a more general term like "location" also doesn't work, since the wikidata endpoint does not use transitivity / inferencing.
Endpoint = https://query.wikidata.org/bigdata/namespace/wdq/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?city ?cityLabel ?coordinates WHERE {
?city wdt:P31 wd:Q515;
rdfs:label ?cityLabel.
filter(LANG(?cityLabel) = 'en').
filter(?cityLabel = 'Amsterdam'@en).
?city wdt:P625 ?coordinates
}LIMIT 10
#wd:Q17334923 = location
#wd:Q2221906 = geographic location
#wd:Q486972 = Human Settlement
#wd:Q515 = City