Re: [Wikidata] Status of Wikidata Query Service

2020-02-10 Thread Eugene Alvin Villar
On Tue, Feb 11, 2020, 12:11 AM Amirouche Boubekki, <
amirouche.boube...@gmail.com> wrote:

> > Again, we're not sure. Of course, reducing the load (both in terms of
> edits on Wikidata and of reads on WDQS) will help. But not using those
> services makes them useless.
>
> What about making the lag part of the service.  I mean, you could
> reload WDQS periodically, for instance daily, and drop the updater
> altogether. Who needs to see the updates live in WDQS as soon as edits
> are done in wikidata?
>

I think Wikidata editors are the ones that really need up-to-date query
results as a form of feedback (e.g., to check if imports are okay or
QuickStatements batches are done right).

It might make sense to explore having two WDQS instances:
1. Public instance that is only updated daily or even weekly
2. Community instance that is up-to-date and where you need to log-in with
your Wikimedia user account and therefore we can control access to via
whitelisting or blacklisting

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


Re: [Wikidata] Researching Wikidata's Internal References

2020-01-20 Thread Eugene Alvin Villar
On Mon, Jan 20, 2020, 9:06 PM Nicolas VIGNERON, 
wrote

> In a nutshell, you can safely assume that only the property 'stated in'
> matters.
>

I think 'inferred from' (P3452) should also be considered as an internal
reference.
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Wikidata geo-coordinates

2019-09-02 Thread Eugene Alvin Villar
On Mon, Sep 2, 2019, 11:39 PM Olaf Simons, 
wrote:

> Is there an elegant way to get data out of wikidata in a format that you
> can then fill back into another Wikibase without the pain of such
> conversions (like splitting coordinates, changing columns, changing the
> prefixes...)
>

Depends on how elegant you want it to be but it won't be trivial. If you
want to get data from WDQS, you can use any of the available SPARQL
text/regex manipulation functions to convert the WKT format into a
different format.

Question 2 is related: When you extract dates with the QueryService that
> will change just years like 1971  from 1971-00-00 into 1971-01-01 dates. I
> felt unable to tell whether such a date was just a year or actually a
> January 1 entry. Is there a way to get the exact date as it has been put in
> to Wikibase back from the QueryService?
>

Again, this is not trivial. You need to also query the datePrecision field
of the date value and that means querying for the actual date statement and
not just the simple value that the usual SPARQL queries provide. Then based
on the datePrecision value (I think 9 is for year precision vs. 11 for day
precision), you can then truncate the date to just the year.

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


Re: [Wikidata] What's wrong in Italy ?

2019-05-07 Thread Eugene Alvin Villar
Hi,

You can fix the query by replacing the following SPARQL statement:

?country wdt:P31 wd:Q6256.
>

...with the following 2 statements:

?country p:P31 ?countryStatement.
> ?countryStatement ps:P31 wd:Q6256.
>

As Nicolas mentions, the original "simple" triple in your query takes into
account Wikidata statement rankings. So in order to ignore rankings, just
use the roundabout way that goes directly through the RDF statements.

Another solution would be to also include sovereign state into your query.
So replace the same SPARQL statement above with the following 2 statements:

VALUES ?countryish { wd:Q6256 wd:Q3624078 }
> ?country wdt:P31 ?countryish.
>

Regards,
Eugene


On Wed, May 8, 2019 at 4:54 AM Nicolas VIGNERON 
wrote:

> Hi,
>
> This query only search for "country" (Q6256) but Italy, like many other
> items, has a preferred ranking on the value "sovereign state" (Q3624078),
> so by default, Italy doesn't appears as a country (which is strange but not
> totally illogical "country" is a quite broad term).
>
> Cheers, ~nicolas
>
> Le mar. 7 mai 2019 à 22:11, Fabrizio Carrai  a
> écrit :
>
>> Can anybody explain why Italy is not shown in the results of the
>> "Wikidata Query Service" example "Continents, countries, regions and
>> capitals" [1] ?
>> I suppose because Italy is belonging to two different continents (Europe
>> and Africa). If this is the case I'm not able to fix the query.
>>
>> Thanks
>>
>> --
>> *Fabrizio*
>>
>>
>> *[1]
>> https://query.wikidata.org/#%23Continents%2C%20countries%2C%20regions%20and%20capitals%0A%23defaultView%3ATree%0ASELECT%20%3Fcontinent%20%3FcontinentFlag%20%3FcontinentLabel%20%3Fcountry%20%3FcountryLabel%20%3FcountryFlag%20%3Fregion%20%3FregionLabel%20%3FregionFlag%20%3Fcity%20%3FcityLabel%20%3FcityImage%20%3Fproperty%20%3FpropertyLabel%20%3Fvalue%20%3FvalueLabel%20WHERE%20%7B%0A%20%20%7B%0A%20%20%20%20SELECT%20%2a%20WHERE%20%7B%0A%20%20%20%20%20%20%3Fcontinent%20wdt%3AP31%20wd%3AQ5107.%0A%20%20%20%20%20%20%3Fcountry%20wdt%3AP30%20%3Fcontinent.%0A%20%20%20%20%20%20%3Fcountry%20wdt%3AP31%20wd%3AQ6256.%0A%20%20%20%20%20%20%3Fcountry%20wdt%3AP150%20%3Fregion.%0A%20%20%20%20%20%20OPTIONAL%20%7B%0A%20%20%20%20%20%20%20%20%3Fcontinent%20wdt%3AP242%20%3FcontinentFlag.%0A%20%20%20%20%20%20%20%20%3Fcountry%20wdt%3AP41%20%3FcountryFlag.%0A%20%20%20%20%20%20%20%20%3Fregion%20wdt%3AP41%20%3FregionFlag.%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20OPTIONAL%20%7B%0A%20%20%20%20%20%20%20%20%3Fregion%20wdt%3AP36%20%3Fcity.%0A%20%20%20%20%20%20%20%20%3Fcity%20wdt%3AP31%20wd%3AQ515.%0A%20%20%20%20%20%20%20%20%3Fcity%20wdt%3AP18%20%3FcityImage.%0A%20%20%20%20%20%20%20%20OPTIONAL%20%7B%0A%20%20%20%20%20%20%20%20%20%20VALUES%20%28%3Fprop%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP1082%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP6%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP190%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP31%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP571%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP150%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP206%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%28wdt%3AP527%29%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%3Fcity%20%3Fprop%20%3Fvalue.%0A%20%20%20%20%20%20%20%20%20%20%3Fproperty%20%3Fref%20%3Fprop.%0A%20%20%20%20%20%20%20%20%20%20%3Fproperty%20rdf%3Atype%20wikibase%3AProperty.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D
>>