Skip to content

Add attribute types for sets of times (timestampset, intervalset) #33

Open

Description

@mbastian

GEXF 1.3 can describe when a node or edge exists (timestamp/timestamps, start/end, <spells>). It can't store a set of times as an attribute value: attrtype-type has no such type, and mode="dynamic" attributes hold a value per time, not a set of times.

Gephi has such columns (TimestampSet, IntervalSet), for example a date column imported from a spreadsheet edge list. These columns can't be exported to GEXF with their type. gephi/gephi#3403 writes them as string, which keeps the data, but the column comes back as a string on re-import. The spreadsheet format keeps the type.

Proposal: add two static attribute types. Their values use the same syntax Gephi already prints for these types:

<attribute id="events" title="events" type="timestampset"/>
<attribute id="periods" title="periods" type="intervalset"/>
...
<attvalue for="events" value="&lt;[3.0, 6.0]&gt;"/>
<attvalue for="periods" value="&lt;[1.0, 5.0]; [10.0, 10.5]&gt;"/>

Open questions:

  • Should the values follow the graph's timeformat/timezone, like spells do?
  • Should a type have to match timerepresentation (timestampset only with timestamp, intervalset only with interval), or be allowed with either?
  • Is <[...]> the right syntax, or should it reuse the list syntax from Modify array strings #8?

Activity

  1. MattArtzAnthro commented on Nov 21, 2026

    @MattArtzAnthro

    I ran a few cases against the merged gephi/gephi#3403 to see what this would need to cover. These are from tests on master (87386a2), not from the GUI.

    timeformat/timezone. The exporter already writes these values in the graph's format and zone. A date column in a date graph comes out as <[2025-01-03, 2025-02-10]>, and in a datetime graph with timezone="America/Chicago" as <[2025-01-03T00:00:00.000-06:00]>. Following timeformat/timezone would match what files already contain.

    Matching timerepresentation. As far as I can tell, Gephi already requires this in practice. graphstore lets me add an IntervalSet column to a timestamp graph (and a TimestampSet column to an interval graph), but setting a value throws ClassCastException in TimestampIndexStore.checkK, and the first node keeps its value, so the table is left half-written. A rule that the type matches timerepresentation would describe what Gephi can hold. The exception may deserve a clearer check in graphstore, but that is separate.

    Syntax. Without the type, the text is ambiguous: TimestampSet{3, 6} and IntervalSet{[3, 6]} both print as <[3.0, 6.0]>, and an empty set prints as <empty>. With a declared type that is fine, but the value cannot be read on its own, so the spec may want to say so.

    Two smaller things:

    • From reading ImporterGEXF (I have not run it), current releases log "Attribute type for '...' is not recognized. The attribute is ignored." for an unknown type, so a file using timestampset would lose the column in 0.11.x, where the string export keeps the text.
    • #3403 did not cover the attribute's <default>. It is written with toString(), so in a date graph the default comes out in milliseconds (<[1735862400000.0]>) while the values are dates. I can send a small PR for that if it is useful.

    I checked these together with Claude, Anthropic's AI assistant, which wrote and ran the tests on my machine.

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