Release 1.22.0: Improved update support, extension functions, and improved CLI handling

Monday, August 30, 2021

On this page

    The 1.22.0 version features some major additions, and a bunch of smaller internal fixes and performance improvements 🚀! The primary changes that are discussed in this post are support for more SPARQL update destination types, SPARQL extension functions, and rewritten CLI handling.

    Updating Solid, Linked Data Platform, and SPARQL endpoints

    In the previous release of Comunica, basic support for updating documents in Solid/LDP data pods was already added by enabling PATCH requests. In this release, we improve this support by also adding an actor that can handle PUT requests, which will allow resources to be created that do not exist yet.

    For example, the following query will work whether or not the destination resource already exists, and Comunica will automatically determine if it should send a PUT or PATCH request:

    $ comunica-sparql \
      -q "INSERT DATA { <ex:s> <ex:p> <ex:o> }"

    In the future, it will also become possible to update private resources via Solid authentication.

    Furthermore, this release also makes it possible to forward update queries to SPARQL endpoints.

    Learn more about updating from the command line or from a JavaScript application in the documentation.

    SPARQL extension functions

    SPARQL allows non-standard, custom extension functions to be used within queries. Since this release, Comunica allows developers to plug in custom implementations for such functions.

    For example, this allows you to plug in an implementation for the custom func:reverse function in the following query:

    PREFIX func: <>
    SELECT ?caps WHERE {
      ?s ?p ?o.
      BIND (func:reverse(?o) AS ?caps)

    Learn more about configuring SPARQL extension functions here.

    Improved CLI arguments handling

    Up until this release, the internal mechanics of declaring and handling command-line arguments for comunica-sparql was hardcoded. This caused some problems for custom init actors such as comunica-sparql-hdt, where custom handling of these arguments was required.

    In order to meet these needs, the internals of CLI handling has been completely rewritten using the yargs library. Other init actors can now easily plug in custom argument handlers to modify how the CLI tool behaves. For the end-user, no significant changes are apparent, as the CLI tools remain fully backwards-compatible.

    You can learn more about this in the custom CLI arguments guide.

    Features, fixes and enhancements

    Next to the changes above, several minor features, fixes and enhancements were applied, such as migration to the more flexible Fetch-based HTTP actor, allowing custom Fetch functions to be provided via the context, logging filter errors as warnings in the logger, reducing memory usage during query execution, better error reporting for HTTP errors, and more. Check out the full changelog to read more about them.