Add built-in for string splitting
- Dominant language
- Rust
- Stars
- 289
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
It would be good if Nemo could feature a built-in for splitting strings along delimiters, similar to `split()` in common programming languages (e.g., Python). Since we do not have lists so far, there are two modes:
1. `SPLIT(?string,?delimiter,?part)` as a bool function that can be used to produce all parts for the given input (requires support for specific unsafe uses of type bool function to generate bindings)
2. `?part = SPLITPIECE(?string,?delimiter,?index)` as a string function that returns exactly the given piece, if there are enough many split pieces to get to this index.
The first would be much more useful in practice. There does not seem to be any SPARQL precedence on this.
Contributor guide
Research direction
Start by locating Nemo's existing built-in function definitions and string-function tests; the issue names SPLIT and SPLITPIECE as the entry points. Review how boolean functions generate bindings, then define the supported behavior for delimiters, parts, and indexes. Done means the chosen splitting modes are implemented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100