CSBiology / FSharp.FGL

Functional graph library for F#
https://csbiology.github.io/FSharp.FGL/
MIT License
61 stars 11 forks source link

GDF files saved by gephi cannot be opend due to formating issues. #19

Closed LibraChris closed 3 years ago

LibraChris commented 3 years ago

Description

Files that were saved under the gdf format of gephi coud not be opend by GDF.FromFile due to differences in the expected formating and the actual formating. A detailed list is found down below.

Repro steps

  1. Save any graph as .gdf in gephi.

  2. Try to open it via FSharp.FGL.IO.GDF.fromFile

Expected behavior

The graph will be acquired from the file and returned

Actual behavior

The experienced issues are:

  1. vertex X does not contain any identifier.
  2. unknown typeAnnotation in header.
  3. edge XY does not contain any vertex ids.

Solution

These errors occur, because the sample data used to code the GDF file reader (gephi example page) differs in its internal structure from the gdf structure shown by gephi. However, the implementation of this is straightforward.

  1. allow for vertex headers to contain spacebar as a first character. Previously the first char needed to be part of the name string.
  2. change the typeAnnotation coded as INT to INTEGER
  3. if not stated otherwise, assume that node-Ids are strings. Previously the type (string/int/float) of the node-Id had to be stated in the header.

A pull request will follow soon which will fix these errors.