4.1.10.3. rule/GraphInterface

class Rule.LeftGraph

A proxy object representing the left graph of the rule. The class implements the protocols.LabelledGraph protocol,

rule

(Read-only) The rule the graph belongs to.

Type:

Rule

class Vertex

A descriptor of either a vertex in a left side, or a null vertex. Implements the protocols.LabelledGraph.Vertex protocol. Additionally, the id is in the range \([0, numCoreVertices[\).

core

(Read-only) The descriptor for this vertex in the core graph.

Type:

Rule.Vertex

rule

(Read-only) The rule the vertex belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class Edge

A descriptor of either an edge in a left side, or a null edge. Implements the protocols.LabelledGraph.Edge protocol.

core

(Read-only) The descriptor for this edge in the core graph.

Type:

Rule.Edge

rule

(Read-only) The rule the edge belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class VertexRange

Implements the protocols.Graph.VertexRange protocol.

class EdgeRange

Implements the protocols.Graph.EdgeRange protocol.

class IncidentEdgeRange

Implements the protocols.Graph.IncidentEdgeRange protocol.

class Rule.ContextGraph

A proxy object representing the context graph of the rule. The class implements the protocols.Graph protocol,

rule

(Read-only) The rule the graph belongs to.

Type:

Rule

class Vertex

A descriptor of either a vertex in a context, or a null vertex. Implements the protocols.Graph.Vertex protocol. Additionally, the id is in the range \([0, numCoreVertices[\).

core

(Read-only) The descriptor for this vertex in the core graph.

Type:

Rule.Vertex

rule

(Read-only) The rule the vertex belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class Edge

A descriptor of either an edge in a context, or a null edge. Implements the protocols.LabelledGraph.Edge protocol.

core

(Read-only) The descriptor for this edge in the core graph.

Type:

Rule.Edge

graph

(Read-only) The rule the edge belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class VertexRange

Implements the protocols.Graph.VertexRange protocol.

class EdgeRange

Implements the protocols.Graph.EdgeRange protocol.

class IncidentEdgeRange

Implements the protocols.Graph.IncidentEdgeRange protocol.

class Rule.RightGraph

A proxy object representing the right graph of the rule. The class implements the protocols.LabelledGraph protocol,

rule

(Read-only) The rule the graph belongs to.

Type:

Rule

class Vertex

A descriptor of either a vertex in a right side, or a null vertex. Implements the protocols.LabelledGraph.Vertex protocol. Additionally, the id is in the range \([0, numCoreVertices[\).

core

(Read-only) The descriptor for this vertex in the core graph.

Type:

Rule.Vertex

rule

(Read-only) The rule the vertex belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class Edge

A descriptor of either an edge in a right side, or a null edge. Implements the protocols.LabelledGraph.Edge protocol.

core

(Read-only) The descriptor for this edge in the core graph.

Type:

Rule.Edge

rule

(Read-only) The rule the edge belongs to.

Type:

Rule

Raises:

LogicError if it is a null descriptor.

class VertexRange

Implements the protocols.Graph.VertexRange protocol.

class EdgeRange

Implements the protocols.Graph.EdgeRange protocol.

class IncidentEdgeRange

Implements the protocols.Graph.IncidentEdgeRange protocol.

class Rule.Vertex

Implements the protocols.Graph.Vertex protocol. Additionally, the id is in the range \([0, numVertices[\).

rule

An alias for protocols.Graph.Vertex.graph.

Type:

Rule

left

(Read-only) A null descriptor if this vertex is not in the left graph, otherwise the descriptor of this vertex in the left graph.

Type:

LeftGraph.Vertex

context

(Read-only) A null descriptor if this vertex is not in the context graph, otherwise the descriptor of this vertex in the context graph.

Type:

ContextGraph.Vertex

right

(Read-only) A null descriptor if this vertex is not in the right graph, otherwise the descriptor of this vertex in the right graph.

Type:

RightGraph.Vertex

get2DX(withHydrogens=True)
Returns:

the x-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and without certain hydrogens.

Return type:

float

Raises:

LogicError if it is a null descriptor, or if withHydrogens is True and the vertex is a “clean” hydrogen.

get2DY(withHydrogens=True)
Returns:

the y-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and without certain hydrogens.

Return type:

float

Raises:

LogicError if it is a null descriptor, or if withHydrogens is True and the vertex is a “clean” hydrogen.

class Rule.Edge

Implements the protocols.Graph.Edge protocol.

rule

An alias for protocols.Graph.Edge.graph.

Type:

Rule

left

(Read-only) A null descriptor if this edge is not in the left graph, otherwise the descriptor of this edge in the left graph.

Type:

LeftGraph.Edge

context

(Read-only) A null descriptor if this edge is not in the context graph, otherwise the descriptor of this edge in the context graph.

Type:

ContextGraph.Edge

right

(Read-only) A null descriptor if this edge is not in the right graph, otherwise the descriptor of this edge in the right graph.

Type:

RightGraph.Edge

class Rule.VertexRange

Implements the protocols.Graph.VertexRange protocol, in addition to the following functionality.

__getitem__(i)
Returns:

the ith vertex of the graph.

Return type:

Rule.Vertex

class Rule.EdgeRange

Implements the protocols.Graph.EdgeRange protocol.

class Rule.IncidentEdgeRange

Implements the protocols.Graph.IncidentEdgeRange protocol.