Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Unable to read GraphML with attribute type double and value POSITIVE_INFINITY

0 votes
I'm generating graphs with Python NetworkX and marshaling to GraphML.  Some attributes are `float('inf')` which equates to Java's POSITIVE_INFINITY.  However, NetworkX encodes this in the attribute as `<data key="d24">inf</data>`, which breaks yWorks w/ `Caused by: java.lang.NumberFormatException: For input string: "inf"`.

I think the spec is weak here, so this bug could go against NetworkX as well.  Also, I can work around this, but it would be nice to have a fix.
in Feature Requests by

1 Answer

0 votes

You are right, the GraphML specification does not state how to encode infinite values. (The GraphML specification is mostly concerned with encoding graph structure and very little with encoding value types of any kind.) As a result, this is up to the GraphML implementation. (So this is probably not a bug in NetworkX, just their decision for encoding infinite values.) yEd's GraphML implementation encodes infinite (double) values as Infinity and -Infinity. If you want to read in infinite values in yEd, you will have to ensure those values are given as Infinity or -Infinity - e.g. by transforming your NetworkX GraphML files using XSLT. (There really is not much you can do with infinite values in yEd - for most features, infinite values are considered "bad data". Thus we are not going to support additional encodings for infinite values.)

by [yWorks] (160k points)
Legal Disclosure | Privacy Policy
...