New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String matching using wildcards #85
Comments
why? |
@lisp that is a very common scenario in the real world and right now I have to look up every time how I can do it with regex. I teach SPARQL on a regular base as well, that would definitely facilitate simple string-matches for users. |
If this were added, it should be a different name. When explaining SPARQL, one constantly has to talk about matching—and it usually means matching graph patterns against triples. Having a function called “match” that uses the word in a different sense does not help. Some possible other names: FILTER wildcard(?title, "*sparql*", "i")
FILTER like(?title, "*sparql*", "i") This could also be combined with #34: ?doc :title ~"*sparql*"i. |
It is called |
if the goal is succinctness, it makes sense to go all the way to something like
but
|
Shex has a similar construct called Stem. |
Shex Stem is fn:starts-with / |
I agree "match" is already used for graph patterns,. It is also valuable a as a keyword.
Filename matching with glob matching, where Possibilities:
The other choice s what matching language. SQL LIKE can be rewritten to a regex expression and there are code examples for that online. In Java, there a few open source direct implementations with |
I think being close to SQL is not a bad idea so I like the And while I like the |
Regular expressions can be complex. Strings with wildcards are simpler.
Proposed solution
Provide string matching using wildcards as an additional, alternative to regular
expressions by adding a new function. The string is anchored.
Examples:
Previous work
Glob patterns
SQL LIKE
Lucene wildcard searches
Considerations for backward compatibility
None.
The text was updated successfully, but these errors were encountered: