Skip to content

Allow more elaborate patterns (like specifying suffix/prefix) for bindings inside HAVING clauses #122

@rogerlucena

Description

@rogerlucena

It would be useful to be able to apply more ellaborate patterns for bindings inside the HAVING clauses, like being able to specify the suffix/prefix of a TYPE binding for example:

SELECT ?o, ?o_type
FROM ?test
WHERE {
  ?s ?p ?o TYPE ?o_type
}
HAVING ?o_type LIKE "/country/corp%"^^type:text;

With something like a LIKE keyword and a protected symbol such as % to represent that anything can appear at that position, as in the example above on which we specify a prefix for ?o_type.

Given a graph containing hierarchical node TYPEs, such as /country/corp and /country/corp/employee for example, this feature would be especially handy.

To achieve that, it may be helpful to have a look at functions such as strings.HasPrefix as used for covariants in BadWolf here:

if !strings.HasPrefix(t.String(), ot.String()) {
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions