The Parser class Main class for network file parsing and loading Supports GraphML, Pajek, Adjacency, Graphviz, UCINET, EdgeLists etc. More...
#include <parser.h>


Signals | |
void | addRelation (const QString &relName, const bool &changeRelation=false) |
void | relationSet (int) |
void | createNode (const int &num, const int &size, const QString &color, const QString &numColor, const int &numSize, const QString &label, const QString &lColor, const int &lSize, const QPointF &p, const QString &shape, const QString &iconPath=QString(), const bool &signalMW=false) |
void | createNodeAtPosRandom (const bool &signalMW=false) |
void | createNodeAtPosRandomWithLabel (const int &num, const QString &label, const bool &signalMW=false) |
void | edgeCreate (const int &source, const int &target, const qreal &weight, const QString &color, const int &edgeDirType, const bool &arrows, const bool &bezier, const QString &edgeLabel=QString(), const bool &signalMW=false) |
void | networkFileLoaded (int fileType, QString fileName, QString netName, int totalNodes, int totalLinks, int edgeDirType, const QString &message=QString()) |
void | removeDummyNode (int) |
void | finished (QString) |
Public Member Functions | |
Parser () | |
~Parser () | |
void | load (const QString fn, const QString codec, const int iNS, const QString iNC, const QString iNSh, const QString iNNC, const int iNNS, const QString iNLC, const int iNLS, const QString iEC, const int w, const int h, const int format, const int sm_mode, const QString delim=QString()) |
Loads the network calling one of the load* methods. More... | |
bool | loadPajek () |
bool | loadAdjacency () |
Tries to load the file as adjacency sociomatrix-formatted. If not it returns -1. More... | |
bool | loadDot () |
bool | loadGraphML () |
Tries to load a file as GraphML (not GML) formatted network. If not GraphML, it returns false. More... | |
bool | loadGML () |
bool | loadGW () |
bool | loadDL () |
bool | readDLKeywords (QStringList &strList, int &N, int &NM, int &NR, int &NC, bool &fullmatrixFormat, bool &edgelist1Format) |
bool | loadEdgeListSimple (const QString &delimiter) |
bool | loadEdgeListWeighed (const QString &delimiter) |
A method to load a weighted edge list formatted file. More... | |
bool | loadTwoModeSociomatrix () |
void | readDotProperties (QString str, qreal &, QString &label, QString &shape, QString &color, QString &fontName, QString &fontColor) |
bool | readGraphML (QXmlStreamReader &) |
Checks the xml token name and calls the appropriate function. Called from loadGraphML. More... | |
void | readGraphMLElementGraph (QXmlStreamReader &) |
Reads a graph definition Called at Graph element. More... | |
void | readGraphMLElementNode (QXmlStreamReader &) |
void | endGraphMLElementNode (QXmlStreamReader &) |
void | readGraphMLElementEdge (QXmlStreamAttributes &) |
void | endGraphMLElementEdge (QXmlStreamReader &) |
void | readGraphMLElementData (QXmlStreamReader &) |
Reads data for edges and nodes called at a data element (usually nested inside a node or an edge element) More... | |
void | readGraphMLElementUnknown (QXmlStreamReader &) |
void | readGraphMLElementKey (QXmlStreamAttributes &) |
bool | xmlStreamHasAttribute (QXmlStreamAttributes &, QString) const |
void | readGraphMLElementDefaultValue (QXmlStreamReader &) |
Reads default key values Called at a default element (usually nested inside key element) More... | |
void | readGraphMLElementNodeGraphics (QXmlStreamReader &) |
void | readGraphMLElementEdgeGraphics (QXmlStreamReader &) |
void | createMissingNodeEdges () |
bool | isComment (QString str) |
void | createRandomNodes (const int &fixedNum=1, const QString &label=QString(), const int &newNodes=1) |
Parser::createRandomNodes. More... | |
void | loadFileError (const QString &errorMessage) |
Parser::loadFileError. More... | |
Detailed Description
The Parser class Main class for network file parsing and loading Supports GraphML, Pajek, Adjacency, Graphviz, UCINET, EdgeLists etc.
Constructor & Destructor Documentation
◆ Parser()
Parser::Parser | ( | ) |
◆ ~Parser()
Parser::~Parser | ( | ) |
Member Function Documentation
◆ addRelation
|
signal |
◆ createMissingNodeEdges()
void Parser::createMissingNodeEdges | ( | ) |
◆ createNode
|
signal |
◆ createNodeAtPosRandom
|
signal |
◆ createNodeAtPosRandomWithLabel
|
signal |
◆ createRandomNodes()
void Parser::createRandomNodes | ( | const int & | fixedNum = 1 , |
const QString & | label = QString() , |
||
const int & | newNodes = 1 |
||
) |
- Parameters
-
fixedNum label newNodes Creates either a new node numbered fixedNum or newNodes nodes numbered from 1 to to newNodes
◆ edgeCreate
|
signal |
◆ endGraphMLElementEdge()
void Parser::endGraphMLElementEdge | ( | QXmlStreamReader & | xml | ) |
◆ endGraphMLElementNode()
void Parser::endGraphMLElementNode | ( | QXmlStreamReader & | xml | ) |
◆ finished
|
signal |
◆ isComment()
bool Parser::isComment | ( | QString | str | ) |
◆ load()
void Parser::load | ( | const QString | fn, |
const QString | codec, | ||
const int | iNS, | ||
const QString | iNC, | ||
const QString | iNSh, | ||
const QString | iNNC, | ||
const int | iNNS, | ||
const QString | iNLC, | ||
const int | iNLS, | ||
const QString | iEC, | ||
const int | w, | ||
const int | h, | ||
const int | format, | ||
const int | sm_mode, | ||
const QString | delim = QString() |
||
) |
Loads the network calling one of the load* methods.
◆ loadAdjacency()
bool Parser::loadAdjacency | ( | ) |
Tries to load the file as adjacency sociomatrix-formatted. If not it returns -1.
- Returns
- bool
◆ loadDL()
bool Parser::loadDL | ( | ) |
Tries to load a file as DL-formatted network (UCINET) If not it returns -1
◆ loadDot()
bool Parser::loadDot | ( | ) |
Tries to load the file as Dot (Graphviz) formatted network. If not it returns -1
◆ loadEdgeListSimple()
bool Parser::loadEdgeListSimple | ( | const QString & | delimiter | ) |
◆ loadEdgeListWeighed()
bool Parser::loadEdgeListWeighed | ( | const QString & | delimiter | ) |
A method to load a weighted edge list formatted file.
- Parameters
-
delimiter
- Returns
- This method can read and parse edgelist formated files where edge source and target are either named with numbers or with labels That is the following formats can be parsed:
edgelist with node numbers
1 2 1 1 3 2 1 6 2 1 8 2 ...
edgelist with node labels
actor1 actor2 1 actor2 actor4 2 actor1 actor3 1 actorX actorY 3 name othername 1 othername somename 2 ....
◆ loadFileError()
void Parser::loadFileError | ( | const QString & | errorMessage | ) |
◆ loadGML()
bool Parser::loadGML | ( | ) |
Tries to load a file as GML formatted network. If not it returns -1
◆ loadGraphML()
bool Parser::loadGraphML | ( | ) |
Tries to load a file as GraphML (not GML) formatted network. If not GraphML, it returns false.
- Returns
◆ loadGW()
bool Parser::loadGW | ( | ) |
◆ loadPajek()
bool Parser::loadPajek | ( | ) |
Tries to load the file as Pajek-formatted network. If not it returns -1
SPLIT EACH LINE (ON EMPTY SPACE CHARACTERS) IN SEVERAL ELEMENTS
READING NODES
NODELABEL
NODESHAPE: There are five possible .
NODECOLORS
READ NODE COORDINATES
START NODE CREATION
EDGES
ARCS
ARCSlist
matrix
◆ loadTwoModeSociomatrix()
bool Parser::loadTwoModeSociomatrix | ( | ) |
Tries to load the file as two-mode sociomatrix. If not it returns -1
◆ networkFileLoaded
|
signal |
◆ readDLKeywords()
bool Parser::readDLKeywords | ( | QStringList & | strList, |
int & | N, | ||
int & | NM, | ||
int & | NR, | ||
int & | NC, | ||
bool & | fullmatrixFormat, | ||
bool & | edgelist1Format | ||
) |
◆ readDotProperties()
void Parser::readDotProperties | ( | QString | str, |
qreal & | nValue, | ||
QString & | label, | ||
QString & | shape, | ||
QString & | color, | ||
QString & | fontName, | ||
QString & | fontColor | ||
) |
◆ readGraphML()
bool Parser::readGraphML | ( | QXmlStreamReader & | xml | ) |
Checks the xml token name and calls the appropriate function. Called from loadGraphML.
- Parameters
-
xml
- Returns
◆ readGraphMLElementData()
void Parser::readGraphMLElementData | ( | QXmlStreamReader & | xml | ) |
Reads data for edges and nodes called at a data element (usually nested inside a node or an edge element)
- Parameters
-
xml
◆ readGraphMLElementDefaultValue()
void Parser::readGraphMLElementDefaultValue | ( | QXmlStreamReader & | xml | ) |
Reads default key values Called at a default element (usually nested inside key element)
- Parameters
-
xml
◆ readGraphMLElementEdge()
void Parser::readGraphMLElementEdge | ( | QXmlStreamAttributes & | xmlStreamAttr | ) |
◆ readGraphMLElementEdgeGraphics()
void Parser::readGraphMLElementEdgeGraphics | ( | QXmlStreamReader & | xml | ) |
◆ readGraphMLElementGraph()
void Parser::readGraphMLElementGraph | ( | QXmlStreamReader & | xml | ) |
Reads a graph definition Called at Graph element.
- Parameters
-
xml
◆ readGraphMLElementKey()
void Parser::readGraphMLElementKey | ( | QXmlStreamAttributes & | xmlStreamAttr | ) |
◆ readGraphMLElementNode()
void Parser::readGraphMLElementNode | ( | QXmlStreamReader & | xml | ) |
◆ readGraphMLElementNodeGraphics()
void Parser::readGraphMLElementNodeGraphics | ( | QXmlStreamReader & | xml | ) |
Reads node graphics data and properties: label, color, shape, size, coordinates, etc.
◆ readGraphMLElementUnknown()
void Parser::readGraphMLElementUnknown | ( | QXmlStreamReader & | xml | ) |
◆ relationSet
|
signal |
◆ removeDummyNode
|
signal |
◆ xmlStreamHasAttribute()
bool Parser::xmlStreamHasAttribute | ( | QXmlStreamAttributes & | xmlStreamAttr, |
QString | str | ||
) | const |
Member Data Documentation
◆ arrows
|
private |
◆ arrowSize
|
private |
◆ bez_p1_x
|
private |
◆ bez_p1_y
|
private |
◆ bez_p2_x
|
private |
◆ bez_p2_y
|
private |
◆ bezier
|
private |
◆ bool_edge
|
private |
◆ bool_key
|
private |
◆ bool_node
|
private |
◆ conv_OK
|
private |
◆ delimiter
|
private |
◆ edge_directed
|
private |
◆ edge_id
|
private |
◆ edge_source
|
private |
◆ edge_target
|
private |
◆ edge_weight
|
private |
◆ edgeColor
|
private |
◆ edgeDirType
|
private |
◆ edgeLabel
|
private |
◆ edgeMissingNodesList
|
private |
◆ edgeMissingNodesListData
|
private |
◆ edgesMissingNodesHash
|
private |
◆ edgeType
|
private |
◆ edgeWeight
|
private |
◆ errorMessage
|
private |
◆ fileContainsLinkColors
|
private |
◆ fileContainsLinkLabels
|
private |
◆ fileContainsNodeColors
|
private |
◆ fileContainsNodeCoords
|
private |
◆ fileDirPath
|
private |
◆ fileFormat
|
private |
◆ fileName
|
private |
◆ firstModeMultiMap
|
private |
◆ gwHeight
|
private |
◆ gwWidth
|
private |
◆ initEdgeColor
|
private |
◆ initEdgeLabel
|
private |
◆ initEdgeWeight
|
private |
◆ initNodeColor
|
private |
◆ initNodeCustomIcon
|
private |
◆ initNodeLabelColor
|
private |
◆ initNodeLabelSize
|
private |
◆ initNodeNumberColor
|
private |
◆ initNodeNumberSize
|
private |
◆ initNodeShape
|
private |
◆ initNodeSize
|
private |
◆ key_id
|
private |
◆ key_name
|
private |
◆ key_type
|
private |
◆ key_value
|
private |
◆ key_what
|
private |
◆ keyDefaultValue
|
private |
◆ keyFor
|
private |
◆ keyName
|
private |
◆ keyType
|
private |
◆ missingNode
|
private |
◆ networkName
|
private |
◆ node_id
|
private |
◆ nodeColor
|
private |
◆ nodeHash
|
private |
◆ nodeIconPath
|
private |
◆ nodeLabel
|
private |
◆ nodeLabelColor
|
private |
◆ nodeLabelSize
|
private |
◆ nodeNumberColor
|
private |
◆ nodeNumberSize
|
private |
◆ nodeShape
|
private |
◆ nodeSize
|
private |
◆ randX
|
private |
◆ randY
|
private |
◆ relationsList
|
private |
◆ secondModeMultiMap
|
private |
◆ source
|
private |
◆ target
|
private |
◆ totalLinks
|
private |
◆ totalNodes
|
private |
◆ two_sm_mode
|
private |
◆ userSelectedCodecName
|
private |
◆ xml
|
private |
The documentation for this class was generated from the following files:
- app/src/parser.h
- app/src/parser.cpp