Discussion:
[Wikidata] sparql + regex?
Ed Summers
2016-09-25 10:32:06 UTC
Permalink
I've been experimenting a bit with queries that contain regular expressions and have noticed that they seem to be triggering 502 Bad Gateway errors. Or perhaps it's just a coincidence and there were other things going on around 10AM GMT?

Here's an example query where I'm looking for cities that start with "Silver":

---

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?s ?label
WHERE {
?s wdt:P31 wd:Q515 .
?s rdfs:label ?label
FILTER(regex(?label, "^Silver"))
}
LIMIT 15

---

Am I doing something wrong in the query? Occasionally it seems to work, but most of the time it waits for a while and then I get the 502 error. Any guidance you may have would be appreciated.

//Ed
David Abián
2016-09-25 10:51:42 UTC
Permalink
I'm also experiencing issues and finding 502 Bad Gateway errors.

However, they aren't related to regular expressions. These issues also
appear in other cases, even with the simplest queries.

Loading Image...
Post by Ed Summers
I've been experimenting a bit with queries that contain regular expressions and have noticed that they seem to be triggering 502 Bad Gateway errors. Or perhaps it's just a coincidence and there were other things going on around 10AM GMT?
---
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?s ?label
WHERE {
?s wdt:P31 wd:Q515 .
?s rdfs:label ?label
FILTER(regex(?label, "^Silver"))
}
LIMIT 15
---
Am I doing something wrong in the query? Occasionally it seems to work, but most of the time it waits for a while and then I get the 502 error. Any guidance you may have would be appreciated.
//Ed
--
David Abián - davidabian.com
Junta Directiva

Wikimedia España
Vega Sicilia, 2
47008 - Valladolid
https://wikimedia.es

Wikimedia España es una asociación sin ánimo de lucro española con
CIF G-10413698 inscrita en el Registro Nacional de Asociaciones,
Grupo 1, Sección 1, Núm. Nacional 597390.

«Imagina un mundo en el que cada persona
tenga acceso libre a todo el conocimiento».
David Abián
2016-09-25 11:19:25 UTC
Permalink
Tracked in Phabricator...

https://phabricator.wikimedia.org/T146576
Post by David Abián
I'm also experiencing issues and finding 502 Bad Gateway errors.
However, they aren't related to regular expressions. These issues also
appear in other cases, even with the simplest queries.
https://davidabian.com/downloads/wikidata/502-error-sparql.png
Post by Ed Summers
I've been experimenting a bit with queries that contain regular expressions and have noticed that they seem to be triggering 502 Bad Gateway errors. Or perhaps it's just a coincidence and there were other things going on around 10AM GMT?
---
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?s ?label
WHERE {
?s wdt:P31 wd:Q515 .
?s rdfs:label ?label
FILTER(regex(?label, "^Silver"))
}
LIMIT 15
---
Am I doing something wrong in the query? Occasionally it seems to work, but most of the time it waits for a while and then I get the 502 error. Any guidance you may have would be appreciated.
//Ed
--
David Abián - davidabian.com
Junta Directiva

Wikimedia España
Vega Sicilia, 2
47008 - Valladolid
https://wikimedia.es

Wikimedia España es una asociación sin ánimo de lucro española con
CIF G-10413698 inscrita en el Registro Nacional de Asociaciones,
Grupo 1, Sección 1, Núm. Nacional 597390.

«Imagina un mundo en el que cada persona
tenga acceso libre a todo el conocimiento».
Ed Summers
2016-09-25 11:23:38 UTC
Permalink
Post by David Abián
Tracked in Phabricator...
https://phabricator.wikimedia.org/T146576
Thanks!

//Ed

Loading...