def match(*, label="NluCell", topic=""):
"""Match subgraph and download.
"""
database = Database(password="train")
if topic:
cypher_info = "MATCH (n:{label}) WHERE n.topic='{topic}' RETURN n"
else:
cypher_info = "MATCH (n:{label}) RETURN n"
filename = asksaveasfilename(filetypes=[('QA?excel??', '*.xls')])
keys = ['name', 'content', 'topic', 'tag', 'keywords', 'api', 'behavior', 'url', \
"hot", 'txt', 'img', 'chart', 'parameter']
# keys = database.graph.find_one(label).keys()
items = database.graph.run(cypher_info.format(label=label, topic=topic)).data()
sheets = [{"name": label, "keys": keys, "items": items}]
write_excel(filename=filename, sheets=sheets)
评论列表
文章目录