Introduction
Example
Distribution
Tutorials
Applications
News
People
Publications
Hints

Hints

Some commonly used access methods in graph grammars under Python (to be replaced by a more user-friendly approach):

  • To access a node with label n (attribute GGlabel of the node on the LHS):
    node = self.LHS.getMatched(graphId, self.LHS.nodeWithLabel(n))
  • To access an attribute a of node n, obtained as before:
    attr = node.a
  • To obtain the actual value:
    attr_val = node.a.getValue()
  • To change it's value (not recommended; should be done by the return statement of the ``specify'' action of the attribute in the node on the RHS):
    node.a.setValue(new_value)