Page MenuHomePhabricator

[BLZMI] Create a guide for Query Service users to help migrate their queries from Blazegraph to QLever
Closed, ResolvedPublic

Description

As part of the Blazegraph migration we need to create a guide for Query Service users to help them migrate their queries from Blazegraph to QLever.

This is an important part of the migration that will be linked in the banners:
T434917: [BLZMI] Update informational banner on query.wikidata.org
T432578: [BLZMI] Create informational banner for the qlever qs-gui

Acceptance Criteria

  • There is a guide for Query Service users to help them migrate their queries from Blazegraph to QLever

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Update informational banners for the QLever migrationrepos/wmde/wikidata-query-gui!105thiemowmdeT432578main
Customize query in GitLab

Event Timeline

I believe this is covered by T431053 and related tasks. See, especially https://www.wikidata.org/wiki/User:TBurmeister_(WMF)/Sandbox/Migrate. This content will be published on wikidata.org on October 1 (tomorrow); that set of Sandbox pages will replace the content currently at https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/WDQS_backend_update.

@TBurmeister While working on T432638 we found various Blazegraph-specific quirks we have not seen in any migration guide so far. For example:

  • Blazegraph allows to re-assign existing variable names, often used in something like SELECT ( SAMPLE( ?var ) AS ?var ). QLever doesn't allow this. The two variable names must be different.
  • Blazegraph's parser for dates like "2001-08-25"^^xsd:dateTime is much more relaxed. QLever sticks strictly to the standard and doesn't allow such shortcuts. Dates must be written as "2001-08-25T00:00:00"^^xsd:dateTime.
  • Blazegraph allows direct = comparisons with such dates and "magically" covers an entire day. QLever always compares down to the second. Date ranges must be manually constructed via something like ?x >= "2001-01-01T00:00:00"^^xsd:dateTime && ?x < "2001-01-02T00:00:00"^^xsd:dateTime.
  • Blazegraph returns the result of date calculations as numbers. This makes it possible to do comparisons like >= 30. QLever strictly requires both sides of the comparison to be the same type, e.g. "P1D"^^xsd:dayTimeDuration.
  • Generally, QLever appears to not support the same range of type conversations and comparisons that Blazegraph supported. They are just not implemented, as far as I understand the QLever documentation.
  • I currently don't see wikibase:geoLatitude, wikibase:geoLongitude, and wikibase:geoGlobe covered.

Are you aware of these?

The revised migration guide is now published at https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/WDQS_backend_update. It includes links to the query rewrite guides that @AWesterinen-WMF created, including:

I believe those should cover everything except the date issues you mentioned.

To keep conversations and questions about this centralized and more visible, I suggest moving follow-ups about this to https://www.wikidata.org/wiki/Wikidata_talk:SPARQL_query_service/WDQS_backend_update. Thanks!

I've added a section about date and time parsing and arithmetic here: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/WDQS_backend_update/Migrate#Date_and_time_parsing. Please feel free to add to or otherwise revise this information. Thanks for capturing the issues so it was easy to add the information to the docs!

Just an additional update, for transparency. I created two additional documentation pages today:

Change #1358692 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[operations/deployment-charts@master] wikidata-query-gui: bump to latest version

https://gerrit.wikimedia.org/r/1358692

Change #1358692 merged by jenkins-bot:

[operations/deployment-charts@master] wikidata-query-gui: bump to latest version

https://gerrit.wikimedia.org/r/1358692