Skip to content

Commit

Permalink
added angle brackets check to query generators
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwestphal committed Feb 12, 2015
1 parent 8881a39 commit f217657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public static StringBuilder makeInFilter(String var, Set<String> uris) {
StringBuilder builder = new StringBuilder();
builder.append(" FILTER (" + var + " IN( ");
for (String uri : uris) {
builder.append("<");
if (!uri.startsWith("<")) builder.append("<");
builder.append(uri);
builder.append(">");
if (!uri.endsWith(">")) builder.append(">");
builder.append(", ");
}
builder.deleteCharAt(builder.length() - 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public String createQuery(Set<String> individuals, String filter) {
builder.append("{ ?example a ?class . ");
builder.append("Filter ( ?example IN(");
for (String individual : individuals) {
builder.append("<");
if (!individual.startsWith("<")) builder.append("<");
builder.append(individual);
builder.append(">");
if (!individual.endsWith(">")) builder.append(">");
builder.append(", ");
}
builder.deleteCharAt(builder.length() - 2);
Expand Down

0 comments on commit f217657

Please sign in to comment.