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

Version: LibSBGN Milestone 2 (cf. targetNamespace attribute - as recommended by the W3C)

The SBGNBase type is the base type of all main components in SBGN. It supports attaching metadata, notes and annotations to components.

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 bbox element on a map is not mandatory, it allows the application to define a canvas, and at the same time define a whitespace margin around the glyphs.

If a bbox is defined on a map, all glyphs and arcs must be inside this bbox, otherwise they could be clipped off by applications.

Language of the map: one of three sublanguages defined by SBGN. Different languages have different restrictions on the usage of sub-elements (that are not encoded in this schema but must be validated with an external validator)

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 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.

A state must have a value, a variable, or both. If it has both, they are rendered as a concatenated string with @ in between.

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 callout element is only used for glyphs with class annotation. It contains the coordinate of the point where the annotation points to, as well as a reference to the element that is pointed to.

The entity is only used in activity flow diagrams. It can only be used on a unit of information glyph on a biological activity glyph, where it is compulsory. It is used to indicate the shape of this unit of information.

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 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 PD 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).
And the following ER SBGN elements
  • Entities (Entity, Outcome)
  • Other (Annotation, Phenotype)
  • Auxiliary on glyps (Existence, Location)
  • Auxiliary on arcs (Cardinality)
  • Delay operator
  • implicit xor

The orientation attribute is used to express how to draw asymmetric glyphs. In PD, 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. In PD, 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")

Reference to the ID of the compartment that this glyph is part of. Only use this if there is at least one explicit compartment present in the diagram. Compartments are only used in PD and AF, and thus this attribute as well. For PD, this should be used only for EPN's.

In case there are no compartments, entities that can have a location, such as EPN's, are implicit member of an invisible compartment that encompasses the whole map. In that case, this attribute must be omitted.

The compartment order attribute can be used to define a drawing order for compartments. It enables tools to draw compartments in the correct order especially in the case of overlapping compartments. Compartments are only used in PD and AF, and thus this attribute as well.

The attribute is of type float, the attribute value has not to be unique. Compartments with higher compartment order are drawn on top. The attribute is optional and should only be used for compartments.

The arc group describes a set of arcs and glyphs that together have a relation. For example

  • For ER: interaction arcs around an interaction glyph,
  • ...
Note that, in spite of the name, an arcgroup contains both arcs and glyphs.

An arcgroup can contain glyphs. For example, in an interaction arcgroup, there must be one interaction glyph.

An arcgroup can have multiple arcs. They are all assumed to form a single hyperarc-like structure.

The class attribute defines the semantic of the arcgroup.

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

  • For PD: an optional stoichiometry marker,
  • For ER: an optional cardinality marker, zero or more ports (influence targets), and zero or more outcomes,
  • 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.

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

In ER, an arc can contain several sub-glyphs. This can be zero or one cardinality glyphs (e.g. cis or trans), plus zero to many outcome glyphs (black dot)

Ports are only allowed in ER.

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 xsd:ID type is an alphanumeric identifier, starting with a letter.

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.