google / badwolf

Temporal graph store abstraction layer.
Apache License 2.0
983 stars 66 forks source link

Support predicate binding equalities inside HAVING clauses #137

Closed rogerlucena closed 4 years ago

rogerlucena commented 4 years ago

We can now compare a predicate binding to a predicate literal inside the HAVING clause (only equalities allowed) to filter the results of our query.

To illustrate, the following query is now possible:

SELECT ?s, ?p, ?o
FROM ?test
WHERE {
    ?s ?p ?o
}
HAVING ?p = "height_cm"@[];

Note that predicate inequalities are not allowed because their behavior may become confusing for the user (especially when time anchors come on stage). In this case an error is prompted orienting to extract bindings with the ID/AT keywords and to use these bindings to proceed with the comparisons in a clearer way.