wikibase-solutions / php-cypher-dsl
A query builder for the Cypher query language
Installs: 49 953
Dependents: 3
Suggesters: 0
Security: 0
Stars: 18
Watchers: 6
Forks: 5
pkg:composer/wikibase-solutions/php-cypher-dsl
Requires
- php: >=8.1
- ext-ctype: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- infection/infection: ^0.29
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0
- rregeer/phpunit-coverage-check: ^0.3.1
- dev-main
- 7.0.0
- 6.0.0
- 5.0.0
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.0
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.1
- 3.0.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-release-7
- dev-96-reusing-nodes-in-create-clause-leads-to-unexpected-behaviour
- dev-62-add-support-for-comparison-chains
- dev-78-insert-parentheses-based-on-precedence
- dev-95-make-more-use-of-variadic-functions
- dev-marijnvanwezel-patch-1
- dev-89-use-php-80-union-types
- dev-feature/rewrite-cast-trait-to-static
- dev-feature/use-union-types
- dev-development
- dev-support/5.0
This package is auto-updated.
Last update: 2026-02-07 16:18:16 UTC
README
The php-cypher-dsl library provides a way to construct Cypher queries in a type-safe manner.
Documentation
The documentation can be found on the wiki here.
Installation
Requirements
php-cypher-dsl requires PHP 8.1 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 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:
use function WikibaseSolutions\CypherDSL\node; use function WikibaseSolutions\CypherDSL\query; $tom = node("Person")->withProperties(["name" => "Tom Hanks"]); $coActors = node(); $statement = query() ->match($tom->relationshipTo(node(), "ACTED_IN")->relationshipFrom($coActors, "ACTED_IN")) ->returning($coActors->property("name")) ->build();
This produces the following Cypher query (where $1 is a random variable name):
MATCH (:Person {name: 'Tom Hanks'})-[:ACTED_IN]->()<-[:ACTED_IN]-($1) RETURN $1.name