Here is a simple SPARQL query to get population numbers from (any time
in) 2015 of (arbitrary types of) entities, limited to 100 results:
SELECT ?entity ?entityLabel ?population ?time
WHERE
{
?entity p:P1082 ?statement .
?statement ps:P1082 ?population .
?statement pq:P585 ?time .
FILTER (
?time > "2015-01-01T00:00:00Z"^^xsd:dateTime &&
?time < "2015-12-31T23:59:59Z"^^xsd:dateTime
)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
LIMIT 100
See
http://tinyurl.com/gwzubox
You can replace ?entity by something like wd:Q64 to query the population
of a specific place:
http://tinyurl.com/jnajczu (I changed to 2014 here
since there are no 2015 figures for Berlin).
You could also add other qualifiers to narrow down statements further,
but of course only if Wikidata has such information in the first place.
I don't see many qualifiers other than P585 being used with population
statements, so this is probably of little use.
Cheers
Markus
On 19.05.2016 14:35, Yetkin Sakal wrote:
The only way I could find to retrieve it is through
theAPI.
https://www.wikidata.org/w/api.php?action=wbgetclaims&entity=Q2674064&a…
How to go about picking a population type (urban, rural, etc.) and
accessing its value? I cannot see such a qualifier, so what is the right
way to do it?
On Thursday, May 19, 2016 9:50 AM, Gerard Meijssen
<gerard.meijssen(a)gmail.com> wrote:
Hoi,
So 2015 is preferred, how do I then get the data for 1984?
Thanks.
GerardM
On 18 May 2016 at 21:00, Stas Malyshev <smalyshev(a)wikimedia.org
<mailto:smalyshev@wikimedia.org>> wrote:
Hi!
Is there any chance we can access
qualifier-specific data on
Wikidata?
For instance, we have two population properties
on
https://www.wikidata.org/wiki/Q2674064 and want to access the
value of
the first one (i.e, the population value for
2015).
What should happen is that 2015 value should be marked as preferred.
That is regardless of data access. Then probably something like this:
https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.en…
can be used (not sure if there's better way to achieve the same).
Also not sure what #property would return...
--
Stas Malyshev
smalyshev(a)wikimedia.org <mailto:smalyshev@wikimedia.org>
_______________________________________________
Wikidata mailing list
Wikidata(a)lists.wikimedia.org <mailto:Wikidata@lists.wikimedia.org>
https://lists.wikimedia.org/mailman/listinfo/wikidata
_______________________________________________
Wikidata mailing list
Wikidata(a)lists.wikimedia.org <mailto:Wikidata@lists.wikimedia.org>
https://lists.wikimedia.org/mailman/listinfo/wikidata
_______________________________________________
Wikidata mailing list
Wikidata(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata