def load_file(): '''docstring for load_file''' a = AtomSpace() load_scm_file(a, "air.scm") return a
if is_a(node.type_name, "Link"): node_name = node.type_name + "[%s]" % str(node.h.value()) # print "***%s" % node_name else: node_name = self.graph.unique_id(node.name) # print "^^%s" % node_name # print "%s -> %s" %(link_name,node_name) self.graph.add_edge(link_name, node_name) # maintain order in the list self.graph.set_edge_attr(link_name, node_name, order=str(i)) atom = FakeAtom(node.type, node_name, node.tv, node.av) self.graph.set_node_attr(node_name, atom=atom) # self.graph.set_node_attr(node_name, shape = "point") atom = FakeAtom(link.type, link.name, link.tv, link.av) self.graph.set_node_attr(link_name, atom=atom) # self.graph.set_node_attr(link_name, shape = "point") return self.graph if __name__ == "__main__": from load_scm_file import load_scm_file a = AtomSpace() load_scm_file(a, "./test/scm/test_atomspace_abserver.scm") abserver = Atomspace_Abserver(a) abserver.graph_info() abserver.filter_graph() abserver.write("test_atomspace_abserver.dot")
__author__ = 'Keyvan' from blending.agents import DummyBlendingAgent from opencog.atomspace import AtomSpace from opencog.cogserver import Server from load_scm_file import load_scm_file # Check if git shows the branch if __name__ == '__main__': server = Server() server.add_mind_agent(DummyBlendingAgent()) a = AtomSpace() load_scm_file(a, '../examples/bat_man.scm') a.print_list() server.run(a)
else: node_name = self.graph.unique_id(node.name) #print "^^%s" % node_name #print "%s -> %s" %(link_name,node_name) self.graph.add_edge(link_name, node_name) # maintain order in the list self.graph.set_edge_attr(link_name, node_name, order=str(i)) atom = FakeAtom(node.type, node_name, node.tv, node.av) self.graph.set_node_attr(node_name, atom=atom) #self.graph.set_node_attr(node_name, shape = "point") atom = FakeAtom(link.type, link.name, link.tv, link.av) self.graph.set_node_attr(link_name, atom=atom) #self.graph.set_node_attr(link_name, shape = "point") return self.graph if __name__ == '__main__': from load_scm_file import load_scm_file a = AtomSpace() load_scm_file(a, "./test/scm/test_atomspace_abserver.scm") abserver = Atomspace_Abserver(a) abserver.graph_info() abserver.filter_graph() abserver.write("test_atomspace_abserver.dot")