STEM allows users to create a custom graph using a format similar to the '''Pajek''' ([http://vlado.fmf.uni-lj.si/pub/networks/pajek/]) format. The PajekNetGraphGenerator allows creating user-defined graphs for STEM and is based on this format, which is specified below. The PajekNetGraphGenerator is available in the graph creation dialogue of STEM. Please see the page [[Creating a new Graph]] for information on using this dialog.

−

The following reserved words are supported in the current Pajek Import implementation:

−

=== *Vertices n ===

+

This page is about the new '''Pajek''' format which is used in STEM releases since version 1.4.0 and in current milestone and integration builds. The old format that was used prior to 1.4.0 is still supported. Examples and documentation of the old format are available at the website download page for [http://www.eclipse.org/stem/download_sample.php?file=MultiPopulationExample_PajekGraphs.zip Multi-Population Pajek Graph Example].

−

*n denotes the number of vertices in the graph.

+

== File Format ==

−

In STEM nodes are the equivalent of vertices. The keyword "*Vertices n" is the starting point for the section, in which each vertex is described using following format:

+

STEM allows users to create a custom graph using a format similar to the '''Pajek''' ([http://vlado.fmf.uni-lj.si/pub/networks/pajek/]) format. The PajekNetGraphGenerator, which is available in the graph creation dialogue of STEM, can create user-defined graphs for STEM and is based on this format.

*label – if label starts with character a..zA..Z or 0..9 first blank determines end of the label (e.g., vertex1), labels consisting of more words must be enclosed in pair of special characters (e.g., ”vertex 1”). The definition of a label is obligatory.

+

−

*x, y, z – coordinates of vertex. The z coordinate is ignored in STEM. In Pajek the coordinates have values between 0 and 1, for STEM the values are not limited. x and y coordinates are obligatory for STEM.

+

−

*shape – shape of object which represents vertex. The following shapes are supported by the PajekNetGraphGenerator: triangle, cross, ellipse, box, diamond. In STEM ellipse is represented as circle and box and diamond both are represented as box. box is the default value.

+

The keyword "*Vertices [number of nodes]" is the starting point for the nodes section. New nodes and references to existing nodes can be defined. The formats are as follows.

−

'''Additional optional parameters:'''

+

=== New Node ===

−

*s_size – size of the node. The default size is given by the parameter “Default Area” within the PajekNetGraphGeneratorImpl dialog in STEM. For STEM the size of the node is not limited. Overlaps of nodes are not checked by the importer, they are allowed.

*origin node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.

+

*destination node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.

+

*populationID – defines the ID of the migrating population.

+

*rate - number population members migrating per day.

−

'''''v1 v2 [borderlength] [additional optional parameters]'''''

+

'''Optional parameters:'''

+

*date - specification a of date at which the migration rate is different from the standard value specified in the obligatory parameters. ISO 8601 standard is used (YYYY-MM-DD). This parameter may be used repeatedly.

+

*rate - migration rate for the specified date. This parameter may be used repeatedly. The associated date is the last mentioned one.

−

*v1 – initial vertex number. The definition of v1 is obligatory. v1 has to be defined as node (see above: vertexnum).

+

'''Example:'''

−

*v2 – terminal vertex number. The definition of v2 is obligatory. v2 has to be defined as node (see above: vertexnum).

+

1 2 popID beef rate 1.0 date 2012-01-01 rate 10.0

−

*borderlength – defines the borderlength for CommonBorderEdges

+

−

'''Additional optional parameters:'''

+

=== Containment Edges ===

−

''Parameters only valid in STEM (these parameters are ignored by Pajek):''

+

'''[containing node number] [contained node number]:'''

+

*containing node number – number of the node that contains the other node. Has to be defined as node number in *Vertices.

+

*contained node number – number of the node that is contained by the other node. Has to be defined as node number in *Vertices.

−

*popid – identifier of a population migrating on the edge. This parameter may be used repeatedly. If this parameter and additionally “rateab” or “rateba” is set at least once then a MigrationEdge will be specified in STEM, otherwise a CommonBorderEdge will be defined.

+

'''Example:'''

−

+

−

*rateab – fraction of the population in node v1 migrating over the edge to the terminal node v2 in a given time period (see http://wiki.eclipse.org/Transportation_Models#Migration_Between_Regions). This parameter may be used repeatedly. The associated popid is the last mentioned one. The default value is 0.

+

−

+

−

*rateba – fraction of the population in node v2 migrating over the edge to the node v1 in a given time period. This parameter may be used repeatedly. The associated popid is the last mentioned one. The default value is 0.

The dialog to import a Pajek graph from a file is shown on the right. It is available in the STEM Graph Dialog. The following parameters are available for importing.

+

*Pajek File - The file from which the graph is imported. A file dialog is available to select the file.

+

*Scaling Factor - A factor by which all coordinates specified in the file are scaled during import. If node has the coordinates 10.0/20.0 in the file and the scaling factor is 2.0, the node's resulting coordinates in STEM are 20.0/40.0.

+

*Node Size - In STEM each imported node appears as a square for visualization. This parameter specifies the edge length of the squares for all imported nodes.

+

*Use global Region Names - If selected, the URIs for the imported nodes will be of the type ''stem://org.eclipse.stem/node/geo/region/*****''. This has the advantage, that the nodes can be accessed by just using that last part of the URI ''*****''. This option should only be used if node names specified in the Pajek file are unique and do not occur in other STEM graphs. If not selected, the node URIs will contain the graph's URI.

+

*Move Nodes to Containers - If selected, all nodes that are contained by another node from a different graph will be moved close to this container. That means that coordinates specified for these nodes in the Pajek file will be ignored.

+

+

== Tutorial ==

+

+

A tutorial on how to import a Pajek graph that contains discrete migration events for a STEM graph is available at [[STEM Import Discrete Transportation Events|Import Discrete Transportation Events]]. Discrete events can be used to model commodity flows, e.g. the transportation of beef from slaughterhouses to supermarkets in order to model the spread of a foodborne disease.

== Contributors ==

== Contributors ==

−

The PajekNetGraphGenerator was created and developed by the Department of Biological Safety of the Federal Institute for Risk Assessment in Germany.

+

The PajekNetGraphGenerator was created and developed by the Department of Biological Safety of the Federal Institute for Risk Assessment in Germany.

Revision as of 12:53, 19 September 2013

Contents

Multi-Population Pajek Graph Example

This page is about the new Pajek format which is used in STEM releases since version 1.4.0 and in current milestone and integration builds. The old format that was used prior to 1.4.0 is still supported. Examples and documentation of the old format are available at the website download page for Multi-Population Pajek Graph Example.

File Format

STEM allows users to create a custom graph using a format similar to the Pajek ([1]) format. The PajekNetGraphGenerator, which is available in the graph creation dialogue of STEM, can create user-defined graphs for STEM and is based on this format.
The format specification is as follows.

Migration Edges

origin node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.

destination node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.

populationID – defines the ID of the migrating population.

rate - number population members migrating per day.

Optional parameters:

date - specification a of date at which the migration rate is different from the standard value specified in the obligatory parameters. ISO 8601 standard is used (YYYY-MM-DD). This parameter may be used repeatedly.

rate - migration rate for the specified date. This parameter may be used repeatedly. The associated date is the last mentioned one.

Example:

1 2 popID beef rate 1.0 date 2012-01-01 rate 10.0

Containment Edges

[containing node number] [contained node number]:

containing node number – number of the node that contains the other node. Has to be defined as node number in *Vertices.

contained node number – number of the node that is contained by the other node. Has to be defined as node number in *Vertices.

Running the downloadable pajek scenario the map view should appear as shown below.

Using the dialog

The dialog to import a Pajek graph from a file is shown on the right. It is available in the STEM Graph Dialog. The following parameters are available for importing.

Pajek File - The file from which the graph is imported. A file dialog is available to select the file.

Scaling Factor - A factor by which all coordinates specified in the file are scaled during import. If node has the coordinates 10.0/20.0 in the file and the scaling factor is 2.0, the node's resulting coordinates in STEM are 20.0/40.0.

Node Size - In STEM each imported node appears as a square for visualization. This parameter specifies the edge length of the squares for all imported nodes.

Use global Region Names - If selected, the URIs for the imported nodes will be of the type stem://org.eclipse.stem/node/geo/region/*****. This has the advantage, that the nodes can be accessed by just using that last part of the URI *****. This option should only be used if node names specified in the Pajek file are unique and do not occur in other STEM graphs. If not selected, the node URIs will contain the graph's URI.

Move Nodes to Containers - If selected, all nodes that are contained by another node from a different graph will be moved close to this container. That means that coordinates specified for these nodes in the Pajek file will be ignored.

Tutorial

A tutorial on how to import a Pajek graph that contains discrete migration events for a STEM graph is available at Import Discrete Transportation Events. Discrete events can be used to model commodity flows, e.g. the transportation of beef from slaughterhouses to supermarkets in order to model the spread of a foodborne disease.

Contributors

The PajekNetGraphGenerator was created and developed by the Department of Biological Safety of the Federal Institute for Risk Assessment in Germany.