Code Monkey home page Code Monkey logo

neo4j-gremlin-plugin's Introduction

This is a Neo4j Server plugin, providing Gremlin backend scripting to the Neo4j Server. To deploy, please do the following

For usage, see the current documentation.

Building from source and deploying into Neo4j Server

Ensure Maven knows where to find Java 1.7. Note: on Mac OSX (tested on 10.9), please see this issue/workaround StackOverflow.

Also ensure you do not have neo4j currently running or the build tests will fail as it attempts to start up a neo4j instance on the same port as the defaults for neo4j. Otherwise the tests and the build will fail.

mvn clean package
unzip target/neo4j-gremlin-plugin-2.1-SNAPSHOT-server-plugin.zip -d $NEO4J_HOME/plugins/gremlin-plugin
cd $NEO4J_HOME
bin/neo4j restart

Maven setup

In your pom.xml, add

<repositories>
    <repository>
        <id>neo4j-contrib-snapshots</id>
        <url>https://github.com/neo4j-contrib/m2/raw/master/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

and

<dependency>
     <groupId>org.neo4j.server.plugin</groupId>
     <artifactId>neo4j-gremlin-plugin</artifactId>
     <version>2.1-SNAPSHOT</version>
     <type>test-jar</type>
     <scope>test</scope>
</dependency>

Eclipse setup

  • Install m2eclipse maven support for Eclipse from the update site http://download.eclipse.org/technology/m2e/releases
  • clone this repo
  • do Eclipse->Import...->Maven->Existing_projects_into_workspace and point out your cloned code directory
  • wait until the process is finished and you should have a compiling setup in Eclipse.

access the plugin

curl localhost:7474/db/data/
{
"relationship_index" : "http://localhost:7474/db/data/index/relationship",
"node" : "http://localhost:7474/db/data/node",
"relationship_types" : "http://localhost:7474/db/data/relationship/types",
"extensions_info" : "http://localhost:7474/db/data/ext",
"node_index" : "http://localhost:7474/db/data/index/node",
"reference_node" : "http://localhost:7474/db/data/node/0",
"extensions" : {
  "GremlinPlugin" : {
    "execute_script" : "http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script"
  }
}

submit (HTTP POST) a Gremlin script i=g.V(2);i.outE.inV returning a list of nodes, URL encoded:

curl -d "script=i+%3D+g.v%282%29%3Bi.outE.inV" http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script
[ {
  "outgoing_relationships" : "http://localhost:7474/db/data/node/0/relationships/out",
  "data" : {
  },
  "traverse" : "http://localhost:7474/db/data/node/0/traverse/{returnType}",
  "all_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
  "property" : "http://localhost:7474/db/data/node/0/properties/{key}",
  "self" : "http://localhost:7474/db/data/node/0",
  "properties" : "http://localhost:7474/db/data/node/0/properties",
  "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
  "incoming_relationships" : "http://localhost:7474/db/data/node/0/relationships/in",
  "extensions" : {
  },
  "create_relationship" : "http://localhost:7474/db/data/node/0/relationships",
  "all_relationships" : "http://localhost:7474/db/data/node/0/relationships/all",
  "incoming_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}"
} ]

neo4j-gremlin-plugin's People

Contributors

jexp avatar jakewins avatar mikesname avatar lmeyerov avatar christabor avatar chrisvest avatar plukevdh avatar tinwelint avatar thobe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.