private GraphBuilder cloneGraphBuilder(GraphBuilder graphBuilder) { GraphBuilder clonedGraphBuilder = null; if (graphBuilder == null || graphBuilder.getGraph() == null) { clonedGraphBuilder = new GraphBuilderTopK(this.ontologyManager, false); } else { clonedGraphBuilder = new GraphBuilderTopK(this.ontologyManager, graphBuilder.getGraph()); } return clonedGraphBuilder; }
public TreePostProcess( GraphBuilder graphBuilder, UndirectedGraph<Node, DefaultLink> tree) { this.graphBuilder = graphBuilder; this.tree = (DirectedWeightedMultigraph<Node, DefaultLink>)GraphUtil.asDirectedGraph(tree); buildOutputTree(false); }
public TreePostProcess( GraphBuilder graphBuilder, UndirectedGraph<Node, DefaultLink> tree, Set<LabeledLink> newLinks, boolean findRoot) { this.graphBuilder = graphBuilder; this.tree = (DirectedWeightedMultigraph<Node, DefaultLink>)GraphUtil.asDirectedGraph(tree); buildOutputTree(true); addLinks(newLinks); if (findRoot) { this.root = selectRoot(this.tree); } }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); return this.computeAlignmentAndSemanticTypesAndCreateUpdates(workspace); }
public SemanticModel(SemanticModel semanticModel) { this.id = semanticModel.getId(); this.name = semanticModel.getName(); this.description = semanticModel.getDescription(); this.graph = semanticModel.getGraph(); this.sourceColumns = semanticModel.getSourceColumns(); this.mappingToSourceColumns = semanticModel.getMappingToSourceColumns(); // this.selection = SuperSelectionManager.DEFAULT_SELECTION; }
public void deleteForcedInternalNode(String nodeId) { Node node = getNodeById(nodeId); if(node != null) { this.removeNode(nodeId); // if (this.graphBuilder.removeNode(node)) // this.steinerTree.removeVertex(node); } }
public void print() { logger.info("id: " + this.getId()); logger.info("name: " + this.getName()); logger.info("description: " + this.getDescription()); logger.info(GraphUtil.labeledGraphToString(this.graph)); }
public Set<LabeledLink> getCurrentOutgoingLinksToNode(String nodeId) { Node node = this.getNodeById(nodeId); if (node == null) return null; return this.graphBuilder.getOutgoingLinksMap().get(nodeId); }
public Set<LabeledLink> getCurrentIncomingLinksToNode(String nodeId) { Node node = this.getNodeById(nodeId); if (node == null) return null; return this.graphBuilder.getIncomingLinksMap().get(nodeId); }
private GraphBuilder cloneGraphBuilder(GraphBuilder graphBuilder) { GraphBuilder clonedGraphBuilder = null; if (graphBuilder == null || graphBuilder.getGraph() == null) { clonedGraphBuilder = new GraphBuilder(this.ontologyManager, false); } else { clonedGraphBuilder = new GraphBuilder(this.ontologyManager, graphBuilder.getGraph(), false); } this.nodeIdFactory = clonedGraphBuilder.getNodeIdFactory(); return clonedGraphBuilder; }
protected ModelLearningGraph(OntologyManager ontologyManager, boolean emptyInstance, ModelLearningGraphType type) { this.ontologyManager = ontologyManager; if (type == ModelLearningGraphType.Compact) this.graphBuilder = new GraphBuilderTopK(ontologyManager, false); else this.graphBuilder = new GraphBuilder(ontologyManager, false); this.nodeIdFactory = this.graphBuilder.getNodeIdFactory(); this.lastUpdateTime = System.currentTimeMillis(); }
public void changeLinkWeight(String linkId, double weight) { LabeledLink link = this.getLinkById(linkId); if (link == null) { logger.error("Could not find the link with the id " + linkId); return; } this.graphBuilder.changeLinkWeight(link, weight); }
public boolean addLink(Node source, Node target, DefaultLink link, Double weight) { if (addLink(source, target, link)) { if (weight != null) changeLinkWeight(link, weight); return true; } return false; }
public GraphPreProcess(DirectedWeightedMultigraph<Node, DefaultLink> graph, Set<LabeledLink> linksPreferredByUI, Set<LabeledLink> linksForcedByUser) { this.linksPreferredByUI = linksPreferredByUI; this.linksForcedByUser = linksForcedByUser; this.gPrime = cloneGraph(graph); this.updateWeights(); }
public SteinerTree(UndirectedGraph<Node, DefaultLink> graph, List<Node> steinerNodes) { this.graph = graph; this.steinerNodes = steinerNodes; runAlgorithm(); }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); // Get the alignment update return WorksheetUpdateFactory.createSemanticTypesAndSVGAlignmentUpdates(worksheetId, workspace); }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); // Get the alignment update return WorksheetUpdateFactory.createSemanticTypesAndSVGAlignmentUpdates(worksheetId, workspace); }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); return this.computeAlignmentAndSemanticTypesAndCreateUpdates(workspace); }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); return this.computeAlignmentAndSemanticTypesAndCreateUpdates(workspace); }
@Override public UpdateContainer undoIt(Workspace workspace) { // Revert to the old alignment AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); // Get the alignment update return WorksheetUpdateFactory.createSemanticTypesAndSVGAlignmentUpdates(worksheetId, workspace); }