GraphML does not support vector types, but they are in the GraphML extension used by graph-tool and Netzschleuder.
A workaround that allows importing graphs in this extended GraphML format is to replace all vector types by a string in which elements are separated by a comma, as suggested here.
from pathlib import Path
graphml_filename = 'path to file'
# Gets the text from the GraphML file.
graphml_content = Path(graphml_filename).read_text()
# What substring should be replaced by what.
strmap = {
'attr.type="vector_string"': 'attr.type="string"',
'attr.type="vector_float"': 'attr.type="string"'
# more types could be added here
}
# Does the subtitution.
for oldstr, newstr in strmap.items():
graphml_content = graphml_content.replace(oldstr, newstr)
# The standardized GraphML content can then be directly loaded in NetworkX
import networkx as nx
graph = nx.parse_graphml(graphml_content)
# or it can be saved to file
with open(graphml_filename.replace('.xml', '_std.xml').replace('.graphml', '_std.graphml'), 'w') as f:
f.write(graphml_content)