Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for Bolt protocols ('3.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2', '5.3', '5.4') - exception connecting with python neo4j #106

Open
brunocek opened this issue Jan 26, 2024 · 7 comments

Comments

@brunocek
Copy link

brunocek commented Jan 26, 2024

Hello.

I am trying to connect using a python script, and I am getting the bellow message:

neo4j._exceptions.BoltHandshakeError: The neo4j server does not support communication with this driver. This driver has support for Bolt protocols ('3.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2', '5.3', '5.4').

Are we completely out of compatibility with all these Bolt protocol versions? Is there an easy and accessible way to connect python to the ongdb backend, please?


Note: It seems related to this jira issue, but the server is down and archive.org has no record of it:
[ONGDB-223] – Bolt version needs to be compatible with driver checks

( https://graphfoundation.org/ongdb/1.0.0-alpha01/ )

details to reproduce the error

  1. Create a python script file script.py:
# script.py
from neo4j import GraphDatabase

uri = 'bolt://localhost:7687' # or neo4j://localhost
auth = ('ongdb', 'ongdb')

with GraphDatabase.driver(uri, auth=auth) as driver:
    driver.verify_connectivity()

  1. Install python3 and pipenv (debian):
sudo apt-get install python3 pipenv
  1. Create an environment on the same directory where the script.py lives, install neo4j python library and run the script:
pipenv shell
pipenv install neo4j
python script.py
@bradnussbaum
Copy link
Contributor

ONgDB 1.0 uses Bolt protocol version 1.0. You will need to install and older python driver. Could you determine which python driver version dropped support?

@brunocek
Copy link
Author

brunocek commented Jan 29, 2024

The release notes of version 5.1 contains a table of compatibility. It says version 3.5 and 4.0 are the two last ones that support certainly Bolt 1.7.
( https://pypi.org/project/neo4j/5.1.0/ )

Release notes for 4.1 to 5.0 will hold the description of how to use Bolt 1.7, but as we see in 5.1, they actually don't know if it works or not.

I use pipenv on debian, and I was unable to install an older version of python package neo4j:

ERROR: Could not find a version that satisfies the requirement neo4j4.0
ERROR: No matching distribution found for neo4j4.0

Please help and advise. It would be great to hear (have it documented) from users.

All release notes: ( https://pypi.org/project/neo4j/#history )


2024 programmatically use free software graph database

  1. What is the most valuable, free software, graph database, skill set to learn?

Should the programmatical use of the graph database be python via Bolt protocol on ongdb? Or should the connection use some different protocol?

  1. Do we need ongdb?

I recall reading that some queries are not available on neo4j personal (only paid enterprise) and that ongdb was forked to keep it, but unfortunately I cannot find the page where I read this.

( https://neo4j.com/pricing/ )( formaly /editions ) says on the paid professional:

Support for analytical queries with Parallel Runtime

Does it mean we cannot do some Cypher queries/graph algorithms (unless in paid enterprise)? Are these available in SPARQL? And is it a better choice?


My research now shows me only two functional limitations on neo4j personal:

My use case is not impacted by these neo4j personal limitations. On the other hand, at the moment, my research leads me to believe python with package neo4j and Bolt protocol is the best programmatical use of a free software graph db. Comments on this perception, please?

tracking (also asked on..)

@brunocek
Copy link
Author

Quick updates:

Python's Neo4J driver won't support version 1.
( neo4j/neo4j-python-driver#1013 )

I got this discusssion in neo4j forum where it should happen. - Centralises drivers discussion.
( https://community.neo4j.com/t/2024-programmatically-use-free-software-graph-database/66027 )


Does anyone use ongdb + python, please?

Or, is it possible to have ongdb support python current neo4j driver, please?

@gambarim
Copy link

I am also interested in this please

@crazyyanchao
Copy link

crazyyanchao commented Mar 23, 2024 via email

@bradnussbaum
Copy link
Contributor

You try this:

pip install neo4j==1.7.6

Then to execute a query:

from neo4j.v1 import GraphDatabase

# Define the connection URI
uri = "bolt://localhost:7687"
username = "your_username"
password = "your_password"

# Define your query
query = "MATCH (n) RETURN n LIMIT 5"

# Define a function to execute the query
def execute_query(uri, username, password, query):
    driver = GraphDatabase.driver(uri, auth=(username, password))
    session = driver.session()
    result = session.run(query)
    return result

# Execute the query
result = execute_query(uri, username, password, query)

# Process the result
for record in result:
    print(record)

I can get a better example if needed.

@gambarim
Copy link

Perfect it works. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants