@Override public Iterator<Statement> range(final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected void addStatementInternal( final Resource subj, final URI pred, final Value obj, final Resource... contexts) throws SailException { try { if (_quad) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("A quadstore always needs a context."); } for (int i = 0; i < contexts.length; i++) { _crdf.addData(_factory.createStatement(subj, pred, obj, contexts[i])); } } else { _crdf.addData(_factory.createStatement(subj, pred, obj)); } } catch (CumulusStoreException e) { e.printStackTrace(); throw new SailException(e); } }
_mHit = query(new Value[] {object, null, null}, _mSubjects); } catch (CumulusStoreException e) { _log.error(e.getMessage()); _mHit = null; _mHit = query(new Value[] {object, null, null}, _mSubjects); } catch (CumulusStoreException e) { _log.error(e.getMessage()); _mHit = null;
@Override protected void addStatementInternal( final Resource subj, final URI pred, final Value obj, final Resource... contexts) throws SailException { try { if (_quad) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("A quadstore always needs a context."); } for (int i = 0; i < contexts.length; i++) { _crdf.addData(_factory.createStatement(subj, pred, obj, contexts[i])); } } else { _crdf.addData(_factory.createStatement(subj, pred, obj)); } } catch (CumulusStoreException e) { e.printStackTrace(); throw new SailException(e); } }
_mHit = query(new Value[] {object, null, null}, _mSubjects); } catch (CumulusStoreException e) { _log.error(e.getMessage()); _mHit = null; _mHit = query(new Value[] {object, null, null}, _mSubjects); } catch (CumulusStoreException e) { _log.error(e.getMessage()); _mHit = null;
@Override public Iterator<Statement> range(final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected void removeStatementsInternal( final Resource subj, final URI pred, final Value obj, final Resource... contexts) throws SailException { try { if (_quad) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("A quadstore always needs a context."); } for (int i = 0; i < contexts.length; i++) { _crdf.removeData(_factory.createNodes(subj, pred, obj, contexts[0])); } } else { _crdf.removeData(_factory.createNodes(subj, pred, obj)); } } catch (CumulusStoreException e) { e.printStackTrace(); throw new SailException(e); } }
@Override protected Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { if ((query == null || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected void removeStatementsInternal( final Resource subj, final URI pred, final Value obj, final Resource... contexts) throws SailException { try { if (_quad) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("A quadstore always needs a context."); } for (int i = 0; i < contexts.length; i++) { _crdf.removeData(_factory.createNodes(subj, pred, obj, contexts[0])); } } else { _crdf.removeData(_factory.createNodes(subj, pred, obj)); } } catch (CumulusStoreException e) { e.printStackTrace(); throw new SailException(e); } }
@Override protected Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { if ((query == null || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { // check if query is valid if (query == null || (query.length > 4 || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public Iterator<byte[][]> queryWithIDs(final byte[][] query, final int limit) throws CumulusStoreException { try { // check if query is valid if (query == null || (query.length > 4 || query.length < 3)) { return Iterators.emptyIterator(); } return _rdfIndexDAO.query(query, limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public Iterator<Statement> rangeDateTime( final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeDateTimeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public Iterator<Statement> rangeDateTime( final Value[] query, final Literal lower, final boolean equalsLower, final Literal upper, final boolean equalsUpper, final boolean reverse, final int limit) throws CumulusStoreException { try { return _dictionary.toValueTripleIterator(rangeDateTimeAsIDs(query, lower, equalsLower, upper, equalsUpper, reverse, limit)); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void addData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(iterator, _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override public void addData(final Iterator<Statement> iterator) throws CumulusStoreException { try { notifyListeners(_startChangesEvent); batchInsert(iterator, _batchLimit); notifyListeners(_finishedChangesEvent); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } catch (final Exception exception) { _log.error(MessageCatalog._00026_NWS_SYSTEM_INTERNAL_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2], query.length > 3 ? query[3] : null), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2]), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2]), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }
@Override protected Iterator<byte[][]> queryAsIDs(final Value[] query, final int limit) throws CumulusStoreException { try { return queryWithIDs(_dictionary.getIDs(query[0], query[1], query[2], query.length > 3 ? query[3] : null), limit); } catch (final DataAccessLayerException exception) { _log.error(MessageCatalog._00093_DATA_ACCESS_LAYER_FAILURE, exception); throw new CumulusStoreException(exception); } }