@Test public void testBuild() throws Exception { String docId = "documentId"; String otherDocId = "otherDocId"; float similarity = 1f; DocumentSimilarity docSim = buildDocSim(docId, otherDocId, similarity); ActionBuilderModule<DocumentSimilarity, Relation> module = factory.instantiate(config); List<AtomicAction<Relation>> actions = module.build(docSim); assertNotNull(actions); assertEquals(2, actions.size()); AtomicAction<Relation> action = actions.get(0); assertNotNull(action); assertEquals(Relation.class, action.getClazz()); assertOaf(action.getPayload(), docId, otherDocId, similarity, "hasAmongTopNSimilarDocuments"); action = actions.get(1); assertNotNull(action); assertEquals(Relation.class, action.getClazz()); assertOaf(action.getPayload(), otherDocId, docId, similarity, "isAmongTopNSimilarDocuments"); }
@Override public ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config) { Float similarityThreshold = null; String thresholdStr = WorkflowRuntimeParameters.getParamValue(EXPORT_DOCUMENTSSIMILARITY_THRESHOLD, config); if (thresholdStr != null) { similarityThreshold = Float.valueOf(thresholdStr); log.info("setting documents similarity exporter threshold to: " + similarityThreshold); } return new DocumentSimilarityActionBuilderModule(provideTrustLevelThreshold(config), similarityThreshold); }
DocumentSimilarityActionBuilderModuleFactory extends AbstractActionBuilderFactory<DocumentSimilarity, Relation> { @Override public ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config) { Float similarityThreshold = null; String thresholdStr = WorkflowRuntimeParameters.getParamValue(EXPORT_DOCUMENTSSIMILARITY_THRESHOLD, config); if (thresholdStr != null) { similarityThreshold = Float.valueOf(thresholdStr); log.info("setting documents similarity exporter threshold to: " + similarityThreshold); } return new DocumentSimilarityActionBuilderModule(provideTrustLevelThreshold(config), similarityThreshold); } }
DocumentSimilarityActionBuilderModuleFactory extends AbstractActionBuilderFactory<DocumentSimilarity, Relation> { @Override public ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config) { Float similarityThreshold = null; String thresholdStr = WorkflowRuntimeParameters.getParamValue(EXPORT_DOCUMENTSSIMILARITY_THRESHOLD, config); if (thresholdStr != null) { similarityThreshold = Float.valueOf(thresholdStr); log.info("setting documents similarity exporter threshold to: " + similarityThreshold); } return new DocumentSimilarityActionBuilderModule(provideTrustLevelThreshold(config), similarityThreshold); } DocumentSimilarityActionBuilderModuleFactory(); }
DocumentSimilarityActionBuilderModuleFactory extends AbstractActionBuilderFactory<DocumentSimilarity, Relation> { @Override public ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config) { Float similarityThreshold = null; String thresholdStr = WorkflowRuntimeParameters.getParamValue(EXPORT_DOCUMENTSSIMILARITY_THRESHOLD, config); if (thresholdStr != null) { similarityThreshold = Float.valueOf(thresholdStr); log.info("setting documents similarity exporter threshold to: " + similarityThreshold); } return new DocumentSimilarityActionBuilderModule(provideTrustLevelThreshold(config), similarityThreshold); } DocumentSimilarityActionBuilderModuleFactory(); @Override ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config); }
DocumentSimilarityActionBuilderModuleFactory extends AbstractActionBuilderFactory<DocumentSimilarity, Relation> { @Override public ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config) { Float similarityThreshold = null; String thresholdStr = WorkflowRuntimeParameters.getParamValue(EXPORT_DOCUMENTSSIMILARITY_THRESHOLD, config); if (thresholdStr != null) { similarityThreshold = Float.valueOf(thresholdStr); log.info("setting documents similarity exporter threshold to: " + similarityThreshold); } return new DocumentSimilarityActionBuilderModule(provideTrustLevelThreshold(config), similarityThreshold); } DocumentSimilarityActionBuilderModuleFactory(); @Override ActionBuilderModule<DocumentSimilarity, Relation> instantiate(Configuration config);  }