use of com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser in project wikidata-query-rdf by wikimedia.
the class LabelServiceUnitTest method assertLabelQueryResult.
// Blazegraph throws RuntimeException wrapping various checked exceptions and it make it very useful
// to print the query plan for debugging if any test fails
@SuppressWarnings({ "checkstyle:illegalcatch" })
@SafeVarargs
private final void assertLabelQueryResult(String query, final Matcher<BindingSet>... bindingMatchers) {
ASTContainer astContainer = null;
try {
TupleQueryResult q;
try {
astContainer = new Bigdata2ASTSPARQLParser().parseQuery2(query, null);
q = ASTEvalHelper.evaluateTupleQuery(store(), astContainer, new QueryBindingSet(), null);
} catch (MalformedQueryException | QueryEvaluationException e) {
throw new RuntimeException(e);
}
assertResult(q, bindingMatchers);
} catch (AssertionError | RuntimeException e) {
log.error("Error while checking results for {}", astContainer);
throw e;
}
}
use of com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser in project wikidata-query-rdf by wikimedia.
the class MWApiServiceQueryUnitTest method assertQueryResult.
// Blazegraph throws RuntimeException wrapping various checked exceptions and it make it very useful
// to print the query plan for debugging if any test fails
@SuppressWarnings({ "checkstyle:illegalcatch" })
@SafeVarargs
private final void assertQueryResult(String query, final Matcher<BindingSet>... bindingMatchers) {
ASTContainer astContainer = null;
try {
TupleQueryResult q;
try {
astContainer = new Bigdata2ASTSPARQLParser().parseQuery2(query, null);
q = ASTEvalHelper.evaluateTupleQuery(store(), astContainer, new QueryBindingSet(), null);
} catch (MalformedQueryException | QueryEvaluationException e) {
throw new RuntimeException(e);
}
assertResult(q, bindingMatchers);
} catch (AssertionError | RuntimeException e) {
log.error("Error while checking results for {} ", astContainer);
throw e;
}
}
Aggregations