@Test public void ComplexPlanLS() { System.out.println("ComplexPlanLS"); HeliosPlanner p = new HeliosPlanner(source, target); LinkSpecification ls = new LinkSpecification( "AND(jaccard(x.title,y.name)|0.5941,OR(XOR(OR(XOR(trigrams(x.description,y.description)|0.7728,qgrams(x.title,y.name)|0.6029)|0.7728,XOR(trigrams(x.description,y.description)|0.7728,qgrams(x.title,y.name)|0.6029)|0.7728)|0.5807,OR(XOR(trigrams(x.description,y.description)|0.7728,qgrams(x.title,y.name)|0.6029)|0.7728,trigrams(x.title,y.name)|0.5919)|0.5807)|0.7728,trigrams(x.description,y.description)|0.7728)|0.5807)", 0.8); NestedPlan plan = p.plan(ls); assertTrue(plan.isEmpty() == false); assertTrue(plan.isAtomic() == false); // atomic plans have instructions lists = the instructions lists of // their subplans if any assertTrue(plan.getInstructionList().isEmpty() == false); assertTrue(plan.getInstructionList().size() == 8); // atomic plans have subplans assertTrue(plan.getSubPlans().isEmpty() == false); // atomic plans have filteringinstructions assertTrue(plan.getFilteringInstruction() != null); CanonicalPlanner cp = new CanonicalPlanner(); NestedPlan plan2 = cp.plan(ls); assertTrue(plan.equals(plan2) == false); }
@Test public void AtomicPlan() { System.out.println("AtomicPlan"); HeliosPlanner p = new HeliosPlanner(source, target); LinkSpecification ls = new LinkSpecification("jaccard(x.surname, y.surname)", 0.8); NestedPlan plan = p.plan(ls); assertTrue(plan.isEmpty() == false); assertTrue(plan.isAtomic() == true); // atomic plans have instructions lists assertTrue(plan.getInstructionList().isEmpty() == false); // atomic plans don't have subplans assertTrue(plan.getSubPlans() == null); // atomic plans don't have filteringinstructions assertTrue(plan.getFilteringInstruction() == null); }