Skip to content

Commit

Permalink
[Bug #294] Fix invalid parameter parsing within IRIs
Browse files Browse the repository at this point in the history
  • Loading branch information
luxbe authored and ledsoft committed Dec 12, 2024
1 parent 71279ea commit ec7cc1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public SparqlQueryHolder parseQuery(String query) {
break;
case '>':
this.inUri = false;
if(inParam) {
parameterEnd(i);
}
wordEnd();
break;
case '\n':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,14 @@ void parseQueryHandlesMultilineProjection() {
assertNotNull(holder.getParameter("y"));
assertNotNull(holder.getParameter("z"));
}

@Test
void parseQueryHandlesAttributesWithinIris() {
final String query = "SELECT ?x WHERE { <http://example.com/?y> a ?z . }";
final QueryHolder holder = queryParser.parseQuery(query);
assertEquals(3, holder.getParameters().size());
assertNotNull(holder.getParameter("x"));
assertNotNull(holder.getParameter("y"));
assertNotNull(holder.getParameter("z"));
}
}

0 comments on commit ec7cc1a

Please sign in to comment.