nw:save
nw:save file-name
Filetype specific variants:
nw:save-dl
nw:save-gdf
nw:save-gexf
nw:save-gml
nw:save-vna
Export the network context in the given format to the given file. Turtle and link attributes will be exported to formats that support node and edge properties.
Limitations:
x
andy
(notxcor
andycor
) can only be numbers.x
andy
are commonly used in formats pertaining to position and behind the scenes NW uses Gephi’s libraries for exporting. Furthermore,x
andy
will be added even if they didn’t exist in the model. Again, this is because NW uses Gephi’s libraries which assume that nodes have positions stored inx
andy
. If you wish to export to Gephi specifically, we recommend creatingx
andy
turtles variables and setting them toxcor
andycor
before export.- Color will be exported in a standard RGB format. This should hopefully increase compatibility with other programs.
- Turtle and link variables that contain values of different types will be stored as strings. Unfortunately, most network formats require that node and attributes have a single type.
- Many programs use
label
to store the id of nodes. Thus, if you’re having trouble importing data exported from NetLogo into another program, you might try setting turtles’ labels to theirwho
number. - Multigraphs are not supported. Thus, two turtles can share at most one link.
nw:save-graphml
does support multigraphs, so use that if turtles can have more than one type of link connecting them.
nw:save
determines the file-type of the given file based on the extension and calls the corresponding save-*
primitive on it. Note that GraphML must be exported with nw:save-graphml
.
Take me to the full Networks Extension Dictionary