[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] graphml broken?

From: Tamás Nepusz
Subject: Re: [igraph] graphml broken?
Date: Mon, 12 Dec 2011 20:26:12 +0100


1) <data> tags in GraphML should have no "attr.type" attributes, only "key" -- 
at least according to the GraphML DTD: 

2) You are probably missing the <key id="ts" for="edge" attr.name="ts" 
attr.type="float"/> tag from within the <graphml> tag. The point here is that 
attribute names and type should be specified in advance (i.e. outside the  
<graph> tag) using <key> tags, and later on you only refer to the ID of the key 
from the <data> tag using <data key="your_key_id">.

So, IMHO your GraphML file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns";
  <key id="ts" for="edge" attr.name="ts" attr.type="float"/>
  <graph id="G" ....>
    <edge source="..." target="...">
      <data key="ts">.....</data>

Let me know if this did not work for you.


On 12 Dec 2011, at 18:06, Claudio Martella wrote:

> Hello,
> i'm running igraph 0.5.4 on python 2.7.
> I'm loading my GraphML file but I get this warning:
> /usr/local/share/python/ipython:1: RuntimeWarning: unknown attribute
> key in GraphML file, ignoring attribute at foreign-graphml.c:660
> #!/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
> at igraph.Graph.Read_GraphML(...)
> the only attributes i'm using for my graph are the edge data attributes:
>    <edge source="1542" target="1782">
>      <data key="ts" attr.type="float">1322829863.192513</data>
>    </edge>
>    <edge source="1542" target="4119">
>      <data key="ts" attr.type="float">1322829863.192513</data>
>    </edge>
>    <edge source="1542" target="4151">
>      <data key="ts" attr.type="float">1322829865.293222</data>
>    </edge>
>    ...
> as vertices are easy:
>    <node id="1234"/>
> What's wrong with this usage of attributes?
> -- 
>    Claudio Martella
>    address@hidden
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help

reply via email to

[Prev in Thread] Current Thread [Next in Thread]