@Override public List<String> getBindingNames() throws OWLException { return ontopBindingSet.getBindingNames(); }
@Override @Nonnull public Iterator<Binding> iterator() { return ontopBindingSet.getBindings() .map(this::convertBinding) .iterator(); }
@Override @Nonnull public Iterator<Binding> iterator() { List<Binding> allBindings = new LinkedList<>(); List<String> names = ontopBindingSet.getBindingNames(); for (String s : names) { if (ontopBindingSet.hasBinding(s)) { allBindings.add(getBinding(s)); } } return allBindings.iterator(); }
@Override @Nullable public Value getValue(String variableName) { try { final Constant constant = ontopBindingSet.getConstant(variableName); return constant == null? null: RDF4JHelper.getValue(constant); } catch (OntopResultConversionException e) { throw new RuntimeException(e); } }
@Override @Nullable public Binding getBinding(String bindingName) { OntopBinding ontopBinding = ontopBindingSet.getBinding(bindingName); return ontopBinding == null? null: convertBinding(ontopBinding); }
/** Inefficient */ @Override public boolean hasBinding(String bindingName) { return ontopBindingSet.hasBinding(bindingName); }
@Override @Nonnull public Iterator<OWLBinding> iterator() { return Iterators.transform(ontopBindingSet.iterator(), OntopOWLBinding::new); }
@Override @Nullable public Value getValue(String bindingName) { if (!hasBinding(bindingName)) { return null; } else { try { final Constant constant = ontopBindingSet.getConstant(bindingName); return RDF4JHelper.getValue(constant); } catch (OntopResultConversionException e) { throw new RuntimeException(e); } } }
@Override public OWLBinding getBinding(String bindingName) throws OWLException { final OntopBinding ontopBinding = ontopBindingSet.getBinding(bindingName); if (ontopBinding == null) { return null; } else { return new OntopOWLBinding(ontopBinding); } }
@Override public boolean hasBinding(String bindingName) { return ontopBindingSet.hasBinding(bindingName); }
@Override public OWLNamedIndividual getOWLNamedIndividual(int column) throws OWLException { try { return (OWLNamedIndividual) translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public Set<String> getBindingNames() { return new LinkedHashSet<>(ontopBindingSet.getBindingNames()); }
@Override public OWLIndividual getOWLIndividual(int column) throws OWLException { try { return (OWLIndividual) translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public Set<String> getBindingNames() { return new LinkedHashSet<>(ontopBindingSet.getBindingNames()); }
@Override public OWLObject getOWLObject(int column) throws OWLException { try { return translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public int size() { return ontopBindingSet.getBindingNames().size(); }
@Override public OWLLiteral getOWLLiteral(int column) throws OWLException { try { return (OWLLiteral) translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public int size() { return ontopBindingSet.getBindingNames().size(); }
@Override public OWLObject getOWLObject(String column) throws OWLException { try { return translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }
@Override public OWLIndividual getOWLIndividual(String column) throws OWLException { try { return (OWLIndividual) translate(ontopBindingSet.getConstant(column)); } catch (Exception e) { throw new OntopOWLException(e); } }