public static void exportJGraphToGraphviz( DirectedWeightedMultigraph<Node, DefaultLink> graph, String label, boolean onlyAddPatterns, GraphVizLabelType nodeLabelType, GraphVizLabelType linkLabelType, boolean showNodeMetaData, boolean showLinkMetaData, String filename) throws IOException { logger.info("exporting the graph to graphviz ..."); org.kohsuke.graphviz.Graph graphViz = convertToGraphviz(graph, null, onlyAddPatterns, nodeLabelType, linkLabelType, showNodeMetaData, showLinkMetaData);; graphViz.attr("fontcolor", "blue"); graphViz.attr("remincross", "true"); graphViz.attr("label", label == null ? "" : label); OutputStream out = new FileOutputStream(filename); graphViz.writeTo(out); logger.info("export is done."); }
public void exportGraphviz() { try { GraphVizUtil.exportJGraphToGraphviz(this.graphBuilder.getGraph(), "main graph", true, GraphVizLabelType.LocalId, GraphVizLabelType.LocalUri, false, true, getGraphGraphvizName()); } catch (Exception e) { logger.error("error in exporting the alignment graph to graphviz!"); } }
public void writeGraphviz(String filename, boolean showNodeMetaData, boolean showLinkMetaData) throws IOException { GraphVizUtil.exportSemanticModelToGraphviz(this, GraphVizLabelType.LocalId, GraphVizLabelType.LocalUri, showNodeMetaData, showLinkMetaData, filename); }
sourceLabel = sourceId; else if (nodeLabelType == GraphVizLabelType.LocalId) sourceLabel = (sourceLocalId = getLocalName(sourceId)) == null ? sourceId : sourceLocalId; else if (nodeLabelType == GraphVizLabelType.Uri) sourceLabel = sourceUri; else if (nodeLabelType == GraphVizLabelType.LocalUri) sourceLabel = (sourceLocalUri = getLocalName(sourceUri)) == null ? sourceUri : sourceLocalUri; if (showNodeMetaData) { targetLabel = targetId; else if (nodeLabelType == GraphVizLabelType.LocalId) targetLabel = (targetLocalId = getLocalName(targetId)) == null ? targetId : targetLocalId; else if (nodeLabelType == GraphVizLabelType.Uri) targetLabel = targetUri; else if (nodeLabelType == GraphVizLabelType.LocalUri) targetLabel = (targetLocalUri = getLocalName(targetUri)) == null ? targetUri : targetLocalUri; if (showNodeMetaData) { for (SemanticType st : suggestedTypes) targetLabel += "\n[" + getLocalName(st.getDomain().getUri()) + "," + getLocalName(st.getType().getUri()) + "," + roundDecimals(st.getConfidenceScore(),3) + "]"; edgeLabel = edgeUri; else if (linkLabelType == GraphVizLabelType.LocalUri) edgeLabel = (edgeLocalUri = getLocalName(edgeUri)) == null ? edgeUri : edgeLocalUri;
GraphVizUtil.exportSemanticModelsToGraphviz( models, newSource.getName(),
try { GraphUtil.exportJson(ml.getGraphBuilder().getGraph(), graphName, true, true); GraphVizUtil.exportJGraphToGraphviz(ml.getGraphBuilder().getGraph(), "main graph", true,
for(Entry<String,SemanticModel> entry : models.entrySet()) { if (entry.getKey() == "1-correct model") { cluster = GraphVizUtil.convertToGraphviz(GraphUtil.asDefaultGraph(entry.getValue().getGraph()), entry.getValue().getMappingToSourceColumns(), false, nodeLabelType, linkLabelType, false, false); } else { cluster = GraphVizUtil.convertToGraphviz(GraphUtil.asDefaultGraph(entry.getValue().getGraph()), entry.getValue().getMappingToSourceColumns(), false, nodeLabelType, linkLabelType, showNodeMetaData, showLinkMetaData);
try { GraphUtil.exportJson(ml.getGraphBuilder().getGraph(), graphName, true, true); GraphVizUtil.exportJGraphToGraphviz(ml.getGraphBuilder().getGraph(), "main graph", true,
public static void exportSemanticModelToGraphviz( SemanticModel model, GraphVizLabelType nodeLabelType, GraphVizLabelType linkLabelType, boolean showNodeMetaData, boolean showLinkMetaData, String filename) throws IOException { OutputStream out = new FileOutputStream(filename); org.kohsuke.graphviz.Graph graphViz = new org.kohsuke.graphviz.Graph(); graphViz.attr("fontcolor", "blue"); graphViz.attr("remincross", "true"); graphViz.attr("label", model.getName() == null ? "" : model.getName()); // graphViz.attr("page", "8.5,11"); org.kohsuke.graphviz.Graph gViz = convertToGraphviz(GraphUtil.asDefaultGraph(model.getGraph()), model.getMappingToSourceColumns(), false, nodeLabelType, linkLabelType, showNodeMetaData, showLinkMetaData); gViz.attr("label", "model"); gViz.id("cluster"); graphViz.subGraph(gViz); graphViz.writeTo(out); out.close(); }