use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.
the class AbstractTestTupleIndex method TupleIndexRecordPOS_2.
@Test
public void TupleIndexRecordPOS_2() {
TupleIndex index = createIndex("POS");
add(index, n1, n2, n3);
Tuple<NodeId> tuple2 = TupleFactory.tuple(null, n2, null);
Iterator<Tuple<NodeId>> iter = index.find(tuple2);
assertTrue("Can't find tuple", iter.hasNext());
iter.next();
assertFalse(iter.hasNext());
}
use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.
the class AbstractTestTupleIndex method TupleIndexRecordFindNot_6.
@Test
public void TupleIndexRecordFindNot_6() {
TupleIndex index = createIndex("SPO");
add(index, n1, n2, n3);
add(index, n4, n5, n6);
Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, null, n6);
Iterator<Tuple<NodeId>> iter = index.find(tuple2);
assertFalse(iter.hasNext());
}
use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.
the class AbstractTestTupleIndex method TupleIndexRecordSPO_2.
@Test
public void TupleIndexRecordSPO_2() {
TupleIndex index = createIndex("SPO");
add(index, n1, n2, n3);
Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, n2, null);
Iterator<Tuple<NodeId>> iter = index.find(tuple2);
assertTrue(iter.hasNext());
iter.next();
assertFalse(iter.hasNext());
}
use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.
the class AbstractTestTupleIndex method TupleIndexRecordFindNot_4.
@Test
public void TupleIndexRecordFindNot_4() {
TupleIndex index = createIndex("SPO");
add(index, n1, n2, n3);
add(index, n1, n5, n6);
Tuple<NodeId> tuple2 = TupleFactory.tuple(n4, n5, n6);
Iterator<Tuple<NodeId>> iter = index.find(tuple2);
assertFalse(iter.hasNext());
}
use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.
the class AbstractTestTupleIndex method TupleIndexRecordSPO_6.
@Test
public void TupleIndexRecordSPO_6() {
TupleIndex index = createIndex("SPO");
add(index, n1, n2, n3);
add(index, n1, n2, n4);
Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, n2, NodeId.NodeIdAny);
Iterator<Tuple<NodeId>> iter = index.find(tuple2);
Set<Tuple<NodeId>> x = Iter.toSet(iter);
assertEquals(2, x.size());
assertTrue(x.contains(TupleFactory.tuple(n1, n2, n3)));
assertTrue(x.contains(TupleFactory.tuple(n1, n2, n4)));
}
Aggregations