Answer the question
In order to leave comments, you need to log in
How to get the code from Wikipedia by the name of the county or city?
There is an example of a request to get the population for Vietnam in json format:
https://query.wikidata.org/sparql?format=json&query=SELECT ?country ?countryLabel ?population WHERE {
?country wdt:P31 wd:Q6256.
?country wdt:P17 wd:Q881.
?country wdt:P1082 ?population.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Answer the question
In order to leave comments, you need to log in
Cool topic)
Query language basics say that values after the wd: prefix correspond to wikipedia objects (here is your "country" entity ), and values after the wtd: prefix correspond to a property (something like "relation type": "is an object of a class" )
The list of properties of
the List of entities cannot exist (this is the table of contents of the entire wikidata), but an internal search returns the necessary identifiers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question