Search in sources :

Example 16 with QueryEvaluationException

use of org.eclipse.rdf4j.query.QueryEvaluationException in project rdf4j by eclipse.

the class ServiceJoinConversionIteration method convert.

@Override
protected BindingSet convert(BindingSet bIn) throws QueryEvaluationException {
    // overestimate the capacity
    SPARQLQueryBindingSet res = new SPARQLQueryBindingSet(bIn.size() + bindings.size());
    int bIndex = -1;
    Iterator<Binding> bIter = bIn.iterator();
    while (bIter.hasNext()) {
        Binding b = bIter.next();
        String name = b.getName();
        if (name.equals("__rowIdx")) {
            bIndex = Integer.parseInt(b.getValue().stringValue());
            continue;
        }
        res.addBinding(b.getName(), b.getValue());
    }
    // is dealt with in another place)
    if (bIndex == -1)
        throw new QueryEvaluationException("Invalid join. Probably this is due to non-standard behavior of the SPARQL endpoint. " + "Please report to the developers.");
    res.addAll(bindings.get(bIndex));
    return res;
}
Also used : Binding(org.eclipse.rdf4j.query.Binding) QueryEvaluationException(org.eclipse.rdf4j.query.QueryEvaluationException) SPARQLQueryBindingSet(org.eclipse.rdf4j.repository.sparql.query.SPARQLQueryBindingSet)

Aggregations

QueryEvaluationException (org.eclipse.rdf4j.query.QueryEvaluationException)16 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)15 IOException (java.io.IOException)9 MalformedQueryException (org.eclipse.rdf4j.query.MalformedQueryException)9 TupleQueryResult (org.eclipse.rdf4j.query.TupleQueryResult)9 BindingSet (org.eclipse.rdf4j.query.BindingSet)6 TupleQuery (org.eclipse.rdf4j.query.TupleQuery)5 RDF4JProtocolSession (org.eclipse.rdf4j.http.client.RDF4JProtocolSession)4 Value (org.eclipse.rdf4j.model.Value)4 ArrayList (java.util.ArrayList)3 ExceptionConvertingIteration (org.eclipse.rdf4j.common.iteration.ExceptionConvertingIteration)3 UnauthorizedException (org.eclipse.rdf4j.http.protocol.UnauthorizedException)3 Resource (org.eclipse.rdf4j.model.Resource)3 Binding (org.eclipse.rdf4j.query.Binding)3 UnsupportedQueryLanguageException (org.eclipse.rdf4j.query.UnsupportedQueryLanguageException)3 UpdateExecutionException (org.eclipse.rdf4j.query.UpdateExecutionException)3 UnknownTransactionStateException (org.eclipse.rdf4j.repository.UnknownTransactionStateException)3 RDFHandlerException (org.eclipse.rdf4j.rio.RDFHandlerException)3 RDFParseException (org.eclipse.rdf4j.rio.RDFParseException)3 Model (org.eclipse.rdf4j.model.Model)2