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:
object
A GraphML Key specification on how to convert attributes of nodes
Note: Unlike the GraphML key
element, no domain is stored. SeeKeyDomain
for 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:
object
A GraphML edge element
-
class
graphi.graph_io.graphml.elements.
GraphMLNode
(identifier, attributes)¶ Bases:
object
A GraphML node element
-
class
graphi.graph_io.graphml.elements.
KeyDomain
(domain, keys)¶ Bases:
object
The GraphML domain to which keys apply
A
KeyDomain
represents all keys of a given domain. A GraphMLkey
element with adomain
is represented by aDataKey
stored 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 element
is of the wrong domain.
-
-
class
graphi.graph_io.graphml.elements.
QualifiedTag
(namespace, localname)¶ Bases:
object
An XML tag consisting of (optional) namespace and local name
-
classmethod
from_tag
(tag)¶ Parse an
{namespace}localname
tag to aQualifiedTag
-
classmethod