本文整理汇总了Java中org.neo4j.visualization.graphviz.GraphvizWriter类的典型用法代码示例。如果您正苦于以下问题:Java GraphvizWriter类的具体用法?Java GraphvizWriter怎么用?Java GraphvizWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GraphvizWriter类属于org.neo4j.visualization.graphviz包,在下文中一共展示了GraphvizWriter类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: cfg
点赞 3
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void cfg(String branchId) throws IOException {
Transaction transaction = dbServices.beginTx();
final File dot = File.createTempFile("dot", null);
dot.deleteOnExit();
Walker walker = new CfgWalker(dbServices);
NewlineFilterStream fileOutputStream = new NewlineFilterStream(new FileOutputStream(dot));
new GraphvizWriter().emit(fileOutputStream, walker);
fileOutputStream.close();
ProcessBuilder builder = new ProcessBuilder("dot", "-Tpng", dot.getAbsolutePath());
builder.redirectErrorStream(true);
Process process = builder.start();
final InputStream inputStream = process.getInputStream();
final BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
ByteStreams.copy(bufferedInputStream, out);
}
开发者ID:FTSRG,
项目名称:codemodel-rifle,
代码行数:22,
代码来源:ExportGraph.java
示例2: test
点赞 3
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
@Test
public void test() throws Exception {
OwlLoadConfiguration config = new OwlLoadConfiguration();
Neo4jConfiguration neo4jConfig = new Neo4jConfiguration();
neo4jConfig.setLocation(folder.getRoot().getAbsolutePath());
config.setGraphConfiguration(neo4jConfig);
OntologySetup ontSetup = new OntologySetup();
ontSetup.setUrl("http://127.0.0.1:10000/main.owl");
config.getOntologies().add(ontSetup);
BatchOwlLoader.load(config);
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(folder.getRoot());
graphDb.beginTx();
GraphvizWriter writer = new GraphvizWriter();
Walker walker = Walker.fullGraph(graphDb);
writer.emit(new File("/tmp/test.dot"), walker);
}
开发者ID:SciGraph,
项目名称:SciGraph,
代码行数:18,
代码来源:BatchOwlLoaderIT.java
示例3: ExportDot
点赞 3
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
private String ExportDot(Iterable<Node> nodes)
{
OutputStream out = new ByteArrayOutputStream();
GraphvizWriter writer = new GraphvizWriter();
Iterable<RelationshipType> types = GlobalGraphOperations.at(graph_db).getAllRelationshipTypes();
try
{
writer.emit(out, Walker.crosscut(nodes
, Iterables.toArray(types, RelationshipType.class)));
}
catch(IOException e)
{
throw new ExceptionModelFail
("Traverse during export to .dot file failed: "
+ e.getMessage());
}
return out.toString();
}
开发者ID:srcc-msu,
项目名称:octotron_core,
代码行数:23,
代码来源:Neo4jGraph.java
示例4: writeGraphAsGraphVis
点赞 3
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void writeGraphAsGraphVis(String filePath) throws Exception {
Transaction t = graphDatabaseService.beginTx();
try {
GraphvizWriter writer = new GraphvizWriter();
OutputStream out = new FileOutputStream(filePath);
writer.emit(out, Walker.fullGraph(graphDatabaseService));
out.flush();
out.close();
t.success();
} catch (IOException e) {
t.failure();
}
t.finish();
}
开发者ID:tuwiendsg,
项目名称:MELA,
代码行数:19,
代码来源:DataAccess.java
示例5: svg
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void svg(String branchId, long nodeId, boolean simple, boolean cfg) throws IOException {
Transaction transaction = dbServices.beginTx();
final File dot = File.createTempFile("dot", null);
dot.deleteOnExit();
Walker walker;
if (nodeId != -1) {
walker = new GraphWalker(dbServices, nodeId, simple, cfg);
} else {
walker = new GraphWalker(dbServices, simple, cfg);
}
NewlineFilterStream fileOutputStream = new NewlineFilterStream(new FileOutputStream(dot));
new GraphvizWriter().emit(fileOutputStream, walker);
fileOutputStream.close();
ProcessBuilder builder = new ProcessBuilder("dot", "-Tsvg", dot.getAbsolutePath());
builder.redirectErrorStream(true);
Process process = builder.start();
final InputStream inputStream = process.getInputStream();
final BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
ByteStreams.copy(bufferedInputStream, out);
}
开发者ID:FTSRG,
项目名称:codemodel-rifle,
代码行数:28,
代码来源:ExportGraph.java
示例6: png
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void png(String branchId, long nodeId, boolean simple, boolean cfg) throws IOException {
Transaction transaction = dbServices.beginTx();
final File dot = File.createTempFile("dot", null);
dot.deleteOnExit();
Walker walker;
if (nodeId != -1) {
walker = new GraphWalker(dbServices, nodeId, simple, cfg);
} else {
walker = new GraphWalker(dbServices, simple, cfg);
}
NewlineFilterStream fileOutputStream = new NewlineFilterStream(new FileOutputStream(dot));
new GraphvizWriter().emit(fileOutputStream, walker);
fileOutputStream.close();
ProcessBuilder builder = new ProcessBuilder("dot", "-Tpng", dot.getAbsolutePath());
builder.redirectErrorStream(true);
Process process = builder.start();
final InputStream inputStream = process.getInputStream();
final BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
ByteStreams.copy(bufferedInputStream, out);
}
开发者ID:FTSRG,
项目名称:codemodel-rifle,
代码行数:28,
代码来源:ExportGraph.java
示例7: cfgdot
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void cfgdot(String branchId) throws IOException {
Transaction transaction = dbServices.beginTx();
final File dot = File.createTempFile("dot", null);
dot.deleteOnExit();
Walker walker = new CfgWalker(dbServices);
GraphvizWriter writer = new GraphvizWriter();
writer.emit(out, walker);
}
开发者ID:FTSRG,
项目名称:codemodel-rifle,
代码行数:12,
代码来源:ExportGraph.java
示例8: populate
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void populate() {
if (null == graph)
throw new IllegalStateException("Illegal state for 'graph' attribute in Propoli.populate(): the db is not connected");
try (Transaction tx = graph.beginTx()) {
Node zero, x2, x3, x4, x5;
(zero = graph.createNode()).setProperty(ID, "0");
(one = graph.createNode()).setProperty(ID, "1");
(x2 = graph.createNode()).setProperty(ID, "2");
(x3 = graph.createNode()).setProperty(ID, "3");
(x4 = graph.createNode()).setProperty(ID, "4");
(x5 = graph.createNode()).setProperty(ID, "5");
Relationship relationship;
(relationship = x3.createRelationshipTo(x2, RelTypes.CHILD_HI)).setProperty(PROB, 0.1);
(relationship = x3.createRelationshipTo(zero, RelTypes.CHILD_LO)).setProperty(PROB, 0.9);
(relationship = x2.createRelationshipTo(one, RelTypes.CHILD_HI)).setProperty(PROB, 0.5);
(relationship = x2.createRelationshipTo(x4, RelTypes.CHILD_LO)).setProperty(PROB, 0.5);
(relationship = x4.createRelationshipTo(x5, RelTypes.CHILD_HI)).setProperty(PROB, 0.4);
(relationship = x4.createRelationshipTo(zero, RelTypes.CHILD_LO)).setProperty(PROB, 0.6);
(relationship = x5.createRelationshipTo(one, RelTypes.CHILD_HI)).setProperty(PROB, 0.5);
(relationship = x5.createRelationshipTo(zero, RelTypes.CHILD_LO)).setProperty(PROB, 0.5);
root = x3;
try {
OutputStream out = new ByteArrayOutputStream();
GraphvizWriter writer = new GraphvizWriter();
writer.emit(out, Walker.fullGraph(graph));
System.out.println(out.toString());
} catch (IOException e) {
}
tx.success();
}
}
开发者ID:stefano-bragaglia,
项目名称:NeoDD,
代码行数:35,
代码来源:Propoli.java
示例9: dump
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void dump(String path) {
if (null == path || (path = path.trim()).isEmpty())
throw new IllegalArgumentException("Illegal 'path' argument in Problem.dump(String): " + path);
try (Transaction ignore = graph.beginTx()) {
try {
File file = new File(path);
OutputStream out = new FileOutputStream(file);
GraphvizWriter writer = new GraphvizWriter();
writer.emit(out, Walker.fullGraph(graph));
} catch (IOException e) {
throw new IllegalArgumentException("Illegal 'path' argument in Problem.dump(String): " + path);
}
}
}
开发者ID:stefano-bragaglia,
项目名称:NeoDD,
代码行数:15,
代码来源:Problem.java
示例10: dump
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
public void dump(String path) {
if (null == path || (path = path.trim()).isEmpty())
throw new IllegalArgumentException("Illegal 'path' argument in Kimmig.dump(String): " + path);
try (Transaction ignore = graph.beginTx()) {
try {
File file = new File(path);
OutputStream out = new FileOutputStream(file);
GraphvizWriter writer = new GraphvizWriter();
writer.emit(out, Walker.fullGraph(graph));
} catch (IOException e) {
throw new IllegalArgumentException("Illegal 'path' argument in Kimmig.dump(String): " + path);
}
}
}
开发者ID:stefano-bragaglia,
项目名称:NeoDD,
代码行数:15,
代码来源:Kimmig.java
示例11: drawGraph
点赞 2
import org.neo4j.visualization.graphviz.GraphvizWriter; //导入依赖的package包/类
void drawGraph() throws IOException {
GraphvizWriter writer = new GraphvizWriter();
Walker walker = Walker.fullGraph(graphDb);
new File("target/owl_cases").mkdirs();
writer.emit(new File("target/owl_cases/" + getTestName() + ".dot"), walker);
}
开发者ID:SciGraph,
项目名称:SciGraph,
代码行数:7,
代码来源:OwlTestCase.java