@Override public boolean hasNext() throws OntopConnectionException, OntopResultConversionException { if (results.size() > 0) return true; //in case of describe, we return the collected results list information if (storeResults) return false; // construct while(tupleResultSet.hasNext()) { List<Assertion> newTriples = processResults(tupleResultSet.next()); if (!newTriples.isEmpty()) { results.addAll(newTriples); return true; } } return false; }
@Override public OWLBindingSet next() throws OWLException { try { return new OntopOWLBindingSet(res.next()); } catch (OntopConnectionException | OntopResultConversionException | NoSuchElementException e) { throw new OntopOWLException(e); } } }
@Override public BindingSet next() throws QueryEvaluationException { try { return new OntopRDF4JBindingSet(res.next()); } catch (OntopConnectionException | OntopResultConversionException e) { throw new QueryEvaluationException(e); } // // MapBindingSet set = new MapBindingSet(this.signature.size() * 2); // for (String name : this.signature) { // Binding binding = createBinding(name, ontopBindingSet, this.bindingNames); // if (binding != null) { // set.addBinding(binding); // } // } }
@Override public BindingSet next() throws QueryEvaluationException { try { return new OntopRDF4JBindingSet(res.next()); } catch (OntopConnectionException | OntopResultConversionException e) { throw new QueryEvaluationException(e); } // // MapBindingSet set = new MapBindingSet(this.signature.size() * 2); // for (String name : this.signature) { // Binding binding = createBinding(name, ontopBindingSet, this.bindingNames); // if (binding != null) { // set.addBinding(binding); // } // } }
public DefaultSimpleGraphResultSet(TupleResultSet tupleResultSet, ConstructTemplate constructTemplate, boolean storeResults, TermFactory termFactory, org.apache.commons.rdf.api.RDF rdfFactory) throws OntopResultConversionException, OntopConnectionException { this.tupleResultSet = tupleResultSet; this.constructTemplate = constructTemplate; this.termFactory = termFactory; this.rdfFactory = rdfFactory; Extension ex = constructTemplate.getExtension(); if (ex != null) { extMap = ex.getElements().stream() .collect(ImmutableCollectors.toMap(e -> e.getName(), e -> e.getExpr())); } else extMap = null; this.storeResults = storeResults; if (storeResults) { //process current result set into local buffer, //since additional results will be collected while (tupleResultSet.hasNext()) { results.addAll(processResults(tupleResultSet.next())); } } }
final OntopBindingSet bindingSet = resultSet.next(); Constant constant = bindingSet.getConstant(1); if (constant instanceof IRIConstant) {