Search in sources :

Example 1 with RyaStatementBindingSetCursorIterator

use of org.apache.rya.mongodb.iter.RyaStatementBindingSetCursorIterator in project incubator-rya by apache.

the class MongoDBQueryEngine method queryWithBindingSet.

@Override
public CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> queryWithBindingSet(final Collection<Entry<RyaStatement, BindingSet>> stmts, final StatefulMongoDBRdfConfiguration conf) throws RyaDAOException {
    checkNotNull(stmts);
    checkNotNull(conf);
    final Multimap<RyaStatement, BindingSet> rangeMap = HashMultimap.create();
    // TODO: cannot span multiple tables here
    try {
        for (final Map.Entry<RyaStatement, BindingSet> stmtbs : stmts) {
            final RyaStatement stmt = stmtbs.getKey();
            final BindingSet bs = stmtbs.getValue();
            rangeMap.put(stmt, bs);
        }
        // TODO not sure what to do about regex ranges?
        final RyaStatementBindingSetCursorIterator iterator = new RyaStatementBindingSetCursorIterator(getCollection(conf), rangeMap, strategy, conf.getAuthorizations());
        return iterator;
    } catch (final Exception e) {
        throw new RyaDAOException(e);
    }
}
Also used : MapBindingSet(org.openrdf.query.impl.MapBindingSet) BindingSet(org.openrdf.query.BindingSet) RyaStatement(org.apache.rya.api.domain.RyaStatement) RyaDAOException(org.apache.rya.api.persist.RyaDAOException) HashMap(java.util.HashMap) Map(java.util.Map) AbstractMap(java.util.AbstractMap) RyaStatementBindingSetCursorIterator(org.apache.rya.mongodb.iter.RyaStatementBindingSetCursorIterator) IOException(java.io.IOException) RyaDAOException(org.apache.rya.api.persist.RyaDAOException)

Aggregations

IOException (java.io.IOException)1 AbstractMap (java.util.AbstractMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 RyaStatement (org.apache.rya.api.domain.RyaStatement)1 RyaDAOException (org.apache.rya.api.persist.RyaDAOException)1 RyaStatementBindingSetCursorIterator (org.apache.rya.mongodb.iter.RyaStatementBindingSetCursorIterator)1 BindingSet (org.openrdf.query.BindingSet)1 MapBindingSet (org.openrdf.query.impl.MapBindingSet)1