Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Export question

27 views
Skip to first unread message

su qi

unread,
Nov 3, 2024, 3:47:43 AM11/3/24
to visone-users
Hi all,  I have some questions about Export. I import the data using edge lists. And all of 

the  nodes have their id. But when I want to export the data in json, the source and target 

are not expressed by id in links. How can I solve this problem?

Thanks!

Su qi

Kimmo Elo

unread,
Nov 4, 2024, 4:10:32 AM11/4/24
to visone-users
Hi Su qi,

maybe I misunderstood your question, but I cannot reproduce this. I
tested this by exporting a network by opening the export dialog, then
selecting "JSON" as the file format. The saved JSON file contains two
arrays - nodes and links - and the link array has one object for each
link. Such an object has also the properties "source" and "target", of
which values are node id values.

Or do you mean with "id" something different that the node id
automatically created/maintained by visone?

HTH,

Kimmo
Message has been deleted

su qi

unread,
Nov 4, 2024, 8:12:02 AM11/4/24
to visone-users
Hi kimmo,
I mean  with "id" something different that the node id automatically created/maintained by visone. 
The node ids for both source and target are based on sorting all nodes from 0 to n when saving, which is different from what I expected.

Su qi

Kimmo Elo 在 2024年11月4日 星期一下午5:10:32 [UTC+8] 的信中寫道:

Kimmo Elo

unread,
Nov 5, 2024, 4:32:32 PM11/5/24
to visone...@googlegroups.com
Hi again,

ok, I understand. But now the question is: what is the output for "id" in JSON you expect visone to produce? What should the "ids" be?

Best,

Kimmo

Müller Julian

unread,
Nov 11, 2024, 8:48:19 AM11/11/24
to visone...@googlegroups.com
Hi,

I guess Su Qi has a point: The JSON export does not follow the usual JSON format specification, since the specified node IDs (based on the attribute "id") can be different from the IDs used to reference the link sources and targets.
However, the attribute "id" is not guaranteed to assign unique identifiers to nodes because visone does not assign much special meaning to this attribute (other than often creating it automatically and assigning unique identifiers for newly added nodes).

So this is the solution that I came up with: If the attribute "id" does uniquely identify the nodes, it will be used to identify link sources and targets as well.
If not, other unique identifiers will be used. The original attribute "id" will be renamed to some other free identifier (likely something like "originalid[xxx]").

After I have implemented this change, note that the IDs do not have to be integers if the attribute "id" stores strings or another kind of data.

Best,
Julian

Reply all
Reply to author
Forward
0 new messages