SBGNML is an XML implementation of the Systems Biology Graphical Notation. For more information, please consult http://libsbgn.sourceforge.net.

Version: LibSBGN_PD_0.1 (cf. targetNamespace attribute - as recommended by the W3C)

The PointAttributes group describes absolute 2D cartesian coordinates. Namely:

  • x (horizontal, from left to right),
  • y (vertical, from top to bottom).

The origin is located in the top-left corner of the map. There is no unit: proportions must be preserved, but the maps can be drawn at any scale. In the test files examples, to obtain a drawing similar to the reference *.png file, values in the corresponding *.sbgn file should be read as pixels.

The point element is characterized by PointAttributes, which describe absolute 2D cartesian coordinates. Namely:

  • x (horizontal, from left to right),
  • y (vertical, from top to bottom).

The origin is located in the top-left corner of the map. There is no unit: proportions must be preserved, but the maps can be drawn at any scale. In the test files examples, to obtain a drawing similar to the reference *.png file, values in the corresponding *.sbgn file should be read as pixels.

The bbox element describes a rectangle. This rectangle is defined by:

  • PointAttributes corresponding to the 2D coordinates of the top left corner,
  • width and height attributes.

The rectangle corresponds to the outer bounding box of a shape. The shape itself can be irregular (for instance in the case of some compartments).

In the case of process nodes, the bounding box only concerns the central glyph (square, or circle), the input/output ports are not included, and neither are the lines connecting them to the central glyph.

A bbox is required for all glyphs, and is optional for labels.

The label element describes the text accompanying a glyph. The text attribute is mandatory. Its position can be specified by a bbox (optional). Tools are free to display the text in any style (font, font-size, etc.)

The bbox element of a label is optional. When no bbox is defined, the bbox of the parent glyph is inherited. The label should be drawn centered horizontally and vertically in the bbox.

When the bbox is inherited, the label can freely spill outside (just like it can spill outside its parent glyph). An explicit bbox provides a stronger hint regarding what surface the label should cover. It defines an upper boundary outside of which the label should (ideally) not spill. It also represents a preferred size: the surface covered by the label can be smaller, but should ideally be as close as possible to the bbox.

In most glyphs (EPNs, unit of information, etc.), the label is supposed to be centered, so the bbox is usually omitted (unless there's a specific hint to be shared concerning the area the label should ideally cover). However, labels can be drawn anywhere inside compartments or complex, so these should preferably have an explicit bbox.

Multi-line labels are allowed. Line breaks are encoded as 
 as specified by the XML standard.

The sbgn element is the root of any SBGNML document. Currently each document must contain exactly one map element.

The map element describes a single SBGN PD map. It contains a list of glyph elements and a list of arc elements. These lists can be of any size (possibly empty).

The glyph element is:

  • either a stand-alone, high-level SBGN glyph (EPN, PN, compartment, etc),
  • or a sub-glyph (state variable, unit of information, inside of a complex, ...)

In the first case, it appears directly in the glyph list of the map. In the second case, it is a child of another glyph element.

The text inside a glyph is described:

  • either by a label element (optional) [process nodes can't have one],
  • or by a state element (optional) [for state variables only].

The state element should only be used for state variables. It replaces the label element used for other glyphs. It describes the text to be drawn inside the state variable.

The value attribute represents the state of the variable. It can be:

  • either from a predefined set of string (P, S, etc.) which correspond to specific SBO terms (cf. SBGN specs),
  • or any arbitrary string.

The variable attribute describes the site where the modification described by the value attribute occurs. It is:

  • optional when there is only one state variable on the parent EPN,
  • required when there is more than one state variable the parent EPN.

The clone element (which is optional) means the glyph carries a clone marker. It can contain an optional label.

The bbox element is mandatory and unique: exactly one per glyph. It defines the outer bounding box of the glyph. The actual shape of the glyph can be irregular (for instance in the case of some compartments)

In the case of process nodes, the bounding box only concerns the central glyph (square, or circle): the input/output ports are not included, and neither are the lines connecting them to the central glyph.

A glyph element can contain any number of children glyph elements. In practice, this should only happen in the following cases:

  • a compartment with unit of information children,
  • an EPN with states variables and/or unit of information children,
  • a complex, with state variables, unit of info, and/or EPN children.

The port element describes an anchor point which arcs can refer to as a source or target. It consists in:

  • absolute 2D cartesian coordinates (PointAttribute),
  • a unique id attribute.

Two port elements are required for process nodes. They represent the extremity of the two "arms" which protrude on both sides of the core of the glyph (= square or circle shape). Other glyphs don't need ports (but can use them if desired).

The xsd:ID type is an alphanumeric identifier, starting with a letter. Port IDs often contain the ID of their glyph, followed by a local port number (e.g. glyph4.1, glyph4.2, etc.) However, this style convention is not mandatory, and IDs should never be interpreted as carrying any meaning.

The class attribute defines the semantic of the glyph, and influences:

  • the way that glyph should be rendered,
  • the overall syntactic validity of the map.

The various classes encompass the following SBGN elements:

  • Entity Pool Nodes (EPN),
  • Process Nodes (PN),
  • Logic Operator Nodes,
  • Sub-glyphs on Nodes (State Variable, Unit of Information),
  • Sub-glyphs on Arcs (Stoichiometry Label),
  • Other glyphs (Compartment, Submap, Tag, Terminal).

The orientation attribute is used to express how to draw asymmetric glyphs. The orientation of Process Nodes is either horizontal or vertical. It refers to an (imaginary) line connecting the two in/out sides of the PN. The orientation of Tags and Terminals can be left, right, up or down. It refers to the direction the arrow side of the glyph is pointing at.

The xsd:ID type is an alphanumeric identifier, starting with a letter. It is recommended to generate meaningless IDs (e.g. "glyph1234") and avoid IDs with a meaning (e.g. "epn_ethanol")

The arc element describes an SBGN arc between two SBGN nodes. It contains:

  • an optional stoichiometry marker,
  • a mandatory source and target (glyph or port),
  • a geometric description of its whole path, from start to end.

This path can involve any number of straight lines or quadratic/cubic Bezier curves.

An arc can contain a single optional sub-glyph. This glyph must be a stoichiometry marker (square with a numeric label)

The start element represents the starting point of the arc's path. It is unique and mandatory.

The next element represents the next point in the arc's path. Between the start and the end of the path, there can be any number (even zero) of next elements (intermediate points). They are read consecutively: start, next, next, ..., next, end. When the path from the previous point to this point is not straight, this element also contains a list of control points (between 1 and 2) describing a Bezier curve (quadratic if 1 control point, cubic if 2) between the previous point and this point.

List of control points, used when the path describes a curve. The number of points describes the degree of the Bezier curve: linear (0), quadratic (1) or cubic (2)

The end element represents the ending point of the arc's path. It is unique and mandatory. When the path from the previous point to this point is not straight, this element also contains a list of control points (between 1 and 2) describing a Bezier curve (quadratic if 1 control point, cubic if 2) between the previous point and this point.

List of control points, used when the path describes a curve. The number of points describes the degree of the Bezier curve: linear (0), quadratic (1) or cubic (2)

The class attribute defines the semantic of the arc, and influences:

  • the way that arc should be rendered,
  • the overall syntactic validity of the map.

The various classes encompass all possible types of SBGN arcs:

  • production and consumption arcs,
  • all types of modification arcs,
  • logic arcs,
  • equivalence arcs.
To express a reversible reaction, use production arcs on both sides of the Process Node.

The source attribute can refer:

  • either to the id of a glyph,
  • or to the id of a port on a glyph.

The target attribute can refer:

  • either to the id of a glyph,
  • or to the id of a port on a glyph.