test_check_bd241.py 768 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python3
  2. """检查 BusinessDomain ID=241 的名称"""
  3. from app import create_app
  4. from app.core.graph.graph_operations import connect_graph
  5. app = create_app()
  6. with app.app_context():
  7. with connect_graph().session() as session:
  8. query = """
  9. MATCH (bd:BusinessDomain)
  10. WHERE id(bd) = 241
  11. RETURN bd.name_zh as name_zh, bd.name_en as name_en, bd.describe as describe
  12. """
  13. result = session.run(query).single()
  14. if result:
  15. print(f'BusinessDomain ID=241:')
  16. print(f' name_zh: {result["name_zh"]}')
  17. print(f' name_en: {result["name_en"]}')
  18. print(f' describe: {result["describe"]}')
  19. else:
  20. print('未找到 BusinessDomain ID=241')