You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2018/11/13 12:34:00 UTC
[jira] [Commented] (JENA-1628) apf:strSplit should take several
possible separators
[ https://issues.apache.org/jira/browse/JENA-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685133#comment-16685133 ]
Andy Seaborne commented on JENA-1628:
-------------------------------------
It already does.
{noformat}
PREFIX apf: <http://jena.apache.org/ARQ/property#>
SELECT * {
?x apf:strSplit ("123,456;890" "(,|;)") .
}
{noformat}
{noformat}
---------
| x |
=========
| "123" |
| "456" |
| "890" |
---------
{noformat}
> apf:strSplit should take several possible separators
> ----------------------------------------------------
>
> Key: JENA-1628
> URL: https://issues.apache.org/jira/browse/JENA-1628
> Project: Apache Jena
> Issue Type: Improvement
> Reporter: Vladimir Alexiev
> Priority: Major
>
> We're working with some FP7 project data using tarql, and the column "Participant Internet Homepage" sometimes has multiple values, separated by
> - comma, semicolon, " / ", " or "
> It would be nice if apf:strSplit took a regex separator (like perl's split), then I could use it like this:
> {noformat}
> ?websites apf:strSplit (?Participant_Internet_Homepage, "(,|;| / | or )")
> {noformat}
> If the change is considered breaking, a new function apf:strSplitByRegex can be introduced.
> For the time being, I'll try with this ugliness (should work, right?):
> {noformat}
> {?websites apf:strSplit (?Participant_Internet_Homepage, ",")} union
> {?websites apf:strSplit (?Participant_Internet_Homepage, ";")} union
> {?websites apf:strSplit (?Participant_Internet_Homepage, " / ")} union
> {?websites apf:strSplit (?Participant_Internet_Homepage, " or ")}
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)