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()) { |
.