DEPRECATED in favor of https://github.com/comunica/comunica-feature-versioning
A Query Operation actor that detects graph-based version operations and rewrites them to operations with a version context.
This module is part of the Comunica framework, and should only be used by developers that want to build their own query engine.
Click here if you just want to query with Comunica.
$ yarn add @comunica/actor-query-operation-contextify-version
After installing, this package can be added to your engine's configuration as follows:
{
"@context": [
...
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-contextify-version/^1.0.0/components/context.jsonld"
],
"actors": [
...
{
"@id": "config-sets:contextify-version.json#myContextifyVersionQueryOperator",
"@type": "ActorQueryOperationContextifyVersion",
"cbqo:mediatorQueryOperation": { "@id": "config-sets:sparql-queryoperators.json#mediatorQueryOperation" },
"caqocv:Actor/QueryOperation/ContextifyVersion/baseGraphUri": "http://graph.version.",
"caqocv:Actor/QueryOperation/ContextifyVersion/numericalVersions": true
}
]
}
caqocv:Actor/QueryOperation/ContextifyVersion/baseGraphUri
: The base URI of the graph to contextify. If this is not provided, then graphs will be converted to version identifiers as-is.caqocv:Actor/QueryOperation/ContextifyVersion/numericalVersions
: If versions should be parsed as integers.
Assuming a base graph URI http://ex/g/
.
Input query:
SELECT * WHERE {
GRAPH <http://ex/g/1> {
?s ?p ?o
}
}
Output context:
{
"version": {
"type": "version-materialization",
"version": 1
}
}
Output query:
SELECT * WHERE {
?s ?p ?o
}
Input query:
SELECT * WHERE {
GRAPH <http://ex/g/4> {
?s ?p ?o
} .
FILTER (NOT EXISTS {
GRAPH <http://ex/g/2> {
?s ?p ?o
}
})
}
Output context:
{
"version": {
"queryAdditions": true,
"type": "delta-materialization",
"versionEnd": 4,
"versionStart": 2
}
}
Output query:
SELECT * WHERE {
?s ?p ?o
}
Note: Flipping the versions would make this a deletions query instead of an additions query,
i.e., queryAdditions
would be set to false
.