QASystemOnMedicalKG/answer_search.py
2018-10-05 12:12:19 +08:00

29 lines
643 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# coding: utf-8
# File: answer_search.py
# Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io>
# Date: 18-10-5
from py2neo import Graph,Node
class AnswerSearcher:
def __init__(self):
self.g = Graph(
host="127.0.0.1",
http_port=7474,
user="lhy",
password="lhy123")
'''执行cypher查询并返回相应结果'''
def search_main(self, sqls):
for sql in sqls:
ress = self.g.run(sql).data()
for res in ress:
print(res)
return
if __name__ == '__main__':
searcher = AnswerSearch()