igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Graph Attributes


From: Gábor Csárdi
Subject: Re: [igraph] Graph Attributes
Date: Thu, 26 Feb 2009 15:00:56 +0100

Domingo,

I think that the <key> tags should come before <graph>. I haven't
checked the specification, but igraph writes GraphML files like this,
so I assume this is the right way.

So, put all <key>...</key> tags before <graph> and it works well.

I'll check the specification to see whether your file is valid.

Best,
G.

On Thu, Feb 26, 2009 at 2:52 PM, Domingo Vargas <address@hidden> wrote:
> Dear Igraphers
>
> I have been working on a program that generates graphml files from various
> sources. As far as I have tested it, the XML structure seems to be right for
> node and edge representation. My problem is with the attributes and so far I
> haven't found a way to generate a file that R/Igraph could accept without
> warning messages.
> The warning messages are the following:
> a <-
> read.graph("/Users/dvar/Developments/t2graph/red.graphml",format="graphml")
>
> There were 50 or more warnings (use warnings() to see the first 50)
>
>> warnings()
> 1: In read.graph.graphml(file, ...) :
>   At foreign-graphml.c:634 :unknown attribute key in GraphML file, ignoring
> attribute
> 2: In read.graph.graphml(file, ...) :
>   At foreign-graphml.c:634 :unknown attribute key in GraphML file, ignoring
> attribute
> 3: In read.graph.graphml(file, ...) :
> <SNIP>
> Any advise would be gladly welcome.
> Best Regards!!!
> -dv
> PD1. This is the file structure of the XML file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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.0/graphml.xsd";>
> <graph id="my first graph" edgedefault="undirected">
> <key id="x" for="node" attr.name="x" attr.type="float">
> </key>
> <key id="y" for="node" attr.name="y" attr.type="float">
> </key>
> <key id="z" for="node" attr.name="z" attr.type="float">
> </key>
> <key id="v_size" for="node" attr.name="v_size" attr.type="float">
> </key>
> <key id="shape" for="node" attr.name="shape" attr.type="string">
> </key>
> <key id="ic_color" for="node" attr.name="ic_color" attr.type="string">
> </key>
> <key id="bc_color" for="node" attr.name="bc_color" attr.type="string">
> </key>
> <key id="lc_color" for="node" attr.name="lc_color" attr.type="string">
> </key>
> <key id="value" for="edge" attr.name="value" attr.type="float">
> </key>
> <key id="color" for="edge" attr.name="color" attr.type="string">
> </key>
> <key id="label" for="edge" attr.name="label" attr.type="string">
> </key>
> <key id="time" for="edge" attr.name="event time" attr.type="int">
> </key>
> <key id="s_time" for="node" attr.name="start time" attr.type="int">
> </key>
> <key id="e_time" for="node" attr.name="end time" attr.type="int">
> </key>
> <node id = "b">
> <data key="x">2</data>
> <data key="y">4</data>
> <data key="z">6</data>
> <data key="v_size">2</data>
> <data key="shape">circle</data>
> <data key="ic_color">red</data>
> <data key="bc_color">green</data>
> <data key="lc_color">blue</data>
> <data key="s_time">1</data>
> <data key="e_time">1</data>
> </node>
> <node id = "c">
> <data key="x">3</data>
> <data key="y">6</data>
> <data key="z">9</data>
> <data key="v_size">3</data>
> <data key="shape">circle</data>
> <data key="ic_color">red</data>
> <data key="bc_color">green</data>
> <data key="lc_color">blue</data>
> <data key="s_time">1</data>
> <data key="e_time">1</data>
> </node>
> <node id = "m">
> <data key="x">2</data>
> <data key="y">4</data>
> <data key="z">6</data>
> <data key="v_size">2</data>
> <data key="shape">circle</data>
> <data key="ic_color">red</data>
> <data key="bc_color">green</data>
> <data key="lc_color">blue</data>
> <data key="s_time">1</data>
> <data key="e_time">1</data>
> </node>
> <node id = "d">
> <data key="x">5</data>
> <data key="y">10</data>
> <data key="z">15</data>
> <data key="v_size">4</data>
> <data key="shape">circle</data>
> <data key="ic_color">red</data>
> <data key="bc_color">green</data>
> <data key="lc_color">blue</data>
> <data key="s_time">1</data>
> <data key="e_time">1</data>
> </node>
> <edge id= "1" directed="false" source="b" target="c">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l1</data>
> </edge>
> <edge id= "2" directed="false" source="b" target="d">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l1</data>
> </edge>
> <edge id= "3" directed="false" source="b" target="b">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l2</data>
> </edge>
> <edge id= "4" directed="false" source="b" target="m">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l2</data>
> </edge>
> <edge id= "5" directed="false" source="c" target="d">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l1</data>
> </edge>
> <edge id= "6" directed="false" source="m" target="b">
> <data key="value">1</data>
> <data key="color">yellow</data>
> <data key="label">l2</data>
> </edge>
> </graph>
> </graphml>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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