Skip to content

Commit 2bdf28c

Browse files
authored
Update algebra docs to reflect migration to Traqula (#66)
1 parent df5248f commit 2bdf28c

1 file changed

Lines changed: 6 additions & 57 deletions

File tree

pages/docs/2_modify/advanced/algebra.md

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ correspond to exactly one SPARQL algebra operator type.
1717
For example, [`@comunica/actor-query-operation-construct`](https://github.com/comunica/comunica/tree/master/packages/actor-query-operation-construct)
1818
handles algebra operations with type `'construct'`.
1919

20-
## SPARQLAlgebra.js
20+
## Traqula
2121

2222
Converting a query string to SPARQL algebra
2323
happens in the [SPARQL Parse bus](/docs/modify/advanced/buses/#query-parse).
2424
The [`@comunica/actor-query-parse-sparql`](https://github.com/comunica/comunica/tree/master/packages/actor-query-parse-sparql) actor
25-
on this bus makes use of the [SPARQLAlgebra.js](https://github.com/joachimvh/SPARQLAlgebra.js) package.
25+
on this bus makes use of the [Traqula framework](https://github.com/comunica/traqula).
2626

27-
Examples on how the conversion between SPARQL query string and SPARQL algebra happens can be found in the tests: https://github.com/joachimvh/SPARQLAlgebra.js/tree/master/test
27+
Examples on how the conversion between SPARQL query string and SPARQL algebra happens can be found in [the specific SPARQL algebra 1.2 package](https://www.npmjs.com/package/@traqula/algebra-sparql-1-2).
28+
Example transformations can be found as part of [Traqula's test suite](https://github.com/comunica/traqula/tree/main/packages/test-utils/statics/algebra).
2829

2930
## Converting a SPARQL query into algebra
3031

@@ -81,57 +82,5 @@ $ comunica-sparql https://fragments.dbpedia.org/2016-04/en -q 'SELECT * { ?s ?p
8182
This tool is therefore useful if you want to implement support for a SPARQL operator,
8283
but you need to find out to what algebra operation this corresponds.
8384

84-
## Converting algebra into a SPARQL query
85-
86-
You can also apply the reverse transformation from algebra to SPARQL query string,
87-
for which you will need to globally install [SPARQLAlgebra.js](https://github.com/joachimvh/SPARQLAlgebra.js):
88-
```bash
89-
$ npm install -g sparqlalgebrajs
90-
$ sparqlalgebrajs -q -r '
91-
{
92-
"type": "project",
93-
"input": {
94-
"type": "bgp",
95-
"patterns": [
96-
{
97-
"type": "pattern",
98-
"termType": "Quad",
99-
"value": "",
100-
"subject": {
101-
"termType": "Variable",
102-
"value": "x"
103-
},
104-
"predicate": {
105-
"termType": "Variable",
106-
"value": "y"
107-
},
108-
"object": {
109-
"termType": "Variable",
110-
"value": "z"
111-
},
112-
"graph": {
113-
"termType": "DefaultGraph",
114-
"value": ""
115-
}
116-
}
117-
]
118-
},
119-
"variables": [
120-
{
121-
"termType": "Variable",
122-
"value": "x"
123-
},
124-
{
125-
"termType": "Variable",
126-
"value": "y"
127-
},
128-
{
129-
"termType": "Variable",
130-
"value": "z"
131-
}
132-
]
133-
}
134-
'
135-
136-
SELECT ?x ?y ?z WHERE { ?x ?y ?z }
137-
```
85+
> [!note]
86+
> Before implementing support for a SPARQL operator, read our tutorial on [contributing an actor](../1_getting_started/5_contribute_actor.md) and [contributing a new operator](../1_getting_started/7_contribute_new_operation.md).

0 commit comments

Comments
 (0)