Will guess script(.py) able to find all node attributes (not pre-defined) names?

5 views
Skip to first unread message

Yijun Ding

unread,
Aug 12, 2010, 11:38:16 AM8/12/10
to guess-discuss
Will guess script(.py) able to find all node attributes (not pre-
defined) names?

Also, will script be able to add new "attribute"? I know it can add
new node. Thanks!

Gutemberg Vieira

unread,
Aug 12, 2010, 3:20:50 PM8/12/10
to guess-...@googlegroups.com
On Thu, Aug 12, 2010 at 11:08 AM, Yijun Ding <dingz...@gmail.com> wrote:
> Will guess script(.py) able to find all node attributes (not pre-
> defined) names?


Yes, for listing all node attributes you can do issue this command in
the console:

g.getNodeSchema().fieldNames()


>
> Also, will script be able to add new "attribute"? I know it can add
> new node. Thanks!


You can check the following methods to create new fields for nodes and edges:

g.addNodeField(name, type, defaultValue)
g.addEdgeField(name, type, defaultValue)


See morte at http://guess.wikispot.org/Modifying_graphs


--
Gutemberg

Yijun Ding

unread,
Aug 12, 2010, 4:58:07 PM8/12/10
to guess-discuss
Thanks a lot! I just find that to add field in the manual. It seems I
have not read the manual carefully.
The manual is hard to locate though. Thanks again.

On Aug 12, 2:20 pm, Gutemberg Vieira <gutemberg.vie...@gmail.com>
wrote:

Yijun Ding

unread,
Aug 12, 2010, 5:09:24 PM8/12/10
to guess-discuss
Let me continue to ask another question. When I load a GDF file, the
nodes are added to the existing graph. It there an easy way to reset
to empty state without exit GUESS so that I can load a clean GDF file?

i.e. If there a way to restore (re-load is OK) a GDF file to the
initial state without exit guess?

On Aug 12, 2:20 pm, Gutemberg Vieira <gutemberg.vie...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages