Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GML loading cannot accept scientific notation for float-type edge property #300

Closed
mbastian opened this issue Oct 22, 2011 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@mbastian
Copy link
Member

I would expect Gephi GML loader would admit scientific notations, but it doesn't. Scientific notation is prescribed in the GML official specification (see page 2):
http://www.fim.uni-passau.de/fileadmin/files/lehrstuhl/brandenburg/projekte/gml/gml-technical-report.pdf

Sample file:
graph [
directed 0

node [
    id 3719161
    label "GGNBP2"
]
node [
    id 3719150
    label "PIGW"
]
edge [
    source 3719161
    target 3719150
    CtrlRSq 0.03564458751187731
    CasePVal 0.36896971076737917
    CtrlPVal 6.870900696337445E-4
    CaseRSq 0.006731404647102828
]

]


Imported from Launchpad using lp2gh.

@sheymann
Copy link
Member

sheymann commented May 8, 2012

I merged your patch manually, thanks!

@sheymann sheymann closed this as completed May 8, 2012
@eduramiba
Copy link
Member

Hi,
The important part is just changing new Double() to Double.valueOf(), right?

One problem with the merged code is that it uses a String and += operator as a string buffer. But that is very inneficient. StringBuilder should be used.

@sheymann
Copy link
Member

sheymann commented May 8, 2012

No it's not so simple because of the parser of StringTokenizer:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4079180
http://docs.oracle.com/javase/6/docs/api/java/io/StreamTokenizer.html

I agree the current solution is not efficient, but it works. I'll improve it using a StringBuilder.

@eduramiba
Copy link
Member

Oh I see, I didn't know that problem of StreamTokenizer.

@lbertelo
Copy link

lbertelo commented May 8, 2012

Hi,

No the important change is how to detect "6.870900696337445E-4" as a Double.
Before with StreamTokenizer, we had "6.870900696337445" as a Double and "E-4" as a String.

But you are right, it should be better to use StringBuilder. I didn't think to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants