Release 5.5: 🪽Native-like in-memory performance, expression evaluators, and Graph Store Protocol
Tuesday, November 24, 2026
On this page
In this minor release, we introduce significant performance improvements, bug fixes, and several new useful features such as a dedicated expression evaluator engine, support for the Graph Store Protocol, and more.
🚀 Native-like in-memory performance
For Comunica, the ability to federate efficiently over multiple data sources of different types is of high importance, which includes querying over local or remote data dumps, such as Turtle, JSON-LD, and HTML+RDFa files. Thereby, the ability to fetch, parse, load, and query these files efficiently is crucial for performance.
As such, for this release, we developed a new in-memory triple store that focuses on low memory usage, fast ingestion, and fast querying. Specifically, this new store uses sorted indexes that are compactly represented in memory as typed JavaScript arrays, which modern JavaScript engines can optimize extremely well. Since the indexes are sorted, this allows for efficient merge joins (newly introduced in this release as well) to be executed, with seeking capabilities that allow for skipping over large parts of the data.
RdfStore.createOrdered().
Besides this, we also introduced several other smaller optimizations to better exploit the JIT optimizers within modern JavaScript engines, such as better use of small integers within hash joins, migrating to native Maps instead of immutable.js, and more.
Two years ago, we performed experiments to compare the performance of Comunica with other SPARQL engines, in a single centralized dataset scenario, where we observed that Comunica's performance back then was comparable to Java-based engines, and slower than native engines. With the new optimizations introduced in this release, we performed the same experiments again (and extended them), and observed that Comunica's performance is now on average comparable to native engines (and in many cases even faster), and significantly faster than Java-based engines on WatDiv and BSBM. However, a general finding that came out of these experiments, is that there's no single engine that is the fastest in all scenarios, and that the performance of engines can vary significantly depending on the query and dataset.
Below, we summarize some general conclusions:
- Across all datasets, Comunica achieves by far the lowest storage size among all in-memory engines (2-4x smaller).
- Overall, Comunica achieves the fastest total query execution time on the WatDiv benchmark, especially due to our new merge join significantly improving performance for complex queries that would otherwise produce many intermediary results.
- Oxigraph achieves the fastest mean query execution time on the BSBM benchmark (mostly small and selective queries), with Comunica coming in second place.
- On LDBC, conclusions are less clear, with not all engines producing correct results, or timing out.
- Loading time in Comunica is slightly slower than Oxigraph (in-memory), but significantly faster than all other engines.
- Comunica-HDT is quite a bit slower compared to Comunica-Memory, due to the overhead of C++-to-JavaScript calls. (we are working on improving this in future releases)
Below, you can find the results of our performance comparison.
Loading the results…
🏯 Graph Store Protocol support
In SPARQL, the Graph Store Protocol (GSP) is a standard for managing RDF graphs over HTTP.
As of this release, Comunica now supports the Graph Store Protocol, allowing users to perform operations such as retrieving, adding, and deleting RDF graphs over HTTP.
To do this, you can pass the new flag --graphStore when starting the Comunica SPARQL endpoint (passing the -u flag enables updates):
$ comunica-sparql-http https://example.org/sparql --graphStore -u
More information on how to use the Graph Store Protocol with Comunica can be found in our documentation.
⚙️ Standalone SPARQL expression evaluation engine
While Comunica is a framework using which you can build (SPARQL) engines, we provide several pre-built engines, such as Comunica SPARQL, Comunica SPARQL File, Comunica SPARQL HDT, and so on. Since we received requests to use the expression evaluation engine of Comunica in other contexts, we decided to make it available as a standalone engine.
This new engine is available as the @comunica/expressions-sparql package, and can be used to evaluate SPARQL expressions in a flexible way.
For example, to evaluate the expression xsd:integer(?age) >= 18, you can do the following:
import { toAlgebra12Builder } from '@traqula/algebra-sparql-1-2'; import { createAlgebraContext } from '@traqula/algebra-transformations-1-2'; import { sparql12ParserBuilder } from '@traqula/parser-sparql-1-2'; import { completeParseContext, lex } from '@traqula/rules-sparql-1-2'; // Build the parser once and reuse it, as building it is expensive const parser = sparql12ParserBuilder.build({ tokenVocabulary: lex.sparql12LexerBuilder.tokenVocabulary }); const translator = toAlgebra12Builder.build(); // Parse from the Expression grammar rule, and translate the result const prefixes = { xsd: 'http://www.w3.org/2001/XMLSchema#' }; const ast = parser.expression('xsd:integer(?age) >= 18', completeParseContext({ prefixes })); const expression = translator.translateExpression(createAlgebraContext({ prefixes }), ast); const isAdult = await engine.createEvaluator(expression); await isAdult.evaluateAsEBV(BF.fromRecord({ age: DF.literal('21') })); // true
You can learn more about this new engine in our documentation.
🧩 Extension aggregators
So far, Comunica already supported the use of custom SPARQL extension functions.
Since this release, we also support the use of custom SPARQL extension aggregators.
For example, this allows you to define a custom aggregator such as func:longest(),
which could then be used in a query like:
const longest = () => { let longestTerm: RDF.Term | undefined; return { put([ arg ]: RDF.Term[]) { if (!longestTerm || arg.value.length > longestTerm.value.length) { longestTerm = arg; } }, result() { return longestTerm; }, }; }; const bindingsStream = await myEngine.queryBindings(` PREFIX func: <http://example.org/functions#> SELECT ?s (func:longest(?o) AS ?longest) WHERE { ?s ?p ?o. } GROUP BY ?s `, { sources: ['https://www.rubensworks.net/'], extensionAggregators: { 'http://example.org/functions#longest': longest, }, });
👨💼 SERVICE executors
In SPARQL, the SERVICE keyword allows you to delegate parts of a query to a remote SPARQL endpoint.
This SERVICE keyword is often used as a non-standard extension point to inject custom behavior into the query execution.
As of this release, we now support the use of custom SERVICE executors.
For example, this allows you to define a custom executor as follows:
import { KeysInitQuery } from '@comunica/context-entries'; import type { IServiceExecutor } from '@comunica/types'; import { BindingsFactory } from '@comunica/utils-bindings-factory'; const greetExecutor: IServiceExecutor = { async execute(serviceOperation, bindings, context) { const dataFactory = context.getSafe(KeysInitQuery.dataFactory); const bindingsFactory = new BindingsFactory(dataFactory); return [ bindingsFactory.bindings([ [ dataFactory.variable('greeting'), dataFactory.literal('Hello world!') ], ]), ]; }, }; const bindingsStream = await myEngine.queryBindings(` SELECT ?greeting WHERE { SERVICE <urn:my-app:greet> { <urn:my-app:me> <urn:my-app:greeting> ?greeting. } } `, { sources: [], serviceExecutors: { 'urn:my-app:greet': greetExecutor, }, });
You can learn more about these service executors in our documentation.
🤝 Contributors
This release has been made possible thanks to the help of the following contributors (in no particular order):
If you would like to contribute yourself, be sure to have a look at our contribution guide.
Full changelog
Besides the new features and changes mentioned above, this release contains several more new features and changes. If you want to learn more about the other changes in Comunica 5.5, check out the full changelog.