tugraph-db
tugraph-db copied to clipboard
cypher响应不规范
cql = f"CALL db.createLabel('edge','{edge_name}', '{json.dumps([[vertex_name, target]], ensure_ascii=False)}')'" responses = run_cypher_by_name(kg_name, cql) print(responses) 在使用cypher进行数据查询、插入操作时,发现响应结果会缺少错误码,或是输出无关的信息: {'error_message': 'Label[测试]: Duplicate property definition: [name]'} {'error_message': 'No such vertex label: 会议'} {'elapsed': 0.0008828639984130859, 'header': [{'name': '', 'type': 0}], 'result': [], 'size': 0}
最后实际传递给tugraph-db执行的cypher是什么?
Hello @zhang-jinqi. Please provide more info for debugging. Issues labeled by more info needed
will be closed if no activities in 7 days.
你好 @zhang-jinqi, 我们需要你提供更多信息以便于排查问题。7 天内未跟进此 issue 将会被自动关闭。
是这样的cql:cql = f'match (n)-[r]-(l) where n.name CONTAINS "{item[1]}" return n,r,l'
cql = f'match (n)-[r]-(l) where n.name CONTAINS "{item[1]}" return n,r,l'
这个cypher好像和下面的response对不上啊。
{'error_message': 'Label[测试]: Duplicate property definition: [name]'} {'error_message': 'No such vertex label: 会议'} {'elapsed': 0.0008828639984130859, 'header': [{'name': '', 'type': 0}], 'result': [], 'size': 0}
{item[1]}的值是什么?
具体的隔得有点久,找不到了,是类似查询实体关系、顶点标签、关联实体之间的信息、插入数据等等,但是发现返回的信息中错误情况下和正确情况下,信息格式不统一,对业务上面去判断不太友好。 cql如下: cql = f"CALL db.createVertexLabel('{vertex_name}','name','name',string,false, " cql = f"CALL db.createLabel('edge','{edge_name}', '{json.dumps([[vertex_name, target]], ensure_ascii=False)}')'" cql1 = f'MATCH p=(m)-[r2:{relation}]-(l:{label}) where id(m)={entity_id} RETURN count(p)' 类似于这些
嗯,好吧。那可以不管具体的case,我们后面看一下cypher的返回结果的格式统一问题
具体的隔得有点久,找不到了,是类似查询实体关系、顶点标签、关联实体之间的信息、插入数据等等,但是发现返回的信息中错误情况下和正确情况下,信息格式不统一,对业务上面去判断不太友好。 cql如下: cql = f"CALL db.createVertexLabel('{vertex_name}','name','name',string,false, " cql = f"CALL db.createLabel('edge','{edge_name}', '{json.dumps([[vertex_name, target]], ensure_ascii=False)}')'" cql1 = f'MATCH p=(m)-[r2:{relation}]-(l:{label}) where id(m)={entity_id} RETURN count(p)' 类似于这些
最新的 4.1.0 版本支持使用neo4j的客户端访问,可以试用下,response format 会好很多。 https://github.com/TuGraph-family/tugraph-db/blob/master/docs/zh-CN/source/5.developer-manual/4.client-tools/6.bolt-client.md https://github.com/TuGraph-family/tugraph-db/tree/master/demo/Bolt 有问题,感谢反馈,会及时修复。