use of fr.lirmm.graphik.util.stream.IteratorException in project graal by graphik-team.
the class RDF4jStore method getTerms.
@Override
public Set<Term> getTerms() throws AtomSetException {
TreeSet<Term> set = new TreeSet<Term>();
CloseableIterator<Term> it = this.termsIterator();
try {
while (it.hasNext()) {
set.add(it.next());
}
} catch (IteratorException e) {
throw new AtomSetException("An error occurs during iteration over terms", e);
}
return set;
}
use of fr.lirmm.graphik.util.stream.IteratorException in project graal by graphik-team.
the class Neo4jStore method removeAll.
@Override
public boolean removeAll(CloseableIterator<? extends Atom> it) throws AtomSetException {
boolean isChanged = false;
this.checkTransaction();
try {
while (it.hasNext()) {
isChanged = this.remove(it.next(), null) || isChanged;
}
this.successTransaction();
} catch (IteratorException e) {
throw new AtomSetException("An errors occurs while iterating atoms to remove", e);
} finally {
this.reloadTransaction();
}
return isChanged;
}
use of fr.lirmm.graphik.util.stream.IteratorException in project graal by graphik-team.
the class Neo4jStore method getTerms.
@Override
@Deprecated
public Set<Term> getTerms(Type type) throws AtomSetException {
TreeSet<Term> set = new TreeSet<Term>();
CloseableIterator<Term> it = this.termsIterator(type);
try {
while (it.hasNext()) {
set.add(it.next());
}
} catch (IteratorException e) {
throw new AtomSetException("An errors occurs while iterating terms", e);
}
return set;
}
use of fr.lirmm.graphik.util.stream.IteratorException in project graal by graphik-team.
the class Neo4jStore method addAll.
@Override
public boolean addAll(CloseableIterator<? extends Atom> it) throws AtomSetException {
boolean isChanged = false;
this.checkTransaction();
try {
while (it.hasNext()) {
isChanged = this.add(it.next(), null) || isChanged;
}
this.successTransaction();
} catch (IteratorException e) {
throw new AtomSetException("An errors occurs while iterating atoms to add", e);
} finally {
this.reloadTransaction();
}
return isChanged;
}
use of fr.lirmm.graphik.util.stream.IteratorException in project graal by graphik-team.
the class AbstractRdbmsStore method clear.
@Override
public void clear() throws AtomSetException {
CloseableIterator<Predicate> it = this.predicatesIterator();
Statement stat = null;
try {
try {
stat = this.createStatement();
while (it.hasNext()) {
Predicate p = it.next();
this.removePredicate(stat, p);
}
this.getConnection().commit();
} catch (IteratorException e) {
this.getConnection().rollback();
throw new AtomSetException(e);
} catch (SQLException e) {
this.getConnection().rollback();
throw new AtomSetException(e);
} finally {
if (stat != null)
stat.close();
}
} catch (SQLException e) {
throw new AtomSetException(e);
}
}
Aggregations