The service will be shut down on April 1st. Please see this page for more information.

The GUESS .gdf format


The GUESS .gdf format

The file structure for the .gdf files is very simple. We will basically define the nodes with their properties followed by the edges with theirs.

The node definition section starts with the line: “nodedef> name”

The nodedef line will tell GUESS what the format is of the following lines that actually describe nodes. In the simple case we are just going to have one column on each line, the node name. Nodes are required to have unique names (identifiers). You will want to avoid using anything that is not a valid Python variable name here if you want to access the nodes by this name (so setting names to just a number is probably a bad idea... try v44 or n44 instead of just "44"). When GUESS starts up, it will automatically create variables for you for each node. So if you have a node called foobarbaz, you’ll be able to talk about foobarbaz.color.

The simplest file looks something like this:

nodedef> name 

which tells GUESS that we want a node called foobar. All other aspects of the node (color, visibility, style) will be extracted from defaults. After name (the only required column), you may use pre-defined columns and new columns to set and control extra node properties. Pre-defined columns are:

These properties can also be controlled and accessed once GUESS is actually running. You can type “foobar.x” to get the x coordinate for foobar and “foobar.height = 20” to set foobar’s height.

These pre-defined attributes can be overridden by simply adding them to the list in the nodedef line. For example:

nodedef> name,x,y,color 

This will tell GUESS that you want two nodes: a blue one called foo at (0,0) and a red one called bar at (100,100). Notice that you don’t have to quote things explicitly (strings versus numbers). The system should figure that out for you (unless your string has a comma in which case you’ll want to put it in quotes).

nodedef> name,style,dept VARCHAR(32),salary INT default 40000 

This file tells GUESS that you want to have two user defined columns, dept (the department) and salary. Notice that we can define a default salary so that any new nodes added after the load will take on the default value. After running GUESS on this .gdf file you will have two nodes and be able to access these properties in the same way as the pre-defined ones. For example, typing “” will return 1 and “foo.salary” will return 50000.

nodedef> name 
edgedef> node1,node2

Which defines a star network centered on node a. It will look something like:


Edges, like nodes, can contain pre-defined and user-defined attributes in the definition lines. Valid pre-defined edge properties are:

Again, just as in the case of nodes, any user-defined edge attributes can be added by putting them on the edgedef line. Extending our previous example:

nodedef> name,style,dept VARCHAR(32),salary INT default 40000
edgedef> node1,node2,directed,relationship VARCHAR(32)
bob,alice,true,reports to
john,alice,true,reports to
bob,john,false,colleague of

Using something like this you will be able to say “(bob-john).relationship” in GUESS and get back “colleague of.”

Arrows: If your graph contains directed edges, GUESS will, by default, create an arrow at the appropriate end. You can turn this on or off for ANY graph by using the command setDirected(true) or setDirected(false) (undirected arrows are assumed to be bidirected and an arrow will appear on both ends). You can play with appearance of arrows by using the command overrideArrowLength(length) or overrideArrowWidth(width).

Node Styles

As we described above there are a number of predefined nodes styles. The following image shows these styles:


Node style 7 has its “image” field set to hplogo.jpg (a local file). It is also possible to “push” an image (a java object) to an image style node. This allows you to create new images dynamically. For example, in the scripts directory will generate an “aqua” style button for each node when convertAllToAqua() is called. The result would look something like:


Finally, it is now possible to define your own polygon shapes for nodes. By generating a style id (an integer > 100) and associating it with a Shape object in the shapeDB you will be able to create your own shapes. For example, we can create diamond, triangle, or star shapes using the following code (also in

from java.awt.geom import GeneralPath 
from java.awt import Polygon
import jarray

xpoints = jarray.array((10,5,0,5),'i')
ypoints = jarray.array((5,10,5,0),'i')

diamond = Polygon(xpoints,ypoints,4);

xpoints = jarray.array((55, 67, 109, 73, 83, 55, 27, 37, 1, 43),'i')
ypoints = jarray.array((0, 36, 36, 54, 96, 72, 96, 54, 36, 36),'i')

star = Polygon(xpoints,ypoints,10)

triangle = GeneralPath()



Running this script and applying the commands = 104, = 105, and = 106 results in the following picture:


This is a Wiki Spot wiki. Wiki Spot is a 501(c)3 non-profit organization that helps communities collaborate via wikis.