-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some tests covering regex quantifiers and options
Based on XPath spec: https://www.w3.org/TR/xpath-functions/#regex-syntax Issue #46
- Loading branch information
Showing
36 changed files
with
1,011 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "abc", "i") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>abc</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>ABC</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a[b\\n]c") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>abc</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>a | ||
c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix ex: <http://example.com/#> . | ||
|
||
ex:foo rdf:value "ac" , "abc" , "abbc" , "abbbc" , "a\nc", "a\nb\nc" , "a.c" , "ABC" , "a?+*.{}()[]c" , "b" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a.c", "s") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>abc</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>a | ||
c</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>a.c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a.c") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>abc</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>a.c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
8 changes: 8 additions & 0 deletions
8
sparql/sparql10/regex/regex-ignore-whitespaces-class-expression.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, " a\n\r\t[\\n]c ", "x") | ||
} |
14 changes: 14 additions & 0 deletions
14
sparql/sparql10/regex/regex-ignore-whitespaces-class-expression.srx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>a | ||
c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, " a\n\tc ", "x") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>ac</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
8 changes: 8 additions & 0 deletions
8
sparql/sparql10/regex/regex-negative-char-class-expression.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a[^b]c") | ||
} |
19 changes: 19 additions & 0 deletions
19
sparql/sparql10/regex/regex-negative-char-class-expression.srx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>a | ||
c</literal> | ||
</binding> | ||
</result> | ||
<result> | ||
<binding name="val"> | ||
<literal>a.c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
8 changes: 8 additions & 0 deletions
8
sparql/sparql10/regex/regex-no-metacharacters-case-insensitive.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a?+*.{}()[]C", "iq") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "a?+*.{}()[]c", "q") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | ||
<head> | ||
<variable name="val"/> | ||
</head> | ||
<results> | ||
<result> | ||
<binding name="val"> | ||
<literal>a?+*.{}()[]c</literal> | ||
</binding> | ||
</result> | ||
</results> | ||
</sparql> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX ex: <http://example.com/#> | ||
|
||
SELECT ?val | ||
WHERE { | ||
ex:foo rdf:value ?val . | ||
FILTER regex(?val, "ab{2}c") | ||
} |
Oops, something went wrong.