Re: [Wikidata-l] Kian: The first neural network to serve Wikidata

2015-03-20 Thread Magnus Manske
On Fri, Mar 20, 2015 at 12:38 AM Amir Ladsgroup  wrote:

> One mistake  I just found via the
> report. Article in French Wikipedia is about a French type of cheese but
> connected to an article in Russian Wikipedia about a French playwriter.
>
Maybe his plays are cheesy?
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Kian: The first neural network to serve Wikidata

2015-03-20 Thread Amir Ladsgroup
Probably :P

On Fri, Mar 20, 2015 at 1:36 PM Magnus Manske 
wrote:

> On Fri, Mar 20, 2015 at 12:38 AM Amir Ladsgroup 
> wrote:
>
>> One mistake  I just found via
>> the report. Article in French Wikipedia is about a French type of cheese
>> but connected to an article in Russian Wikipedia about a French playwriter.
>>
> Maybe his plays are cheesy?
>
> ___
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
>
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] new patrol tool

2015-03-20 Thread Finn Aarup Nielsen


How can this tool work? I am not a Wikidata patroller (not even
autopatrolled) but the tool seems to accept my patrols and my edits are
autopatrolled:

https://www.wikidata.org/w/index.php?title=Special%3ALog&type=patrol&user=Fnielsen&page=&year=&month=-1&tagfilter=&hide_patrol_log=1&hide_thanks_log=1

https://www.wikidata.org/w/index.php?title=Q13915&oldid=205178699&diff=prev

It seems that I do not understand the issue of patrolling on Wikidata.


- Finn Årup Nielsen

Den 19-03-2015 kl. 15:52 skrev Magnus Manske:
> Cool! And nice use of my API :-)
> 
> On Thu, Mar 19, 2015 at 2:45 PM Lydia Pintscher
> mailto:lydia.pintsc...@wikimedia.de>> wrote:
> 
> Hey folks :)
> 
> Pasleim has created a nice new patrolling tool to help with
> vandalism and spam fighting. Here's their announcement text:
> 
> Hey. To fight against vandalism, I wrote an oAuth application which
> is similar to Special:RecentChanges
>  but has some
> more features:
> 
>   * 1-click patrol button
>   * select edits by type (edited terms, sitelinks, merges...)
>   * mass patrolling
>   * clickable edits comments, i.e. identifiers of external databases
> and URLs are linked
>   * hints showing you various additional information, e.g. if the
> format of an identifier is violated
>   * 1-click translation button for labels and descriptions
>   * automated description  when
> hovering over the item's label
> 
> You find the tool on https://tools.wmflabs.org/pltools/rech. I hope
> with it that some more users get motivated to patrol recent changes.
> --Pasleim  (talk
> ) 21:46, 18 March
> 2015 (UTC)
> 
> 
> Cheers
> Lydia
> 
> -- 
> Lydia Pintscher - http://about.me/lydia.pintscher
> Product Manager for Wikidata
> 
> Wikimedia Deutschland e.V.
> Tempelhofer Ufer 23-24
> 10963 Berlin
> www.wikimedia.de 
> 
> Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
> 
> Eingetragen im Vereinsregister des Amtsgerichts
> Berlin-Charlottenburg unter der Nummer 23855 Nz. Als gemeinnützig
> anerkannt durch das Finanzamt für Körperschaften I Berlin,
> Steuernummer 27/681/51985.
> _
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org 
> https://lists.wikimedia.org/__mailman/listinfo/wikidata-l
> 
> 
> 
> 
> ___
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
> 




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


Re: [Wikidata-l] new patrol tool

2015-03-20 Thread Federico Leva (Nemo)

Finn Aarup Nielsen, 20/03/2015 13:49:


How can this tool work? I am not a Wikidata patroller (not even
autopatrolled) but the tool seems to accept my patrols and my edits are
autopatrolled:


As on most wikis, all (autoconfirmed) users have "patrol".
https://www.wikidata.org/wiki/Special:ListGroupRights

Nemo

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


Re: [Wikidata-l] new patrol tool

2015-03-20 Thread Adrian Raddatz
Autoconfirmed users have the "autopatrol" right as well.

This tool is good, but it could use integration with rollback
functionality. It currently doesn't, unless I am missing something.

Adrian Raddatz

On Fri, Mar 20, 2015 at 7:27 AM, Federico Leva (Nemo) 
wrote:

> Finn Aarup Nielsen, 20/03/2015 13:49:
>
>  How can this tool work? I am not a Wikidata patroller (not even
>> autopatrolled) but the tool seems to accept my patrols and my edits are
>> autopatrolled:
>>
>
> As on most wikis, all (autoconfirmed) users have "patrol".
> https://www.wikidata.org/wiki/Special:ListGroupRights
>
> Nemo
>
>
> ___
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
>
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


[Wikidata-l] FAQ for Freebase users

2015-03-20 Thread Lydia Pintscher
Hey folks :)

At the end of the month Freebase is going read-only and I expect we'll
get an influx of new people. I started an FAQ for them at
https://www.wikidata.org/wiki/Help:FAQ/Freebase


Cheers
Lydia

-- 
Lydia Pintscher - http://about.me/lydia.pintscher
Product Manager for Wikidata

Wikimedia Deutschland e.V.
Tempelhofer Ufer 23-24
10963 Berlin
www.wikimedia.de

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.

Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
unter der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das
Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.

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


[Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Markus Kroetzsch

Dear all,

Thanks to the people at the Center of Semantic Web Research in Chile 
[1], we have a very first public SPARQL endpoint for Wikidata running. 
This is very preliminary, so do not rely on it in applications and 
expect things to fail, but you may still enjoy some things.


http://milenio.dcc.uchile.cl/sparql

The endpoint has all the data from our current RDF exports in one big 
database [2]. Below this email are some example queries to get you 
started (this is a bit of a learning-by-doing crash course in SPARQL 
too, but you may want to consult a tutorial if you don't know it ;-).


There are some known bugs in the RDF that we will hopefully fix soon 
[3]. Also, the service uses a dump that is already a few weeks old now. 
We are more interested in testing functions right now before going 
production. Also, this is a raw API interface, not a proposal for a nice UI.


Feedback (and other interesting queries) are welcome :-)

Cheers,

Markus


[1] http://ciws.cl/ -- a joint team from University of Chile and 
Pontificia Universidad Catolica de Chile

[2] http://tools.wmflabs.org/wikidata-exports/rdf/
[3] 
https://github.com/Wikidata/Wikidata-Toolkit/issues?q=is%3Aopen+is%3Aissue+label%3A%22RDF+export%22



==Lighthouses (Q39715) with their English label (LIMIT 100 for demo)==

PREFIX : 
SELECT *
WHERE {
 ?lighthouse a :Q39715 .
 ?lighthouse rdfs:label ?label FILTER(LANG(?label) = "en")
} LIMIT 100

(Just paste the query into the box at http://milenio.dcc.uchile.cl/sparql)

The actual query condition is in the WHERE {...} part. Things starting 
with ? are variables. Basic conditions take the form of triples: 
"subject property value". For example, "?lighthouse a :Q39715" looks for 
things that are a lighthouse ("a" is short for "rdf:type" which we use 
to encode P31 statements without qualifiers). The dot "." is used as a 
separator between triples.


Note that the label output is a bit cumbersome because you want to 
filter by language (without the FILTER you get all labels in all 
languages). A future UI would better fetch the labels after the query, 
similar to WDQ, to get smaller & faster queries.



==People born in the same place that they died in==

PREFIX : 
SELECT ?person ?personname ?placename
WHERE {
 ?person a :Q5 .
 ?person :P19c ?place .
 ?person :P20c ?place .
 ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
 ?place rdfs:label ?placename FILTER(LANG(?placename) = "en")
}  LIMIT 100

Here we use a few actual Wikidata properties. Properties in their simple 
form (Entity->Value) use ids with a "c" in the end, like :P19c here. 
Only qualifier-free statements will be available in this form right now. 
Note that we use the variable ?place in two places as a value. This is 
how we query for things that have the same place in both cases.



==People who have Wikipedia (Q52) accounts==

PREFIX : 
SELECT ?person ?personname ?username
WHERE {
  ?person :P553s ?statement .
  ?statement :P553v :Q52 .
  ?statement :P554q ?username .
  ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
} LIMIT 100

This query needs to access qualifiers of a statement for "website 
account on" (P553). To do this in RDF (and SPARQL), we access the 
statement object instead of using simple property :P553c (which would 
only give us the value). The statement is found through an "...s" 
property; its value is found through a "...v" property; its qualifiers 
are found through "...q" properties. Check out the graph in our paper to 
get the picture 
(http://korrekt.org/page/Introducing_Wikidata_to_the_Linked_Data_Web). 
There you can also find how references are accessed.



==Currently existing countries==

PREFIX : 
SELECT ?country ?countryName
WHERE {
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
 FILTER NOT EXISTS { ?statement :P582q ?endDate }
  ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
}

Similar pattern as with the Wikipedia accounts, but now we check that a 
certain qualifier (end time) does not exist. You could also find 
currently married people in this way, etc.



==Descendants of Queen Victoria (Q9439) ==

PREFIX : 
SELECT DISTINCT *
WHERE {
 :Q9439 ((^:P25c|^:P22c)+) ?person .
 ?person rdfs:label ?label
 FILTER(LANG(?label) = "en")
} LIMIT 1000

Here, ((^:P25c|^:P22c)+) is a regular expression; ^ is for changing the 
direction of a property (has mother -> mother of ...); | is for "or", + 
is for one or more repetitions.



==Currently existing countries, ordered by the number of their current 
neighbours==


PREFIX : 
SELECT ?countryName (COUNT (DISTINCT ?neighbour) AS ?neighbours)
WHERE {
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
 FILTER NOT EXISTS { ?statement :P582q ?endDate }
  ?country rdfs:label ?countryName FILT

Re: [Wikidata-l] FAQ for Freebase users

2015-03-20 Thread Thad Guidry
Overall, that's a pretty good summary FAQ, Lydia.  Good Job putting that
together and thanks !

Thad
+ThadGuidry 

2015-03-20 11:57 GMT-05:00 Lydia Pintscher :

> Hey folks :)
>
> At the end of the month Freebase is going read-only and I expect we'll
> get an influx of new people. I started an FAQ for them at
> https://www.wikidata.org/wiki/Help:FAQ/Freebase
>
>
> Cheers
> Lydia
>
> --
> Lydia Pintscher - http://about.me/lydia.pintscher
> Product Manager for Wikidata
>
> Wikimedia Deutschland e.V.
> Tempelhofer Ufer 23-24
> 10963 Berlin
> www.wikimedia.de
>
> Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
>
> Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
> unter der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das
> Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
>
> ___
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
>
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Dmitriy Sintsov
Hi Markus,
Is  ?statement :P31v :Q3624078 .
 FILTER NOT EXISTS { ?statement :P582q ?endDate }
really enough to filter off currently non-existing countries?
Because I have such code in my Python bot:
http://paste.debian.net/162319/
And even with so many filters, there is a bit strange "Kingdom of
Netherlands" which duplicates "Netherlands" but having only few cities.
Dmitriy

On Fri, Mar 20, 2015 at 9:08 PM, Markus Kroetzsch <
markus.kroetz...@tu-dresden.de> wrote:

> Dear all,
>
> Thanks to the people at the Center of Semantic Web Research in Chile [1],
> we have a very first public SPARQL endpoint for Wikidata running. This is
> very preliminary, so do not rely on it in applications and expect things to
> fail, but you may still enjoy some things.
>
> http://milenio.dcc.uchile.cl/sparql
>
> The endpoint has all the data from our current RDF exports in one big
> database [2]. Below this email are some example queries to get you started
> (this is a bit of a learning-by-doing crash course in SPARQL too, but you
> may want to consult a tutorial if you don't know it ;-).
>
> There are some known bugs in the RDF that we will hopefully fix soon [3].
> Also, the service uses a dump that is already a few weeks old now. We are
> more interested in testing functions right now before going production.
> Also, this is a raw API interface, not a proposal for a nice UI.
>
> Feedback (and other interesting queries) are welcome :-)
>
> Cheers,
>
> Markus
>
>
> [1] http://ciws.cl/ -- a joint team from University of Chile and
> Pontificia Universidad Catolica de Chile
> [2] http://tools.wmflabs.org/wikidata-exports/rdf/
> [3] https://github.com/Wikidata/Wikidata-Toolkit/issues?q=is%
> 3Aopen+is%3Aissue+label%3A%22RDF+export%22
>
>
> ==Lighthouses (Q39715) with their English label (LIMIT 100 for demo)==
>
> PREFIX : 
> SELECT *
> WHERE {
>  ?lighthouse a :Q39715 .
>  ?lighthouse rdfs:label ?label FILTER(LANG(?label) = "en")
> } LIMIT 100
>
> (Just paste the query into the box at http://milenio.dcc.uchile.cl/sparql)
>
> The actual query condition is in the WHERE {...} part. Things starting
> with ? are variables. Basic conditions take the form of triples: "subject
> property value". For example, "?lighthouse a :Q39715" looks for things that
> are a lighthouse ("a" is short for "rdf:type" which we use to encode P31
> statements without qualifiers). The dot "." is used as a separator between
> triples.
>
> Note that the label output is a bit cumbersome because you want to filter
> by language (without the FILTER you get all labels in all languages). A
> future UI would better fetch the labels after the query, similar to WDQ, to
> get smaller & faster queries.
>
>
> ==People born in the same place that they died in==
>
> PREFIX : 
> SELECT ?person ?personname ?placename
> WHERE {
>  ?person a :Q5 .
>  ?person :P19c ?place .
>  ?person :P20c ?place .
>  ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
>  ?place rdfs:label ?placename FILTER(LANG(?placename) = "en")
> }  LIMIT 100
>
> Here we use a few actual Wikidata properties. Properties in their simple
> form (Entity->Value) use ids with a "c" in the end, like :P19c here. Only
> qualifier-free statements will be available in this form right now. Note
> that we use the variable ?place in two places as a value. This is how we
> query for things that have the same place in both cases.
>
>
> ==People who have Wikipedia (Q52) accounts==
>
> PREFIX : 
> SELECT ?person ?personname ?username
> WHERE {
>   ?person :P553s ?statement .
>   ?statement :P553v :Q52 .
>   ?statement :P554q ?username .
>   ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
> } LIMIT 100
>
> This query needs to access qualifiers of a statement for "website account
> on" (P553). To do this in RDF (and SPARQL), we access the statement object
> instead of using simple property :P553c (which would only give us the
> value). The statement is found through an "...s" property; its value is
> found through a "...v" property; its qualifiers are found through "...q"
> properties. Check out the graph in our paper to get the picture (
> http://korrekt.org/page/Introducing_Wikidata_to_the_Linked_Data_Web).
> There you can also find how references are accessed.
>
>
> ==Currently existing countries==
>
> PREFIX : 
> SELECT ?country ?countryName
> WHERE {
>   ?country :P31s ?statement .
>   ?statement :P31v :Q3624078 .
>  FILTER NOT EXISTS { ?statement :P582q ?endDate }
>   ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
> }
>
> Similar pattern as with the Wikipedia accounts, but now we check that a
> certain qualifier (end time) does not exist. You could also find currently
> married people in this way, etc.
>
>
> ==Descendants of Queen Victoria (Q9439) ==
>
> PREFIX : 
> SELECT DISTINCT *
> WHERE {
>  :Q94

Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Magnus Manske
Really impressive!

On Fri, Mar 20, 2015 at 6:09 PM Markus Kroetzsch <
markus.kroetz...@tu-dresden.de> wrote:

> Dear all,
>
> Thanks to the people at the Center of Semantic Web Research in Chile
> [1], we have a very first public SPARQL endpoint for Wikidata running.
> This is very preliminary, so do not rely on it in applications and
> expect things to fail, but you may still enjoy some things.
>
> http://milenio.dcc.uchile.cl/sparql
>
> The endpoint has all the data from our current RDF exports in one big
> database [2]. Below this email are some example queries to get you
> started (this is a bit of a learning-by-doing crash course in SPARQL
> too, but you may want to consult a tutorial if you don't know it ;-).
>
> There are some known bugs in the RDF that we will hopefully fix soon
> [3]. Also, the service uses a dump that is already a few weeks old now.
> We are more interested in testing functions right now before going
> production. Also, this is a raw API interface, not a proposal for a nice
> UI.
>
> Feedback (and other interesting queries) are welcome :-)
>
> Cheers,
>
> Markus
>
>
> [1] http://ciws.cl/ -- a joint team from University of Chile and
> Pontificia Universidad Catolica de Chile
> [2] http://tools.wmflabs.org/wikidata-exports/rdf/
> [3]
> https://github.com/Wikidata/Wikidata-Toolkit/issues?q=is%
> 3Aopen+is%3Aissue+label%3A%22RDF+export%22
>
>
> ==Lighthouses (Q39715) with their English label (LIMIT 100 for demo)==
>
> PREFIX : 
> SELECT *
> WHERE {
>   ?lighthouse a :Q39715 .
>   ?lighthouse rdfs:label ?label FILTER(LANG(?label) = "en")
> } LIMIT 100
>
> (Just paste the query into the box at http://milenio.dcc.uchile.cl/sparql)
>
> The actual query condition is in the WHERE {...} part. Things starting
> with ? are variables. Basic conditions take the form of triples:
> "subject property value". For example, "?lighthouse a :Q39715" looks for
> things that are a lighthouse ("a" is short for "rdf:type" which we use
> to encode P31 statements without qualifiers). The dot "." is used as a
> separator between triples.
>
> Note that the label output is a bit cumbersome because you want to
> filter by language (without the FILTER you get all labels in all
> languages). A future UI would better fetch the labels after the query,
> similar to WDQ, to get smaller & faster queries.
>
>
> ==People born in the same place that they died in==
>
> PREFIX : 
> SELECT ?person ?personname ?placename
> WHERE {
>   ?person a :Q5 .
>   ?person :P19c ?place .
>   ?person :P20c ?place .
>   ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
>   ?place rdfs:label ?placename FILTER(LANG(?placename) = "en")
> }  LIMIT 100
>
> Here we use a few actual Wikidata properties. Properties in their simple
> form (Entity->Value) use ids with a "c" in the end, like :P19c here.
> Only qualifier-free statements will be available in this form right now.
> Note that we use the variable ?place in two places as a value. This is
> how we query for things that have the same place in both cases.
>
>
> ==People who have Wikipedia (Q52) accounts==
>
> PREFIX : 
> SELECT ?person ?personname ?username
> WHERE {
>?person :P553s ?statement .
>?statement :P553v :Q52 .
>?statement :P554q ?username .
>?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
> } LIMIT 100
>
> This query needs to access qualifiers of a statement for "website
> account on" (P553). To do this in RDF (and SPARQL), we access the
> statement object instead of using simple property :P553c (which would
> only give us the value). The statement is found through an "...s"
> property; its value is found through a "...v" property; its qualifiers
> are found through "...q" properties. Check out the graph in our paper to
> get the picture
> (http://korrekt.org/page/Introducing_Wikidata_to_the_Linked_Data_Web).
> There you can also find how references are accessed.
>
>
> ==Currently existing countries==
>
> PREFIX : 
> SELECT ?country ?countryName
> WHERE {
>?country :P31s ?statement .
>?statement :P31v :Q3624078 .
>   FILTER NOT EXISTS { ?statement :P582q ?endDate }
>?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
> }
>
> Similar pattern as with the Wikipedia accounts, but now we check that a
> certain qualifier (end time) does not exist. You could also find
> currently married people in this way, etc.
>
>
> ==Descendants of Queen Victoria (Q9439) ==
>
> PREFIX : 
> SELECT DISTINCT *
> WHERE {
>   :Q9439 ((^:P25c|^:P22c)+) ?person .
>   ?person rdfs:label ?label
>   FILTER(LANG(?label) = "en")
> } LIMIT 1000
>
> Here, ((^:P25c|^:P22c)+) is a regular expression; ^ is for changing the
> direction of a property (has mother -> mother of ...); | is for "or", +
> is for one or more repetitions.
>
>
> ==Currently existing countries, ordered by 

Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Markus Kroetzsch

Hi Dmitriy,

Yes, you are right. There are some countries that have a value for 
"dissolved or abolished" (P576) but no end date for "instance of" 
"sovereign state". This includes the "United Kingdom of the 
Netherlands". Probably these should get an end date for their P31, or we 
should use P576 in the query.


A list of all states that have no end date to their P31 sovereign state 
but that do have a P576 date:


PREFIX : 
SELECT ?country ?countryName
WHERE {
  ?country :P576c ?disolutionDate .
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
 FILTER NOT EXISTS { ?statement :P582q ?endDate }
  ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
}

A list of all states that have an end date to their P31 sovereign state 
but that do not have a P576 date:


PREFIX : 
SELECT ?country ?countryName
WHERE {
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
  ?statement :P582q ?endDate .
 FILTER NOT EXISTS { ?country :P576c ?disolutionDate }
  ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
}

Of course, this is all based on the dump we use. Some of these things 
might have been fixed already.


Cheers,

Markus

On 20.03.2015 20:04, Dmitriy Sintsov wrote:

Hi Markus,
Is ?statement :P31v :Q3624078 .
  FILTER NOT EXISTS { ?statement :P582q ?endDate }
really enough to filter off currently non-existing countries?
Because I have such code in my Python bot:
http://paste.debian.net/162319/
And even with so many filters, there is a bit strange "Kingdom of
Netherlands" which duplicates "Netherlands" but having only few cities.
Dmitriy

On Fri, Mar 20, 2015 at 9:08 PM, Markus Kroetzsch
mailto:markus.kroetz...@tu-dresden.de>>
wrote:

Dear all,

Thanks to the people at the Center of Semantic Web Research in Chile
[1], we have a very first public SPARQL endpoint for Wikidata
running. This is very preliminary, so do not rely on it in
applications and expect things to fail, but you may still enjoy some
things.

http://milenio.dcc.uchile.cl/__sparql


The endpoint has all the data from our current RDF exports in one
big database [2]. Below this email are some example queries to get
you started (this is a bit of a learning-by-doing crash course in
SPARQL too, but you may want to consult a tutorial if you don't know
it ;-).

There are some known bugs in the RDF that we will hopefully fix soon
[3]. Also, the service uses a dump that is already a few weeks old
now. We are more interested in testing functions right now before
going production. Also, this is a raw API interface, not a proposal
for a nice UI.

Feedback (and other interesting queries) are welcome :-)

Cheers,

Markus


[1] http://ciws.cl/ -- a joint team from University of Chile and
Pontificia Universidad Catolica de Chile
[2] http://tools.wmflabs.org/__wikidata-exports/rdf/

[3]

https://github.com/Wikidata/__Wikidata-Toolkit/issues?q=is%__3Aopen+is%3Aissue+label%3A%__22RDF+export%22




==Lighthouses (Q39715) with their English label (LIMIT 100 for demo)==

PREFIX : >
SELECT *
WHERE {
  ?lighthouse a :Q39715 .
  ?lighthouse rdfs:label ?label FILTER(LANG(?label) = "en")
} LIMIT 100

(Just paste the query into the box at
http://milenio.dcc.uchile.cl/__sparql
)

The actual query condition is in the WHERE {...} part. Things
starting with ? are variables. Basic conditions take the form of
triples: "subject property value". For example, "?lighthouse a
:Q39715" looks for things that are a lighthouse ("a" is short for
"rdf:type" which we use to encode P31 statements without
qualifiers). The dot "." is used as a separator between triples.

Note that the label output is a bit cumbersome because you want to
filter by language (without the FILTER you get all labels in all
languages). A future UI would better fetch the labels after the
query, similar to WDQ, to get smaller & faster queries.


==People born in the same place that they died in==

PREFIX : >
SELECT ?person ?personname ?placename
WHERE {
  ?person a :Q5 .
  ?person :P19c ?place .
  ?person :P20c ?place .
  ?person rdfs:label ?personname FILTER(LANG(?personname) = "en") .
  ?place rdfs:label ?placename FILTER(LANG(?placename) = "en")
}  LIMIT 100

Here we use a few actual Wikidata properties. Properties in their
simple form (Entity->Value) use ids with a "c" in the end, like
:P19c here. O

Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Kingsley Idehen

On 3/20/15 2:08 PM, Markus Kroetzsch wrote:

Dear all,

Thanks to the people at the Center of Semantic Web Research in Chile 
[1], we have a very first public SPARQL endpoint for Wikidata running. 
This is very preliminary, so do not rely on it in applications and 
expect things to fail, but you may still enjoy some things.


http://milenio.dcc.uchile.cl/sparql 


You have a SPARQL that provides access to Wikidata dumps loaded into an 
RDF compliant RDBMS (in this case a Virtuoso RDBMS instance). I emphasis 
"a" because "the first" isn't accurate.


There are other endpoints that provide access to Wikidata dumps:

[1] http://lod.openlinksw.com/sparql -- 61 Billion+ RDF triples culled 
from across the LOD Cloud (if you lookup Wikidata URIs that are objects 
of owl:sameAs relations you'll end up in Wikidata own Linked Data Space)


[2] http://wikidata.metaphacts.com/sparql -- another endpoint I 
discovered yesterday .



#1 was actually loaded a long time ago :)

Links:

1. 
http://lod.openlinksw.com/sparql?default-graph-uri=&query=PREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E+SELECT+%3Fcountry+WHERE+%7B+%3Fcountry+%3AP31s%2F%3AP31v+%3AQ3624078+.+%7D&format=text%2Fhtml&timeout=0&debug=on 
-- LOD Cloud SPARQL Query Results URL


2. 
http://milenio.dcc.uchile.cl/sparql?default-graph-uri=&query=PREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E+SELECT+%3Fcountry+WHERE+%7B+%3Fcountry+%3AP31s%2F%3AP31v+%3AQ3624078+.+%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=0&debug=on 
-- Center of Semantic Web Research in Chile SPARQL Query Results URL .



--
Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this




smime.p7s
Description: S/MIME Cryptographic Signature
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Markus Kroetzsch

Hi Kingsley,

On 20.03.2015 21:10, Kingsley Idehen wrote:
...

You have a SPARQL that provides access to Wikidata dumps loaded into an
RDF compliant RDBMS (in this case a Virtuoso RDBMS instance). I emphasis
"a" because "the first" isn't accurate.


Great, the more the merrier! I did not know about these so far :-) 
Anyway, we are not claiming an award for being the first (when we put up 
the RDF dumps, we did hope that there would be an endpoint sooner ...). 
The important point now is to get the community working with this to 
gather feedback to help us tweak the RDF dumps for maximal utility. The 
folks in Chile are helping us to gather first-hand experience in 
providing such a service (as you will know, the plan is to offer 
official SPARQL endpoints for Wikidata in the future).




There are other endpoints that provide access to Wikidata dumps:

[1] http://lod.openlinksw.com/sparql -- 61 Billion+ RDF triples culled
from across the LOD Cloud (if you lookup Wikidata URIs that are objects
of owl:sameAs relations you'll end up in Wikidata own Linked Data Space)


Yes, works like a charm. Impressive that you can do this with all the 
data in one store!




[2] http://wikidata.metaphacts.com/sparql -- another endpoint I
discovered yesterday .


Interesting find. This one did not answer correctly to all the queries, 
but some worked quite well.


And of course there is the LDF endpoint provided by Cristian Consonni 
(http://wikidataldf.com/). However, this is a different technology and 
it cannot answer queries very fast.


Markus





#1 was actually loaded a long time ago :)

Links:

1.
http://lod.openlinksw.com/sparql?default-graph-uri=&query=PREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E+SELECT+%3Fcountry+WHERE+%7B+%3Fcountry+%3AP31s%2F%3AP31v+%3AQ3624078+.+%7D&format=text%2Fhtml&timeout=0&debug=on
-- LOD Cloud SPARQL Query Results URL

2.
http://milenio.dcc.uchile.cl/sparql?default-graph-uri=&query=PREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E+SELECT+%3Fcountry+WHERE+%7B+%3Fcountry+%3AP31s%2F%3AP31v+%3AQ3624078+.+%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=0&debug=on
-- Center of Semantic Web Research in Chile SPARQL Query Results URL .




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




--
Markus Kroetzsch
Faculty of Computer Science
Technische Universität Dresden
+49 351 463 38486
http://korrekt.org/

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


Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Markus Kroetzsch

On 20.03.2015 19:08, Markus Kroetzsch wrote:
...


Feedback (and other interesting queries) are welcome :-)


Here's another nice query:

"Find all astronomical bodies on which Wikidata has some coordinates, 
ordered by the number of coordinates that refer to them":


PREFIX : 
SELECT ?globe (COUNT(DISTINCT ?coordinatesValue) AS ?globeCount)
WHERE {
  ?coordinatesValue  ?globe
} ORDER BY DESC(?globeCount)

This is a bit more costly, so don't try to add labels in the query ;-)

Cheers,

Markus

--
Markus Kroetzsch
Faculty of Computer Science
Technische Universität Dresden
+49 351 463 38486
http://korrekt.org/

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


[Wikidata-l] wikidata tag on Openstreetmap

2015-03-20 Thread Jo
Hi,

I'm a longtime OSM contributor. I like the idea of Wikidata and what I'm
really interested in is a sort of bridge between both projects.

Would somebody be interested in writing a game like application, which
would invoke JOSM Remote Control (JOSM RC) at the coordinates in the
wikidata item and

wikidata=Q

in the clipboard?

That would make it easier to add such tags to the OSM objects.

Polyglot
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] Preliminary SPARQL endpoint for Wikidata

2015-03-20 Thread Kingsley Idehen

On 3/20/15 4:09 PM, Markus Kroetzsch wrote:

Hi Dmitriy,

Yes, you are right. There are some countries that have a value for 
"dissolved or abolished" (P576) but no end date for "instance of" 
"sovereign state". This includes the "United Kingdom of the 
Netherlands". Probably these should get an end date for their P31, or 
we should use P576 in the query.


A list of all states that have no end date to their P31 sovereign 
state but that do have a P576 date:


PREFIX : 
SELECT ?country ?countryName
WHERE {
  ?country :P576c ?disolutionDate .
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
 FILTER NOT EXISTS { ?statement :P582q ?endDate }
  ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
}



See:

[1] 
http://milenio.dcc.uchile.cl/sparql?default-graph-uri=&query=%0D%0APREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0D%0ASELECT+%3Fcountry+%3FcountryName%0D%0AWHERE+%7B%0D%0A++%3Fcountry+%3AP576c+%3FdisolutionDate+.%0D%0A++%3Fcountry+%3AP31s+%3Fstatement+.%0D%0A++%3Fstatement+%3AP31v+%3AQ3624078+.%0D%0A+FILTER+NOT+EXISTS+%7B+%3Fstatement+%3AP582q+%3FendDate+%7D%0D%0A++%3Fcountry+rdfs%3Alabel+%3FcountryName+FILTER%28lang%28%3FcountryName%29%3D%22en%22%29%0D%0A%7D+&format=text%2Fhtml&timeout=0&debug=on



A list of all states that have an end date to their P31 sovereign 
state but that do not have a P576 date:


PREFIX : 
SELECT ?country ?countryName
WHERE {
  ?country :P31s ?statement .
  ?statement :P31v :Q3624078 .
  ?statement :P582q ?endDate .
 FILTER NOT EXISTS { ?country :P576c ?disolutionDate }
  ?country rdfs:label ?countryName FILTER(lang(?countryName)="en")
}


See:

http://milenio.dcc.uchile.cl/sparql?default-graph-uri=&query=%0D%0APREFIX+%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0D%0ASELECT+%3Fcountry+%3FcountryName%0D%0AWHERE+%7B%0D%0A++%3Fcountry+%3AP31s+%3Fstatement+.%0D%0A++%3Fstatement+%3AP31v+%3AQ3624078+.%0D%0A++%3Fstatement+%3AP582q+%3FendDate+.%0D%0A+FILTER+NOT+EXISTS+%7B+%3Fcountry+%3AP576c+%3FdisolutionDate+%7D%0D%0A++%3Fcountry+rdfs%3Alabel+%3FcountryName+FILTER%28lang%28%3FcountryName%29%3D%22en%22%29%0D%0A%7D+&format=text%2Fhtml&timeout=0&debug=on

--
Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this




smime.p7s
Description: S/MIME Cryptographic Signature
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l