Skip to content

GEXF export writes an empty file when a column is a TimestampSet or IntervalSet #3402

Closed

Description

@MattArtzAnthro

Summary

Exporting to GEXF produces an empty file, with no error shown, when the node or edge table has a regular attribute column of type TimestampSet (a column other than the timeset property). A spreadsheet edge list with a date column imports with exactly such a column, so the export of that graph is a 0-byte file.

Where

modules/ExportPlugin/src/main/java/org/gephi/io/exporter/plugin/ExporterGEXF.java, writeAttributes(XMLStreamWriter, Column[], String, String):

  • Column.isDynamic() is true both for TimeMap columns (a value per time) and for TimeSet columns (a set of times).
  • The exporter treats every dynamic column as a TimeMap and calls AttributeUtils.getStaticType(...), which throws for a TimeSet type.
  • execute() catches the exception and logs it, so the export ends quietly with an empty document.

The log has:

SEVERE [org.gephi.io.exporter.plugin.ExporterGEXF]
java.lang.IllegalArgumentException: Unsupported type org.gephi.graph.api.types.TimestampSet
	at org.gephi.graph.api.AttributeUtils.getStaticType(AttributeUtils.java:726)
	at org.gephi.io.exporter.plugin.ExporterGEXF.writeAttributes(ExporterGEXF.java:325)

#2297 looks like the same confusion in the Appearance module. The spreadsheet exporter handles the same graph (SpreadsheetTest.testNodeTimestampSetOtherColumn).

Steps to reproduce

  1. Save this as edges.csv:
    source,target,date
    a,b,2025-01-03
    a,b,2025-02-10
    b,c,2025-03-21
    
  2. Import it as an edges table with the default settings. The edge table now has date as a TimestampSet column, next to the timeset property.
  3. Export the graph to GEXF.
  4. The exported file is 0 bytes.

I ran these steps through the import and export controllers on Gephi 0.11.4 rather than through the menus. In a test, GraphGenerator.build(timestampConfiguration).generateTinyGraph().addTimestampSetColumn() followed by ExporterGEXF.execute() writes nothing on current master.

I expect an IntervalSet column to fail the same way, since it takes the same path, but I have not tested it.

Possible fix

Use isDynamicAttribute() where the exporter means a value per time. GEXF has no attribute type for a set of times, so a time-set column could be declared as a string attribute holding its text form (<[3.0, 6.0]>), which is what the spreadsheet exporter writes. The timeset property would be unchanged.

I have this as a small patch with two tests in GEXFTest; the ExportPlugin tests pass with it. I am happy to open a PR if that direction is welcome.

Separately, because execute() swallows the exception, a failed export looks like a successful one. I have left that alone.

Environment

  • Gephi 0.11.4, and master (0.11.5-SNAPSHOT) in the ExportPlugin tests
  • macOS (Apple Silicon)

This was found and checked together with Claude Code. I ran everything on my own machine and can share the patch and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions