GML Export issue with quotation marks since 0.8.1

Get help with your data
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
eregil
Posts:1
Joined:30 Apr 2012 15:12
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
GML Export issue with quotation marks since 0.8.1

Post by eregil » 30 Apr 2012 15:50

Since gephi 0.8.1, when I export to GML format from gephi, I have trouble importing graphs to other software. Namely, the importer module in Cytoscape simply exits with an error and doesn't import any data.

Some investigation unveiled that gephi now encloses node and edge ids in quotation marks, e.g. gephi 0.8.1 exports

Code: Select all

  node
  [
    id "1"
    label "xxxx"
    graphics
    [
      x -494.6182
      y -30.708168
      z 0.0
      w 10.0
      h 10.0
      d 10.0
      fill "#999999"
    ]
  ]
where gephi 0.8 exports

Code: Select all

  node
  [
    id 1
    label "xxxx"
    graphics
    [
      x -494.6182
      y -30.708168
      z 0.0
      w 10.0
      h 10.0
      d 10.0
      fill "#999999"
    ]
  ]
GML specification, as downloadable from the relevant page, suggests that ids should be integers, and integers should not be enclosed in quotation marks. Specifically, the Syntax section within gml-technical-report.pdf defines
Integer ::= sign digit+
and the List of keys section lists
.id int
It appears that the addition of quotation marks was part of a specific changeset:

https://github.com/gephi/gephi/pull/524
https://github.com/megaterik/gephi/comm ... 2adc533ca2

Why was this change made? It is only briefly described as "user ids instead of system's". As I understand it, it is meant to export nodes and edges with their ids from the NodeData object, which are strings (as opposed to their ids in the Node objects, which are integers). However, the main point of exporting to a standard format such as GML is to be able to import the data elsewhere. It is important for the sake of interoperability that the format is implemented consistently across different software, which means, in this case, that exported ids should be integers.

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: GML Export issue with quotation marks since 0.8.1

Post by admin » 30 Apr 2012 17:07

Right, I reported the bug on Github.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable