PHPackages                             xp-forge/neo4j - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. xp-forge/neo4j

ActiveLibrary

xp-forge/neo4j
==============

Neo4J connectivity for XP Framework

v2.0.0(1y ago)04.2k[1 issues](https://github.com/xp-forge/neo4j/issues)[1 PRs](https://github.com/xp-forge/neo4j/pulls)BSD-3-ClausePHPPHP &gt;=7.4.0CI passing

Since Sep 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xp-forge/neo4j)[ Packagist](https://packagist.org/packages/xp-forge/neo4j)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-forge-neo4j/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

Neo4J connectivity
==================

[](#neo4j-connectivity)

[![Build status on GitHub](https://github.com/xp-forge/neo4j/workflows/Tests/badge.svg)](https://github.com/xp-forge/neo4j/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/34d9a2b20570d339be342a507802b556ba012231784c03a28847d77d76177c53/68747470733a2f2f706f7365722e707567782e6f72672f78702d666f7267652f6e656f346a2f76657273696f6e2e737667)](https://packagist.org/packages/xp-forge/neo4j)

This library implements Neo4J connectivity via its REST API.

Examples
--------

[](#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):

```
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()`:

```
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:

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

Format characters
-----------------

[](#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`.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance49

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~308 days

Recently: every ~363 days

Total

10

Last Release

370d ago

Major Versions

v0.2.1 → v1.0.02019-12-01

v1.2.0 → v2.0.02025-05-04

PHP version history (3 changes)v0.1.0PHP &gt;=5.6.0

v1.0.0PHP &gt;=7.0.0

v2.0.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (48 commits)")

---

Tags

neo4jphpxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-forge-neo4j/health.svg)

```
[![Health](https://phpackages.com/badges/xp-forge-neo4j/health.svg)](https://phpackages.com/packages/xp-forge-neo4j)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
