Git Product home page Git Product logo

distinct_network's Introduction

distinct_network

Stored Procedure to get the distinct network of a node 4 levels out

Instructions

This project uses maven, to build a jar-file with the procedure in this project, simply package the project with maven:

mvn clean package

This will produce a jar-file,target/procedures-1.0-SNAPSHOT.jar, that can be deployed in the plugin directory of your Neo4j instance.

cp target/procedures-1.0-SNAPSHOT.jar neo4j-enterprise-3.1.0/plugins/.

If you don't have maven, you can look at the releases tab of this github repository and grab a pre-compiled jar.

Start Neo4j and log in.

Create sample users:

    WITH ['Jennifer','Michelle','Tanya','Julie','Christie','Sophie','Amanda','Khloe','Sarah','Kaylee'] AS names 
    FOREACH (r IN range(0,100000) | CREATE (:Customer {CustomerID:names[r % size(names)]+r}))

Connect those sample users:

    MATCH (u1:Customer),(u2:Customer)
    WITH u1,u2
    LIMIT 100000000
    WHERE rand() < 0.1
    CREATE (u1)-[:FRIEND_OF]->(u2);

Try the stored procedure:

    MATCH (c:Customer {CustomerID:'Jennifer0'}) CALL com.maxdemarzi.distinct_network(c) YIELD value RETURN value

distinct_network's People

Contributors

maxdemarzi avatar

Watchers

Rohan 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.