@@ -152,8 +152,7 @@ Example Application
152152 class App :
153153
154154 def __init__ (self , uri , user , password ):
155- # Aura queries use an encrypted connection
156- self .driver = GraphDatabase.driver(uri, auth = (user, password), encrypted = True )
155+ self .driver = GraphDatabase.driver(uri, auth = (user, password))
157156
158157 def close (self ):
159158 # Don't forget to close the driver connection when you are finished with it
@@ -177,12 +176,12 @@ Example Application
177176 # The Reference Card is also a good resource for keywords,
178177 # see https://neo4j.com/docs/cypher-refcard/current/
179178
180- query = """
181- CREATE (p1:Person { name: $person1_name })
182- CREATE (p2:Person { name: $person2_name })
183- CREATE (p1)-[:KNOWS]->(p2)
184- RETURN p1, p2
185- """
179+ query = (
180+ " CREATE (p1:Person { name: $person1_name }) "
181+ " CREATE (p2:Person { name: $person2_name }) "
182+ " CREATE (p1)-[:KNOWS]->(p2) "
183+ " RETURN p1, p2"
184+ )
186185 result = tx.run(query, person1_name = person1_name, person2_name = person2_name)
187186 try :
188187 return [{" p1" : record[" p1" ][" name" ], " p2" : record[" p2" ][" name" ]}
@@ -201,17 +200,17 @@ Example Application
201200
202201 @ staticmethod
203202 def _find_and_return_person (tx , person_name ):
204- query = """
205- MATCH (p:Person)
206- WHERE p.name = $person_name
207- RETURN p.name AS name
208- """
203+ query = (
204+ " MATCH (p:Person) "
205+ " WHERE p.name = $person_name "
206+ " RETURN p.name AS name"
207+ )
209208 result = tx.run(query, person_name = person_name)
210209 return [record[" name" ] for record in result]
211210
212211 if __name__ == " __main__" :
213212 # See https://neo4j.com/developer/aura-connect-driver/ for Aura specific connection URL.
214- scheme = " neo4j"
213+ scheme = " neo4j" # Connecting to Aura, use the "neo4j+s" URI scheme
215214 host_name = " example.com"
216215 port = 7687
217216 url = " {scheme} ://{host_name} :{port} " .format(scheme = scheme, host_name = host_name, port = port)
0 commit comments