/** * Count all non-deleted triples in the triple store * @param context the context to count * @return number of non-deleted triples in the provided context * @throws SQLException */ public long getSize(KiWiResource context) throws SQLException { if (context.getId() < 0) { return 0; } requireJDBCConnection(); PreparedStatement querySize = getPreparedStatement("query.size_ctx"); querySize.setLong(1,context.getId()); try (ResultSet result = querySize.executeQuery()) { if (result.next()) { return result.getLong(1) + (tripleBatch != null ? tripleBatch.listTriples(null, null, null, context, false).size() : 0); } } return tripleBatch != null ? tripleBatch.listTriples(null, null, null, context, false).size() : 0; }
/** * Count all non-deleted triples in the triple store * @param context the context to count * @return number of non-deleted triples in the provided context * @throws SQLException */ public long getSize(KiWiResource context) throws SQLException { if (context.getId() < 0) { return 0; } requireJDBCConnection(); PreparedStatement querySize = getPreparedStatement("query.size_ctx"); querySize.setLong(1,context.getId()); try (ResultSet result = querySize.executeQuery()) { if (result.next()) { return result.getLong(1) + (tripleBatch != null ? tripleBatch.listTriples(null, null, null, context, false).size() : 0); } } return tripleBatch != null ? tripleBatch.listTriples(null, null, null, context, false).size() : 0; }
Collection<KiWiTriple> batched = tripleBatch.listTriples(subject,predicate,object,context, false); if(batched.size() > 0) { return batched.iterator().next().getId();
Collection<KiWiTriple> batched = tripleBatch.listTriples(subject,predicate,object,context, false); if(batched.size() > 0) { return batched.iterator().next().getId();
new ExceptionConvertingIteration<Statement, RepositoryException>( new UnionIteration<>( new IteratorIteration<Statement, SQLException>(tripleBatch.listTriples(subject,predicate,object,context, wildcardContext).iterator()), new DelayedIteration<Statement, SQLException>() { @Override
new ExceptionConvertingIteration<Statement, RepositoryException>( new UnionIteration<>( new IteratorIteration<Statement, SQLException>(tripleBatch.listTriples(subject,predicate,object,context, wildcardContext).iterator()), new DelayedIteration<Statement, SQLException>() { @Override