use of org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT in project incubator-rya by apache.
the class DuplicateEliminationTest method testTableMapperOutput.
@Test
public void testTableMapperOutput() throws Exception {
RyaStatement rya = TestUtils.ryaStatement("x", "subOrganizationOf", "y");
TripleRowResolver trr = new WholeRowTripleResolver();
Map<TABLE_LAYOUT, TripleRow> map = trr.serialize(rya);
TripleRow tr = map.get(TABLE_LAYOUT.SPO);
byte[] b = new byte[0];
Key key = new Key(tr.getRow(), tr.getColumnFamily(), tr.getColumnQualifier(), b, 1);
Value val = new Value(b);
new MapDriver<Key, Value, Fact, Derivation>().withMapper(new DuplicateElimination.DuplicateTableMapper()).withInput(key, val).withOutput(X_SUB_Y, X_SUB_Y.getDerivation()).runTest();
}
use of org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT in project incubator-rya by apache.
the class ForwardChainTest method testTableMapperOutput.
@Test
public void testTableMapperOutput() throws Exception {
RyaStatement rya = TestUtils.ryaStatement("x", "subOrganizationOf", "y");
TripleRowResolver trr = new WholeRowTripleResolver();
Map<TABLE_LAYOUT, TripleRow> map = trr.serialize(rya);
TripleRow tr = map.get(TABLE_LAYOUT.SPO);
byte[] b = new byte[0];
Key key = new Key(tr.getRow(), tr.getColumnFamily(), tr.getColumnQualifier(), b, 1);
Value val = new Value(b);
ResourceWritable rw1 = new ResourceWritable();
ResourceWritable rw2 = new ResourceWritable();
rw1.set(TestUtils.uri("x"));
rw2.set(TestUtils.uri("y"));
new MapDriver<Key, Value, ResourceWritable, Fact>().withMapper(new ForwardChain.TableMapper(schema)).withInput(key, val).withOutput(rw1, X_SUB_Y).withOutput(rw2, X_SUB_Y).runTest();
}
Aggregations