2017 © Pedro Peláez
 

library neo4j

Neo4J connectivity for XP Framework

image

xp-forge/neo4j

Neo4J connectivity for XP Framework

  • Tuesday, October 3, 2017
  • by thekid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 369 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 4 Versions
  • 23 % Grown

The README.md

Neo4J connectivity

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.4+ Supports PHP 8.0+ Latest Stable Version, (*1)

This library implements Neo4J connectivity via its REST API., (*2)

Examples

Running a query can be done via open() (which yields one record at a time) or query() (which collects the results in an array):, (*3)

use com\neo4j\Graph;
use util\cmd\Console;

$g= new Graph('http://user:pass@neo4j-db.example.com:7474/db/data');
$q= $g->open('MATCH (t:Topic) RETURN t.name, t.canonical');
foreach ($q as $record) {
  Console::writeLine('#', $record['t.canonical'], ': ', $record['t.name']);
}

To retrieve single results (or NULL if nothing is found), use fetch():, (*4)

if ($topic= $g->fetch('MATCH (t:Topic{id:%s}) RETURN t', $id)) {
  Console::writeLine('Found topic ', $topic);
}

Formatting parameters uses printf-like format tokens. These will take care of proper escaping and type casting:, (*5)

use com\neo4j\Graph;
use util\cmd\Console;

$g= new Graph('http://user:pass@neo4j-db.example.com:7474/db/data');
$g->query('CREATE (p:Person) SET t.name = %s, t.id = %d', $name, $id);

Batch statements can be executed via the execute() method., (*6)

Format characters

  • %s: Format a string
  • %d: Format a decimal number
  • %f: Format a floating point numer
  • %b: Format a boolean
  • %v: Copy value into parameter
  • %l: Copy label into query
  • %c: Copy literal into query
  • %%: A literal percent sign

Positional parameters (starting at 1) may be used, e.g. %2$s., (*7)

The Versions

03/10 2017

dev-feature/bolt-driver

dev-feature/bolt-driver http://xp-framework.net/

Neo4J connectivity for XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

30/09 2017

dev-master

9999999-dev http://xp-framework.net/

Neo4J connectivity for XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

30/09 2017

v0.2.0

0.2.0.0 http://xp-framework.net/

Neo4J connectivity for XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

30/09 2017

v0.1.0

0.1.0.0 http://xp-framework.net/

Neo4J connectivity for XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp