Search in sources :

Example 6 with TupleIndex

use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.

the class AbstractTestTupleIndex method TupleIndexRecordFindNot_2.

@Test
public void TupleIndexRecordFindNot_2() {
    TupleIndex index = createIndex("SPO");
    add(index, n1, n2, n3);
    Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, n5, n6);
    Iterator<Tuple<NodeId>> iter = index.find(tuple2);
    assertFalse(iter.hasNext());
}
Also used : NodeId(org.apache.jena.tdb.store.NodeId) TupleIndex(org.apache.jena.tdb.store.tupletable.TupleIndex) Tuple(org.apache.jena.atlas.lib.tuple.Tuple) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 7 with TupleIndex

use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.

the class AbstractTestTupleIndex method TupleIndexRecordSPO_3.

@Test
public void TupleIndexRecordSPO_3() {
    TupleIndex index = createIndex("SPO");
    add(index, n1, n2, n3);
    Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, null, n3);
    Iterator<Tuple<NodeId>> iter = index.find(tuple2);
    assertTrue(iter.hasNext());
    iter.next();
    assertFalse(iter.hasNext());
}
Also used : NodeId(org.apache.jena.tdb.store.NodeId) TupleIndex(org.apache.jena.tdb.store.tupletable.TupleIndex) Tuple(org.apache.jena.atlas.lib.tuple.Tuple) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 8 with TupleIndex

use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.

the class AbstractTestTupleIndex method TupleIndexRecordSPO_7.

@Test
public void TupleIndexRecordSPO_7() {
    TupleIndex index = createIndex("SPO");
    add(index, n1, n2, n3);
    add(index, n1, n2, n4);
    Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, NodeId.NodeIdAny, 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)));
}
Also used : NodeId(org.apache.jena.tdb.store.NodeId) TupleIndex(org.apache.jena.tdb.store.tupletable.TupleIndex) Tuple(org.apache.jena.atlas.lib.tuple.Tuple) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 9 with TupleIndex

use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.

the class AbstractTestTupleIndex method TupleIndexRecordFindNot_5.

@Test
public void TupleIndexRecordFindNot_5() {
    TupleIndex index = createIndex("SPO");
    add(index, n1, n2, n3);
    add(index, n1, n5, n6);
    Tuple<NodeId> tuple2 = TupleFactory.tuple(n2, n5, n6);
    Iterator<Tuple<NodeId>> iter = index.find(tuple2);
    assertFalse(iter.hasNext());
}
Also used : NodeId(org.apache.jena.tdb.store.NodeId) TupleIndex(org.apache.jena.tdb.store.tupletable.TupleIndex) Tuple(org.apache.jena.atlas.lib.tuple.Tuple) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 10 with TupleIndex

use of org.apache.jena.tdb.store.tupletable.TupleIndex in project jena by apache.

the class AbstractTestTupleIndex method TupleIndexRecordFindNot_3.

@Test
public void TupleIndexRecordFindNot_3() {
    TupleIndex index = createIndex("SPO");
    add(index, n1, n2, n3);
    Tuple<NodeId> tuple2 = TupleFactory.tuple(n1, null, n6);
    Iterator<Tuple<NodeId>> iter = index.find(tuple2);
    assertFalse(iter.hasNext());
}
Also used : NodeId(org.apache.jena.tdb.store.NodeId) TupleIndex(org.apache.jena.tdb.store.tupletable.TupleIndex) Tuple(org.apache.jena.atlas.lib.tuple.Tuple) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Aggregations

TupleIndex (org.apache.jena.tdb.store.tupletable.TupleIndex)28 NodeId (org.apache.jena.tdb.store.NodeId)20 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)19 BaseTest (org.apache.jena.atlas.junit.BaseTest)18 Test (org.junit.Test)18 Location (org.apache.jena.tdb.base.file.Location)3 Timer (org.apache.jena.atlas.lib.Timer)2 RangeIndex (org.apache.jena.tdb.index.RangeIndex)2 ColumnMap (org.apache.jena.tdb.lib.ColumnMap)2 TupleIndexRecord (org.apache.jena.tdb.store.tupletable.TupleIndexRecord)2 Iterator (java.util.Iterator)1 Set (java.util.Set)1 Semaphore (java.util.concurrent.Semaphore)1 FileSet (org.apache.jena.tdb.base.file.FileSet)1 Record (org.apache.jena.tdb.base.record.Record)1 RecordFactory (org.apache.jena.tdb.base.record.RecordFactory)1 BPlusTree (org.apache.jena.tdb.index.bplustree.BPlusTree)1 NodeTable (org.apache.jena.tdb.store.nodetable.NodeTable)1 NodeTupleTable (org.apache.jena.tdb.store.nodetupletable.NodeTupleTable)1 NodeTupleTableConcrete (org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete)1