java - Joern: access graph database directly without neo4j-server -
the joern documentation says:
it possible access graph database directly scripts loading database memory on script startup.
how can that?
after running java -jar $joern/bin/joern.jar $codedirectory
on code, neo4j database directory (.joernindex) created these .id- , .db-files. possible to access code (with python-joern) without running neo4j server? (is server necessary?)
the web interface way use joern database documented here:
http://joern.readthedocs.io/en/latest/import.html
and python-joern interface documented here:
http://joern.readthedocs.io/en/latest/access.html#python-joern-api
and program:
from joern.all import joernsteps j = joernsteps() j.setgraphdburl('http://localhost:7474/db/data/') # j.addstepsdir('use inject utility traversals') j.connecttodatabase() res = j.rungremlinquery('getfunctionsbyname("main")') res = j.runcypherquery('...') r in res: print r
basically url-way talk neo4j server, , called joern's "rest api".
now if want access database "directly", can using java program shown here:
or python shown here:
https://neo4j.com/developer/python/
https://marcobonzanini.com/2015/04/06/getting-started-with-neo4j-and-python/
but bottomline still going start neo4j database server, , program (via neo4j driver, enable network based communication possible) talk database server.
but if want load "database" files directly, parsed yourself, , extract out data going hard.
Comments
Post a Comment