Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.22 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.22 KB

Welcome to JenaJung

JUNG is a very useful toolkit for working with and visualising graphs in java. JenaJung provides little glue to make Jena models work as (read only) JUNG graphs.

An Example

Model model = FileManager.get().loadModel("http://example.com/data.rdf");
Graph<RDFNode, Statement> g = new JenaJungGraph(model);

Layout<RDFNode, Statement> layout = new FRLayout(g);
layout.setSize(new Dimension(300, 300));
BasicVisualizationServer<RDFNode, Statement> viz =
        new BasicVisualizationServer<RDFNode, Statement>(layout);
RenderContext context = viz.getRenderContext();
context.setEdgeLabelTransformer(Transformers.EDGE); // property label
context.setVertexLabelTransformer(Transformers.NODE); // node label
viz.setPreferredSize(new Dimension(350, 350));
JFrame frame = new JFrame("Jena Graph");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(viz);
frame.pack();
frame.setVisible(true);

See the examples, which show how to produce png and svg images from JUNG.

ToDo

There are undoubtedly bugs. It's also pretty inefficient.