[{"data":1,"prerenderedAt":370},["ShallowReactive",2],{"/nw/load-graphml":3,"/nw/load-graphml-surround":359},{"id":4,"title":5,"body":6,"description":326,"extension":327,"meta":328,"navigation":345,"path":355,"seo":356,"stem":357,"__hash__":358},"content/nw/load-graphml.md","Networks Extension Dictionary: load-graphml",{"type":7,"value":8,"toc":315},"minimark",[9],[10,11,15,16,15,26,51,69,88,95,105,200,210,220,226,251,254],"div",{"className":12,"id":14},[13],"dict_entry","load-graphml","\n  ",[17,18,20,21,15],"h3",{"id":19},"nwload-graphml","\n    ",[22,23,25],"a",{"href":24},"#load-graphml","nw:load-graphml",[27,28,32],"h4",{"id":29,"className":30},"nwload-graphml-file-name-optional-command-block",[31],"section-heading",[22,33,20,37,15],{"className":34,"href":36},[35],"section-anchor","#----nwload-graphml-file-name-optional-command-block--",[38,39,42,43,47,48],"span",{"className":40},[41],"prim_example","nw:load-graphml ",[44,45,46],"i",{},"file-name"," ",[44,49,50],{},"optional-command-block",[52,53,54,55,68],"p",{},"Loading a GraphML file into NetLogo with the network extension should be as simple as calling ",[56,57,58,47,63],"code",{},[38,59,25],{"className":60},[61,62],"token","variable",[38,64,67],{"className":65},[61,66],"string","\"example.graphml\"",", but there is a bit of preparation involved.",[52,70,71,72,74,75,79,80,83,84,87],{},"The key idea is that ",[56,73,25],{}," will try to assign the attribute values defined in the GraphML file to NetLogo agent variables of the same names (this is ",[76,77,78],"em",{},"not"," case sensitive). The first one it tries to set is ",[56,81,82],{},"breed"," if it is there, so the turtle or link will get the right breed and, hence, the right breed variables.  The load expects the ",[76,85,86],{},"plural form"," of the breed for a turtle or link, it will not recognize the singular form.",[52,89,90,91,94],{},"One special case is the ",[56,92,93],{},"who"," number, which is ignored by the importer if it is present as a GraphML attribute: NetLogo does not allow you to modify this number once a turtle is created and, besides, there could already be an existing turtle with that number.",[52,96,97,98,101,102,104],{},"The simplest case to handle is when the original GraphML file has been saved from NetLogo by using ",[56,99,100],{},"nw:save-graphml",". In this case, all you should have to do is to make sure that you have the same breed and variables definition as when you saved the file and you should get back your original graph. For example, if you want to load the file from the ",[56,103,100],{}," example above, you should have the following definitions:",[106,107,108],"pre",{},[56,109,110,114,115,47,119,123,124,114,131,123,135,114,140,47,144,123,148,114,154,123,158,160,114,166,47,170,123,174,176,114,182,47,186,123,190,114,196,123],{},[38,111,82],{"className":112},[61,113],"keyword"," [ ",[38,116,118],{"className":117},[61,62],"bankers",[38,120,122],{"className":121},[61,62],"banker"," ]",[38,125,127,130],{"className":126},[61,113],[128,129],"br",{},"bankers-own",[38,132,134],{"className":133},[61,62],"bank-name",[38,136,138,82],{"className":137},[61,113],[128,139],{},[38,141,143],{"className":142},[61,62],"clients",[38,145,147],{"className":146},[61,62],"client",[38,149,151,153],{"className":150},[61,113],[128,152],{},"clients-own",[38,155,157],{"className":156},[61,62],"hometown",[128,159],{},[38,161,163,165],{"className":162},[61,113],[128,164],{},"undirected-link-breed",[38,167,169],{"className":168},[61,62],"friendships",[38,171,173],{"className":172},[61,62],"friendship",[128,175],{},[38,177,179,181],{"className":178},[61,113],[128,180],{},"directed-link-breed",[38,183,185],{"className":184},[61,62],"accounts",[38,187,189],{"className":188},[61,62],"account",[38,191,193,195],{"className":192},[61,113],[128,194],{},"accounts-own",[38,197,199],{"className":198},[61,62],"amount",[52,201,202,203,209],{},"Loading a graph that was saved from a different program than NetLogo is quite possible as well, but it may take a bit of tinkering to get all the attribute-variable match up right. If you encounter major problems, please do not hesitate to ",[22,204,208],{"href":205,"rel":206},"https://github.com/NetLogo/NW-Extension/issues/new",[207],"nofollow","open an issue",".",[52,211,212,213,216,217,219],{},"The extension will try to assign the type defined by ",[56,214,215],{},"attr.type"," to each variable that it loads. If it’s unable to convert it to that type, it will load it as a string. If ",[56,218,215],{}," is not defined, or is set to an unknown value, the extension will first try to load the value as a double, then try it as a boolean, and finally fall back on a string.",[52,221,222,223,225],{},"If you specify an ",[76,224,50],{},", it is executed for each turtle in the newly created network. For example:",[106,227,228],{},[56,229,230,47,233,114,236,47,241,47,246,123],{},[38,231,25],{"className":232},[61,62],[38,234,67],{"className":235},[61,66],[38,237,240],{"className":238},[61,239],"command","set",[38,242,245],{"className":243},[61,244],"reporter","color",[38,247,250],{"className":248},[61,249],"constant","red",[52,252,253],{},"Note that this command block can be used to build a list or an agentset containing the newly created nodes:",[106,255,256],{},[56,257,258,47,262,266,267,269,47,272,275,276,278,279,47,282,47,285,47,289,47,293,296,298,299,301,47,304,47,308,47,312],{},[38,259,261],{"className":260},[61,239],"let",[38,263,265],{"className":264},[61,62],"node-list"," []",[128,268],{},[38,270,25],{"className":271},[61,62],[38,273,67],{"className":274},[61,66]," [",[128,277],{},"  ",[38,280,240],{"className":281},[61,239],[38,283,265],{"className":284},[61,62],[38,286,288],{"className":287},[61,244],"lput",[38,290,292],{"className":291},[61,244],"self",[38,294,265],{"className":295},[61,62],[128,297],{},"]",[128,300],{},[38,302,261],{"className":303},[61,239],[38,305,307],{"className":306},[61,62],"node-set",[38,309,311],{"className":310},[61,244],"turtle-set",[38,313,265],{"className":314},[61,62],{"title":316,"searchDepth":317,"depth":318,"links":319},"",5,3,[320],{"id":19,"depth":318,"text":321,"children":322},"\n    nw:load-graphml\n  ",[323],{"id":29,"depth":324,"text":325},4,"\n    nw:load-graphml file-name optional-command-block\n  ","Documentation for the load-graphml primitive.","md",{"source":329,"metadataOutputPath":330,"projectConfig":331,"language":338,"inheritFrom":346,"output":345,"version":332,"layout":347,"dictionaryDisplayName":348,"dictionaryHomeDirectory":349,"indexFileURI":350,"currentItemId":14,"currentItemLabel":25,"primRoot":351,"icon":352,"extensionName":353,"assetsRoot":333},"../../external/extensions/nw/nw/load-graphml.md","content/nw/load-graphml.metadata.yaml",{"version":332,"projectRoot":209,"scanRoot":333,"outputRoot":334,"defaults":335,"engine":341,"partials":342,"dedupeIdenticalDiskWrites":345},"7.0.4","/home/runner/work/Helio/Helio/external/extensions/nw","content",{"inheritFrom":336,"language":338,"output":339,"extension":327,"title":340,"version":332},[337],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":343,"extensions":344},[209],[341,327],true,[337],"catalog","Networks Extension Dictionary","/nw.html","/_index/extensions/nw.txt","nw","i-lucide-network",{"shortName":351,"fullName":354},"Networks","/nw/load-graphml",{"title":5,"description":326},"nw/load-graphml","0x9tI6PTSFOKPQ4X3vQNO-kRM-DyUSjBjhTK2SsPibI",[360,365],{"title":361,"path":362,"stem":363,"description":364},"Networks Extension Dictionary: load","/nw/load","nw/load","Documentation for the load primitive.",{"title":366,"path":367,"stem":368,"description":369},"Networks Extension Dictionary: load-matrix","/nw/load-matrix","nw/load-matrix","Documentation for the load-matrix primitive.",1777657888903]