안녕하세요 간단한 graphML 파일이 있습니다. GraphML에서 노드 태그를 제거하고 다른 GraphML 파일에 저장하고 싶습니다. 주어진 GraphML 크기는 3GB 이하입니다.GraphML 파일을 다른 파일로 변환
입력 파일 :
<?xml version="1.0" ?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd">
<key id="weight" for="edge" attr.name="weight" attr.type="string"></key>
<graph id="G" edgedefault="directed">
<node id="1"></node>
<node id="2">
</node>
<node id="3">
</node>
<node id="4">
</node>
<node id="5">
</node>
<edge id="6" source="1" target="2">
<data key="weight">3</data>
</edge>
<edge id="7" source="2" target="4">
<data key="weight">1</data>
</edge>
<edge id="8" source="2" target="3">
<data key="weight">9</data>
</edge>
</graph>
</graphml>
필수 출력 :
<?xml version="1.0" ?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd">
<key id="weight" for="edge" attr.name="weight" attr.type="string"></key>
<graph id="G" edgedefault="directed">
<edge id="6" source="1" target="2">
<data key="weight">3</data>
</edge>
<edge id="7" source="2" target="4">
<data key="weight">1</data>
</edge>
<edge id="8" source="2" target="3">
<data key="weight">9</data>
</edge>
</graph>
</graphml>
이 작업을 수행 할 수있는 방법이 있습니까?
사실, 문제는 파일 크기입니다. 나는 [xml.etree.ElementTree] (https://docs.python.org/3.4/library/xml.etree.elementtree.html#module-xml.etree.ElementTree) 파이썬 라이브러리를 사용하여 동일한 작업을 수행했다. – arjun045