Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Lucas Werkmeister
It matches the German descriptions (German „einst“ = English “once”,
“formerly” – the results are described as having been civil rights
activists in the GDR).

On 04.10.19 16:55, Tim Thompson wrote:
> Great to learn about these features/extensions. However, I'm confused
> by the results in Lucas's example query for WikibaseCirrusSearch. How
> is the string "einst" being matched here?
>
> Thanks,
> Tim
>
> --
> Tim A. Thompson
> Discovery Metadata Librarian
> Yale University Library
>
> On Fri, Oct 4, 2019 at 8:54 AM Lucas Werkmeister
> mailto:m...@lucaswerkmeister.de>> wrote:
>
> If you use regular search rather than entity search, you can use
> WikibaseCirrusSearch
> 
> 
> search keywords like "haswbstatement:P31=Q5". Note that this uses
> a different kind of search, though – I think it only matches full
> words (after stemming and other transformations?), not prefixes.
> Query Link
> 
> 
>
> Cheers,
> Lucas
>
> On 04.10.19 10:22, Ettore RIZZA wrote:
>> Forgot to mention: you can do the same search using the API
>> only: 
>> https://www.wikidata.org/w/api.php?action=wbsearchentities&search=einst&language=en&format=json
>>
>>
>> But not sure you can easily filter the results by "instance of".
>>
>> Ettore Rizza
>>
>>
>> On Fri, 4 Oct 2019 at 10:15, Ettore RIZZA > > wrote:
>>
>> Hello Thomas,
>>
>> You can perform a full text search with the API, but not yet
>> with SPARQL AFAIK. However, it is possible to call the API in
>> a SPARQL query. For example, here is a query
>> 
>> 
>> that looks for "human (Q5)"  whose label contains the string
>> "einst".
>>
>> Hope this helps,
>>
>> Ettore Rizza
>>
>>
>> On Fri, 4 Oct 2019 at 09:58, Thomas Francart
>> > > wrote:
>>
>> Hello
>>
>> I understand the wikidata SPARQL label service only
>> fetches the labels, but does not allow to search/filter
>> on them; labels are also available in regulare rdfs:label
>> on which a FILTER can be made.
>> However I would like to do full-text search over labels,
>> to e.g. feed an autocomplete search field, actually just
>> like the usual top-right wikidata search field does. I
>> would also be interested to combine this with a criteria
>> on "instance of", to search only on instances of a given
>> class.
>>
>> Can I do that efficiently using the Wikidata SPARQL
>> service ? or is there a separate API I could use ?
>> (exemple welcome)
>>
>> Thanks
>> Thomas
>>
>> -- 
>> *
>> *
>> *Thomas Francart* -*SPARNA*
>> Web de _données_ | Architecture de l'_information_ |
>> Accès aux _connaissances_
>> blog : blog.sparna.fr , site :
>> sparna.fr , linkedin :
>> fr.linkedin.com/in/thomasfrancart
>> 
>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>> ___
>> Wikidata mailing list
>> Wikidata@lists.wikimedia.org
>> 
>

Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Kingsley Idehen
On 10/4/19 10:57 AM, Kingsley Idehen wrote:
> On 10/4/19 3:58 AM, Thomas Francart wrote:
>> Hello
>>
>> I understand the wikidata SPARQL label service only fetches the
>> labels, but does not allow to search/filter on them; labels are also
>> available in regulare rdfs:label on which a FILTER can be made.
>> However I would like to do full-text search over labels, to e.g. feed
>> an autocomplete search field, actually just like the usual top-right
>> wikidata search field does. I would also be interested to combine
>> this with a criteria on "instance of", to search only on instances of
>> a given class.
>>
>> Can I do that efficiently using the Wikidata SPARQL service ? or is
>> there a separate API I could use ? (exemple welcome)
>>
>> Thanks
>> Thomas
>>
>> -- 
>> *
>> *
>> *Thomas Francart* -*SPARNA*
>> Web de _données_ | Architecture de l'_information_ | Accès aux
>> _connaissances_
>> blog : blog.sparna.fr , site : sparna.fr
>> , linkedin : fr.linkedin.com/in/thomasfrancart
>> 
>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>
>
> Hi Thomas,
>
> Remember, we also publish a SPARQL Endpoint for Wikdata access [1].
> You can repeat your tests there too.
>
> Example (note that the retry loop indicates resources limits of this
> particular instance setup):
>
> Search on "Paris"
>
> http://wikidata.demo.openlinksw.com/fct/facet.vsp?qxml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20%3F%3E%3Cquery%20inference%3D%22%22%20same-as%3D%22%22%20view3%3D%22%22%20s-term%3D%22%22%20c-term%3D%22%22%3E%3Ctext%3EParis%3C%2Ftext%3E%3Cview%20type%3D%22text-d%22%20limit%3D%2220%22%20offset%3D%22%22%20%2F%3E%3C%2Fquery%3E
> 
>
> Config:
>
> OpenLink Virtuoso version 08.03.3315 as of Sep 4 2019, on Linux
> (x86_64-generic-linux-glibc25), Single-Server Edition (378 GB total
> memory)
>
> Same thing using the LOD Cloud cache instance, where data is a little
> out of date also:
>
> http://lod.openlinksw.com/fct/facet.vsp?qxml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20%3F%3E%3Cquery%20inference%3D%22%22%20same-as%3D%22%22%20view3%3D%22%22%20s-term%3D%22%22%20c-term%3D%22%22%3E%3Ctext%3EParis%3C%2Ftext%3E%3Cview%20type%3D%22text-d%22%20limit%3D%2220%22%20offset%3D%22%22%20%2F%3E%3C%2Fquery%3E
>
> Config:
>
> OpenLink Virtuoso version 07.20.3224 as of Dec 19 2017, on Linux
> (i686-generic-linux-glibc212-64), Cluster Edition (4 server processes,
> 756 GB total memory)
>
> Links
>
> [1] http://wikidata.demo.openlinksw.com/fct
>
> [2] http://wikidata.demo.openlinksw.com/sparql
>
>
> -- 
> Regards,
>
> Kingsley Idehen 
> Founder & CEO 
> OpenLink Software   
> Home Page: http://www.openlinksw.com
> Community Support: https://community.openlinksw.com
> Weblogs (Blogs):
> Company Blog: https://medium.com/openlink-software-blog
> Virtuoso Blog: https://medium.com/virtuoso-blog
> Data Access Drivers Blog: 
> https://medium.com/openlink-odbc-jdbc-ado-net-data-access-drivers
>
> Personal Weblogs (Blogs):
> Medium Blog: https://medium.com/@kidehen
> Legacy Blogs: http://www.openlinksw.com/blog/~kidehen/
>   http://kidehen.blogspot.com
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
> : 
> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>

SPARQL Query variants:

Wikidata SPARQL Endpoint at http://wikidata.demo.openlinksw.com/sparql :

https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=&query=%0D%0Aselect+%3Fs+%3Fo+%0D%0Awhere+%0D%0A++%7B+%0D%0A++graph+%3Fg+%0D%0A++%7B+%0D%0A+%3Fs+rdfs%3Alabel+%3Fo+.%0D%0A+%3Fo+bif%3Acontains++%27%22Paris%22%27++.%0D%0A+filter+%28lang%28%3Fo%29+%3D+%22en%22%29%0D%0A%0D%0A++%7D%0D%0A%0D%0A++%7D%0D%0A%0D%0Alimit+100+&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=3&signal_void=on&signal_unconnected=on&run=+Run+Query+


-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   
Home Page: http://www.openlinksw.com
Community Support: https://community.openlinksw.com
Weblogs (Blogs):
Company Blog: https://medium.com/openlink-software-blog
Virtuoso Blog: https://medium.com/virtuoso-blog
Data Access Drivers Blog: 
https://medium.com/openlink-odbc-jdbc-ado-net-data-access-drivers

Personal Web

Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Kingsley Idehen
On 10/4/19 3:58 AM, Thomas Francart wrote:
> Hello
>
> I understand the wikidata SPARQL label service only fetches the
> labels, but does not allow to search/filter on them; labels are also
> available in regulare rdfs:label on which a FILTER can be made.
> However I would like to do full-text search over labels, to e.g. feed
> an autocomplete search field, actually just like the usual top-right
> wikidata search field does. I would also be interested to combine this
> with a criteria on "instance of", to search only on instances of a
> given class.
>
> Can I do that efficiently using the Wikidata SPARQL service ? or is
> there a separate API I could use ? (exemple welcome)
>
> Thanks
> Thomas
>
> -- 
> *
> *
> *Thomas Francart* -*SPARNA*
> Web de _données_ | Architecture de l'_information_ | Accès aux
> _connaissances_
> blog : blog.sparna.fr , site : sparna.fr
> , linkedin : fr.linkedin.com/in/thomasfrancart
> 
> tel :  +33 (0)6.71.11.25.97, skype : francartthomas


Hi Thomas,

Remember, we also publish a SPARQL Endpoint for Wikdata access [1]. You
can repeat your tests there too.

Example (note that the retry loop indicates resources limits of this
particular instance setup):

Search on "Paris"

http://wikidata.demo.openlinksw.com/fct/facet.vsp?qxml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20%3F%3E%3Cquery%20inference%3D%22%22%20same-as%3D%22%22%20view3%3D%22%22%20s-term%3D%22%22%20c-term%3D%22%22%3E%3Ctext%3EParis%3C%2Ftext%3E%3Cview%20type%3D%22text-d%22%20limit%3D%2220%22%20offset%3D%22%22%20%2F%3E%3C%2Fquery%3E


Config:

OpenLink Virtuoso version 08.03.3315 as of Sep 4 2019, on Linux
(x86_64-generic-linux-glibc25), Single-Server Edition (378 GB total memory)

Same thing using the LOD Cloud cache instance, where data is a little
out of date also:

http://lod.openlinksw.com/fct/facet.vsp?qxml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20%3F%3E%3Cquery%20inference%3D%22%22%20same-as%3D%22%22%20view3%3D%22%22%20s-term%3D%22%22%20c-term%3D%22%22%3E%3Ctext%3EParis%3C%2Ftext%3E%3Cview%20type%3D%22text-d%22%20limit%3D%2220%22%20offset%3D%22%22%20%2F%3E%3C%2Fquery%3E

Config:

OpenLink Virtuoso version 07.20.3224 as of Dec 19 2017, on Linux
(i686-generic-linux-glibc212-64), Cluster Edition (4 server processes,
756 GB total memory)

Links

[1] http://wikidata.demo.openlinksw.com/fct

[2] http://wikidata.demo.openlinksw.com/sparql


-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   
Home Page: http://www.openlinksw.com
Community Support: https://community.openlinksw.com
Weblogs (Blogs):
Company Blog: https://medium.com/openlink-software-blog
Virtuoso Blog: https://medium.com/virtuoso-blog
Data Access Drivers Blog: 
https://medium.com/openlink-odbc-jdbc-ado-net-data-access-drivers

Personal Weblogs (Blogs):
Medium Blog: https://medium.com/@kidehen
Legacy Blogs: http://www.openlinksw.com/blog/~kidehen/
  http://kidehen.blogspot.com

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Tim Thompson
Great to learn about these features/extensions. However, I'm confused by
the results in Lucas's example query for WikibaseCirrusSearch. How is the
string "einst" being matched here?

Thanks,
Tim

--
Tim A. Thompson
Discovery Metadata Librarian
Yale University Library

On Fri, Oct 4, 2019 at 8:54 AM Lucas Werkmeister 
wrote:

> If you use regular search rather than entity search, you can use
> WikibaseCirrusSearch
> 
> search keywords like "haswbstatement:P31=Q5". Note that this uses a
> different kind of search, though – I think it only matches full words
> (after stemming and other transformations?), not prefixes. Query Link
> 
>
> Cheers,
> Lucas
> On 04.10.19 10:22, Ettore RIZZA wrote:
>
> Forgot to mention: you can do the same search using the API only:
> https://www.wikidata.org/w/api.php?action=wbsearchentities&search=einst&language=en&format=json
>
> But not sure you can easily filter the results by "instance of".
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 10:15, Ettore RIZZA  wrote:
>
>> Hello Thomas,
>>
>> You can perform a full text search with the API, but not yet with SPARQL
>> AFAIK. However, it is possible to call the API in a SPARQL query. For
>> example, here is a query
>> 
>> that looks for "human (Q5)"  whose label contains the string "einst".
>>
>> Hope this helps,
>>
>> Ettore Rizza
>>
>>
>> On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
>> wrote:
>>
>>> Hello
>>>
>>> I understand the wikidata SPARQL label service only fetches the labels,
>>> but does not allow to search/filter on them; labels are also available in
>>> regulare rdfs:label on which a FILTER can be made.
>>> However I would like to do full-text search over labels, to e.g. feed an
>>> autocomplete search field, actually just like the usual top-right wikidata
>>> search field does. I would also be interested to combine this with a
>>> criteria on "instance of", to search only on instances of a given class.
>>>
>>> Can I do that efficiently using the Wikidata SPARQL service ? or is
>>> there a separate API I could use ? (exemple welcome)
>>>
>>> Thanks
>>> Thomas
>>>
>>> --
>>>
>>> *Thomas Francart* -* SPARNA*
>>> Web de *données* | Architecture de l'*information* | Accès aux
>>> *connaissances*
>>> blog : blog.sparna.fr, site : sparna.fr, linkedin :
>>> fr.linkedin.com/in/thomasfrancart
>>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>>> ___
>>> Wikidata mailing list
>>> Wikidata@lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/wikidata
>>>
>>
> ___
> Wikidata mailing 
> listWikidata@lists.wikimedia.orghttps://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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Thomas Francart
Ettore, Lucas, thanks a lof for your answers, that's what I was looking for.
Searching for an entity based on a label + language (and optionally
additionnal criteria like instance of) looks like a reasonable use-case,
this could be "packaged" inside magic triples to make this feature directly
available in SPARQL (as other triplestores with full-text/index-based
search are doing).

Cheers
Thomas

Le ven. 4 oct. 2019 à 14:55, Lucas Werkmeister  a
écrit :

> If you use regular search rather than entity search, you can use
> WikibaseCirrusSearch
> 
> search keywords like "haswbstatement:P31=Q5". Note that this uses a
> different kind of search, though – I think it only matches full words
> (after stemming and other transformations?), not prefixes. Query Link
> 
>
> Cheers,
> Lucas
> On 04.10.19 10:22, Ettore RIZZA wrote:
>
> Forgot to mention: you can do the same search using the API only:
> https://www.wikidata.org/w/api.php?action=wbsearchentities&search=einst&language=en&format=json
>
> But not sure you can easily filter the results by "instance of".
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 10:15, Ettore RIZZA  wrote:
>
>> Hello Thomas,
>>
>> You can perform a full text search with the API, but not yet with SPARQL
>> AFAIK. However, it is possible to call the API in a SPARQL query. For
>> example, here is a query
>> 
>> that looks for "human (Q5)"  whose label contains the string "einst".
>>
>> Hope this helps,
>>
>> Ettore Rizza
>>
>>
>> On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
>> wrote:
>>
>>> Hello
>>>
>>> I understand the wikidata SPARQL label service only fetches the labels,
>>> but does not allow to search/filter on them; labels are also available in
>>> regulare rdfs:label on which a FILTER can be made.
>>> However I would like to do full-text search over labels, to e.g. feed an
>>> autocomplete search field, actually just like the usual top-right wikidata
>>> search field does. I would also be interested to combine this with a
>>> criteria on "instance of", to search only on instances of a given class.
>>>
>>> Can I do that efficiently using the Wikidata SPARQL service ? or is
>>> there a separate API I could use ? (exemple welcome)
>>>
>>> Thanks
>>> Thomas
>>>
>>> --
>>>
>>> *Thomas Francart* -* SPARNA*
>>> Web de *données* | Architecture de l'*information* | Accès aux
>>> *connaissances*
>>> blog : blog.sparna.fr, site : sparna.fr, linkedin :
>>> fr.linkedin.com/in/thomasfrancart
>>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>>> ___
>>> Wikidata mailing list
>>> Wikidata@lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/wikidata
>>>
>>
> ___
> Wikidata mailing 
> listWikidata@lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/wikidata
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>


-- 

*Thomas Francart* -* SPARNA*
Web de *données* | Architecture de l'*information* | Accès aux
*connaissances*
blog : blog.sparna.fr, site : sparna.fr, linkedin :
fr.linkedin.com/in/thomasfrancart
tel :  +33 (0)6.71.11.25.97, skype : francartthomas
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Thad Guidry
A few things of note:
1. the label service adds its variables very late during query evaluation;
at the point where you try to FILTER on ?humanLabel, the label service
hasn’t created that variable yet.
2. the label service isn’t the only way to get an item’s label. Labels are
also stored as regular triples, using the predicate rdfs:label. Of course,
this means all labels, not just English ones; if we only want English
labels, we’ll have to filter on the language of the label:
3. One can also use FILTER with a regular expression. In the following
example

SELECT ?item ?itemLabel ?bblidWHERE {
?item wdt:P2580 ?bblid .
SERVICE wikibase:label { bd:serviceParam wikibase:language
"[AUTO_LANGUAGE],en" }
FILTER(!REGEX(STR(?bblid), "[\\.q]")) }

Read thoroughly the FILTER section in the Wikidata:SPARQL tutorial
<https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#FILTER> to read
more about options above and others FILTER functions available.

Here's some extra example's:

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Scholarly_articles_with_%22Zika%22_in_the_item_label

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Actors_whose_Spanish_label_ends_with_%E2%80%9C_(actor)%E2%80%9D

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Distribution_of_names_of_human_settlements_ending_in_%22-ow%22_or_%22-itz%22_in_Germany

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Rock_bands_that_start_with_%22M%22

Thad
https://www.linkedin.com/in/thadguidry/


On Fri, Oct 4, 2019 at 6:09 AM Houcemeddine A. Turki <
turkiabdelwa...@hotmail.fr> wrote:

> Dear Mr.,
> I thank you for the query. This is absolutely useful to ameliorate data
> mining methods for Wikidata. I always said that Wikidata Query Service is
> still misused.
> Yours Sincerely,
> Houcemeddine Turki (he/him)
> Medical Student, Faculty of Medicine of Sfax, University of Sfax, Tunisia
> GLAM, Research and Education Coordinator, Wikimedia TN User Group
> Member, Wiki Project Med
> Member, WikiIndaba Steering Committee
> Member, Wikimedia and Library User Group Steering Committee
> 
> +21629499418
>
>
>  Message d'origine 
> De : Ettore RIZZA 
> Date : 2019/10/04 09:15 (GMT+01:00)
> À : Discussion list for the Wikidata project 
>
> Objet : Re: [Wikidata] Full-text / autocomplete search on labels
>
> Hello Thomas,
>
> You can perform a full text search with the API, but not yet with SPARQL
> AFAIK. However, it is possible to call the API in a SPARQL query. For
> example, here is a query
> <https://query.wikidata.org/#SELECT%20DISTINCT%20%3Fperson%20%3FpersonLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Amwapi%20%7B%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aapi%20%22EntitySearch%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aendpoint%20%22www.wikidata.org%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Asearch%20%22einst%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Alanguage%20%22en%22%20.%0A%20%20%20%20%20%20%3Fperson%20wikibase%3AapiOutputItem%20mwapi%3Aitem%20.%0A%20%20%7D%0A%20%20%3Fperson%20wdt%3AP31%20wd%3AQ5.%0A%20%20%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%0A%20%20%0A%7D%20ORDER%20BY%20DESC(%3Fperson)%20LIMIT%2020>
> that looks for "human (Q5)"  whose label contains the string "einst".
>
> Hope this helps,
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
> wrote:
>
>> Hello
>>
>> I understand the wikidata SPARQL label service only fetches the labels,
>> but does not allow to search/filter on them; labels are also available in
>> regulare rdfs:label on which a FILTER can be made.
>> However I would like to do full-text search over labels, to e.g. feed an
>> autocomplete search field, actually just like the usual top-right wikidata
>> search field does. I would also be interested to combine this with a
>> criteria on "instance of", to search only on instances of a given class.
>>
>> Can I do that efficiently using the Wikidata SPARQL service ? or is there
>> a separate API I could use ? (exemple welcome)
>>
>> Thanks
>> Thomas
>>
>> --
>>
>> *Thomas Francart* -* SPARNA*
>> Web de *données* | Architecture de l'*information* | Accès aux
>> *connaissances*
>> blog : blog.sparna.fr, site : sparna.fr, linkedin :
>> fr.linkedin.com/in/thomasfrancart
>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>> ___
>> Wikidata mailing list
&

Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Lucas Werkmeister
If you use regular search rather than entity search, you can use
WikibaseCirrusSearch

search keywords like "haswbstatement:P31=Q5". Note that this uses a
different kind of search, though – I think it only matches full words
(after stemming and other transformations?), not prefixes. Query Link


Cheers,
Lucas

On 04.10.19 10:22, Ettore RIZZA wrote:
> Forgot to mention: you can do the same search using the API
> only: 
> https://www.wikidata.org/w/api.php?action=wbsearchentities&search=einst&language=en&format=json
>
>
> But not sure you can easily filter the results by "instance of".
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 10:15, Ettore RIZZA  > wrote:
>
> Hello Thomas,
>
> You can perform a full text search with the API, but not yet with
> SPARQL AFAIK. However, it is possible to call the API in a SPARQL
> query. For example, here is a query
> 
> 
> that looks for "human (Q5)"  whose label contains the string "einst".
>
> Hope this helps,
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 09:58, Thomas Francart
> mailto:thomas.franc...@sparna.fr>> wrote:
>
> Hello
>
> I understand the wikidata SPARQL label service only fetches
> the labels, but does not allow to search/filter on them;
> labels are also available in regulare rdfs:label on which a
> FILTER can be made.
> However I would like to do full-text search over labels, to
> e.g. feed an autocomplete search field, actually just like the
> usual top-right wikidata search field does. I would also be
> interested to combine this with a criteria on "instance of",
> to search only on instances of a given class.
>
> Can I do that efficiently using the Wikidata SPARQL service ?
> or is there a separate API I could use ? (exemple welcome)
>
> Thanks
> Thomas
>
> -- 
> *
> *
> *Thomas Francart* -*SPARNA*
> Web de _données_ | Architecture de l'_information_ | Accès aux
> _connaissances_
> blog : blog.sparna.fr , site :
> sparna.fr , linkedin :
> fr.linkedin.com/in/thomasfrancart
> 
> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
> ___
> 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
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Houcemeddine A. Turki
Dear Mr.,
I thank you for your efforts. I ask if a tutorial about merging Wikidata API 
with Wikidata Query Service or about doing federated queries with Wikidata 
Query Service can be done.
Yours Sincerely,
Houcemeddine Turki (he/him)
Medical Student, Faculty of Medicine of Sfax, University of Sfax, Tunisia
GLAM, Research and Education Coordinator, Wikimedia TN User Group
Member, Wiki Project Med
Member, WikiIndaba Steering Committee
Member, Wikimedia and Library User Group Steering Committee

+21629499418


 Message d'origine 
De : "Houcemeddine A. Turki" 
Date : 2019/10/04 12:09 (GMT+01:00)
À : Ettore RIZZA , Discussion list for the Wikidata 
project 
Objet : Re: [Wikidata] Full-text / autocomplete search on labels

Dear Mr.,
I thank you for the query. This is absolutely useful to ameliorate data mining 
methods for Wikidata. I always said that Wikidata Query Service is still 
misused.
Yours Sincerely,
Houcemeddine Turki (he/him)
Medical Student, Faculty of Medicine of Sfax, University of Sfax, Tunisia
GLAM, Research and Education Coordinator, Wikimedia TN User Group
Member, Wiki Project Med
Member, WikiIndaba Steering Committee
Member, Wikimedia and Library User Group Steering Committee

+21629499418


 Message d'origine 
De : Ettore RIZZA 
Date : 2019/10/04 09:15 (GMT+01:00)
À : Discussion list for the Wikidata project 
Objet : Re: [Wikidata] Full-text / autocomplete search on labels

Hello Thomas,

You can perform a full text search with the API, but not yet with SPARQL AFAIK. 
However, it is possible to call the API in a SPARQL query. For example, here is 
a 
query<https://query.wikidata.org/#SELECT%20DISTINCT%20%3Fperson%20%3FpersonLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Amwapi%20%7B%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aapi%20%22EntitySearch%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aendpoint%20%22www.wikidata.org%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Asearch%20%22einst%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Alanguage%20%22en%22%20.%0A%20%20%20%20%20%20%3Fperson%20wikibase%3AapiOutputItem%20mwapi%3Aitem%20.%0A%20%20%7D%0A%20%20%3Fperson%20wdt%3AP31%20wd%3AQ5.%0A%20%20%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%0A%20%20%0A%7D%20ORDER%20BY%20DESC(%3Fperson)%20LIMIT%2020>
 that looks for "human (Q5)"  whose label contains the string "einst".

Hope this helps,

Ettore Rizza


On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
mailto:thomas.franc...@sparna.fr>> wrote:
Hello

I understand the wikidata SPARQL label service only fetches the labels, but 
does not allow to search/filter on them; labels are also available in regulare 
rdfs:label on which a FILTER can be made.
However I would like to do full-text search over labels, to e.g. feed an 
autocomplete search field, actually just like the usual top-right wikidata 
search field does. I would also be interested to combine this with a criteria 
on "instance of", to search only on instances of a given class.

Can I do that efficiently using the Wikidata SPARQL service ? or is there a 
separate API I could use ? (exemple welcome)

Thanks
Thomas

--

Thomas Francart - SPARNA
Web de données | Architecture de l'information | Accès aux connaissances
blog : blog.sparna.fr<http://blog.sparna.fr>, site : 
sparna.fr<http://sparna.fr>, linkedin : 
fr.linkedin.com/in/thomasfrancart<https://fr.linkedin.com/in/thomasfrancart>
tel :  +33 (0)6.71.11.25.97, skype : francartthomas
___
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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Houcemeddine A. Turki
Dear Mr.,
I thank you for the query. This is absolutely useful to ameliorate data mining 
methods for Wikidata. I always said that Wikidata Query Service is still 
misused.
Yours Sincerely,
Houcemeddine Turki (he/him)
Medical Student, Faculty of Medicine of Sfax, University of Sfax, Tunisia
GLAM, Research and Education Coordinator, Wikimedia TN User Group
Member, Wiki Project Med
Member, WikiIndaba Steering Committee
Member, Wikimedia and Library User Group Steering Committee

+21629499418


 Message d'origine 
De : Ettore RIZZA 
Date : 2019/10/04 09:15 (GMT+01:00)
À : Discussion list for the Wikidata project 
Objet : Re: [Wikidata] Full-text / autocomplete search on labels

Hello Thomas,

You can perform a full text search with the API, but not yet with SPARQL AFAIK. 
However, it is possible to call the API in a SPARQL query. For example, here is 
a 
query<https://query.wikidata.org/#SELECT%20DISTINCT%20%3Fperson%20%3FpersonLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Amwapi%20%7B%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aapi%20%22EntitySearch%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Aendpoint%20%22www.wikidata.org%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Asearch%20%22einst%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Alanguage%20%22en%22%20.%0A%20%20%20%20%20%20%3Fperson%20wikibase%3AapiOutputItem%20mwapi%3Aitem%20.%0A%20%20%7D%0A%20%20%3Fperson%20wdt%3AP31%20wd%3AQ5.%0A%20%20%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%0A%20%20%0A%7D%20ORDER%20BY%20DESC(%3Fperson)%20LIMIT%2020>
 that looks for "human (Q5)"  whose label contains the string "einst".

Hope this helps,

Ettore Rizza


On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
mailto:thomas.franc...@sparna.fr>> wrote:
Hello

I understand the wikidata SPARQL label service only fetches the labels, but 
does not allow to search/filter on them; labels are also available in regulare 
rdfs:label on which a FILTER can be made.
However I would like to do full-text search over labels, to e.g. feed an 
autocomplete search field, actually just like the usual top-right wikidata 
search field does. I would also be interested to combine this with a criteria 
on "instance of", to search only on instances of a given class.

Can I do that efficiently using the Wikidata SPARQL service ? or is there a 
separate API I could use ? (exemple welcome)

Thanks
Thomas

--

Thomas Francart - SPARNA
Web de données | Architecture de l'information | Accès aux connaissances
blog : blog.sparna.fr<http://blog.sparna.fr>, site : 
sparna.fr<http://sparna.fr>, linkedin : 
fr.linkedin.com/in/thomasfrancart<https://fr.linkedin.com/in/thomasfrancart>
tel :  +33 (0)6.71.11.25.97, skype : francartthomas
___
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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Amirouche Boubekki
Hello all,

Le ven. 4 oct. 2019 à 09:58, Thomas Francart
 a écrit :
>
> Hello
>
> I understand the wikidata SPARQL label service only fetches the labels, but 
> does not allow to search/filter on them; labels are also available in 
> regulare rdfs:label on which a FILTER can be made.

See Etorre Rizza answer about filtering.

> However I would like to do full-text search over labels, to e.g. feed an 
> autocomplete search field,

I understand what you want to do but that is not called "full-text
search". FTS means "inside the text" or "all the text" that does not
apply to concept search or wikification.

The most common term for this kind of search is called "fuzzy search"
or "spell checking" or "autocomplete". The basic algorithm is to
search terms using prefixes of the input query.

More on that later 

---

Amirouche ~ amz3 ~ https://hyper.dev

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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Ettore RIZZA
Forgot to mention: you can do the same search using the API only:
https://www.wikidata.org/w/api.php?action=wbsearchentities&search=einst&language=en&format=json

But not sure you can easily filter the results by "instance of".

Ettore Rizza


On Fri, 4 Oct 2019 at 10:15, Ettore RIZZA  wrote:

> Hello Thomas,
>
> You can perform a full text search with the API, but not yet with SPARQL
> AFAIK. However, it is possible to call the API in a SPARQL query. For
> example, here is a query
> 
> that looks for "human (Q5)"  whose label contains the string "einst".
>
> Hope this helps,
>
> Ettore Rizza
>
>
> On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
> wrote:
>
>> Hello
>>
>> I understand the wikidata SPARQL label service only fetches the labels,
>> but does not allow to search/filter on them; labels are also available in
>> regulare rdfs:label on which a FILTER can be made.
>> However I would like to do full-text search over labels, to e.g. feed an
>> autocomplete search field, actually just like the usual top-right wikidata
>> search field does. I would also be interested to combine this with a
>> criteria on "instance of", to search only on instances of a given class.
>>
>> Can I do that efficiently using the Wikidata SPARQL service ? or is there
>> a separate API I could use ? (exemple welcome)
>>
>> Thanks
>> Thomas
>>
>> --
>>
>> *Thomas Francart* -* SPARNA*
>> Web de *données* | Architecture de l'*information* | Accès aux
>> *connaissances*
>> blog : blog.sparna.fr, site : sparna.fr, linkedin :
>> fr.linkedin.com/in/thomasfrancart
>> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
>> ___
>> 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


Re: [Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Ettore RIZZA
Hello Thomas,

You can perform a full text search with the API, but not yet with SPARQL
AFAIK. However, it is possible to call the API in a SPARQL query. For
example, here is a query

that looks for "human (Q5)"  whose label contains the string "einst".

Hope this helps,

Ettore Rizza


On Fri, 4 Oct 2019 at 09:58, Thomas Francart 
wrote:

> Hello
>
> I understand the wikidata SPARQL label service only fetches the labels,
> but does not allow to search/filter on them; labels are also available in
> regulare rdfs:label on which a FILTER can be made.
> However I would like to do full-text search over labels, to e.g. feed an
> autocomplete search field, actually just like the usual top-right wikidata
> search field does. I would also be interested to combine this with a
> criteria on "instance of", to search only on instances of a given class.
>
> Can I do that efficiently using the Wikidata SPARQL service ? or is there
> a separate API I could use ? (exemple welcome)
>
> Thanks
> Thomas
>
> --
>
> *Thomas Francart* -* SPARNA*
> Web de *données* | Architecture de l'*information* | Accès aux
> *connaissances*
> blog : blog.sparna.fr, site : sparna.fr, linkedin :
> fr.linkedin.com/in/thomasfrancart
> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
> ___
> 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


[Wikidata] Full-text / autocomplete search on labels

2019-10-04 Thread Thomas Francart
Hello

I understand the wikidata SPARQL label service only fetches the labels, but
does not allow to search/filter on them; labels are also available in
regulare rdfs:label on which a FILTER can be made.
However I would like to do full-text search over labels, to e.g. feed an
autocomplete search field, actually just like the usual top-right wikidata
search field does. I would also be interested to combine this with a
criteria on "instance of", to search only on instances of a given class.

Can I do that efficiently using the Wikidata SPARQL service ? or is there a
separate API I could use ? (exemple welcome)

Thanks
Thomas

-- 

*Thomas Francart* -* SPARNA*
Web de *données* | Architecture de l'*information* | Accès aux
*connaissances*
blog : blog.sparna.fr, site : sparna.fr, linkedin :
fr.linkedin.com/in/thomasfrancart
tel :  +33 (0)6.71.11.25.97, skype : francartthomas
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata