GitHub user cygri opened a pull request:
https://github.com/apache/jena/pull/266
JENA-1367: Improve apf:strSplit corner cases
This is a patch to improve the behaviour of `apf:strSplit` in cases where
it is invoked with inputs other than the obvious node types.
The general syntax of the property function is:
?parts apf:strSplit (?input ?regex)
The patch changes various cases that previously would have thrown
`ExprEvalException` or `NotLiteralException`:
- If `?input` is an unbound variable, return no match
- If `?input` is an IRI or blank node, return no match
- If `?regex` is not a literal, return no match
- If `?parts` is a plain literal that equals one of the tokens of the parts
of `?input`, return true (one match, no new variable bindings)
- If `?parts` is anything else but not a variable, return no match
- If the object is a list but does not have two elements, throw
`QueryBuildException`
The patch also adds fairly exhaustive tests for the function. The test
class may still need to be hooked into the test suite in some way.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cygri/jena JENA-1367
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/266.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #266
----
commit 305a5b1846d0fbaf165f2a8c4423b3e2645222c1
Author: Richard Cyganiak <[email protected]>
Date: 2017-06-23T10:44:51Z
JENA-1367: Improve apf:strSplit corner cases
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---