Example #1
0
    def on_btnConfirms_clicked(self):
        # self.ui.table_sql.setVisible(True)
        # self.url='http://www.baidu.com'
        # self.url = 'file:///' + os.path.dirname(os.path.dirname(d)) + \
        #            '/static/html/show.html'
        # self.url = self.url.replace('\\', '/')
        # self.browser.page().load(QUrl(self.url))
        # self.browser.show()
        self.browser.setVisible(True)
        self.ui.table_sql.setVisible(True)
        self.browser_kg.setVisible(False)

        search_name = self.ui.Check_lineEdit.text()

        graph = py2neo.Graph("http://localhost:7474", auth=("neo4j", "961121"))
        str1 = "MATCH(n{name:'%s'})RETURN n" % (search_name)
        result = graph.run(str1).to_subgraph()
        # print(len(result.nodes))
        if result == None:
            return
        if len(result.nodes) > 1:
            return
        # print(result.identity)
        search_name = result.identity
        # a = str(result)  # f**k neo4j
        # neodict=dict(result) if result else None

        self.neo = search.search_return(search_name)
        node_dict = self.neo.dict()
        print(node_dict)
        if node_dict:
            self.__createSearch(node_dict)
            # self.__draw(self.neo.picture_path())
            self.ToJS_showNode.emit(self.neo.singleNode_json())
Example #2
0
 def changePicPro(self, strParameter):
     if not strParameter:
         return
     a = search.search_return(strParameter)
     print("changePicPro")
     self.__createSearch(a.dict())
     self.__draw(a.picture_path())
Example #3
0
 def returnShowNode(self, strParameter):
     if not strParameter.isdigit():
         return
     strParameter = int(strParameter)
     # if not strParameter:
     #     return
     a = search.search_return(strParameter)
     self.ToJS_showNode.emit(a.singleNode_json())
Example #4
0
 def returnExpandNode(self, strParameter):
     if not strParameter.isdigit():
         return
     strParameter = int(strParameter)
     # if not strParameter:
     #     return
     a = search.search_return(strParameter)
     print("expandNode")
     self.ToJS_expandNode.emit(a.json())
Example #5
0
 def changePicPro(self, strParameter):
     if not strParameter.isdigit():
         return
     strParameter = int(strParameter)
     # if not strParameter:
     #     return
     a = search.search_return(strParameter)
     print("changePicPro")
     print(a.dict())
     self.__createSearch(a.dict())
Example #6
0
    def on_btnConfirms_clicked(self):
        search_name = self.ui.Check_lineEdit.text()

        self.neo = search.search_return(search_name)
        node_dict = self.neo.dict()
        print(node_dict)
        if node_dict:
            self.__createSearch(node_dict)
            self.__draw(self.neo.picture_path())
            self.ToJS_showNode.emit(self.neo.singleNode_json())
Example #7
0
    def on_btnConfirms_clicked(self):
        search_name = self.ui.Check_lineEdit.text()

        self.neo = search.search_return(search_name)
        node_dict = self.neo.dict()
        print(node_dict)
        if node_dict:
            self.ui.table_sql.setColumnCount(len(node_dict))
            self.ui.table_sql.setRowCount(1)
            self.ui.table_sql.setHorizontalHeaderLabels(node_dict.keys())
            self.__createSearch(node_dict)
        picPath = self.neo.picture_path()[0] if\
        self.neo.picture_path()\
        else self.defaultPicture
        print('picpath = ', picPath)
        self.__draw(picPath)
Example #8
0
 def returnShowNode(self, strParameter):
     if not strParameter:
         return
     a = search.search_return(strParameter)
     self.ToJS_showNode.emit(a.singleNode_json())