public RyaStatement findStatement(final RyaStatement ryaStatement) throws RyaDAOException { RyaStatement resultRyaStatement = null; CloseableIteration<RyaStatement, RyaDAOException> iter = null; try { iter = accumuloRyaDao.getQueryEngine().query(ryaStatement, accumuloRyaDao.getConf()); if (iter.hasNext()) { resultRyaStatement = iter.next(); } } finally { if (iter != null) { iter.close(); } } return resultRyaStatement; }
public RyaStatement findStatement(final RyaStatement ryaStatement) throws RyaDAOException { RyaStatement resultRyaStatement = null; CloseableIteration<RyaStatement, RyaDAOException> iter = null; try { iter = accumuloRyaDao.getQueryEngine().query(ryaStatement, accumuloRyaDao.getConf()); if (iter.hasNext()) { resultRyaStatement = iter.next(); } } finally { if (iter != null) { iter.close(); } } return resultRyaStatement; }
/** * Gets the metadata key from the table. * @param ryaStatement the {@link RyaStatement} for the metadata key to query. * @param dao the {@link AccumuloRyaDAO}. * @return the string value of the object from the metadata key. * @throws RyaDAOException */ private static String getMetadata(final RyaStatement ryaStatement, final AccumuloRyaDAO dao) throws RyaDAOException { String metadata = null; final AccumuloRdfConfiguration config = dao.getConf(); final CloseableIteration<RyaStatement, RyaDAOException> iter = dao.getQueryEngine().query(ryaStatement, config); if (iter.hasNext()) { metadata = iter.next().getObject().getData(); } iter.close(); return metadata; }