-
Notifications
You must be signed in to change notification settings - Fork 23
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
SPARQL Tests for REGEX function #46
Comments
if you would like to see them included, the best way is to implement them. |
I know. Unfortunately I do not have the time at the moment, I just wanted to document it here, so that I can come to that back later and have something to start with. Or that someone else can have a crack at them. Furthermore I have these issues (no critique, just mentioning) that prevent me from starting right away:
I could have written more than 5 tests by know instead of writing this. Please take it with a grain of salt and maybe I will have time in the future and
PS: I definitely do not want to insult the maintainers of tools related to RDF or thinkers of the specs. I have the utmost respect for them. |
ARQ passes both those tests when run in strict mode. Strict mode switches the regex engine to Apache Xerces. |
Thanks for the info :)
Regarding the last query. I even suspect that the escaping of the backslash is "wrong", so that it should be |
It is |
|
|
ARQ does not support flag "q". |
|
FWIW: I hope you agree, that a more granular regex test suite for SPARQL is needed. The discussion already slips away and turns into an implementation specific one. Instead of arguing about the details of arqs implementation we should argue about test cases. I am happy to start implementing test cases after July 18th, if someone could provide me guidance on how to run the suite (#47) |
Recently I had a look into the pattern definition of
REGEX
(and alsoREPLACE
) to find out what "regex flavor" SPARQL is using. The regex definition of XQuery 1.0 and XPath 2.0 Functions and its base XML Schema Part 2 are quite interesting reads (and the latter is actually fun to read).Unfortunately it seems like none of the SPARQL 1.1 libraries I tested (ARQ and RDFLib) use those definitions. They use the regex implementations of the underlying programming languages Java.util.regex and python's re. Who would blame the developers? This leads to a mismatch between the SPARQL 1.1 specification and the implementation.
Apache Jena ARQ has 100% in the latest implementation report, while not supporting the
REGEX
function correctly. In my opinion tests for this function should be added in the next iteration of the test suite.A few of the queries I tested (all taken from XQuery/XPath regex description):
Regex Flag
x
(result should be yes, but errors):Lowercase
\u212A
should match case insensitive[A-Z]
(result should be yes, but is no):If I were to implement the tests, I would test, that...
s
,m
,i
,x
) work correctly.The text was updated successfully, but these errors were encountered: