Skip to content

Calpano/graphinout

Repository files navigation

GraphInOut: Graph In → Graph Out

  • Convert between graph formats

  • Advanced converters usually include support for graph/node/edge labels/attributes, nested graphs, hyper-edges, …​

  • As intermediate formate the modern GraphML successor Connected JSON (CJ) (spec: https://j-s-o-n.org) is used. It has all features of GraphML, but even more extensible JSON data support on all entities.

Input Formats

Graphinout reads many common graph file formats

  • GraphML,

  • Connected JSON,

  • GML,

  • GraphViz/DOT,

  • Graph6,

  • Trivial Graph Format,

  • Adjacency List Format of NetworkX)

into CJ and writes losslessly to many output graph file formats.

Output Formats
  • GraphML,

  • Connected JSON,

  • GML,

  • GraphViz/DOT, and

  • Trivial Graph Format.

Note
Earlier versions of GraphInOut used GraphML as the lingua franca, but we since then switched to Connected JSON.

Maven Coordinates

<dependency>
    <groupId>com.graphinout</groupId>
    <artifactId>engine</artifactId>
    <version>0.1.6</version>
</dependency>

Purpose

There are many graph toolkits, graph databases and graph-based apps, which all implement their importers and map incoming graph to their internal APIs. As there are so many variants of graphs and even more kinds of internal APIs, there is no "common Java graph API" in sight. GraphInOut develops into the 'pandoc of graph file formats'.

Benefits
App developers

of graph-related software can focus on core features. Need only to implement one importer for Connected JSON (CJ) to be able to import a bunch for graph formats.

Converter developers

easy to add more input formats

Users

can re-use their existing data effortlessly using almost any format their data-producing software writes.

Features

  • Parses input and either converts to valid output file, or

  • Shows comprehensible validation errors [Ok, we need to improve here].

  • Easy to integrate into existing software.

  • Written in modern Java (17+).

Non-Features
  • Java graph API

  • Convert relational data (CSV, Excel, databases) into graphs

Usage

GraphInOut can be used as a Java library to read format X (GioReader) and write format Y (GioWriter). See GioEngineCore as currently the best entry point.

You can use this lib in the free online service for graph conversion running at https://graphinout.com

Road Map

Issues

You found a bug or want a feature? Please file an issue.

Questions?

Ask DeepWiki

Background: Introduction to Graphs

A graph is first a mathematical concept. As it turns out, it is rather a family of concepts. A good introduction into the general idea can be found in Wikipedia on Graph Theory. In computer science, a graph is an abstract data type, see Wikipedia. An exhausting glossary of graph theory explains all terms with a special meaning in a graph context.

Note
Graph vs. Graph File Format
Don’t confuse graph file format features with graph features. Graph features such as a cycle-free graph do not depend on the file format. Graph features depend on the kind of data stored in a graph file format. A graph file format needs to be able to represent e.g. directed graphs. All formats which do can represent cycle-free directed graphs as well as graphs with cycles. There are many, many graph concepts, which are not required to understand or even know when converting graph input data is your job.
Graph File Format Features
  • undirected graphs

  • directed graphs Wikipedia

  • mixed graph: mix of directed and undirected edges

  • self-loops: An edge from a node A to itself

  • parallel edges aka multi-edges: Multiple edges from a node A to another node B

  • edge attributes (e.g. type of edge or weight)

  • node attributes (e.g. type of node or weight)

  • hyper-graphs: edges with more than 2 endpoints

About

Graph Input/Output Converter – GraphML Reader/Writer in Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 7

Languages