Closed garanews closed 5 years ago
I dont find in the code a place to change the backend...
You need to use the python bindings to send to neo4j:
from beagle.backends import Neo4J
from beagle.datasources import HXTriage
HXTriage(...).to_graph(backend=Neo4J)
https://github.com/yampelo/beagle#python-library
Fair warning, my cypher is awful and there may be a way way way better to set it up to send to neo4j, if you guys have more experience you should totally contribute a better way to transform the node classes to batch cypher upload queries 😄
I installed (not so easy) beagle outside docker with pipenv in order to modify code faster. I'm looking the base_transformer.py should I set there Neo4j instead networkx? I tried this from beagle.backends.neo4j import Neo4J def to_graph(self, backend: "Backend" = Neo4J, *args, **kwargs) -> Any:
but system is still using networkx instead neo4j
Are you trying to use the web interface to upload to Neo4J? That won't work, you need to use the bindings like above. The web interface is meant to be a self-contained thing, where you upload a triage, it transforms it to a NetworkX object, saves it in the database, then redirects you to the web interface for it.
Try calling the python library directly like in my example above.
having some issue passing db parameters:
Traceback (most recent call last):
File "
passing manually someghing changes: backend = HXTriage('/home/users/analyst/dsadadm15jMy.mans').to_graph(backend=Neo4J, uri="bolt://12.3.4:7687", auth=("neo4j","password"))
2019-04-19T15:00:42 | beagle.transformers.base_transformer.run:111 | INFO | Finished processing of events, created 8838 nodes.
2019-04-19T15:00:42 | beagle.backends.neo4j.init:36 | INFO | Connecting to neo4j server at bolt://1.2.3.4:7687
Traceback (most recent call last):
File "
Seems like the Neo4J has a couple of bugs with it since I had to move over from py2neo
to the official neo4j driver. I might not be able to debug until this weekend due to travel, do you wanna chat about it on slack? : https://join.slack.com/t/beaglegraph/shared_invite/enQtNjE1MzQyNTE3NTI3LTUzMGNhMzcwN2M5ODg3NGRmNzVmM2ZjMmU0NDk3ODEwMmRkZjEyZWIxYzU5NmM3MWMxOWU4MjVhNWEyNWVkNTI
Sure, I joined in slack (I'm also on gitter, same user) on other projects I am running py2neo (4.x). Take your time, now Easter times :) Thanks
Hey @garanews , i finally finished my finals week and had time to check this out. I got it working!
The version on pypi (pip install pybeagle --upgrade
) will allow it to work
Hello, thanks, going to try it immediately! Now it would be useful sending data from ui directly to neo4j :)
Opened #41 to track it, it should be pretty straight forward to do.
Following the guide in order to use Neo4J I eported these variables (passing through -e in docker run...) : BEAGLEGENERALLOG_LEVEL=DEBUG BEAGLENEO4JHOST=bolt://my_neo4j_ip:7687 BEAGLENEO4JUSERNAME=myuser BEAGLENEO4JPASSWORD=mypwd
I am able to see the debug messages, but there is no communication with Neo4j. I see INFO | Initialized NetworkX Backend Am I missing something? I tried also to use docker-compose with same variables under "environment" but result is the same. Thanks