otherVars.remove(FederatedQueryFetchAsNeededWithCache.this.endpoint);
for(final Variable var: otherVars){
bindingsKey.add(var, null);
}
final QueryResult cached = FederatedQueryFetchAsNeededWithCache.this.cache.get(bindingsKey);
if(cached!=null){
return cached.iterator();
}
final String fQuery = FederatedQueryFetchAsNeededWithCache.this.toStringQuery(bindingsTemp);
if (!FederatedQueryFetchAsNeededWithCache.this.endpoint.isVariable()) {
final QueryResult queryResult = QueryResult.createInstance(new IteratorQueryResultAndOneBindings(Client.submitQuery(((URILiteral)FederatedQueryFetchAsNeededWithCache.this.endpoint).getString(), fQuery, FederatedQueryFetchAsNeededWithCache.this.bindingsFactory), bindingsTemp));
queryResult.materialize();
FederatedQueryFetchAsNeededWithCache.this.cache.put(bindingsKey, queryResult);
return queryResult.iterator();
} else {
Literal endpointURI = bindingsTemp.get((Variable) FederatedQueryFetchAsNeededWithCache.this.endpoint);
if (endpointURI instanceof LazyLiteral) {
endpointURI = ((LazyLiteral) endpointURI).getLiteral();
}
if (endpointURI instanceof URILiteral) {
final QueryResult queryResult = QueryResult.createInstance(new IteratorQueryResultAndOneBindings(Client.submitQuery(((URILiteral) endpointURI).getString(), fQuery, FederatedQueryFetchAsNeededWithCache.this.bindingsFactory), bindingsTemp));
queryResult.materialize();
FederatedQueryFetchAsNeededWithCache.this.cache.put(bindingsKey, queryResult);
return queryResult.iterator();
} else {
// ignore or error message?
}
}
} catch(final IOException e){