Page MenuHomePhabricator

Parsing example queries partially produce errors
Open, Needs TriagePublic

Description

Main Components:

  • Wikibase Release Pipeline
  • Query Service GUI

Problem:
The parser of SPARQL examples for the Query Service GUI does not work in the context of the Wikibase Release Pipeline (at least when using syntax highlighting at the SPARQL-example-page). This used to be a problem in the context of Wikidata as well (see "original") but was apparently solved.

Original:
It seems that some queries parsed from https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples are not displayed correctly on the example pop-up on https://query.wikidata.org/ : when opening an example query, the # of the code lines are displayed inside the query code, which makes it fail.

Steps to reproduce:

  • Go to https://query.wikidata.org/
  • Click on the "Examples" button
  • type "lexeme" in the filter box and pick any of the suggested queries
  • look at the query code: numbers appear at the beginning of each line

Screenshot from 2020-12-16 15-50-52.png (243×726 px, 45 KB)

I noticed this for the first time on December 16th, but I'm not sure since when it's broken.
Not all examples are affected, the ones at the beginning of the list (eg cats) work correctly.

Questions:

  • Where does it come from? Is it an issue in the WDQS UI or with the templated used on the wikipage?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_Lacroix_WMDE added a subscriber: Tagishsimon.

Pinging @Tagishsimon since it seems that you discovered this issue a few days ago. Is it already reported somewhere else?

The template itself hasn't changed recently so a template enclosed in this template is probably at issue here.

According to https://web.archive.org/web/20190205051545/https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
previously, syntaxhighlight markup looked like:

<span class="lineno"> 1 </span><span class="c">#defaultView:BarChart</span>

Line numbers were not selectable.

Now generated html looks like:

<span class="linenos"> 1</span><span class="c"># See also the SPARQL manual</span>

The worst part (despite that some external tools were broken) that now when you select code block, line numbers are selected and copied too.

Lineno were renamed to linenos in https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/commit/d2e9809554b6bc239f5964c881c29d7548e6018c
@ori

I am testing the yesterday's release of the Wikibase Release Pipeline. The parser of SPARQL examples leads to the same problem with numbers in the Query Service GUI. I am using syntaxhighlight at the SPARQL-example-page as well. Sooo... I am adding the tag "Wikibase Release Pipeline". Any workarounds for the problem? Downgrading syntaxhighlight?

Hi @RShigapov, could you please confirm that this is still an issue. I have tested it on WDQS and could no find any problems there.

Hi @Manuel, have you tested it on Wikidata-WDQS? There is no problem at Wikidata SPARQL frontend (may be because it uses the template SPARQL2 whereas I use just SPARQL template?), I meant the Wikibase-Release-Pipeline.

Manuel updated the task description. (Show Details)

Thank you for the clarification @RShigapov! I now updated the description and informed the team that is working on the Wikibase Release Pipeline.

CC: @Addshore

Thank you @Manuel! By the way, for testing this issue T192907 would be very useful.