Page MenuHomePhabricator

Wikidata query times out
Closed, InvalidPublic


when i get this query query wikidata will be crash but by changing the country it will be ok like this. in my opinion it is cased the huge number of results.

Event Timeline

Yamaha5 created this task.Mar 17 2018, 5:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 17 2018, 5:02 PM

it shows time out

	at java.util.concurrent.FutureTask.get(
	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(
	at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(
	at com.bigdata.rdf.sail.webapp.QueryServlet.doGet(
	at com.bigdata.rdf.sail.webapp.RESTServlet.doGet(
	at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doGet(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.jetty.servlet.ServletHolder.handle(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.wikidata.query.rdf.blazegraph.throttling.ThrottlingFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at ch.qos.logback.classic.helpers.MDCInsertingServletFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.wikidata.query.rdf.blazegraph.filters.ClientIPFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.servlet.ServletHandler.doScope(
	at org.eclipse.jetty.server.session.SessionHandler.doScope(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handle(
	at org.eclipse.jetty.server.HttpChannel.handle(
	at org.eclipse.jetty.server.HttpConnection.onFillable(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$
Yamaha5 renamed this task from query wikidata crash to query wikidata crash and shows time out.Mar 17 2018, 5:08 PM
Restricted Application added projects: Wikidata, Discovery. · View Herald TranscriptMar 17 2018, 6:14 PM

There is too much data returned for the query service to handle within the timelimit.
A little optimization for your query:

PREFIX schema: <>
SELECT ?item ?enarticle ?linkcount ?itemLabel WHERE { {
SELECT ?item ?enarticle (COUNT(DISTINCT ?sitelink) AS ?linkcount) WHERE {
  ?item (wdt:P31/wdt:P279) wd:Q486972.
  ?sitelink schema:about ?item.
  ?item wdt:P17 wd:Q668.
    ?enarticle schema:about ?item.
    ?enarticle schema:isPartOf <>.
    ?article schema:about ?item.
    ?article schema:inLanguage "fa".
    ?article schema:isPartOf <>.
GROUP BY ?item ?itemLabel ?enarticle
ORDER BY DESC(?linkcount)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fa". }

By moving the label service outside the main query, it first matches the main query and then it fetches the labels for the results. Otherwise it fetches the label for all items before filtering them.
This isn't an error, but just a limitation of the query service to prevent 1 query to run that long that other queries have to wait in the queue.

Ladsgroup closed this task as Invalid.Mar 17 2018, 11:56 PM
Ladsgroup added a subscriber: Ladsgroup.

I talked to the user, cities in India is too big to run such queries which ends up as time outs. This is more of a symptom of bad indexing in the blazegraph than a problem on its own.

Smalyshev renamed this task from query wikidata crash and shows time out to Wikidata query times out.Mar 18 2018, 2:36 AM