Skip to content
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

GH-4923 Spaces inserted by PropertyPathBuilder cause problems with AllegroGraph #4928

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public InversePath(PropertyPath path) {
this.path = path;
}

@Override
public String getQueryString() {
return "^ " + path.getQueryString();
return "^" + path.getQueryString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public InversePredicatePath(IRI predicate) {

@Override
public String getQueryString() {
return "^ " + predicate.getQueryString();
return "^" + predicate.getQueryString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public NegatedPropertySet(PredicatePathOrInversePredicatePath... properties) {
@Override
public String getQueryString() {
if (properties.length == 1) {
return "! " + properties[0].getQueryString();
return "!" + properties[0].getQueryString();
} else {
return Arrays
.stream(properties)
.map(QueryElement::getQueryString)
.collect(Collectors.joining(" | ", "! ( ", " )"));
.collect(Collectors.joining(" | ", "!( ", " )"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public OneOrMorePath(PropertyPath path) {

@Override
public String getQueryString() {
return path.getQueryString() + " +";
return path.getQueryString() + "+";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public ZeroOrMorePath(PropertyPath path) {

@Override
public String getQueryString() {
return path.getQueryString() + " *";
return path.getQueryString() + "*";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public ZeroOrOnePath(PropertyPath path) {

@Override
public String getQueryString() {
return path.getQueryString() + " ?";
return path.getQueryString() + "?";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void testInversePath() {
.path(iri(RDFS.COMMENT))
.inv()
.build();
assertEquals("^ ( <" + RDFS.COMMENT + "> )", p.getQueryString());
assertEquals("^( <" + RDFS.COMMENT + "> )", p.getQueryString());
}

@Test
Expand All @@ -131,7 +131,7 @@ public void testOneOrMorePath() {
.path(iri(RDFS.COMMENT))
.oneOrMore()
.build();
assertEquals("<" + RDFS.COMMENT + "> +", p.getQueryString());
assertEquals("<" + RDFS.COMMENT + ">+", p.getQueryString());
}

@Test
Expand All @@ -140,7 +140,7 @@ public void testZeroOrMorePath() {
.path(iri(RDFS.COMMENT))
.zeroOrMore()
.build();
assertEquals("<" + RDFS.COMMENT + "> *", p.getQueryString());
assertEquals("<" + RDFS.COMMENT + ">*", p.getQueryString());
}

@Test
Expand All @@ -149,7 +149,7 @@ public void testZeroOrOnePath() {
.path(iri(RDFS.COMMENT))
.zeroOrOne()
.build();
assertEquals("<" + RDFS.COMMENT + "> ?", p.getQueryString());
assertEquals("<" + RDFS.COMMENT + ">?", p.getQueryString());
}

@Test
Expand All @@ -159,7 +159,7 @@ public void testNegatedPropertySetSingle() {
.negProp()
.pred(iri(RDFS.COMMENT))
.build();
assertEquals("! <" + RDFS.COMMENT + ">", p.getQueryString());
assertEquals("!<" + RDFS.COMMENT + ">", p.getQueryString());
}

@Test
Expand All @@ -169,7 +169,7 @@ public void testNegatedPropertySetSingleInverted() {
.negProp()
.invPred(iri(RDFS.COMMENT))
.build();
assertEquals("! ^ <" + RDFS.COMMENT + ">", p.getQueryString());
assertEquals("!^<" + RDFS.COMMENT + ">", p.getQueryString());
}

@Test
Expand All @@ -180,7 +180,7 @@ public void testNegatedPropertySetMultipleInverted() {
.invPred(iri(RDFS.COMMENT))
.invPred(iri(RDFS.LABEL))
.build();
assertEquals("! ( ^ <" + RDFS.COMMENT + "> | ^ <" + RDFS.LABEL + "> )", p.getQueryString());
assertEquals("!( ^<" + RDFS.COMMENT + "> | ^<" + RDFS.LABEL + "> )", p.getQueryString());
}

@Test
Expand All @@ -193,7 +193,7 @@ public void testNegatedPropertySetMultipleMixed() {
.invPred(iri(RDFS.SUBPROPERTYOF))
.pred(iri(RDFS.COMMENT))
.build();
assertEquals("! ( ^ <" + RDFS.SUBCLASSOF + "> | <" + RDFS.LABEL + "> | ^ <" + RDFS.SUBPROPERTYOF
assertEquals("!( ^<" + RDFS.SUBCLASSOF + "> | <" + RDFS.LABEL + "> | ^<" + RDFS.SUBPROPERTYOF
+ "> | <" + RDFS.COMMENT + "> )", p.getQueryString());
}

Expand Down
Loading