Giter Site home page Giter Site logo

dapper-magician / neo4j-apoc-procedures Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neo4j-contrib/neo4j-apoc-procedures

0.0 0.0 0.0 54.69 MB

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            

Home Page: https://neo4j.com/labs/apoc

License: Apache License 2.0

JavaScript 0.03% Java 82.74% Kotlin 14.12% ANTLR 0.08% HTML 2.40% Cypher 0.63%

neo4j-apoc-procedures's Introduction

Discourse users Discord

Awesome Procedures for Neo4j 5.13.0.x (Extended)

Introduction

apoc

Neo4j 3.x introduced the concept of user-defined procedures and functions. Those are custom implementations of certain functionality, that can’t be (easily) expressed in Cypher itself. They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.

As of 5.0 APOC has been split into separate repositories, one being the main, officially supported, APOC Library. The other belonging to APOC Extended. This repository handles the extended part of APOC.

There are over 150 different procedures and functions in the Extended APOC library. Their purpose is to increase functionality in areas such as data integration, graph algorithms and data conversion.

License

Apache License 2.0

"APOC" Name history

Apoc was the technician and driver on board of the Nebuchadnezzar in the Matrix movie. He was killed by Cypher.

APOC was also the first bundled A Package Of Component for Neo4j in 2009.

APOC also stands for "Awesome Procedures On Cypher"

Feedback

Please provide feedback and report bugs as GitHub issues or join the Neo4j Community Forum and ask with the APOC tag.

Calling Procedures & Functions within Cypher

User defined Functions can be used in any expression or predicate, just like built-in functions.

Procedures can be called stand-alone with CALL procedure.name();

But you can also integrate them into your Cypher statements which makes them so much more powerful.

Load JSON example
WITH 'https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/5.4/src/test/resources/person.json' AS url

CALL apoc.load.json(url) YIELD value as person

MERGE (p:Person {name:person.name})
   ON CREATE SET p.age = person.age, p.children = size(person.children)

APOC Procedures & Functions Overview

All included procedures are listed in the overview in the documentation and detailed in subsequent sections.

Built in Help

apoc help apoc

call apoc.help('keyword')

lists name, description, signature, roles, based on keyword

Detailed Feature Documentation

See the APOC User Guide for documentation of each of the major features of the library, including data import/export, graph refactoring, data conversion, and more.

Procedure & Function Signatures

To call procedures correctly, you need to know their parameter names, types and positions. And for YIELDing their results, you have to know the output column names and types.

INFO:The signatures are shown in error messages, if you use a procedure incorrectly.

You can see the procedure’s signature in the output of CALL apoc.help("name")

CALL apoc.help("dijkstra")

The signature is always name : : TYPE, so in this case:

apoc.algo.dijkstra
 (startNode :: NODE?, endNode :: NODE?,
   relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?)
:: (path :: PATH?, weight :: FLOAT?)
Table 1. Parameter Explanation
Name Type

Procedure Parameters

startNode

Node

endNode

Node

relationshipTypesAndDirections

String

weightPropertyName

String

Output Return Columns

path

Path

weight

Float

Manual Installation: Download the latest release

Manual Configuration

Warning

For security reasons, procedures and functions that use internal APIs are disabled by default. Loading and enabling APOC procedures and functions can be configured using the Neo4j config file.

For more details, see the APOC installation documentation.

Using APOC with the Neo4j Docker image

Build & install the current development branch from source

git clone https://github.com/neo4j-contrib/neo4j-apoc-procedures
cd neo4j-apoc-procedures
sudo ./gradlew --init-script init.gradle shadow
cp build/extended/libs/apoc-<version>-extended.jar $NEO4J_HOME/plugins/
$NEO4J_HOME/bin/neo4j restart

A full build including running the tests can be run by sudo ./gradlew --init-script init.gradle build.

Note that --init-script init.gradle is not needed if you already loaded the gradle changes (e.g. via IntelliJ)

Applying Code-style

./gradlew spotlessApply

To apply the spotless code-style, run the above gradle command, this will remove all unused imports

neo4j-apoc-procedures's People

Contributors

adam-cowley avatar adtc avatar albertodelazzari avatar alexiudice avatar angelobusato avatar azuobs avatar burqen avatar conker84 avatar fbiville avatar gem-neo4j avatar github-actions[bot] avatar ikwattro avatar inversefalcon avatar jexp avatar jmhreif avatar jpryce-aklundh avatar klaren avatar kvegter avatar lojjs avatar mishademianenko avatar mneedham avatar moxious avatar ncordon avatar neo4j-oss-build avatar sarmbruster avatar szarnyasg avatar tomasonjo avatar vboulaye avatar vga91 avatar zimmre 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.