google / google/badwolf

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

Open
#122 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
984
Forks
65
PR merge metrics
No merged PRs in 30d

Description

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: https://github.com/google/badwolf/blob/dd89f9bf4852586b23d693d4313d8dad9d23f6f3/triple/node/node.go#L46 .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.