This class exports GXL or GTXL XML files by converting them from Hypergraph and GTS objects respectively.
More...
#include <GTXLWriterXerces.h>
|
bool | storeGraphIDs |
| A value of true will cause the internally used ID of a graph to be stored as its name in the exported file.
|
|
bool | storeRuleIDs |
| A value of true will cause the internally used ID of a rule to be stored as its name in the exported file.
|
|
|
void | writeHypergraph (xercesc::DOMElement *gxlRoot, graphs::Hypergraph const &graph) const |
| Takes a Hypergraph, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement. More...
|
|
void | writeHypergraph (xercesc::DOMElement *gxlRoot, graphs::AnonHypergraph const &graph) const |
| Takes an AnonHypergraph, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement. More...
|
|
xercesc::DOMElement * | writeHypergraph (xercesc::DOMElement *gxlRoot, graphs::AnonHypergraph const &graph, IDType const &graphID) const |
| Implements the writeHypergraph functions for Hypergraph and AnonHypergraph. More...
|
|
void | writeStdRule (xercesc::DOMElement *gtxlRoot, graphs::Rule const &rule) const |
| Takes a Rule, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement. More...
|
|
void | writeUQRule (xercesc::DOMElement *gtxlRoot, graphs::UQRule const &rule) const |
| Takes a UQRule, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement. More...
|
|
void | writeRule (xercesc::DOMElement *gtxlRoot, graphs::AnonRule const &rule, IDType id, vector< unordered_set< IDType >> const *leftUQids, vector< unordered_set< IDType >> const *rightUQids) const |
| This function is a generalized implementation of writeStdRule(...) and writeUQRule(...). More...
|
|
string | generateGraphID (const IDType &graphID) const |
| Generates a unique XML ID for a Hypergraph. More...
|
|
string | generateVertexID (const IDType &nodeID, const IDType &graphID) const |
| Generates a unique XML ID for a vertex of a graph. More...
|
|
string | generateEdgeID (const IDType &edgeID, const IDType &graphID) const |
| Generates a unique XML ID for an edge of a graph. More...
|
|
string | generateRuleID (const IDType &ruleID) const |
| Generates a unique XML ID for a Rule. More...
|
|
string | generateLeftRulegraphID (const IDType &ruleID) const |
| Generates a unique XML ID for the left graph of a Rule. More...
|
|
string | generateRightRulegraphID (const IDType &ruleID) const |
| Generates a unique XML ID for the right graph of a Rule. More...
|
|
|
XMLCh * | xmlch_gxl |
|
XMLCh * | xmlch_graph |
|
XMLCh * | xmlch_edgeids |
|
XMLCh * | xmlch_true |
|
XMLCh * | xmlch_hypergraph |
|
XMLCh * | xmlch_id |
|
XMLCh * | xmlch_edgemode |
|
XMLCh * | xmlch_undirected |
|
XMLCh * | xmlch_node |
|
XMLCh * | xmlch_vertex |
|
XMLCh * | xmlch_rel |
|
XMLCh * | xmlch_attr |
|
XMLCh * | xmlch_name |
|
XMLCh * | xmlch_string |
|
XMLCh * | xmlch_label |
|
XMLCh * | xmlch_relend |
|
XMLCh * | xmlch_target |
|
XMLCh * | xmlch_role |
|
XMLCh * | xmlch_startorder |
|
XMLCh * | xmlch_int |
|
XMLCh * | xmlch_gts |
|
XMLCh * | xmlch_initial |
|
XMLCh * | xmlch_rule |
|
XMLCh * | xmlch_lhs |
|
XMLCh * | xmlch_rhs |
|
XMLCh * | xmlch_rulegraph |
|
XMLCh * | xmlch_mapping |
|
XMLCh * | xmlch_mapelem |
|
XMLCh * | xmlch_from |
|
XMLCh * | xmlch_to |
|
XMLCh * | xmlch_quantification |
|
XMLCh * | xmlch_elem |
|
XMLCh * | xmlch_ref |
|
This class exports GXL or GTXL XML files by converting them from Hypergraph and GTS objects respectively.
Xerces is used as underlying framework.
- Author
- Jan Stückrath
Creates a new GTXLWriterXerces object, which includes initialization of the Xerces framework.
No additional initialization is needed.
Destroys the GTXLWriterXerces object.
This also frees all resources reserved for Xerces.
string generateEdgeID |
( |
const IDType & |
edgeID, |
|
|
const IDType & |
graphID |
|
) |
| const |
|
private |
Generates a unique XML ID for an edge of a graph.
If the given graphID is not unique, the generated ID will only be unique within the graph.
- Parameters
-
edgeID | the internal ID of the edge |
graphID | the internal ID of the graph containing the edge |
- Returns
- a unique XML ID for a edge
string generateGraphID |
( |
const IDType & |
graphID | ) |
const |
|
private |
Generates a unique XML ID for a Hypergraph.
- Parameters
-
graphID | the internal ID of the represented Hypergraph |
- Returns
- a unique XML ID for a Hypergraph
string generateLeftRulegraphID |
( |
const IDType & |
ruleID | ) |
const |
|
private |
Generates a unique XML ID for the left graph of a Rule.
- Parameters
-
ruleID | the internal ID of the represented Rule |
- Returns
- a unique XML ID for the left graph of a Rule
string generateRightRulegraphID |
( |
const IDType & |
ruleID | ) |
const |
|
private |
Generates a unique XML ID for the right graph of a Rule.
- Parameters
-
ruleID | the internal ID of the represented Rule |
- Returns
- a unique XML ID for the right graph of a Rule
string generateRuleID |
( |
const IDType & |
ruleID | ) |
const |
|
private |
Generates a unique XML ID for a Rule.
- Parameters
-
ruleID | the internal ID of the represented Rule |
- Returns
- a unique XML ID for a Rule
string generateVertexID |
( |
const IDType & |
nodeID, |
|
|
const IDType & |
graphID |
|
) |
| const |
|
private |
Generates a unique XML ID for a vertex of a graph.
If the given graphID is not unique, the generated ID will only be unique within the graph.
- Parameters
-
nodeID | the internal ID of the vertex |
graphID | the internal ID of the graph containing the vertex |
- Returns
- a unique XML ID for a vertex
bool getGraphIDStorage |
( |
| ) |
const |
|
inherited |
Returns whether internal graph IDs will be exported.
- Returns
- true, iff internal graph IDs will exported
bool getRuleIDStorage |
( |
| ) |
const |
|
inherited |
Returns whether internal rule IDs will be exported.
- Returns
- ture, iff internal rule IDs will be exported
Use this method to generate a new GTXLWriter object.
No initialization is needed before use.
- Returns
- a pointer to a new GTXLWriter object
Use this method to generate a new GTXLWriter object.
No initialization is needed before use.
- Warning
- The caller has to properly delete the GTXLWriter after use to avoid memory leaks.
- Returns
- a pointer to a new GTXLWriter object
void setGraphIDStorage |
( |
bool |
value | ) |
|
|
inherited |
Sets whether the graph IDs used internally will be stored in the resulting file.
- Parameters
-
value | use 'true' if the graph IDs will be stored |
void setRuleIDStorage |
( |
bool |
value | ) |
|
|
inherited |
Sets whether internal rule IDs should be stores in the resulting file.
- Parameters
-
value | use 'true if the rule IDs should be stored |
void writeGTXL |
( |
graphs::GTS const & |
gts, |
|
|
boost::filesystem::path & |
filename |
|
) |
| const |
|
overridevirtual |
This method takes a GTS object and stores it as a GTXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
gts | the GTS object to be stored |
filename | the filename of the resulting GTXL file |
Implements GTXLWriter.
void writeGTXL |
( |
graphs::GTS const & |
gts, |
|
|
string |
filename |
|
) |
| const |
|
virtualinherited |
This method takes a GTS object and stores it as a GTXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
gts | the GTS object to be stored |
filename | the filename of the resulting GTXL file |
void writeGXL |
( |
vector< graphs::Hypergraph_sp > const & |
graphs, |
|
|
boost::filesystem::path & |
filename |
|
) |
| const |
|
overridevirtual |
This method takes a collection of Hypergraphs and stores the collection as a GXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
graphs | a pointer to a vector of Hypergraphs to be stored |
filename | the filename of the resulting GXL file |
Implements GTXLWriter.
This method takes a collection of Hypergraphs and stores the collection as a GXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
graphs | a pointer to a vector of Hypergraphs to be stored |
filename | the filename of the resulting GXL file |
This method takes a single Hypergraph and stores it as a GXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
graph | a pointer to the Hypergraph to be stored |
filename | the filename of the resulting GXL file |
This method takes a single Hypergraph and stores it as a GXL XML-file with the given filename.
If the file already exists, it is overwritten (if possible).
- Parameters
-
graph | a pointer to the Hypergraph to be stored |
filename | the filename of the resulting GXL file |
void writeHypergraph |
( |
xercesc::DOMElement * |
gxlRoot, |
|
|
graphs::Hypergraph const & |
graph |
|
) |
| const |
|
private |
Takes a Hypergraph, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement.
- Parameters
-
gxlRoot | the DOMElement where the Hypergraph should be added as child |
graph | the Hypergraph to be converted |
Takes an AnonHypergraph, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement.
This function is the same as the variant for Hypergraphs, but the graphs ID (which it does not have) will never be stored even if the option is set. Additionally elements of this graph will not have a unique (XML) ID outside the graph itself.
- Parameters
-
gxlRoot | the DOMElement where the AnonHypergraph should be added as child |
graph | the AnonHypergraph to be converted |
Implements the writeHypergraph functions for Hypergraph and AnonHypergraph.
- Parameters
-
gxlRoot | the DOMElement where the graph should be added as child |
graph | the graph which should be added |
graphID | the ID of the given graph; this can be any value, but should be the Hypergraphs ID or 0 if the graph is an real AnonHypergraph |
- Returns
- the DOMElement generated for the given graph (already added to the document tree)
void writeRule |
( |
xercesc::DOMElement * |
gtxlRoot, |
|
|
graphs::AnonRule const & |
rule, |
|
|
IDType |
id, |
|
|
vector< unordered_set< IDType >> const * |
leftUQids, |
|
|
vector< unordered_set< IDType >> const * |
rightUQids |
|
) |
| const |
|
private |
This function is a generalized implementation of writeStdRule(...) and writeUQRule(...).
It creates a DOMElement from for the given rule, using the given ID and marks parts of the rule as belonging to quantifications. Which elements are marked this ways is defined in the two given vectors. The created DOMElement is added as a child of the given DOMElement.
- Parameters
-
gtxlRoot | the DOMElement where the converted rule will be added as a child |
rule | the rule to be converted in a DOMElement |
id | the ID of the rule |
leftUQids | a vector of sets of IDs of the left-hand side of the rule; the i-th set of the vector contains all elements belonging to the i-th Quantification of the rule |
rightUQids | a vector of sets of IDs of the right-hand side of the rule; the i-th set of the vector contains all elements belonging to the i-th Quantification of the rule |
void writeStdRule |
( |
xercesc::DOMElement * |
gtxlRoot, |
|
|
graphs::Rule const & |
rule |
|
) |
| const |
|
private |
Takes a Rule, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement.
- Parameters
-
gtxlRoot | the DOMElement where the Rule should be added as child |
rule | the Rule to be converted |
void writeUQRule |
( |
xercesc::DOMElement * |
gtxlRoot, |
|
|
graphs::UQRule const & |
rule |
|
) |
| const |
|
private |
Takes a UQRule, converts it to a DOMElement and adds the resulting object as a child of the given DOMElement.
- Parameters
-
gtxlRoot | the DOMElement where the UQRule should be added as child |
rule | the UQRule to be converted |
The documentation for this class was generated from the following files:
- /home/stueckrath/eclipse_ws/Uncover/src/io/GTXLWriterXerces.h
- /home/stueckrath/eclipse_ws/Uncover/src/io/GTXLWriterXerces.cpp