PHPackages                             oosor/neo4j-common - 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. [Database &amp; ORM](/categories/database)
4. /
5. oosor/neo4j-common

ActiveLibrary[Database &amp; ORM](/categories/database)

oosor/neo4j-common
==================

Common Utilities library for Neo4j

10.0.1(4y ago)0602MITPHP

Since Oct 11Pushed 4y agoCompare

[ Source](https://github.com/oosor/neo4j-php-commons)[ Packagist](https://packagist.org/packages/oosor/neo4j-common)[ RSS](/packages/oosor-neo4j-common/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (49)Used By (2)

GraphAware PHP Neo4j Common
===========================

[](#graphaware-php-neo4j-common)

Library with common utility classes for Neo4j
---------------------------------------------

[](#library-with-common-utility-classes-for-neo4j)

[![Build Status](https://camo.githubusercontent.com/c554b6e40681dee0c9fe44d761177da0663a313f47f418ae2a10b1763c80a993/68747470733a2f2f7472617669732d63692e6f72672f677261706861776172652f6e656f346a2d7068702d636f6d6d6f6e732e737667)](https://travis-ci.org/graphaware/neo4j-php-commons)[![Latest Stable Version](https://camo.githubusercontent.com/cb34bf5e9527cc5859c6fa5dee83921e945dec79e8af66136152050abd6118b6/68747470733a2f2f706f7365722e707567782e6f72672f677261706861776172652f6e656f346a2d636f6d6d6f6e2f76657273696f6e)](https://packagist.org/packages/graphaware/neo4j-common)

### Installation

[](#installation)

Require the dependencies in your application :

```
composer require graphaware/neo4j-common
```

---

### Graph

[](#graph)

#### Label

[](#label)

Object representation of a Node Label.

```
use GraphAware\Common\Graph\Label;

$label = new Label("User");
echo $label->getName(); // Returns (string) "User"

// or static construction

$label = Label::label("User");
```

#### Node

[](#node)

Object Representation of a Node. The node object extends `PropertyBag`.

```
use GraphAware\Common\Graph\Node;

$node = new Node(1, array("User", "Person"));
$node->getId(); // Returns (int) 1
$node->getLabels(); // Returns an array of \GraphAware\Common\Graph\Label objects
```

#### Relationship

[](#relationship)

Object Representation of a Relationship. The relationship object extends `PropertyBag`.

```
use GraphAware\Common\Graph\Relationship;

$rel = new Relationship(1, RelationshipType::withName("RELATES"), $node, $node2);
echo $rel->getType(); // Returns (string) "RELATES"
var_dump($rel->isType(RelationshipType::withName("RELATES"))); // Returns (bool) true
```

#### Direction (Enum) : representation of a Relationship Direction

[](#direction-enum--representation-of-a-relationship-direction)

```
use GraphAware\Common\Graph\Direction;

$direction = new Direction(Direction::INCOMING);
echo $direction; // Returns (string) "INCOMING"

// Or static call construction

$direction = Direction::OUTGOING;
echo $direction; // Returns (string) "OUTGOING"
```

Valid values are `INCOMING`, `OUTGOING` and `BOTH`.

#### RelationshipType

[](#relationshiptype)

Object representation of a relationship type.

```
use GraphAware\Common\Graph\RelationshipType;

$relType = RelationshipType::withName("FOLLOWS");
echo $relType->getName(); // Returns (string) "FOLLOWS"
echo (string) $relType; // implements __toString method : Returns (string) "FOLLOWS"
```

---

### Cypher

[](#cypher)

#### Statement and StatementCollection

[](#statement-and-statementcollection)

Utility classes representing Cypher's statements. Both `Statement` and `StatementCollection` classes are `taggable`.

Contains also `StatementInterface` and `StatementCollectionInterface` used in most GraphAware's PHP libraries.

##### Statement

[](#statement)

Represents a Cypher statement with a query and an array of parameters. Also the Statement accepts a `tag` argument default to null;

```
use GraphAware\Common\Cypher\Statement;

$statement = Statement::create("MATCH (n) WHERE id(n) = {id} RETURN n", array("id" => 324));

echo $statement->getQuery(); // Returns (string) "MATCH (n) WHERE id(n) = {id} RETURN n"
echo count($statement->getParameters()); // Returns (int) 1
```

##### StatementCollection

[](#statementcollection)

Represents a collection of `Statement` objects. Is also Taggable.

```
use GraphAware\Common\Cypher\Statement
    GraphAware\Common\Cypher\StatementCollection;

$collection = new StatementCollection();
$collection->add(Statement::create("MATCH (n) RETURN count(n)"));

print_r($collection->getStatements());
echo $collection->isEmpty();
```

---

License
-------

[](#license)

### Apache License 2.0

[](#apache-license-20)

```
Copyright 2015 Graphaware Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

```

---

Support
-------

[](#support)

Standard Community Support through the Github Issues and PR's workflow.

Enterprise support via your first level support contact.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 85.9% 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 ~46 days

Recently: every ~410 days

Total

47

Last Release

1732d ago

Major Versions

1.14.0 → 2.0.02016-03-14

2.2.0 → 3.0.x-dev2016-05-06

2.2.1 → 3.0.02016-05-06

3.5.0 → 10.0.02021-08-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9849117?v=4)[Andrew](/maintainers/oosor)[@oosor](https://github.com/oosor)

---

Top Contributors

[![ikwattro](https://avatars.githubusercontent.com/u/1222009?v=4)](https://github.com/ikwattro "ikwattro (79 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (7 commits)")[![xavismeh](https://avatars.githubusercontent.com/u/181753?v=4)](https://github.com/xavismeh "xavismeh (4 commits)")[![oosor](https://avatars.githubusercontent.com/u/9849117?v=4)](https://github.com/oosor "oosor (2 commits)")

---

Tags

databaseneo4jcyphergraphstatement

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oosor-neo4j-common/health.svg)

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

###  Alternatives

[graphaware/neo4j-common

Common Utilities library for Neo4j

24876.2k24](/packages/graphaware-neo4j-common)[vinelab/neoeloquent

Laravel wrapper for the Neo4j graph database REST interface

65393.1k1](/packages/vinelab-neoeloquent)[neo4j/neo4j-bundle

Symfony integration for Neo4j

8272.1k](/packages/neo4j-neo4j-bundle)[stefanak-michal/bolt

PHP library to provide connectivity to graph database over TCP socket with Bolt specification

79655.8k8](/packages/stefanak-michal-bolt)[ulobby/neoeloquent

Laravel wrapper for the Neo4j graph database REST interface

4473.4k](/packages/ulobby-neoeloquent)[wikibase-solutions/php-cypher-dsl

A query builder for the Cypher query language

1853.4k4](/packages/wikibase-solutions-php-cypher-dsl)

PHPackages © 2026

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