# 3.1.9.2. rule/GraphInterface¶

## 3.1.9.2.1. Class RuleLeftGraph¶

class mod.RuleLeftGraph

A proxy object representing the left graph of the rule.

rule

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

Type: Rule
numVertices

(Read-only) The number of vertices in the graph.

Type: int
vertices

(Read-only) An iterable of all vertices in the graph.

Type: RuleLeftGraphVertexRange
numEdges

(Read-only) The number of edges in the graph.

Type: int
edges

(Read-only) An iterable of all edges in the graph.

Type: RuleLeftGraphEdgeRange

## 3.1.9.2.2. Class RuleLeftGraphVertex¶

class mod.RuleLeftGraphVertex

A descriptor of either a vertex in a left side, or a null vertex.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
id

(Read-only) The index of the vertex. It will be in the range $$[0, numCoreVertices[$$.

Type: int LogicError if it is a null descriptor.
rule

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleVertex
degree

(Read-only) The degree of the vertex.

Type: int LogicError if it is a null descriptor.
incidentEdges

(Read-only) A range of incident edges to this vertex.

Type: RuleLeftGraphIncidentEdgeRange LogicError if it is a null descriptor.
stringLabel

(Read-only) The string label of the vertex.

Type: string LogicError if it is a null descriptor.
atomId

(Read-only) The atom id of the vertex.

Type: AtomId LogicError if it is a null descriptor.
charge

(Read-only) The charge of the vertex.

Type: Charge LogicError if it is a null descriptor.
radical

Type: bool LogicError if it is a null descriptor.
printStereo()
printStereo(p)

Print the stereo configuration for the vertex.

Parameters: p (GraphPrinter) – the printing options used for the depiction. the name of the PDF-file that will be compiled in post-processing. string LogicError if it is a null descriptor.

## 3.1.9.2.3. Class RuleLeftGraphEdge¶

class mod.RuleLeftGraphEdge

A descriptor of either an edge in a left side, or a null edge.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
graph

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleEdge
source

(Read-only) The source vertex of the edge.

Type: RuleLeftGraphVertex LogicError if it is a null descriptor.
target

(Read-only) The target vertex of the edge.

Type: RuleLeftGraphVertex LogicError if it is a null descriptor.
stringLabel

(Read-only) The string label of the edge.

Type: string LogicError if it is a null descriptor.
bondType

(Read-only) The bond type of the edge.

Type: BondType LogicError if it is a null descriptor.

## 3.1.9.2.4. Class RuleContextGraph¶

class mod.RuleContextGraph

A proxy object representing the context graph of the rule.

rule

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

Type: Rule
numVertices

(Read-only) The number of vertices in the graph.

Type: int
vertices

(Read-only) An iterable of all vertices in the graph.

Type: RuleContextGraphVertexRange
numEdges

(Read-only) The number of edges in the graph.

Type: int
edges

(Read-only) An iterable of all edges in the graph.

Type: RuleContextGraphEdgeRange

## 3.1.9.2.5. Class RuleLeftGraphVertex¶

class mod.RuleLeftGraphVertex

A descriptor of either a vertex in a context, or a null vertex.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
id

(Read-only) The index of the vertex. It will be in the range $$[0, numCoreVertices[$$.

Type: int LogicError if it is a null descriptor.
rule

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleVertex
degree

(Read-only) The degree of the vertex.

Type: int LogicError if it is a null descriptor.
incidentEdges

(Read-only) A range of incident edges to this vertex.

Type: RuleContextGraphIncidentEdgeRange LogicError if it is a null descriptor.

## 3.1.9.2.6. Class RuleContextGraphEdge¶

class mod.RuleContextGraphEdge

A descriptor of either an edge in a context, or a null edge.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
graph

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleEdge
source

(Read-only) The source vertex of the edge.

Type: RuleContextGraphVertex LogicError if it is a null descriptor.
target

(Read-only) The target vertex of the edge.

Type: RuleContextGraphVertex LogicError if it is a null descriptor.

## 3.1.9.2.7. Class RuleRightGraph¶

class mod.RuleRightGraph

A proxy object representing the right graph of the rule.

rule

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

Type: Rule
numVertices

(Read-only) The number of vertices in the graph.

Type: int
vertices

(Read-only) An iterable of all vertices in the graph.

Type: RuleRightGraphVertexRange
numEdges

(Read-only) The number of edges in the graph.

Type: int
edges

(Read-only) An iterable of all edges in the graph.

Type: RuleRightGraphEdgeRange

## 3.1.9.2.8. Class RuleRightGraphVertex¶

class mod.RuleRightGraphVertex

A descriptor of either a vertex in a right side, or a null vertex.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
id

(Read-only) The index of the vertex. It will be in the range $$[0, numCoreVertices[$$.

Type: int LogicError if it is a null descriptor.
rule

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleVertex
degree

(Read-only) The degree of the vertex.

Type: int LogicError if it is a null descriptor.
incidentEdges

(Read-only) A range of incident edges to this vertex.

Type: RuleRightGraphIncidentEdgeRange LogicError if it is a null descriptor.
stringLabel

(Read-only) The string label of the vertex.

Type: string LogicError if it is a null descriptor.
atomId

(Read-only) The atom id of the vertex.

Type: AtomId LogicError if it is a null descriptor.
charge

(Read-only) The charge of the vertex.

Type: Charge LogicError if it is a null descriptor.
radical

Type: bool LogicError if it is a null descriptor.
printStereo()
printStereo(p)

Print the stereo configuration for the vertex.

Parameters: p (GraphPrinter) – the printing options used for the depiction. the name of the PDF-file that will be compiled in post-processing. string LogicError if it is a null descriptor.

## 3.1.9.2.9. Class RuleRightGraphEdge¶

class mod.RuleRightGraphEdge

A descriptor of either an edge in a right side, or a null edge.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
graph

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

Type: Rule LogicError if it is a null descriptor.
core

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

Type: RuleEdge
source

(Read-only) The source vertex of the edge.

Type: RuleRightGraphVertex LogicError if it is a null descriptor.
target

(Read-only) The target vertex of the edge.

Type: RuleRightGraphVertex LogicError if it is a null descriptor.
stringLabel

(Read-only) The string label of the edge.

Type: string LogicError if it is a null descriptor.
bondType

(Read-only) The bond type of the edge.

Type: BondType LogicError if it is a null descriptor.

## 3.1.9.2.10. Class RuleVertex¶

class mod.RuleVertex

A descriptor of either a vertex in a rule, or a null vertex.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
id

(Read-only) The index of the vertex. It will be in the range $$[0, numVertices[$$.

Type: int LogicError if it is a null descriptor.
rule

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

Type: Rule LogicError if it is a null descriptor.
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.

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.

left

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

degree

(Read-only) The degree of the vertex.

Type: int LogicError if it is a null descriptor.
incidentEdges

(Read-only) A range of incident edges to this vertex.

Type: RuleIncidentEdgeRange LogicError if it is a null descriptor.
get2DX(withHydrogens=True)
Returns: the x-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and wihout certain hydrogens. float 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 wihout certain hydrogens. float LogicError if it is a null descriptor, or if withHydrogens is True and the vertex is a “clean” hydrogen.

## 3.1.9.2.11. Class RuleEdge¶

class mod.RuleEdge

A descriptor of either an edge in a rule, or a null edge.

__init__(self)

Constructs a null descriptor.

isNull()
Returns: whether this is a null descriptor or not. bool
rule

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

Type: Rule LogicError if it is a null descriptor.
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.

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.

left

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

source

(Read-only) The source vertex of the edge.

Type: RuleVertex LogicError if it is a null descriptor.
target

(Read-only) The target vertex of the edge.

Type: RuleVertex LogicError if it is a null descriptor.