https://github.com/neo4j-php/cypher-data-structures
Data structures for the Cypher query language
https://github.com/neo4j-php/cypher-data-structures
cypher neo4j php
Last synced: 11 months ago
JSON representation
Data structures for the Cypher query language
- Host: GitHub
- URL: https://github.com/neo4j-php/cypher-data-structures
- Owner: neo4j-php
- License: mit
- Created: 2022-08-25T14:27:46.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-15T12:23:46.000Z (over 1 year ago)
- Last Synced: 2025-08-10T23:29:20.422Z (12 months ago)
- Topics: cypher, neo4j, php
- Language: PHP
- Homepage: https://syndesi.github.io/cypher-data-structures
- Size: 532 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/neo4j-php/cypher-data-structures/blob/main/LICENSE)



[](https://codeclimate.com/github/Syndesi/cypher-data-structures/test_coverage)
[](https://codeclimate.com/github/Syndesi/cypher-data-structures/maintainability)
# Syndesi's Cypher Data Structures
This library provides basic data classes, so that working with Cypher based graph databases becomes easy.
- [Documentation](https://neo4j-php.github.io/cypher-data-structures)
- [Packagist](https://packagist.org/packages/syndesi/cypher-data-structures)
## Installation
To install this library, run the following code:
```bash
composer require syndesi/cypher-data-structures
```
This is all, now you can use the library :D
## Using the library
```php
use Syndesi\CypherDataStructures\Type\Node;
use Syndesi\CypherDataStructures\Type\Relation;
$node = new Node();
$node
->addLabel('NodeLabel')
->addIdentifier('id', 123)
->addProperty('someProperty', 'someValue')
->addIdentifier('id');
$otherNode = new Node();
$otherNode
->addLabel('OtherNodeLabel')
->addIdentifier('id', 234)
->addProperty('hello', 'world :D')
->addIdentifier('id');
$relation = new Relation();
$relation
->setStartNode($node)
->setEndNode($node)
->setType('SOME_RELATION');
```
## Advanced integration
This library itself does not provide advanced features like validation. Those are separated into their own projects:
- Validation: Work in progress, not yet released.
- [Entity Manager](https://github.com/neo4j-php/cypher-entity-manager): Automatically creates and runs Cypher statements
from data objects of this library for you.