def install_traversals(cls, node_set):
rels = cls.defined_properties(rels=True, aliases=False, properties=False)<EOL>for key, value in rels.items():<EOL><INDENT>if hasattr(node_set, key):<EOL><INDENT>raise ValueError("<STR_LIT>".format(key))<EOL><DEDENT>rel = getattr(cls, key)<EOL>rel._lookup_node_class()<EOL>traversal = Traversal(source=node_set, name=key, definition=rel.definition)<EOL>setattr(node_set, key, traversal)<EOL><DEDENT>
For a StructuredNode class install Traversal objects for each
relationship definition on a NodeSet instance