HomePhabricator

Update sparqljs to newest version
cb87caa66e77Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Update sparqljs to newest version

Our copy of the SPARQL.js library is severely outdated, not having been
updated since it was first introduced back in 2016 (change Ia43bcd463b,
commit e4475df7df). We can’t use the npmjs package directly (it’s only
suitable for Node.js), but let’s at least update to a new version: from
(presumably) 1.1.4 to 2.2.1.

Generated with the following commands:

npm install -g browserify terser
npm install sparqljs
browserify --standalone sparqljs node_modules/sparqljs/sparql.js | \
    terser >| \

vendor/sparqljs/dist/sparqljs-browser-min.js

A few minor adjustments are necessary to support the new version:

  • SPARQL.js now parses

    SELECT * WHERE { SELECT * WHERE { … } }

    as

    SELECT * WHERE { { SELECT * WHERE { … } } }

    i.e., the subquery is wrapped in a group. This requires an extension of SparqlQuery.getSubQueries() to find this subquery.
  • SPARQL.js now formats queries slightly differently; in particular, it uses the ; syntax to continue triples with repeated subjects [1].
  • SPARQL.js no longer accepts relative IRIs like <S> when no base URI has been defined, so some tests are changed to use an empty prefix instead (<S> → :S).

[1]: https://github.com/RubenVerborgh/SPARQL.js/issues/44

Bug: T206910
Change-Id: I7d002c7b1feffef1162e648750c58e88d5605b89

Details

Provenance
Lucas_Werkmeister_WMDEAuthored on Jan 14 2019, 6:34 PM
MR70Committed on Mar 18 2019, 4:21 PM
Parents
rWDQG2bcf552b6d11: Localisation updates from https://translatewiki.net.
Branches
Unknown
Tags
Unknown
ChangeId
I7d002c7b1feffef1162e648750c58e88d5605b89