
|
If you were logged in you would be able to see more operations.
|
|
Sesame
Created: 18/Nov/08 05:27 PM
Updated: 17/Dec/08 02:06 PM
|
|
| Component/s: |
SPARQL
|
| Affects Version/s: |
3.x
|
| Fix Version/s: |
None
|
|
The SPARQL Parser double-unescapes backslashes. Example:
public void testBackslashParsing() throws MalformedQueryException {
String query = "SELECT * WHERE {?s ?p \"\\\\\"}";
SPARQLParser parser = new SPARQLParser();
ParsedQuery pq = parser.parseQuery(query, null);
Projection proj = (Projection)pq.getTupleExpr();
StatementPattern sp = (StatementPattern)proj.getArg();
// succeeds:
assertEquals(sp.getObjectVar().getValue().stringValue(), "\\");
// fails:
assertEquals(sp.getObjectVar().getValue().stringValue(), "\\\\");
}
|
|
Unless I'm very much mistaken, \ is a SPARQL escape character as well as a Java escape character, so your query actually contains only a single backslash.
Right, it is.
Issue is invalid: the double un-escape is correct, since it's a combination of Java-escapes and SPARQL-escapes.
|
|