Wikidata:Contact the development team/Query Service and search/Archive/2020/10

This page is an archive. Please do not modify it. Use the current page, even to continue an old discussion.

Mwapi service not working for the last couple of days (September 30)

SELECT *
{
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:endpoint "www.wikidata.org" .
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam mwapi:generator "search" .
    bd:serviceParam mwapi:gsrsearch "test" .
    bd:serviceParam mwapi:gsrlimit "max" .    
    bd:serviceParam mwapi:gsrnamespace "0" .    
    ?article wikibase:apiOutput mwapi:title  .
    ?ns wikibase:apiOutput "@ns" .   
  }
}
Try it!

Any idea why the above and similar don't work these days? --- Jura 08:41, 30 September 2020 (UTC)

Thanks for the report, we are looking into it. DCausse (WMF) (talk) 10:31, 30 September 2020 (UTC)
Quick update: we restarted the affected servers 10 hours ago and it fixed the problem. The root cause is not yet identified and the problem might occur again, the next version of the query service will produce more debugging information so please ping me directly here when you encounter the problem again. DCausse (WMF) (talk) 07:32, 2 October 2020 (UTC)
@DCausse (WMF): It works again! Thanks for the quick repair.
In general, I find Query Service much more reliable in recent weeks. Seems your efforts (and the team's) work out. Thanks for that as well. --- Jura 07:46, 2 October 2020 (UTC)

Mwapi service not working (Oct 21)

thanks for ping and sorry for the inconvenience, I restarted the affected servers and we'll resume investigations on this problem. DCausse (WMF) (talk) 15:16, 21 October 2020 (UTC)

Looking for help to write a query with P582

Bonjour

I couldn't find a suitable forum. So I allow myself to post here.

I'm looking for help to write a query that returns the list of French departments without including departments that no longer exist.

For the moment I can get the list of departments that no longer exist ... I am therefore very close to the desired result

 SELECT ?department ?departmentLabel WHERE { 
   ?department wdt:P31 wd:Q6465;
   OPTIONAL {
     ?department wdt:P582|wdt:P576 ?ended.
   }     
   FILTER(BOUND(?ended)).  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" }
 }

Thanks

--RémyPHP (talk) 13:34, 23 October 2020 (UTC)

@RémyPHP: Wikidata:Request a query is the normal place.
You are close - one ! away from victory:
SELECT ?department ?departmentLabel WHERE { 
   ?department wdt:P31 wd:Q6465;
   OPTIONAL {
     ?department wdt:P582|wdt:P576 ?ended.
   }     
   FILTER(!BOUND(?ended)).  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" }
 }
Try it!
and you could also have looked at the qualifiers of the P31 statement to get the same thing
SELECT ?department ?departmentLabel WHERE { 
  ?department p:P31 ?stat. 
  ?stat ps:P31 wd:Q6465 .
   OPTIONAL {
     ?stat pq:P582|pq:P576 ?ended.
   }     
   FILTER(!BOUND(?ended)).  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" }
 }
Try it!
--Tagishsimon (talk) 13:59, 23 October 2020 (UTC)
Merci @Tagishsimon:
By the way I found 2 data errors in the result.
https://www.wikidata.org/wiki/Q3534060 and https://www.wikidata.org/wiki/Q16665897 are not département (Q6465).
how to fix that ?
RémyPHP (talk) 10:18, 28 October 2020 (UTC)
RémyPHP (talkcontribslogs) Good catches. Tourisme en Eure-et-Loir is solved by diff and Métropole de Lyon by diff, at least as far as the département problem is concerned. --Tagishsimon (talk) 10:25, 28 October 2020 (UTC)