Search in sources :

Example 1 with Derivation

use of org.apache.rya.reasoning.Derivation in project incubator-rya by apache.

the class DuplicateEliminationTest method testRetainSimplest.

@Test
public void testRetainSimplest() throws Exception {
    List<Derivation> facts = new LinkedList<>();
    facts.add(Y_SUPER_X_INV.getDerivation());
    facts.add(Y_SUPER_X.getDerivation());
    Fact unset = Y_SUPER_X.clone();
    unset.unsetDerivation();
    ReduceDriver<Fact, Derivation, Fact, NullWritable> driver = new ReduceDriver<>();
    driver.getConfiguration().setInt(MRReasoningUtils.STEP_PROP, 1);
    driver.withReducer(new DuplicateElimination.DuplicateEliminationReducer()).withInput(unset, facts).withMultiOutput(MRReasoningUtils.INTERMEDIATE_OUT, Y_SUPER_X, NullWritable.get()).runTest();
}
Also used : Derivation(org.apache.rya.reasoning.Derivation) Fact(org.apache.rya.reasoning.Fact) NullWritable(org.apache.hadoop.io.NullWritable) ReduceDriver(org.apache.hadoop.mrunit.mapreduce.ReduceDriver) LinkedList(java.util.LinkedList) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

LinkedList (java.util.LinkedList)1 NullWritable (org.apache.hadoop.io.NullWritable)1 ReduceDriver (org.apache.hadoop.mrunit.mapreduce.ReduceDriver)1 Derivation (org.apache.rya.reasoning.Derivation)1 Fact (org.apache.rya.reasoning.Fact)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1