Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neo4j-php/php-cypher-dsl
A low-level query builder for Cypher written in PHP
https://github.com/neo4j-php/php-cypher-dsl
cypher neo4j neo4j-php opencypher php
Last synced: 2 months ago
JSON representation
A low-level query builder for Cypher written in PHP
- Host: GitHub
- URL: https://github.com/neo4j-php/php-cypher-dsl
- Owner: neo4j-php
- License: mit
- Created: 2021-11-16T14:24:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-07T15:19:39.000Z (about 1 year ago)
- Last Synced: 2024-11-14T13:47:07.456Z (3 months ago)
- Topics: cypher, neo4j, neo4j-php, opencypher, php
- Language: PHP
- Homepage:
- Size: 1.53 MB
- Stars: 18
- Watchers: 6
- Forks: 5
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# php-cypher-dsl
The `php-cypher-dsl` library provides a way to construct advanced Cypher
queries in an object-oriented and type-safe manner.## Documentation
[The documentation can be found on the wiki
here.](https://github.com/WikibaseSolutions/php-cypher-dsl/wiki)## Installation
### Requirements
`php-cypher-dsl` requires PHP 7.4 or greater; using the latest version of PHP
is highly recommended.### Installation through Composer
You can install `php-cypher-dsl` through composer by running the following
command:```
composer require "wikibase-solutions/php-cypher-dsl"
```## Contributing
Please refer to [CONTRIBUTING.md](https://github.com/neo4j-php/php-cypher-dsl/blob/main/.github/CONTRIBUTING.md) for information on how to contribute to this project.
## Example
To construct a query to find all of Tom Hanks' co-actors, you can use the
following code:```php
use function WikibaseSolutions\CypherDSL\node;
use function WikibaseSolutions\CypherDSL\query;$tom = node("Person")->withProperties(["name" => "Tom Hanks"]);
$coActors = node();$statement = query()
->match($tom->relationshipTo(Query::node(), "ACTED_IN")->relationshipFrom($coActors, "ACTED_IN"))
->returning($coActors->property("name"))
->build();
```