knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Disclaimer: this package is still at an experimental level, and should only be used for testing, bug reports, and enhancement requests. As long as this package is in "Experimental" mode, some changes to the API are to be expected. Read the NEWS.md to be informed of the last changes.
This package has only been tested on these platforms for now, so it might not work on others :
neo4j 3.3.3
Mac OSX
The goal of play4j is to facilitate Neo4J orchestration from R.
You can install {play4j} from GitHub with:
# install.packages("remotes") remotes::install_github("ThinkR-open/play4j")
neo4j_shell$new
and the path to your NEO4JHOME
:cypher_con <- play4j::neo4j_shell$new("/Users/colin/neo4j/")
Verify the Neo4J shell was found by running :
cypher_con$cypher_shell
You should get a path to the cypher shell. If the returned value is character(0)
, please check the path you have provided.
# In the background cypher_con$start() # In the front cypher_con$console()
You can make cypher call with the cypher method :
cypher_con$cypher(cypher = "MATCH (n) RETURN n LIMIT 5;", username = "neo4j", password = "pouetpouet", format = "plain")
cypher_con$restart()
# See the last 5 lines cypher_con$see_logs(size = 5) cypher_con$see_certificates()
You can also see plugins, imports, data and run.
cypher_con$status()
# Apparently not available on windows cypher_con$version()
cypher_con$stop()
If you simply want to make API calls, start a new neo4j_api
object:
api_con <- play4j::neo4j_api$new(url = "http://localhost:7474", user = "neo4j", password = "pouetpouet")
Then query (result as JSON or as an R list):
# As JSON (default) api_con$query("MATCH (p:Person) RETURN p.name LIMIT 1") # As R list api_con$query("MATCH (p:Person) RETURN p.name LIMIT 1", format = "R")
You can call Neo4J admin commands by creating a new neo4j_admin object:
admin <- play4j::neo4j_admin$new("/Users/colin/neo4j/")
You can call admin commands with args that looks like shell commands (i.e. you should type args = "--verbose true"
, for example).
admin$memrec()
Every admin method comes with a help
arg, that can be turned on to get the list of args to pass to the commands.
admin$check_consistency(help = TRUE)
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.