neo4j-apoc-procedures 0,0,1,2 travis-ci

Awesome procedures for Neo4j 3.0 - codenamed "apoc"                                                  If you like it, please ★ above ⇧            

3 years after

= Awesome Procedures for Neo4j 3.x :readme: :img: https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/master/docs/img

image:https://travis-ci.org/neo4j-contrib/neo4j-apoc-procedures.svg[alt="Travis CI Status", link="https://travis-ci.org/neo4j-contrib/neo4j-apoc-procedures"] image:https://img.shields.io/maven-central/v/org.neo4j.procedure/apoc.svg[alt="Maven status"] image:https://img.shields.io/github/release/neo4j-contrib/neo4j-apoc-procedures.svg[alt="Github release status"] image:https://img.shields.io/github/contributors/neo4j-contrib/neo4j-apoc-procedures.svg[alt="contributor stats"]

https://neo4j-contrib.github.io/neo4j-apoc-procedures[Documentation (WIP)].

// tag::readme[]

== Introduction

// tag::intro[] // tag::intro-text[]

image::https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/master/docs/img/apoc.gif[float=right]

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

The APOC library consists of many (about 300) procedures to help with many different tasks in areas like data integration, graph algorithms or data conversion.

=== License

Apache License 2.0

=== "APOC" Name history

http://matrix.wikia.com/wiki/Apoc[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 http://neo4j.com/blog/convenient-package-neo4j-apoc-0-1-released/[A Package Of Components] for Neo4j in 2009.

APOC also stands for "Awesome Procedures On Cypher"

=== Download latest release

Go to http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/latest to find the latest release and download the binary jar to place into your $NEO4J_HOME/plugins folder.

// end::intro-text[] // tag::build[]

=== Build & install the current development branch from source


git clone http://github.com/neo4j-contrib/neo4j-apoc-procedures ./gradlew shadow cp build/libs/apoc--SNAPSHOT-all.jar $NEO4J_HOME/plugins/ $NEO4J_HOME/bin/neo4j restart

// If you want to run embedded or use neo4j-shell on a disk store, configure your plugins directory in conf/neo4j.conf with dbms.plugin.directory=path/to/plugins.

A full build including running the tests can be run by ./gradlew build.

// end::build[] // tag::calling-procedures[]

== Calling Procedures within Cypher

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 [source,cypher]

WITH 'https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/master/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)

// end::calling-procedures[]

// end::intro[]

// tag::signature[]

== Procedure Signatures

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

You can see the procedures signature in the output of CALL dbms.procedures()

[source,cypher]

CALL dbms.procedures() YIELD name, signature WITH * WHERE name STARTS WITH 'apoc.algo.dijkstra' RETURN name, signature

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?)

Parameters:

[opts=header,cols="m,m"] |=== | Name | Type h| Procedure Parameters | | startNode | Node | endNode | Node | relationshipTypesAndDirections | String | weightPropertyName | String h| Output Return Columns | | path | Path | weight | Float |===

// end::signature[]

== Included Procedures Overview

All included procedures are listed in the https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_included_procedures_overview[overview in the documentation] and detailed in subsequent sections.

=== Built in Help

// tag::help[]

image::{img}/apoc-help-apoc.jpg[width=600]

[cols="1m,5"] |=== | call apoc.help('search') | lists name, description-text and if the procedure performs writes (descriptions are WIP), search string is checked against beginning (package) or end (name) of procedure |===

.helpful [source,cypher]

CALL apoc.help("apoc") YIELD name, text WITH * WHERE text IS null RETURN name AS undocumented

// end::help[]

=== Builtin Package and Procedure count

// tag::procedurecount[]

To find the procedure count with the package in Neo4j:

image::{img}/apoc.dbms.procedure.count.jpg[width=600]

.Cypher for getting count of procedure in a package [source,cypher]


CALL dbms.procedures() YIELD name RETURN head(split(name,".")) as package, count(*), collect(name) as procedures;


// end::procedurecount[]

== Version Compatibility Matrix

Since APOC relies in some places on Neo4j's internal APIs you need to use the right APOC version for your Neo4j installaton.

Any version to be released after 1.1.0 will use a different, consistent versioning scheme: <neo4j-version>.<apoc> version. The trailing <apoc> part of the version number will be incremented with every apoc release.

[options=headers] |=== |apoc version | neo4j version |3.0.4.1 | 3.0.4 |1.1.0 | 3.0.0 - 3.0.3 |1.0.0 | 3.0.0 - 3.0.3 |===

== Feedback

Please provide feedback and report bugs as link:./issues[GitHub issues] or join the http://neo4j.com/slack[neo4j-users Slack] and ask on the #apoc channel. You might also ask on http://stackoverflow.com/questions/tagged/neo4j+apoc[StackOverflow], please tag your question there with neo4j and apoc.

Related Repositories

awesome-neo4j

awesome-neo4j

A curated list of Neo4j resources. ...

awesome-neo4j

awesome-neo4j

A curated list of Neo4j resources. ...

neo4j-algorithms

neo4j-algorithms

Custom graph algorithms for Neo4j with own Java and REST APIs ...

neo4j-warmup

neo4j-warmup

Simple library that warms up Neo4j caches with a single REST call ...

graph-hack-sfo-2016

graph-hack-sfo-2016

Graph Hack at Graph Connect SFO 2016 ...


Top Contributors

jexp sarmbruster ikwattro ADTC fbiville kvegter atuljangra bachmanm craigtaverner neo4j-oss-build tkroman mneedham fpavageau SaschaPeukert rohankharwar Dcanzano inserpio kvangundy maxdemarzi anuragknoldus tommichiels johnymontana ryguyrg viksitpuri

Releases

-   3.1.0.1 zip tar
-   3.0.4.1 zip tar
-   1.1.0 zip tar
-   1.0.0 zip tar
-   1.0.0-RC1 zip tar