Method get_id for nodes