use of org.apache.jena.atlas.lib.tuple.TupleMap in project jena by apache.
the class TDB2StorageBuilder method makeTupleIndex.
private TupleIndex makeTupleIndex(String primary, String index, String name) {
TupleMap cmap = TupleMap.create(primary, index);
RecordFactory rf = new RecordFactory(SystemTDB.SizeOfNodeId * cmap.length(), 0);
RangeIndex rIdx = makeRangeIndex(rf, index);
TupleIndex tIdx = new TupleIndexRecord(primary.length(), cmap, index, rf, rIdx);
return tIdx;
}
use of org.apache.jena.atlas.lib.tuple.TupleMap in project jena by apache.
the class TestTupleMap method map_same_2.
@Test
public void map_same_2() {
TupleMap x1 = TupleMap.create("SPO", "POS");
TupleMap x2 = TupleMap.create("SPO", "OSP");
assertFalse(x1.sameMapping(x2));
assertFalse(x2.sameMapping(x1));
}
use of org.apache.jena.atlas.lib.tuple.TupleMap in project jena by apache.
the class TestTupleMap method compile_2.
@Test
public void compile_2() {
TupleMap map = TupleMap.create("SPOG", "GOPS");
Integer[] expected = { 3, 2, 1, 0 };
assertEquals(Arrays.asList(expected), map.transformPut());
}
use of org.apache.jena.atlas.lib.tuple.TupleMap in project jena by apache.
the class TestTupleMap method map_reverse_1.
@Test
public void map_reverse_1() {
TupleMap x1 = TupleMap.create("SPO", "POS");
TupleMap x2 = TupleMap.create("POS", "SPO");
assertTrue(x1.reverse().sameMapping(x2));
assertFalse(x1.reverse().sameMapping(x1));
}
use of org.apache.jena.atlas.lib.tuple.TupleMap in project jena by apache.
the class TestTupleMap method map_reverse_2.
@Test
public void map_reverse_2() {
TupleMap x1 = TupleMap.create("SPO", "POS");
TupleMap x2 = TupleMap.create("POS", "SPO");
Tuple<String> tuple = TupleFactory.tuple("X", "Y", "Z");
Tuple<String> tuple1 = x1.map(tuple);
Tuple<String> tuple2 = x2.unmap(tuple);
assertEquals(tuple1, tuple2);
}
Aggregations