{"id":15687132,"url":"https://github.com/michael-simons/neo4j-graalvm-polyglot-examples","last_synced_at":"2025-05-07T19:09:42.250Z","repository":{"id":66744014,"uuid":"244901067","full_name":"michael-simons/neo4j-graalvm-polyglot-examples","owner":"michael-simons","description":"Examples how to use the Neo4j Java Driver inside the GraalVM versions of R, Ruby, Python and JavaScript.","archived":false,"fork":false,"pushed_at":"2020-03-06T07:37:47.000Z","size":72,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T19:09:10.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michael-simons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-04T12:59:04.000Z","updated_at":"2023-01-18T01:54:24.000Z","dependencies_parsed_at":"2023-06-29T13:14:07.631Z","dependency_job_id":null,"html_url":"https://github.com/michael-simons/neo4j-graalvm-polyglot-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-simons%2Fneo4j-graalvm-polyglot-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-simons%2Fneo4j-graalvm-polyglot-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-simons%2Fneo4j-graalvm-polyglot-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-simons%2Fneo4j-graalvm-polyglot-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michael-simons","download_url":"https://codeload.github.com/michael-simons/neo4j-graalvm-polyglot-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940934,"owners_count":21828769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:43:57.626Z","updated_at":"2025-05-07T19:09:42.206Z","avatar_url":"https://github.com/michael-simons.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\nStart a Neo4j Docker instance\n\n```\ndocker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:4.0.1\n```\n\n## Installing GraalVM\n\nDownload the JDK 11 version for your operating system from\nhttps://github.com/oracle/graal/releases\n\nAll community downloads are available on\nhttps://github.com/graalvm/graalvm-ce-builds/releases\n\nHere we used version 20.0.0\n\nFollow the install instructions\n\nInstall the different languages (javascript is already bundled) using `gu` the graal updater:\n\n- R,\n- ruby,\n- python\n\n```\nexport GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.0.0/Contents/Home\n$GRAALVM_HOME/bin/gu install R python ruby\n\n# List the installed versions\n$GRAALVM_HOME/bin/gu list\n```  \n\nBe sure to check the FastR requirements: https://www.graalvm.org/docs/reference-manual/languages/r/\n\nIf stuff fails, there's a GraalVM tool helping you troubleshot:\n\n```\n$GRAALVM_HOME/languages/R/bin/configure_fastr\n```\n\n### SDKMAN\n\nYou can also install GraalVM using sdkman.io which automatically sets up the PATH and JAVA_HOME, making the whole process much easier.\n\n```\nsdk install java 20.0.0.r11-grl\ngu install ruby R python\ngu list\n```\n\n## Download Neo4j Driver\n\nDownload the required Neo4j 4.0 driver dependencies via the provided Gradle script:\n\n```\n./gradlew downloadDependencies\n```\n\nor on Windows \n\n```\ngradlew.bat downloadDependencies\n```\n\n## Run Examples\n\nAll examples follow the same pattern:\nOpen up a connection, execute a query with a parameter, collect the results.\nThey include as first instructions an alternative method to the required Neo4j dependencies loaded.\nThis works through the GraalVM interoperability API.\n\nWe decided it would feel more natural not to do this and instead specify the two required jars on the GraalVM classpath with the `--vm.cp` argument as shown below.\n\nAll examples answer the question which actors acted with Tom Hanks in the same movie.\n\n```\nexport CLASSPATH=./lib/neo4j-java-driver-4.0.0.jar:./lib/reactive-streams-1.0.2.jar\n\n# R\n$GRAALVM_HOME/bin/Rscript --jvm --vm.cp=$CLASSPATH neo4j-graalvm-fastr-example.R\n\n# Javascript\n$GRAALVM_HOME/bin/node --jvm --vm.cp=$CLASSPATH neo4j-graalvm-javascript-example.js\n\n# Python\n$GRAALVM_HOME/bin/graalpython --jvm --vm.cp=$CLASSPATH neo4j-graalvm-python-example.py\n\n# Ruby\n$GRAALVM_HOME/bin/truffleruby --jvm --vm.cp=$CLASSPATH neo4j-graalvm-ruby-example.rb\n```\n\nThe examples also exists with `multidb` in their name.\nThey are identical, but make use of Neo4j 4.0 multi database feature.\nAs this is only available in the enterprise edition of Neo4j, you need to use a different docker image to start your instance:\n\n```\ndocker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret'  --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes neo4j:4.0.1-enterprise                   \n```\n\nThe `ee` examples run against a database called `movies`.\n\nIf you use Neo4j desktop, the enterprise edition is included.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-simons%2Fneo4j-graalvm-polyglot-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichael-simons%2Fneo4j-graalvm-polyglot-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-simons%2Fneo4j-graalvm-polyglot-examples/lists"}