#include <Rule.hh>
|
typedef std::map< size_t,
std::set< RuleCnP > > | CopyAndPasteOperations |
|
typedef boost::adjacency_list
< boost::vecS, boost::vecS,
boost::undirectedS,
CoreGraph_NodeProperties,
CoreGraph_EdgeProperties > | CoreGraph |
|
typedef boost::property
< EdgeLabelProperty,
std::string, boost::property
< EdgeContextProperty,
RuleContext > > | CoreGraph_EdgeProperties |
|
typedef boost::property
< NodeIndexProperty, size_t,
boost::property
< NodeLabelProperty,
std::string, boost::property
< NodeRightLabelProperty,
std::string, boost::property
< NodeContextProperty,
RuleContext > > > > | CoreGraph_NodeProperties |
| The properties available for the nodes of a CoreGraph. More...
|
|
typedef boost::edge_name_t | EdgeLabelProperty |
|
typedef std::vector
< sgm::Pattern_Interface::Match_Constraint * > | MatchConstraintVec |
| vector of constraints to be matched More...
|
|
typedef boost::vertex_index_t | NodeIndexProperty |
|
typedef boost::vertex_name_t | NodeLabelProperty |
|
typedef std::map< size_t, size_t > | NodeMap |
|
typedef std::vector< size_t > | NodeVec |
| Vector of node indices. More...
|
|
typedef std::map< size_t, NodeVec > | OutEdgeMap |
|
enum | RuleContext { RULE_LEFT_SIDE = 2,
RULE_RIGHT_SIDE = 3,
RULE_LABEL_CHANGE = (RULE_LEFT_SIDE * RULE_RIGHT_SIDE),
RULE_CONTEXT = 5 * RULE_LABEL_CHANGE
} |
|
|
virtual bool | decodeConsistencyStatus (const size_t consistencyCode, std::ostream &errorStream, const bool completeCheck=true) |
|
const RuleSide & | getContext (void) const |
|
const CopyAndPasteOperations & | getCopyAndPasteOperations (void) const |
|
const CoreGraph & | getCore (void) const |
|
const std::string & | getID (void) const |
|
const RuleSide & | getLeftSide (void) const |
|
const MatchConstraintVec & | getMatchConstraints (void) const |
|
const RuleSide & | getRightSide (void) const |
|
virtual const std::string * | getUsedWildcard (void) const |
|
virtual size_t | isConsistent (void) const |
|
Rule & | operator= (const Rule &toCopy) |
|
| Rule (const CoreGraph &core, const std::string &id, const std::string *wildcardToUse=NULL) |
|
| Rule (const CoreGraph &core, const std::string &id, const MatchConstraintVec &matchConstraints, const std::string *wildcardToUse=NULL) |
|
| Rule (const CoreGraph &core, const std::string &id, const MatchConstraintVec &matchConstraints, const CopyAndPasteOperations ©AndPaste, const std::string *wildcardToUse=NULL) |
|
| Rule (const Rule &toCopy) |
|
void | setID (const std::string &newID) |
|
virtual void | setUsedWildcard (const std::string *const wildcardToUse) |
|
virtual | ~Rule () |
| Destruction. More...
|
|
Graph grammar rule data
A description of a graph grammar rule with left and righ rule side and
context description.
- Author
- Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/
Definition at line 57 of file Rule.hh.
container definition to store copy-and-Paste operations to do the key value defines the source node of the copy-and-Paste
Definition at line 313 of file Rule.hh.
The definition of a the internal graph representation of a graph grammar rule of undirected graphs.
Definition at line 153 of file Rule.hh.
The properties available for the edges of a CoreGraph
NOTE: EdgeContextProperty is NOT TO BE allowed to be RULE_LABEL_CHANGE.
Label changes of edges are to be encoded by insertion and deletion of
the edge, ie. present two times with according RULE_LEFT_SIDE and
RULE_RIGHT_SIDE EdgeContextProperty value.
Definition at line 142 of file Rule.hh.
This boost graph property is used to determine the label of a given edge. If the specified edge changes the label in the left and right side of the graph grammar rule, this property specifies the label of the LEFT side of the edge.
Definition at line 124 of file Rule.hh.
This boost graph property is used to determine the index of a given node along the iterator order.
Definition at line 91 of file Rule.hh.
This boost graph property is used to determine the label of a given node. If the specified node changes the label in the left and right side of the graph grammar rule, this property specifies the label of the LEFT side of the node.
Definition at line 97 of file Rule.hh.
If a node has outgoing edges, this class contains the indices of the ends of these edges.
Definition at line 77 of file Rule.hh.
A type definition to encode the different use cases of a node or edge of a graph grammar rule.
Enumerator |
---|
RULE_LEFT_SIDE |
graph element is ONLY part of the left rule side
|
RULE_RIGHT_SIDE |
graph element is ONLY part of the right rule side
|
RULE_LABEL_CHANGE |
node is part of the both rule sides but the LABEL is CHANGING. NOTE: only valid for nodes!!!
|
RULE_CONTEXT |
graph element is part of the both rule sides = context of the rule
|
Definition at line 83 of file Rule.hh.
ggl::Rule::Rule |
( |
const CoreGraph & |
core, |
|
|
const std::string & |
id, |
|
|
const std::string * |
wildcardToUse = NULL |
|
) |
| |
Construction of a rule based on the given boost graph based core description.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
wildcardToUse | the wildcard string to be used for the left side pattern matching, or NULL if no wildcard to be applied |
ggl::Rule::Rule |
( |
const CoreGraph & |
core, |
|
|
const std::string & |
id, |
|
|
const MatchConstraintVec & |
matchConstraints, |
|
|
const std::string * |
wildcardToUse = NULL |
|
) |
| |
Construction of a rule based on the given boost graph based core description and the additional constraints of the left side matching.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
matchConstraints | the additional constraints for the matching of the left side of the rule |
wildcardToUse | the wildcard string to be used for the left side pattern matching, or NULL if no wildcard to be applied |
Construction of a rule based on the given boost graph based core description and the additional constraints of the left side matching.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
matchConstraints | the additional constraints for the matching of the left side of the rule |
copyAndPaste | the copy-and-Paste operations to perform |
wildcardToUse | the wildcard string to be used for the left side pattern matching, or NULL if no wildcard to be applied |
ggl::Rule::Rule |
( |
const Rule & |
toCopy | ) |
|
Copy construction.
- Parameters
-
toCopy | the Rule to make this a copy of |
virtual ggl::Rule::~Rule |
( |
| ) |
|
|
virtual |
static bool ggl::Rule::checkEdgeContext |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks the context assumptions of all edges, ie.
- context edges have to connect context nodes,
- left side edges have to connect left or context nodes, and
- right side edges have to connect right or context nodes.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all edges show correct context use; false otherwise
virtual bool ggl::Rule::decodeConsistencyStatus |
( |
const size_t |
consistencyCode, |
|
|
std::ostream & |
errorStream, |
|
|
const bool |
completeCheck = true |
|
) |
| |
|
virtual |
Writes a description of the consistency status or errors, encoded in a consistency code produced by isConsistent*(...), to a given outstream. The function returns whether or not an error occured.
- Parameters
-
consistencyCode | the error code to parse, produced by a call to isConsistent(...) |
errorStream | the output stream to write the error decription to |
completeCheck | if true: tries to decode the whole consistencyCode and reports an error message if this is not possible. if false: decodes and reports only the known error codes from consistencyCode |
- Returns
- true if no error is encoded; false otherwise
Reimplemented in ggl::chem::ChemRule.
const RuleSide& ggl::Rule::getContext |
( |
void |
| ) |
const |
Access to the context of the Rule that is fixed during the Rule application and that is present in the left and right side of the Rule.
- Returns
- the context
Access to the copy-and-Paste operations to perform
- Returns
- the CnP operation container
const CoreGraph& ggl::Rule::getCore |
( |
void |
| ) |
const |
Access to the core graph that encodes the whole Rule.
- Returns
- the Rule's core graph
const std::string& ggl::Rule::getID |
( |
void |
| ) |
const |
Access to the string identifier or description of the Rule.
- Returns
- the identifier
const RuleSide& ggl::Rule::getLeftSide |
( |
void |
| ) |
const |
Access to the left side pattern of the rule that has to be matched when the Rule is applied.
- Returns
- the left side pattern
Access to the match constraints to fulfill for each left side match
- Returns
- the match constraint container
const RuleSide& ggl::Rule::getRightSide |
( |
void |
| ) |
const |
Access to the right side pattern that is produced after the Rule was applied.
- Returns
- the right side pattern
Utility member function to derive the node information that describes a certain part of the Rule.
- Parameters
-
graph | the core graph that contains the whole information |
level | identifies what RuleSide is of interest |
- Returns
- the vector of node indices of the requested RuleSide
virtual const std::string* ggl::Rule::getUsedWildcard |
( |
void |
| ) |
const |
|
virtual |
Access to the wildcard string to use for left side pattern matching
- Returns
- the wildcard or NULL if no wildcard is to be applied
Reimplemented in ggl::chem::ChemRule.
virtual size_t ggl::Rule::isConsistent |
( |
void |
| ) |
const |
|
virtual |
Checks whether or not this rule is a consistent one. If not, a combination of according error codes is given.
- Returns
- the value is either C_Consistent, or a product of all other consistency error codes encountered
Reimplemented in ggl::chem::ChemRule.
Rule& ggl::Rule::operator= |
( |
const Rule & |
toCopy | ) |
|
Assignment operator
- Parameters
-
toCopy | the Rule to make this a copy of |
- Returns
- *this
void ggl::Rule::setID |
( |
const std::string & |
newID | ) |
|
Sets the string identifier or description of the Rule.
- Parameters
-
newID | the new identifier to set |
virtual void ggl::Rule::setUsedWildcard |
( |
const std::string *const |
wildcardToUse | ) |
|
|
virtual |
Sets the wildcard string to use for left side pattern matching. To disable wildcard matching set the wildcard to NULL.
- Parameters
-
wildcardToUse | the wildcard to be applied or NULL if no wildcard matching should be done. |
Reimplemented in ggl::chem::ChemRule.
const size_t ggl::Rule_ConCodes::C_Consistent |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_NoID |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_WrongEdgeContext |
|
staticinherited |
std::string ggl::Rule::id |
|
protected |
std::string* ggl::Rule::wildcard |
|
protected |
The documentation for this class was generated from the following file: