Daniel_Mietchen created this task. Daniel_Mietchen added a project: Wikidata-Query-Service. Restricted Application added a subscriber: Aklapper. Restricted Application added a project: Wikidata. |
Somewhen around the holiday period, a change to the WDQS seems to have altered the behaviour of some key elements of queries, notably curly brackets and comments. Since this affects loads of example and maintenance queries, I suppose a bug for that has been filed already but I could not find any, so here is a brief description of the problem:
One of my maintenance queries checks for publications that have the word "Zika" in the title but have not been tagged with P921 (main subject) Q202864 (Zika virus). Here it is:
SELECT DISTINCT ?item ?title WHERE { hint:Query hint:optimizer "None". SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Search"; wikibase:endpoint "www.wikidata.org"; mwapi:srsearch "zika haswbstatement:P31=Q13442814". ?page_title wikibase:apiOutput mwapi:title. } BIND(IRI(CONCAT(STR(wd:), ?page_title)) AS ?item) FILTER NOT EXISTS { ?item wdt:P921 wd:Q202864. } FILTER ( ?item != wd:Q22330904 ) # actually about Spondweni virus, as per Q28733424 FILTER ( ?item != wd:Q22330879 ) # Zika b. Marković, M.D. (19 September 1889--3 September 1970) # Also check for items falsely tagged with the family name Zika (Q56245778) ?item wdt:P31 wd:Q13442814; wdt:P1476 ?title. FILTER CONTAINS(LCASE(?title), "zika").
} # LIMIT 10000
It is expected to return 0 results when things are up to date, but when I am commenting out the FILTER NOT EXISTS line, I am now still getting 0 results, so I played around a bit more and noticed that things go back to normal (i.e. currently 4237 results) when I encapsulate the SERVICE block in curly brackets. However, this breaks (i.e. returns 0 results again) when I am then commenting out the ?title variable. Here, things can be brought back to normal by adding an empty line before the curly brackets around the SERVICE block.
Of note, I had to add the ?title part to the query in response to a similar change in the WDQS some months back which resulted in the mwapi:srsearch command not just returning pages where the string "zika" was in the title but also pages where it occurred anywhere on the page, e.g. in the name of an author or in the title of a cited publication.
I would welcome some feature in the WDQS that would announce, highlight and explain such changes from somewhere near the UI.
Cc: Smalyshev, Daniel_Mietchen, Aklapper, Nandana, Lahi, Gq86, Lucas_Werkmeister_WMDE, GoranSMilovanovic, QZanden, EBjune, merbst, LawExplorer, _jensen, D3r1ck01, Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, Manybubbles, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs