On 19.05.2016 14:51, Markus Krötzsch wrote:
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.

Well, there are some useful qualifiers in some cases, e.g., determination method. Here are estimated populations between 2000 and 2015: http://tinyurl.com/zp6ymwr

See https://tools.wmflabs.org/sqid/#/view?id=P1082 for more qualifiers.

Markus



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&property=P1082


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.meijs...@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 <smalys...@wikimedia.org
<mailto:smalys...@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.entity:getBestStatements

    can be used (not sure if there's better way to achieve the same).
    Also not sure what #property would return...
    --
    Stas Malyshev
    smalys...@wikimedia.org <mailto:smalys...@wikimedia.org>

    _______________________________________________
    Wikidata mailing list
    Wikidata@lists.wikimedia.org <mailto:Wikidata@lists.wikimedia.org>
    https://lists.wikimedia.org/mailman/listinfo/wikidata



_______________________________________________
Wikidata mailing list
Wikidata@lists.wikimedia.org <mailto:Wikidata@lists.wikimedia.org>
https://lists.wikimedia.org/mailman/listinfo/wikidata




_______________________________________________
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata




_______________________________________________
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata

Reply via email to