Re: [Wikidata] Fwd: Using sparql to query for labels with matching regex

2016-04-19 Thread Daniel Kinzler
Hi Mike!

I'm no SPARQL expert, but regular expressions in queries are often not optimized
using indexes. So *all* labels would need to be checked against the regular
expression, which of course times out.

But there are other options. Perhaps
instead of FILTER regex(?label, "^apparel")
try FILTER (STRSTARTS(?label,"apparel"))

See 

Another option would be Blazegraph's full text index:

WHERE {
  ?label bds:search "apparel*" .
  
}

This woudl match any label that contains a word that starts with apparel.

See 

HTH

Am 29.03.2016 um 22:47 schrieb mike white:
> 
> Hi all
> 
> I am trying to query the wiki data for entities with labels that matches a
> regex. I am new in the sparql world. So could you please help me with it. Here
> is what I have for now.
> 
> https://gist.github.com/anonymous/2810eb5747e51a9ae746183a43f20771
> 
> But I don't think it is the right way. Any help will be much appreciate. 
> Thanks
> 
> 
> 
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
> 


-- 
Daniel Kinzler
Senior Software Developer

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

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


[Wikidata] Fwd: Using sparql to query for labels with matching regex

2016-03-30 Thread mike white
Hi all

I am trying to query the wiki data for entities with labels that matches a
regex. I am new in the sparql world. So could you please help me with it.
Here is what I have for now.

https://gist.github.com/anonymous/2810eb5747e51a9ae746183a43f20771

But I don't think it is the right way. Any help will be much appreciate.
Thanks
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata