nw:load-from-string
nw:load-from-string format data default-turtle-breed default-link-breed optional-command-block
Load network data from an in-memory string rather than from a file. This is useful in NetLogo Web and other contexts where the data comes from somewhere other than the file system, such as the fetch or resource extensions.
Because there is no file name to infer the file-type from, the first argument, format, names the format explicitly. It is case-insensitive and an optional leading dot is ignored, so "gml", "GML", and ".gml" are all equivalent. The supported formats are:
dlgdfgexfgmlgraphmlmatrixvna
Aside from taking its data from a string and its format from the format argument, nw:load-from-string behaves exactly like the corresponding nw:load-* primitive, including matching node and edge attributes to turtle and link variables and honoring breed.
For example, to load a GML network fetched from a URL:
fetch:url-async "https://example.com/network.gml" [ [gml] ->
nw:load-from-string "gml" gml turtles links
] [ [err] -> print err ]