0
votes

I used py2neo to add nodes and relations in neo4j.

created with:

asno, = graphDB.create({"name":"ASNO:"+fields[8], "ASNO":fields[8]});
asno.add_labels("Network", "ASNO", continent);

printing in python: ASNO : 38023


However, when I query with cypher:

Query 1. match (n) where n.name = "ASNO:38023" return n;

There are no returns;

Query 2. match (n) where n.name = "ASNO:\u00003\u00008\u00000\u00002\u00003\u0000" return n;

The following is returned.

{ "table": [ { "n": { "name": "ASNO:\u00003\u00008\u00000\u00002\u00003\u0000", "ASNO": "\u00003\u00008\u00000\u00002\u00003\u0000" } } ], "graph": { "nodes": [ { "name": "ASNO:\u00003\u00008\u00000\u00002\u00003\u0000", "ASNO": "\u00003\u00008\u00000\u00002\u00003\u0000", "id": "906", "type": "Network" } ], "edges": [] }, "labels": [ "Network" ] }


I need help in having the query run in Query 1 method. Thanks and Appreciation for your help.

1

1 Answers

0
votes

Try forcing your name value to be ASCII using the str() function.

nameval = str("ASNO:" + fields[8])

asno, = graphDB.create({"name":nameval, "ASNO":fields[8]})

asno.add_labels("Network", "ASNO", continent)