graphi.graph_io.graphml.elements module¶
Representations of the elements in a GraphML document
-
class
graphi.graph_io.graphml.elements.DataKey(identifier, attr_name, attr_type, default=None)¶ Bases:
objectA GraphML Key specification on how to convert attributes of nodes
Note: Unlike the GraphML keyelement, no domain is stored. SeeKeyDomainfor its equivalent.-
types= {'boolean': <type 'bool'>, 'double': <type 'float'>, 'float': <type 'float'>, 'int': <type 'int'>, 'long': <type 'int'>, 'string': <type 'str'>}¶
-
-
class
graphi.graph_io.graphml.elements.GraphMLEdge(identifier, source, target, directed, attributes)¶ Bases:
objectA GraphML edge element
-
class
graphi.graph_io.graphml.elements.GraphMLNode(identifier, attributes)¶ Bases:
objectA GraphML node element
-
class
graphi.graph_io.graphml.elements.KeyDomain(domain, keys)¶ Bases:
objectThe GraphML domain to which keys apply
A
KeyDomainrepresents all keys of a given domain. A GraphMLkeyelement with adomainis represented by aDataKeystored in the correspondingKeyDomain.-
GRAPHML_DOMAINS= ('graph', 'node', 'edge', 'all')¶
-
compile_attributes(element)¶ Compile a dictionary of attributes from a graphml element for this domain
Note: The validity of the domain is currently not checked. In the future, an error may be thrown if elementis of the wrong domain.
-
-
class
graphi.graph_io.graphml.elements.QualifiedTag(namespace, localname)¶ Bases:
objectAn XML tag consisting of (optional) namespace and local name
-
classmethod
from_tag(tag)¶ Parse an
{namespace}localnametag to aQualifiedTag
-
classmethod