From 3aa6bb4d001d2aefdf853b5bf21878eee4a4474e Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 14:19:56 +0200 Subject: [PATCH 001/217] quick fix readme --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9473539f..664f04bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# NeoClient +# Neo4j-PHP-Client -## A PHP HttpClient for the Neo4j ReST API with MultiDB Support +## A PHP Client for the Neo4j ReST API with Enterprise Support [![Build Status](https://travis-ci.org/neoxygen/neo4j-neoclient.svg?branch=master)](https://travis-ci.org/neoxygen/neo4j-neoclient) [![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) @@ -9,15 +9,10 @@ [![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/neoxygen/neoclient) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/bac840f0-7b30-4206-a0e0-c6f4ca320077/big.png)](https://insight.sensiolabs.com/projects/bac840f0-7b30-4206-a0e0-c6f4ca320077) -## Supported and Sponsored By - -[![GraphAware](http://graphaware.com/images/logo.png)](http://graphaware.com) -[![GraphStory](http://i.imgur.com/ykEDw8s.png)](https://www.graphstory.com/) - ## Introduction -NeoClient is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. +Neo4j-PHP-Client is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. ### What is Neo4j? From 37217fe71e734f9ed9453a63001b66933a16ed11 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 19:49:43 +0200 Subject: [PATCH 002/217] bootstrapping namespecing and removing old stuff --- .phpspec/class.tpl | 18 --- .travis.yml | 6 +- README.md | 4 +- composer.json | 25 ++--- phpspec.yml | 4 - .../NeoClient/Command/CommandManagerSpec.php | 51 --------- .../NeoClient/Command/SimpleCommandSpec.php | 20 ---- .../Connection/ConnectionManagerSpec.php | 104 ------------------ .../NeoClient/Connection/ConnectionSpec.php | 77 ------------- spec/Neoxygen/NeoClient/default_config.yml | 15 --- 10 files changed, 15 insertions(+), 309 deletions(-) delete mode 100644 .phpspec/class.tpl delete mode 100644 phpspec.yml delete mode 100644 spec/Neoxygen/NeoClient/Command/CommandManagerSpec.php delete mode 100644 spec/Neoxygen/NeoClient/Command/SimpleCommandSpec.php delete mode 100644 spec/Neoxygen/NeoClient/Connection/ConnectionManagerSpec.php delete mode 100644 spec/Neoxygen/NeoClient/Connection/ConnectionSpec.php delete mode 100644 spec/Neoxygen/NeoClient/default_config.yml diff --git a/.phpspec/class.tpl b/.phpspec/class.tpl deleted file mode 100644 index 5c1023ad..00000000 --- a/.phpspec/class.tpl +++ /dev/null @@ -1,18 +0,0 @@ -" NeoClient package -* -* (c) Neoxygen.io -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -* -*/ - -namespace %namespace%; - -class %name% -{ - -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b98f5039..b407abef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ php: env: - NEO_VERSION="2.1.6" - NEO_VERSION="2.1.8" - - NEO_VERSION="2.2.2" - - NEO_VERSION="2.2.3" + - NEO_VERSION="2.2.5" + - NEO_VERSION="2.3.0-M03" matrix: allow_failures: @@ -32,4 +32,4 @@ script: - vendor/bin/phpunit notifications: - email: "willemsen.christophe@gmail.com" + email: "christophe@graphaware.com" diff --git a/README.md b/README.md index 664f04bf..17fb532d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Neo4j is a transactional, open-source graph database. A graph database manages d You can: - * Check out an [example application build with NeoClient](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) + * Check out an [example application built with NeoClient](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=neo4j-neoclient-php,php,neo4j) * Chat with us on Gitter: [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/neoxygen/neo4j-neoclient?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) * For bugs, please feel free to create a [new issue on GitHub](https://github.com/neoxygen/neo4j-neoclient/issues/new) @@ -63,7 +63,7 @@ You can: Add the library to your composer dependencies : ```bash -composer require neoxygen/neoclient +composer require graphaware/neo4j-php-client ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : diff --git a/composer.json b/composer.json index f5cf3ba1..a1ba490b 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,15 @@ { - "name": "neoxygen/neoclient", + "name": "graphaware/neo4j-php-client", "type": "library", - "description": "NeoClient is the most advanced Http Client for Neo4j", + "description": "Neo4j-PHP-Client is the most advanced Client for Neo4j", "keywords": [ "graph", + "database" "neo4j", "cluster", "client", + "bolt", + "http", "high-availibility" ], "homepage": "http://neoxygen.io", @@ -14,7 +17,7 @@ "authors": [ { "name": "Christophe Willemsen", - "email": "chris@neoxygen.io" + "email": "christophe@graphaware.com" } ], "require": { @@ -25,28 +28,20 @@ "symfony/config": "^2.7", "symfony/dependency-injection": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-response-formatter": "^1.0" + "graphaware/neo4j-response-formatter": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0", - "phpunit/phpunit": "4.*", - "bossa/phpspec2-expect": "*", - "behat/behat": "~3.0" + "phpunit/phpunit": "4.*" }, "autoload": { "psr-4": { - "Neoxygen\\NeoClient\\": "src/" + "GraphAware\\Neo4j\\Client\\": "src/" } }, "autoload-dev": { "psr-4": { - "Neoxygen\\NeoClient\\Tests\\": "tests/Neoxygen/NeoClient/Tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" + "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" } } } diff --git a/phpspec.yml b/phpspec.yml deleted file mode 100644 index ab5718c4..00000000 --- a/phpspec.yml +++ /dev/null @@ -1,4 +0,0 @@ -suites: - suite: - namespace: Neoxygen\NeoClient - psr4_prefix: Neoxygen\NeoClient diff --git a/spec/Neoxygen/NeoClient/Command/CommandManagerSpec.php b/spec/Neoxygen/NeoClient/Command/CommandManagerSpec.php deleted file mode 100644 index 306528e8..00000000 --- a/spec/Neoxygen/NeoClient/Command/CommandManagerSpec.php +++ /dev/null @@ -1,51 +0,0 @@ -shouldHaveType('Neoxygen\NeoClient\Command\CommandManager'); - } - - function it_should_have_an_empty_array_of_commands_by_default() - { - $this->getCommands()->shouldHaveCount(0); - } - - function it_should_register_new_commands(SimpleCommand $command) - { - $this->registerCommand('neo.simple_command', $command); - $this->getCommands()->shouldHaveCount(1); - } - - function it_should_throw_error_if_command_is_already_registered(SimpleCommand $command) - { - $this->registerCommand('neo.test', $command); - $this->shouldThrow('Neoxygen\NeoClient\Exception\CommandException')->duringRegisterCommand('neo.test', $command); - } - - function it_should_return_a_command_by_alias(SimpleCommand $command) - { - $this->registerCommand('neo.test', $command); - $this->getCommand('neo.test')->shouldHaveType('Neoxygen\NeoClient\Command\SimpleCommand'); - } - - function it_should_throw_error_if_command_does_not_exist() - { - $this->shouldThrow('Neoxygen\NeoClient\Exception\CommandException')->duringGetCommand('neo.test'); - } - - function it_should_return_bool_if_command_exist(SimpleCommand $command) - { - $this->hasCommand('neo.test')->shouldReturn(false); - $this->registerCommand('neo.test', $command); - $this->hasCommand('neo.test')->shouldReturn(true); - } - -} diff --git a/spec/Neoxygen/NeoClient/Command/SimpleCommandSpec.php b/spec/Neoxygen/NeoClient/Command/SimpleCommandSpec.php deleted file mode 100644 index c84edd7d..00000000 --- a/spec/Neoxygen/NeoClient/Command/SimpleCommandSpec.php +++ /dev/null @@ -1,20 +0,0 @@ -beConstructedWith($client); - } - - function it_is_initializable() - { - $this->shouldHaveType('Neoxygen\NeoClient\Command\SimpleCommand'); - } -} diff --git a/spec/Neoxygen/NeoClient/Connection/ConnectionManagerSpec.php b/spec/Neoxygen/NeoClient/Connection/ConnectionManagerSpec.php deleted file mode 100644 index e0a35052..00000000 --- a/spec/Neoxygen/NeoClient/Connection/ConnectionManagerSpec.php +++ /dev/null @@ -1,104 +0,0 @@ -shouldHaveType('Neoxygen\NeoClient\Connection\ConnectionManager'); - } - - public function it_should_have_an_empty_array_of_connections() - { - $this->getConnections()->shouldHaveCount(0); - } - - public function it_should_register_new_connections(Connection $connection) - { - $connection->getAlias()->willReturn('default'); - $this->registerConnection($connection); - $this->getConnections()->shouldHaveCount(1); - } - - public function it_should_return_a_connection_for_a_specific_alias(Connection $connection) - { - $connection->getAlias()->willReturn('default'); - $this->registerConnection($connection); - $this->getConnection('default')->shouldHaveType('Neoxygen\NeoClient\Connection\Connection'); - } - - public function it_should_throw_error_if_connection_does_not_exist() - { - $this->shouldThrow('Neoxygen\NeoClient\Exception\InvalidConnectionException')->duringGetConnection(); - } - - public function it_should_throw_error_for_default_connection_when_none_configured() - { - $this->shouldThrow('Neoxygen\NeoClient\Exception\InvalidConnectionException')->duringGetDefaultConnection(); - } - - public function it_should_throw_error_when_defining_default_con_that_does_not_exist() - { - $this->shouldThrow('Neoxygen\NeoClient\Exception\InvalidConnectionException')->duringSetDefaultConnection('default'); - } - - public function it_should_set_the_default_connection_when_it_exist(Connection $connection) - { - $connection->getAlias()->willReturn('default'); - $this->registerConnection($connection); - $this->setDefaultConnection('default'); - $this->getDefaultConnection()->shouldReturn($connection); - } - - public function it_should_return_the_first_connection_when_none_default_is_configured() - { - $connection = $this->getIConnection(); - $connection2 = $this->getIConnection(); - $this->registerConnection($connection); - $this->registerConnection($connection2); - $this->getConnections()->shouldHaveCount(2); - - $this->getDefaultConnection()->shouldReturn($connection); - } - - public function it_should_return_the_default_Connection_2() - { - $connection = $this->getIConnection(); - $connection2 = $this->getIConnection(); - $this->registerConnection($connection); - $this->registerConnection($connection2); - $this->setDefaultConnection($connection2->getAlias()); - $this->getConnections()->shouldHaveCount(2); - - $this->getDefaultConnection()->shouldReturn($connection2); - } - - public function it_should_return_bool_for_has_connection_alias(Connection $connection) - { - $this->hasConnection('default')->shouldReturn(false); - $connection->getAlias()->willReturn('default'); - $this->registerConnection($connection); - $this->hasConnection('default')->shouldReturn(true); - - } - - public function it_should_return_default_connection_if_not_connection_is_defined(Connection $connection) - { - $connection->getAlias()->willReturn('default'); - $this->registerConnection($connection); - $this->getConnection()->shouldHaveType('Neoxygen\NeoClient\Connection\Connection'); - } - - private function getIConnection() - { - $alias = sha1(microtime(true).uniqid()); - $con = new Connection($alias); - - return $con; - - } -} diff --git a/spec/Neoxygen/NeoClient/Connection/ConnectionSpec.php b/spec/Neoxygen/NeoClient/Connection/ConnectionSpec.php deleted file mode 100644 index e16c9425..00000000 --- a/spec/Neoxygen/NeoClient/Connection/ConnectionSpec.php +++ /dev/null @@ -1,77 +0,0 @@ -beConstructedWith(Argument::any()); - } - - public function it_is_initializable() - { - $this->shouldHaveType('Neoxygen\NeoClient\Connection\Connection'); - } - - public function it_should_have_an_alias_on_construct() - { - $this->getAlias()->shouldNotBeNull(); - } - - public function it_should_have_a_default_http_scheme() - { - $this->getScheme()->shouldReturn('http'); - } - - public function it_should_have_a_default_host() - { - $this->getHost()->shouldNotBeNull(); - } - - public function it_should_have_a_port_by_default() - { - $this->getPort()->shouldNotBeNull(); - } - - public function it_should_return_the_base_url() - { - $this->getBaseUrl()->shouldReturn('http://localhost:7474'); - } - - public function its_auth_mode_should_not_be_set_by_default() - { - $this->shouldNotBeAuth(); - } - - public function its_auth_mode_should_be_switchable() - { - $this->setAuthMode(); - $this->shouldBeAuth(); - } - - public function it_should_not_have_a_auth_user_by_default() - { - $this->getAuthUser()->shouldBeNull(); - } - - public function its_user_should_be_mutable() - { - $this->setAuthUser(Argument::any()); - $this->getAuthUser()->shouldNotBeNull(); - } - - public function it_should_not_have_a_auth_password() - { - $this->getAuthPassword()->shouldBeNull(); - } - - public function its_auth_password_should_be_mutable() - { - $this->setAuthPassword(Argument::any()); - $this->getAuthPassword()->shouldNotBeNull(); - } -} diff --git a/spec/Neoxygen/NeoClient/default_config.yml b/spec/Neoxygen/NeoClient/default_config.yml deleted file mode 100644 index 126e1c7a..00000000 --- a/spec/Neoxygen/NeoClient/default_config.yml +++ /dev/null @@ -1,15 +0,0 @@ -connections: - default: - scheme: http - host: localhost - port: 7474 - -# extensions: -# core: -# class: "Neoxygen\\NeoClient\\Extension\\NeoClientCoreExtension" - -# loggers: -# neoclient: -# type: stream -# path: /Users/ikwattro/dev/logs/neoclient.log -# level: debug \ No newline at end of file From 353d4925c6d9a1e9d1daeda5f7ff272a22bdaf22 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 21:47:56 +0200 Subject: [PATCH 003/217] removed legacy auth and bundle --- .../DataCollector/NeoClientDataCollector.php | 27 ------- .../NeoxygenNeoClientExtension.php | 32 --------- src/Bundle/NeoxygenNeoClientBundle.php | 19 ----- src/Bundle/Resources/config/services.yml | 11 --- .../Resources/views/dataCollector.html.twig | 63 ----------------- src/Command/Auth/AuthAddUserCommand.php | 70 ------------------- src/Command/Auth/AuthListUsersCommand.php | 26 ------- src/Command/Auth/AuthRemoveUserCommand.php | 53 -------------- src/Resources/extensions/auth_commands.yml | 6 -- 9 files changed, 307 deletions(-) delete mode 100644 src/Bundle/DataCollector/NeoClientDataCollector.php delete mode 100644 src/Bundle/DependencyInjection/NeoxygenNeoClientExtension.php delete mode 100644 src/Bundle/NeoxygenNeoClientBundle.php delete mode 100644 src/Bundle/Resources/config/services.yml delete mode 100644 src/Bundle/Resources/views/dataCollector.html.twig delete mode 100644 src/Command/Auth/AuthAddUserCommand.php delete mode 100644 src/Command/Auth/AuthListUsersCommand.php delete mode 100644 src/Command/Auth/AuthRemoveUserCommand.php delete mode 100644 src/Resources/extensions/auth_commands.yml diff --git a/src/Bundle/DataCollector/NeoClientDataCollector.php b/src/Bundle/DataCollector/NeoClientDataCollector.php deleted file mode 100644 index a2f59462..00000000 --- a/src/Bundle/DataCollector/NeoClientDataCollector.php +++ /dev/null @@ -1,27 +0,0 @@ -data = array( - 'memory' => memory_get_peak_usage(true), - ); - } - - public function getMemory() - { - return $this->data['memory']; - } - - public function getName() - { - return 'neoclient'; - } -} diff --git a/src/Bundle/DependencyInjection/NeoxygenNeoClientExtension.php b/src/Bundle/DependencyInjection/NeoxygenNeoClientExtension.php deleted file mode 100644 index baa149c2..00000000 --- a/src/Bundle/DependencyInjection/NeoxygenNeoClientExtension.php +++ /dev/null @@ -1,32 +0,0 @@ -load('services.yml'); - - return parent::load($configs, $container); - } - - public function getAlias() - { - return 'neoxygen_neo_client'; - } -} diff --git a/src/Bundle/NeoxygenNeoClientBundle.php b/src/Bundle/NeoxygenNeoClientBundle.php deleted file mode 100644 index a59394a8..00000000 --- a/src/Bundle/NeoxygenNeoClientBundle.php +++ /dev/null @@ -1,19 +0,0 @@ -addCompilerPass(new NeoClientExtensionsCompilerPass()); - $container->addCompilerPass(new ConnectionRegistryCompilerPass()); - } -} diff --git a/src/Bundle/Resources/config/services.yml b/src/Bundle/Resources/config/services.yml deleted file mode 100644 index c4ae33d9..00000000 --- a/src/Bundle/Resources/config/services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - neoxygen.neoclient: - class: "Neoxygen\\NeoClient\\ServiceContainer" - arguments: ["@service_container"] - calls: - - ["addSubscribers"] - - data_collector.neoclient: - class: "Neoxygen\\NeoClient\\Bundle\\DataCollector\\NeoClientDataCollector" - tags: - - { name: data_collector, template: "NeoxygenNeoClientBundle::dataCollector", id: "neoclient" } diff --git a/src/Bundle/Resources/views/dataCollector.html.twig b/src/Bundle/Resources/views/dataCollector.html.twig deleted file mode 100644 index be015f2d..00000000 --- a/src/Bundle/Resources/views/dataCollector.html.twig +++ /dev/null @@ -1,63 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {# the web debug toolbar content #} - -
-
- - - Memory Usage - 0.0 MB - -
- -
- -
- GraphDB Queries - 0 -
-
- Query time - 0.00 ms -
- -
- - - -
- - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': 'neoclient', 'panel': 'neoclient', 'icon': '' } %} - -{% endblock %} - -{% block head %} - {# if the web profiler panel needs some specific JS or CSS files #} - - {{ parent() }} -{% endblock %} - -{% block menu %} - {# the menu content #} - - -{{ (collector.name|capitalize)|default('HTTP calls') }} -{{ (collector.name|capitalize)|default('HTTP calls') }} - - - 0 - 0 ms - - - -{% endblock %} - -{% block panel %} - -
-

Neo4j

-
- -{% endblock %} diff --git a/src/Command/Auth/AuthAddUserCommand.php b/src/Command/Auth/AuthAddUserCommand.php deleted file mode 100644 index b14c3e3d..00000000 --- a/src/Command/Auth/AuthAddUserCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Auth; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class AuthAddUserCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/auth/add-user-'; - - private $readOnly = false; - - private $user; - - private $password; - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), $this->prepareBody(), $this->connection); - } - - public function setReadOnly($readOnly) - { - $this->readOnly = $readOnly; - - return $this; - } - - public function setUser($user) - { - $this->user = $user; - - return $this; - } - - public function setPassword($password) - { - $this->password = $password; - - return $this; - } - - protected function prepareBody() - { - $userField = array( - 'user' => $this->user.':'.$this->password, - ); - - return $userField; - } - - protected function getPath() - { - $mode = true === $this->readOnly ? 'ro' : 'rw'; - $path = self::PATH.$mode; - - return $path; - } -} diff --git a/src/Command/Auth/AuthListUsersCommand.php b/src/Command/Auth/AuthListUsersCommand.php deleted file mode 100644 index f095dc7d..00000000 --- a/src/Command/Auth/AuthListUsersCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Auth; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class AuthListUsersCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/auth/list'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } -} diff --git a/src/Command/Auth/AuthRemoveUserCommand.php b/src/Command/Auth/AuthRemoveUserCommand.php deleted file mode 100644 index ec160986..00000000 --- a/src/Command/Auth/AuthRemoveUserCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Auth; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class AuthRemoveUserCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/auth/remove-user'; - - private $user; - - private $password; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, $this->prepareBody(), $this->connection); - } - - public function setUser($user) - { - $this->user = $user; - - return $this; - } - - public function setPassword($password) - { - $this->password = $password; - - return $this; - } - - protected function prepareBody() - { - $userField = array( - 'user' => $this->user.':'.$this->password, - ); - - return $userField; - } -} diff --git a/src/Resources/extensions/auth_commands.yml b/src/Resources/extensions/auth_commands.yml deleted file mode 100644 index 0d37a037..00000000 --- a/src/Resources/extensions/auth_commands.yml +++ /dev/null @@ -1,6 +0,0 @@ -neo.list_users: - class: "Neoxygen\\NeoClient\\Command\\Auth\\AuthListUsersCommand" -neo.add_user: - class: "Neoxygen\\NeoClient\\Command\\Auth\\AuthAddUserCommand" -neo.remove_user: - class: "Neoxygen\\NeoClient\\Command\\Auth\\AuthRemoveUserCommand" From e09ea7ae44617bdbf58ff51d43bb00c708be8c5a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 22:06:06 +0200 Subject: [PATCH 004/217] Statement object --- composer.json | 2 +- composer.lock | 783 ++---------------- phpunit.xml | 2 +- src/Transaction/Statement.php | 83 ++ .../Tests/Functional/UseCaseTest.php | 228 ----- .../Tests/Schema/SchemaIntegrationTest.php | 156 ---- tests/Unit/Transaction/StatementUnitTest.php | 29 + 7 files changed, 204 insertions(+), 1079 deletions(-) create mode 100644 src/Transaction/Statement.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Schema/SchemaIntegrationTest.php create mode 100644 tests/Unit/Transaction/StatementUnitTest.php diff --git a/composer.json b/composer.json index a1ba490b..964a78d4 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "Neo4j-PHP-Client is the most advanced Client for Neo4j", "keywords": [ "graph", - "database" + "database", "neo4j", "cluster", "client", diff --git a/composer.lock b/composer.lock index b353dcda..df5af3a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e60d2b09a5ccc646058d3081d74f563a", + "hash": "1e2080dcbd6beadf4a3b724d143a4a0e", "packages": [ { "name": "graphaware/neo4j-response-formatter", - "version": "1.1.5", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-response-formatter.git", - "reference": "1cc1ac1bc1f573aeb231ee424c55fae137beea47" + "reference": "a1a1bbbd445163c5dc06e5e47a8fec07b344f903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-response-formatter/zipball/1cc1ac1bc1f573aeb231ee424c55fae137beea47", - "reference": "1cc1ac1bc1f573aeb231ee424c55fae137beea47", + "url": "https://api.github.com/repos/graphaware/neo4j-php-response-formatter/zipball/a1a1bbbd445163c5dc06e5e47a8fec07b344f903", + "reference": "a1a1bbbd445163c5dc06e5e47a8fec07b344f903", "shasum": "" }, "require": { @@ -45,20 +45,20 @@ } ], "description": "Response Formatter for NeoClient", - "time": "2015-08-04 22:19:01" + "time": "2015-08-06 21:11:14" }, { "name": "guzzlehttp/guzzle", - "version": "6.0.2", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f" + "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a8dfeff00eb84616a17fea7a4d72af35e750410f", - "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81", + "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81", "shasum": "" }, "require": { @@ -74,7 +74,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -107,20 +107,20 @@ "rest", "web service" ], - "time": "2015-07-04 20:09:24" + "time": "2015-09-08 17:36:26" }, { "name": "guzzlehttp/promises", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7" + "reference": "97fe7210def29451ec74923b27e552238defd75a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7", - "reference": "2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7", + "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", + "reference": "97fe7210def29451ec74923b27e552238defd75a", "shasum": "" }, "require": { @@ -140,7 +140,7 @@ "GuzzleHttp\\Promise\\": "src/" }, "files": [ - "src/functions.php" + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -158,20 +158,20 @@ "keywords": [ "promise" ], - "time": "2015-06-24 16:16:25" + "time": "2015-08-15 19:37:21" }, { "name": "guzzlehttp/psr7", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd" + "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/af0e1758de355eb113917ad79c3c0e3604bce4bd", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", + "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", "shasum": "" }, "require": { @@ -195,7 +195,7 @@ "GuzzleHttp\\Psr7\\": "src/" }, "files": [ - "src/functions.php" + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -216,20 +216,20 @@ "stream", "uri" ], - "time": "2015-06-24 19:55:15" + "time": "2015-08-15 19:32:36" }, { "name": "monolog/monolog", - "version": "1.15.0", + "version": "1.17.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0" + "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/dc5150cc608f2334c72c3b6a553ec9668a4156b0", - "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", + "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", "shasum": "" }, "require": { @@ -246,7 +246,7 @@ "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.8", + "raven/raven": "~0.11", "ruflin/elastica": ">=0.90 <3.0", "swiftmailer/swiftmailer": "~5.3", "videlalvaro/php-amqplib": "~2.4" @@ -266,7 +266,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15.x-dev" + "dev-master": "1.16.x-dev" } }, "autoload": { @@ -292,7 +292,7 @@ "logging", "psr-3" ], - "time": "2015-07-12 13:54:09" + "time": "2015-08-31 09:17:37" }, { "name": "psr/http-message", @@ -383,16 +383,16 @@ }, { "name": "symfony/config", - "version": "v2.7.3", + "version": "v2.7.5", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9" + "url": "https://github.com/symfony/config.git", + "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9", + "url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61", + "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61", "shasum": "" }, "require": { @@ -429,20 +429,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-09-21 15:02:29" }, { "name": "symfony/dependency-injection", - "version": "v2.7.3", + "version": "v2.7.5", "source": { "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", - "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e", + "reference": "422c3819b110f610d79c6f1dc38af23787dc790e", "shasum": "" }, "require": { @@ -489,20 +489,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" + "time": "2015-09-15 08:30:42" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.3", + "version": "v2.7.5", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", + "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", "shasum": "" }, "require": { @@ -547,20 +547,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-06-18 19:21:56" + "time": "2015-09-22 13:49:29" }, { "name": "symfony/filesystem", - "version": "v2.7.3", + "version": "v2.7.5", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8" + "url": "https://github.com/symfony/filesystem.git", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", "shasum": "" }, "require": { @@ -596,20 +596,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-09-09 17:42:36" }, { "name": "symfony/yaml", - "version": "v2.7.3", + "version": "v2.7.5", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" + "url": "https://github.com/symfony/yaml.git", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", + "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", "shasum": "" }, "require": { @@ -645,235 +645,10 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" + "time": "2015-09-14 14:14:09" } ], "packages-dev": [ - { - "name": "behat/behat", - "version": "v3.0.15", - "source": { - "type": "git", - "url": "https://github.com/Behat/Behat.git", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", - "shasum": "" - }, - "require": { - "behat/gherkin": "~4.3", - "behat/transliterator": "~1.0", - "ext-mbstring": "*", - "php": ">=5.3.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.3", - "symfony/console": "~2.1", - "symfony/dependency-injection": "~2.1", - "symfony/event-dispatcher": "~2.1", - "symfony/translation": "~2.3", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.0", - "symfony/process": "~2.1" - }, - "suggest": { - "behat/mink-extension": "for integration with Mink testing framework", - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework" - }, - "bin": [ - "bin/behat" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Behat": "src/", - "Behat\\Testwork": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Agile", - "BDD", - "ScenarioBDD", - "Scrum", - "StoryBDD", - "User story", - "business", - "development", - "documentation", - "examples", - "symfony", - "testing" - ], - "time": "2015-02-22 14:10:33" - }, - { - "name": "behat/gherkin", - "version": "v4.3.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/43777c51058b77bcd84a8775b7a6ad05e986b5db", - "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "time": "2014-06-06 01:24:32" - }, - { - "name": "behat/transliterator", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/Behat/Transliterator.git", - "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", - "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Transliterator": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Artistic-1.0" - ], - "description": "String transliterator", - "keywords": [ - "i18n", - "slug", - "transliterator" - ], - "time": "2014-05-15 22:08:22" - }, - { - "name": "bossa/phpspec2-expect", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/BossaConsulting/phpspec2-expect.git", - "reference": "f3a80b7fa743b8a1078a7e320bd3e8b8b6283780" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/BossaConsulting/phpspec2-expect/zipball/f3a80b7fa743b8a1078a7e320bd3e8b8b6283780", - "reference": "f3a80b7fa743b8a1078a7e320bd3e8b8b6283780", - "shasum": "" - }, - "require": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "autoload": { - "files": [ - "expect.php" - ], - "psr-0": { - "Bossa\\PhpSpec\\Expect\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Helper that decorates any SUS with a phpspec lazy object wrapper", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification" - ], - "time": "2014-09-12 09:25:51" - }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -977,130 +752,18 @@ ], "time": "2015-02-03 12:10:50" }, - { - "name": "phpspec/php-diff", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton", - "role": "Original developer" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2013-11-01 13:02:21" - }, - { - "name": "phpspec/phpspec", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec.git", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/e9a40577323e67f1de2e214abf32976a0352d8f8", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.1", - "php": ">=5.3.3", - "phpspec/php-diff": "~1.0.0", - "phpspec/prophecy": "~1.4", - "sebastian/exporter": "~1.0", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "behat/behat": "^3.0.11", - "bossa/phpspec2-expect": "~1.0", - "phpunit/phpunit": "~4.4", - "symfony/filesystem": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" - }, - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "PhpSpec": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.3+", - "homepage": "http://phpspec.net/", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification", - "testing", - "tests" - ], - "time": "2015-05-30 15:21:40" - }, { "name": "phpspec/prophecy", - "version": "v1.4.1", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", "shasum": "" }, "require": { @@ -1147,20 +810,20 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2015-08-13 10:07:40" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.2", + "version": "2.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" + "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f", + "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f", "shasum": "" }, "require": { @@ -1209,7 +872,7 @@ "testing", "xunit" ], - "time": "2015-08-04 03:42:39" + "time": "2015-09-14 06:51:16" }, { "name": "phpunit/php-file-iterator", @@ -1342,16 +1005,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.3", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -1387,20 +1050,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-06-19 03:43:16" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.7.7", + "version": "4.8.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724" + "reference": "463163747474815c5ccd4ae12b5b355ec12158e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/463163747474815c5ccd4ae12b5b355ec12158e8", + "reference": "463163747474815c5ccd4ae12b5b355ec12158e8", "shasum": "" }, "require": { @@ -1410,7 +1073,7 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", + "phpspec/prophecy": "^1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", @@ -1418,7 +1081,7 @@ "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -1433,7 +1096,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -1459,24 +1122,24 @@ "testing", "xunit" ], - "time": "2015-07-13 11:28:34" + "time": "2015-10-01 09:14:30" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.6", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", + "doctrine/instantiator": "^1.0.2", "php": ">=5.3.3", "phpunit/php-text-template": "~1.2", "sebastian/exporter": "~1.2" @@ -1515,7 +1178,7 @@ "mock", "xunit" ], - "time": "2015-07-10 06:54:24" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", @@ -1887,272 +1550,6 @@ "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/class-loader", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/ClassLoader.git", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "time": "2015-06-25 12:52:11" - }, - { - "name": "symfony/console", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-07-28 15:18:12" - }, - { - "name": "symfony/finder", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/process", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 11:25:50" - }, - { - "name": "symfony/translation", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" } ], "aliases": [], diff --git a/phpunit.xml b/phpunit.xml index 3c1f9325..557d5fe4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -3,7 +3,7 @@ - ./tests/Neoxygen/NeoClient + ./tests diff --git a/src/Transaction/Statement.php b/src/Transaction/Statement.php new file mode 100644 index 00000000..18cde9f7 --- /dev/null +++ b/src/Transaction/Statement.php @@ -0,0 +1,83 @@ +query = (string) $query; + $this->parameters = $parameters; + $this->includeStats = (bool) $includeStats; + } + + /** + * @param string $query + * @param array $parameters + * @param string|null $tag + * @param bool|false $includeStats + * @return \GraphAware\Neo4j\Client\Transaction\Statement + */ + public static function create($query, array $parameters = [], $tag = null, $includeStats = false) + { + return new self($query, $parameters, $tag, $includeStats); + } + + /** + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * @return array + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * @return string|null + */ + public function getTag() + { + return $this->tag; + } + + /** + * @return boolean + */ + public function hasIncludeStats() + { + return $this->includeStats; + } +} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php deleted file mode 100644 index 2bdbe0fb..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php +++ /dev/null @@ -1,228 +0,0 @@ -getClient(); - - $client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - } - - public function testConnectivity() - { - $client = $this->getClient(); - $root = $client->getRoot()->getBody(); - - $this->assertArrayHasKey('data', $root); - $this->assertArrayHasKey('management', $root); - } - - public function testCreatingElement() - { - $client = $this->getClient(); - $q = 'CREATE (u:`User` {name: {name}, email: {email}}) RETURN u'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com']; - $response = $client->sendCypherQuery($q, $params); - $result = $response->getResult(); - - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result',$result); - // The user is getting created successfully but never returned afterwards. - $this->assertArrayHasKey('User', $result->getNodesByLabel('User', true)); - } - - public function testCreatingElementsAndRelations() - { - $client = $this->getClient(); - $q = 'CREATE (u:`User` {name: {name}, email: {email}})-[:LIKES]->(p:`Post` {title: {title}}) RETURN u, p'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'title' => 'Sss']; - $response = $client->sendCypherQuery($q, $params); - $result = $response->getResult(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result',$result); - - $nodes = $result->getNodes(['User', 'Post'], true); - - $this->assertArrayHasKey('User', $nodes); - $this->assertArrayHasKey('Post', $nodes); - - $nodes_too = $result->getNodesByLabels(['User', 'Post'], true); - $this->assertArrayHasKey('User', $nodes_too); - $this->assertArrayHasKey('Post', $nodes_too); - } - - public function testFetchingElementByAttribute() - { - $client = $this->getClient(); - // You need to recreate the user here because you delete the db on each test run with the query in the setUp() method - $q = 'CREATE (u:`User` {name: {name}, email: {email}})-[:LIKES]->(p:`Post` {title: {title}}) RETURN u, p'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'title' => 'Sss']; - $client->sendCypherQuery($q, $params); - - $q = 'MATCH (u:`User`) WHERE u.email = {email} RETURN u'; - - $response = $client->sendCypherQuery($q, ['email' => 'halawi.abed@gmail.com']); - $result = $response->getResult(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result', $result); - $this->assertGreaterThan(0, $result->getNodesCount()); - - $node = current($result->getNodesByLabel('User')); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Node', $node); - $props = $node->getProperties(['name']); - $this->assertEquals(['name' => 'Abed Halawi'], $props); - } - - public function testGettingAndRenamingLabels() - { - $client = $this->getClient(); - - $result = $client->sendCypherQuery('CREATE (n:Order) RETURN n')->getResult(); - $this->assertTrue(in_array('Order', $client->getLabels()->getBody())); - - $client->renameLabel('Order', 'Product'); - - $updated_labels = $client->getLabels()->getBody(); - $this->assertTrue(in_array('Product', $updated_labels)); - } - - public function testIndexing() - { - $client = $this->getClient(); - - $this->assertTrue($client->createIndex('Person', 'email', 'name')); - } - - public function testRelationshipProperty() - { - $client = $this->getClient(); - $q = 'CREATE (n:RelationshipTest)-[r:SOME_REL {time:1234} ]->(x:RelTest) RETURN r'; - $r = $client->sendCypherQuery($q)->getResult(); - $rel = $r->get('r'); - $this->assertEquals(1234, $rel->getProperty('time')); - $this->assertNull($rel->getProperty('nonExist')); - } - - public function testFormatterIsResetBetweenQueries() - { - $client = $this->getClient(); - $q1 = "CREATE (n:FormatterTest {name:'User1'})"; - $q2 = "CREATE (n:FormatterTest {name:'User2'})"; - $client->sendCypherQuery($q1); - $client->sendCypherQuery($q2); - $match1 = "MATCH (n:FormatterTest {name:'User1'}) RETURN n"; - $match2 = "MATCH (n:FormatterTest {name:'User2'}) RETURN n"; - $r1 = $client->sendCypherQuery($match1)->getResult(); - $this->assertCount(1, $r1->getNodes()); - $r2 = $client->sendCypherQuery($match2)->getResult(); - $this->assertCount(1, $r2->getNodes()); - $this->assertCount(1, $r1->getnodes()); - - } - - public function testCreateTransaction() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery($q); - $query = 'MATCH (n:`Person`) RETURN n LIMIT 25'; - - $tx = $client->createTransaction(); - $tx->pushQuery($query); - $tx->commit(); - $this->assertCount(1, $tx->getResults()); - $this->assertCount(25, $tx->getResults()[0]->getNodes()); - - } - - public function testReuseNodeIdForOtherQuery() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery($q); - $q2 = 'MATCH (n:Person) RETURN n LIMIT 1'; - $r = $client->sendCypherQuery($q2)->getResult(); - $node = $r->get('n'); - $r2 = $client->sendCypherQuery(' - MATCH (a:Person) - WHERE id(a) = {id} - RETURN a -', array( - 'id' => $node->getId() - ))->getResult(); - - $this->assertEquals($node->getId(), $r2->get('a')->getId()); - } - - public function testGetReturnsArray() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - $client->sendCypherQuery($q); - $result = $client->sendCypherQuery('MATCH (n:Person) RETURN n.id as pId')->getResult(); - $this->assertCount(25, $result->get('pId')); - - } - - public function testGetConnectedNodes() - { - $client = $this->getClient(); - $q = 'CREATE (a:Connected {id:1}), (b:Connected {id:2}), (c:Connected {id:3}) - MERGE (a)-[:LINKS_TO]->(b) - MERGE (b)-[:LINKS_TO]->(c) - MERGE (c)-[:LINKS_TO]->(a)'; - $client->sendCypherQuery($q); - $q = 'MATCH (a:Connected {id:1}) OPTIONAL MATCH (a)-[r]-(b) RETURN a,r,b'; - $result = $client->sendCypherQuery($q)->getResult(); - $a = $result->get('a'); - $this->assertTrue($a->hasConnectedNodes()); - $b = $a->getConnectedNode('OUT'); - $this->assertEquals(2, $b->getProperty('id')); - $this->assertTrue($b->hasConnectedNodes()); - } - - public function testIdentifierWithDotIsHandled() - { - $client = $this->getClient(); - $result = $client->sendCypherQuery(' - CREATE (a:TEST {foo: {bar}}) - RETURN a.foo -', array( - 'bar' => array(1, 2, 3) - ))->getResult(); - - $this->assertNotEmpty($result->get('a.foo')); - $this->assertInternalType('array', $result->get('a.foo')); - } - - public function testItCanAddAConstraintIfIndexAlreadyExist() - { - $client = $this->getClient(); - try { - $client->createIndex('Tag', 'name'); - } catch (Neo4jException $e) { - - } - $this->assertTrue($client->createUniqueConstraint('Tag', 'name', true)); - } - - /** - * @return \Neoxygen\NeoClient\Client - */ - protected function getClient() - { - return $this->getConnection(); - } -} diff --git a/tests/Neoxygen/NeoClient/Tests/Schema/SchemaIntegrationTest.php b/tests/Neoxygen/NeoClient/Tests/Schema/SchemaIntegrationTest.php deleted file mode 100644 index 2402474a..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Schema/SchemaIntegrationTest.php +++ /dev/null @@ -1,156 +0,0 @@ -client = $this->getConnection(); - $this->resetDatabase(); - } - - /** - * @group schema - * @group integration - */ - public function testIndexObjectIsReturnedWhenCreatingIndex() - { - $index = $this->client->createSchemaIndex("SchemaNode", "id"); - $this->assertInstanceOf('Neoxygen\NeoClient\Schema\Index', $index); - } - - /** - * @group schema - * @group integration - */ - public function testSchemaIndexesAreReturned() - { - $index = $this->client->createSchemaIndex("SchemaNode", "id"); - $this->assertIndexIsLive($index); - } - - /** - * @group schema - * @group integration - */ - public function testMultipleIndexesAreReturned() - { - $this->client->createSchemaIndex("SchemaNode", "id"); - $this->client->createSchemaIndex("SchemaNode", "login"); - $indexes = $this->client->getSchemaIndexes(); - - $this->assertCount(2, $indexes); - } - - /** - * @group schema - * @group integration - */ - public function testIndexIsDropped() - { - $index = $this->client->createSchemaIndex("SchemaNode", "id"); - $this->client->dropSchemaIndex($index); - - $this->assertCount(0, $this->client->getSchemaIndexes()); - } - - /** - * @group schema - * @group integration - */ - public function testUniqueConstraintIsCreated() - { - $constraint = $this->client->createSchemaUniqueConstraint("UniqueNode", "id"); - $this->assertInstanceOf('Neoxygen\NeoClient\Schema\UniqueConstraint', $constraint); - $this->assertUniqueConstraintIsLive($constraint); - - } - - /** - * @group schema - * @group integration - */ - public function testDropUniqueConstraint() - { - $constraint = $this->client->createSchemaUniqueConstraint("UniqueNode", "id"); - $this->client->dropSchemaUniqueConstraint($constraint); - - $this->assertCount(0, $this->client->getSchemaUniqueConstraints()); - } - - /** - * @group schema - * @group integration - */ - public function testMultipleConstraintsAreReturned() - { - $this->client->createSchemaUniqueConstraint("UniqueNode", "id"); - $this->client->createSchemaUniqueConstraint("UniqueNode", "login"); - $this->assertCount(2, $this->client->getSchemaUniqueConstraints()); - } - - /** - * @group schema - * @group integration - * @group legacy - */ - public function testLegacyUniqueConstraints() - { - $this->client->createUniqueConstraint('User', 'id'); - $constraints = $this->client->getUniqueConstraints(); - $this->assertArrayHasKey('User', $constraints->getBody()); - } - - /** - * @group legacy - */ - public function tesLegacyUniqueConstraintsWithNewFormattingService() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->enableNewFormattingService() - ->build(); - $constraints = $client->getUniqueConstraints(); - $this->assertArrayHasKey('User', $constraints->getBody()); - } - - /** - * @group schema - */ - public function testListIndexesWithNewFormattingService() - { - $this->assertInternalType('array', $this->getConnection()->listIndexes()->getBody()); - } - - private function assertUniqueConstraintIsLive(UniqueConstraint $index) - { - $indexes = $this->client->getSchemaUniqueConstraints(); - - $this->assertThat( - $index, - new SchemaContainsIndexConstraint($indexes) - ); - } - - private function assertIndexIsLive(Index $index) - { - $indexes = $this->client->getSchemaIndexes(); - - $this->assertThat( - $index, - new SchemaContainsIndexConstraint($indexes) - ); - } -} \ No newline at end of file diff --git a/tests/Unit/Transaction/StatementUnitTest.php b/tests/Unit/Transaction/StatementUnitTest.php new file mode 100644 index 00000000..3e9c6d4d --- /dev/null +++ b/tests/Unit/Transaction/StatementUnitTest.php @@ -0,0 +1,29 @@ +getQuery()); + $this->assertInstanceOf(Statement::class, $st); + $this->assertEquals($this->getQuery(), $st->getQuery()); + $this->assertInternalType('array', $st->getParameters()); + $this->assertCount(0, $st->getParameters()); + $this->assertNull($st->getTag()); + $this->assertFalse($st->hasIncludeStats()); + } + + private function getQuery() + { + return 'MATCH (n) RETURN count(n)'; + } +} \ No newline at end of file From 2488db17f86dce21850e341cfc7e3818162f4d62 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 22:12:38 +0200 Subject: [PATCH 005/217] Statement tests --- CHANGELOG.md | 5 ++++ src/Transaction/Statement.php | 1 + tests/Unit/Transaction/StatementUnitTest.php | 25 ++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d17c14f..e665d0c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0 + +* new Statement object + + ## 3.3.1 & 3.3.2 * Fixed some bugs concerning live transactions in respect to the send Multiple in the scope of the tx diff --git a/src/Transaction/Statement.php b/src/Transaction/Statement.php index 18cde9f7..2d824357 100644 --- a/src/Transaction/Statement.php +++ b/src/Transaction/Statement.php @@ -34,6 +34,7 @@ public function __construct($query, array $parameters = [], $tag = null, $includ { $this->query = (string) $query; $this->parameters = $parameters; + $this->tag = $tag; $this->includeStats = (bool) $includeStats; } diff --git a/tests/Unit/Transaction/StatementUnitTest.php b/tests/Unit/Transaction/StatementUnitTest.php index 3e9c6d4d..be7e2543 100644 --- a/tests/Unit/Transaction/StatementUnitTest.php +++ b/tests/Unit/Transaction/StatementUnitTest.php @@ -22,6 +22,31 @@ public function testStatementCreationWithoutParams() $this->assertFalse($st->hasIncludeStats()); } + public function testStatementWithFullSignature() + { + $st = new Statement($this->getQuery(), ['id' => 1], 'example.tag', true); + $this->assertCount(1, $st->getParameters()); + $this->assertNotNull($st->getTag()); + $this->assertEquals(1, $st->getParameters()['id']); + $this->assertTrue($st->hasIncludeStats()); + $this->assertEquals('example.tag', $st->getTag()); + } + + public function testStatementStaticCreation() + { + $st = Statement::create($this->getQuery(), ['ID' => 2], 'static.tag'); + $this->assertInstanceOf(Statement::class, $st); + $this->assertEquals('static.tag', $st->getTag()); + $this->assertEquals(2, $st->getParameters()['ID']); + $this->assertFalse($st->hasIncludeStats()); + } + + public function testStatementSkippingParamsAndTag() + { + $st = Statement::create($this->getQuery(), [], null, true); + $this->assertTrue($st->hasIncludeStats()); + } + private function getQuery() { return 'MATCH (n) RETURN count(n)'; From 58b6fb098ce82b933ee69987bddb0c7d8cf3c8ad Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 22:45:19 +0200 Subject: [PATCH 006/217] statements collection --- src/Transaction/StatementCollection.php | 61 +++++++++++++++++++ .../StatementCollectionUnitTest.php | 43 +++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/Transaction/StatementCollection.php create mode 100644 tests/Unit/Transaction/StatementCollectionUnitTest.php diff --git a/src/Transaction/StatementCollection.php b/src/Transaction/StatementCollection.php new file mode 100644 index 00000000..566f89f2 --- /dev/null +++ b/src/Transaction/StatementCollection.php @@ -0,0 +1,61 @@ +tag = $tag; + } + + /** + * @return \GraphAware\Neo4j\Client\Transaction\Statement[] + */ + public function getStatements() + { + return $this->statements; + } + + /** + * @param \GraphAware\Neo4j\Client\Transaction\Statement $statement + */ + public function add(Statement $statement) + { + $this->statements[] = $statement; + } + + /** + * @return int + */ + public function getCount() + { + return count($this->statements); + } + + /** + * @return bool + */ + public function isEmpty() + { + return empty($this->statements); + } + + /** + * @return null|string + */ + public function getTag() + { + return $this->tag; + } +} \ No newline at end of file diff --git a/tests/Unit/Transaction/StatementCollectionUnitTest.php b/tests/Unit/Transaction/StatementCollectionUnitTest.php new file mode 100644 index 00000000..cd42ab8f --- /dev/null +++ b/tests/Unit/Transaction/StatementCollectionUnitTest.php @@ -0,0 +1,43 @@ +assertInstanceOf(StatementCollection::class, $coll); + $this->assertCount(0, $coll->getStatements()); + $this->assertNull($coll->getTag()); + $this->assertTrue($coll->isEmpty()); + } + + public function testCollectionWithStatements() + { + $coll = new StatementCollection(); + $coll->add($this->getQuery()); + $this->assertCount(1, $coll->getStatements()); + $this->assertFalse($coll->isEmpty()); + $this->assertEquals(1, $coll->getCount()); + } + + public function testCollectionWithTag() + { + $coll = new StatementCollection('coll'); + $this->assertEquals('coll', $coll->getTag()); + } + + private function getQuery() + { + return Statement::create('MATCH (n) RETURN count(n)'); + } +} \ No newline at end of file From fd3c415b5f409dd61ade4f059decaf97d6e18216 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 22:48:45 +0200 Subject: [PATCH 007/217] added TransactionInterface --- src/Transaction/TransactionInterface.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/Transaction/TransactionInterface.php diff --git a/src/Transaction/TransactionInterface.php b/src/Transaction/TransactionInterface.php new file mode 100644 index 00000000..6c4ab80a --- /dev/null +++ b/src/Transaction/TransactionInterface.php @@ -0,0 +1,16 @@ + Date: Fri, 2 Oct 2015 23:16:34 +0200 Subject: [PATCH 008/217] first steps of AutoFlushableTransaction --- src/Exception/InvalidArgumentException.php | 5 + .../Neo4jClientExceptionInterface.php | 5 + src/Transaction/AbstractTransaction.php | 97 +++++++++++++++++++ src/Transaction/AutoFlushableTransaction.php | 71 ++++++++++++++ src/Transaction/TransactionInterface.php | 4 + 5 files changed, 182 insertions(+) create mode 100644 src/Exception/InvalidArgumentException.php create mode 100644 src/Exception/Neo4jClientExceptionInterface.php create mode 100644 src/Transaction/AbstractTransaction.php create mode 100644 src/Transaction/AutoFlushableTransaction.php diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..bce89d7d --- /dev/null +++ b/src/Exception/InvalidArgumentException.php @@ -0,0 +1,5 @@ +setMode($mode); + $this->tag = (string) $tag; + } + + /** + * @param string $mode + */ + protected function setMode($mode) + { + if ($mode !== TransactionInterface::TRANSACTION_WRITE && $mode !== TransactionInterface::TRANSACTION_READ) { + throw new InvalidArgumentException(sprintf('The mode "%s" is not a valid Transactional mode', $mode)); + } + + $this->mode = $mode; + } + + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * @return boolean + */ + public function isCommitted() + { + return $this->isCommitted; + } + + /** + * @return boolean + */ + public function isRunning() + { + return $this->isRunning; + } + + /** + * @return boolean + */ + public function isRolledBack() + { + return $this->isRolledBack; + } + + +} \ No newline at end of file diff --git a/src/Transaction/AutoFlushableTransaction.php b/src/Transaction/AutoFlushableTransaction.php new file mode 100644 index 00000000..bdc6bf85 --- /dev/null +++ b/src/Transaction/AutoFlushableTransaction.php @@ -0,0 +1,71 @@ +treshold = (int) $treshold; + $this->statementsCollection = new StatementCollection(); + parent::__construct($mode, $tag); + } + + public function commit() + { + + } + + public function rollback() + { + + } + + /** + * @param \GraphAware\Neo4j\Client\Transaction\Statement $statement + */ + public function push(Statement $statement) + { + $this->statementsCollection->add($statement); + } + + /** + * @param string $query + * @param array $parameters + */ + public function pushQuery($query, array $parameters = []) + { + $this->statementsCollection->add(Statement::create($query, $parameters)); + } + + /** + * @return int + */ + public function getTreshold() + { + return $this->treshold; + } + + /** + * @return \GraphAware\Neo4j\Client\Transaction\Statement[] + */ + public function getStatements() + { + return $this->statementsCollection->getStatements(); + } +} \ No newline at end of file diff --git a/src/Transaction/TransactionInterface.php b/src/Transaction/TransactionInterface.php index 6c4ab80a..c0e36850 100644 --- a/src/Transaction/TransactionInterface.php +++ b/src/Transaction/TransactionInterface.php @@ -4,6 +4,10 @@ interface TransactionInterface { + const TRANSACTION_WRITE = 'TRANSACTION_WRITE'; + + const TRANSACTION_READ = 'TRANSACTION_READ'; + public function commit(); public function rollback(); From 483e21aaefbd2b3a4a164f38d6eb6a3043a3796d Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 11 Oct 2015 22:17:46 +0200 Subject: [PATCH 009/217] auto flush tx poc --- src/Transaction/AbstractTransaction.php | 2 +- src/Transaction/AutoFlushableTransaction.php | 5 ++- .../AutoFlushableTransactionUnitTest.php | 34 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 tests/Unit/Transaction/AutoFlushableTransactionUnitTest.php diff --git a/src/Transaction/AbstractTransaction.php b/src/Transaction/AbstractTransaction.php index d3a6364b..64e57171 100644 --- a/src/Transaction/AbstractTransaction.php +++ b/src/Transaction/AbstractTransaction.php @@ -38,7 +38,7 @@ abstract class AbstractTransaction implements TransactionInterface public function __construct($mode = TransactionInterface::TRANSACTION_WRITE, $tag = null) { $this->setMode($mode); - $this->tag = (string) $tag; + $this->tag = $tag; } /** diff --git a/src/Transaction/AutoFlushableTransaction.php b/src/Transaction/AutoFlushableTransaction.php index bdc6bf85..d521b3ae 100644 --- a/src/Transaction/AutoFlushableTransaction.php +++ b/src/Transaction/AutoFlushableTransaction.php @@ -42,6 +42,9 @@ public function rollback() public function push(Statement $statement) { $this->statementsCollection->add($statement); + if ($this->statementsCollection->getCount() >= $this->treshold) { + $this->commit(); + } } /** @@ -50,7 +53,7 @@ public function push(Statement $statement) */ public function pushQuery($query, array $parameters = []) { - $this->statementsCollection->add(Statement::create($query, $parameters)); + $this->push(Statement::create($query, $parameters)); } /** diff --git a/tests/Unit/Transaction/AutoFlushableTransactionUnitTest.php b/tests/Unit/Transaction/AutoFlushableTransactionUnitTest.php new file mode 100644 index 00000000..d1672f95 --- /dev/null +++ b/tests/Unit/Transaction/AutoFlushableTransactionUnitTest.php @@ -0,0 +1,34 @@ +assertInstanceOf(AutoFlushableTransaction::class, $tx); + $this->assertInstanceOf(TransactionInterface::class, $tx); + $this->assertEquals(10, $tx->getTreshold()); + $this->assertNull($tx->getTag()); + $this->assertCount(0, $tx->getStatements()); + $this->assertFalse($tx->isRunning()); + $this->assertFalse($tx->isRolledBack()); + $this->assertFalse($tx->isCommitted()); + } + + public function testPushToTransaction() + { + $tx = new AutoFlushableTransaction(10); + $tx->pushQuery('MATCH (n) RETURN n'); + $this->assertCount(1, $tx->getStatements()); + $this->assertFalse($tx->isCommitted()); + } +} \ No newline at end of file From 7828a9aa36342b5f6473effe4e5cb86ed2f4f1e7 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:48:02 +0200 Subject: [PATCH 010/217] travis slight modification --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b98f5039..5dc46294 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,9 @@ before_install: - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - neo4j-community-$NEO_VERSION/bin/neo4j start > null - composer self-update - - COMPOSER_ROOT_VERSION=dev-master composer install before_script: - #- composer install --prefer-source --no-interaction + - composer install --prefer-source --no-interaction - mv tests/database_settings.yml.dist tests/database_settings.yml script: @@ -32,4 +31,4 @@ script: - vendor/bin/phpunit notifications: - email: "willemsen.christophe@gmail.com" + email: "christophe@graphaware.com" From 1ccc0a29e3fa534b6a75c6f6a393df1fe7de0ff3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:50:39 +0200 Subject: [PATCH 011/217] last neo versions for tests builds --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5dc46294..b68ec925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,8 @@ php: env: - NEO_VERSION="2.1.6" - - NEO_VERSION="2.1.8" - - NEO_VERSION="2.2.2" - - NEO_VERSION="2.2.3" + - NEO_VERSION="2.2.6" + - NEO_VERSION="2.3.0-RC1" matrix: allow_failures: From 60f30376b566c4d3665a851b0d26594d5871a3f4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:51:08 +0200 Subject: [PATCH 012/217] last v for 2.1 series is 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b68ec925..44eef942 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.0 env: - - NEO_VERSION="2.1.6" + - NEO_VERSION="2.1.8" - NEO_VERSION="2.2.6" - NEO_VERSION="2.3.0-RC1" From 63dc05b5d6bf87ce0e9c9c75ed027095f3f13f07 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:51:25 +0200 Subject: [PATCH 013/217] reverted --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 44eef942..b68ec925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.0 env: - - NEO_VERSION="2.1.8" + - NEO_VERSION="2.1.6" - NEO_VERSION="2.2.6" - NEO_VERSION="2.3.0-RC1" From 5a5af95a6123e34605d4837f8bfb07d1c247115c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:59:19 +0200 Subject: [PATCH 014/217] removing RC1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b68ec925..32accdf0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ php: env: - NEO_VERSION="2.1.6" - NEO_VERSION="2.2.6" - - NEO_VERSION="2.3.0-RC1" + #- NEO_VERSION="2.3.0-RC1" matrix: allow_failures: From 92cf2ff40b40a9ab99976360e61dbb5f5885c9d9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 15:11:25 +0200 Subject: [PATCH 015/217] mark indexes via rest api as skipped --- .../NeoClient/Tests/Functional/CoreCommandsTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index c209aa5a..7b9fc391 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -75,12 +75,16 @@ public function testDropIndex() $this->assertFalse($this->client->isIndexed('Drop', 'user')); } + public function testListIndexes() { - $this->client->createIndex('List1', 'property'); - $this->client->createIndex('List2', 'property'); + $this->markTestSkipped('Investigate labels management via rest api'); + //$this->client->createIndex('List1', 'property'); + //$this->client->createIndex('List2', 'property'); + sleep(2); $response = $this->client->listIndexes(); $indexes = $response->getBody(); + print_r($indexes); $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); From 15195ce69901dfa213330e4443a78b0132eee86d Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 15:22:48 +0200 Subject: [PATCH 016/217] correct link to travis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 664f04bf..810757f0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## A PHP Client for the Neo4j ReST API with Enterprise Support -[![Build Status](https://travis-ci.org/neoxygen/neo4j-neoclient.svg?branch=master)](https://travis-ci.org/neoxygen/neo4j-neoclient) +[![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) [![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Latest Unstable Version](https://poser.pugx.org/neoxygen/neoclient/v/unstable.svg)](https://packagist.org/packages/neoxygen/neoclient) From 87f0789ce29718200a39a2e767122390ffcb921d Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:40:52 -0700 Subject: [PATCH 017/217] fixed get labels not returning unused labels in 2.3 --- .travis.yml | 4 ++-- README.md | 12 +++++++----- src/Command/Core/CoreGetLabelsCommand.php | 2 +- .../NeoClient/Tests/Functional/CoreCommandsTest.php | 9 ++------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32accdf0..734bec88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ php: env: - NEO_VERSION="2.1.6" - NEO_VERSION="2.2.6" - #- NEO_VERSION="2.3.0-RC1" + - NEO_VERSION="2.3.0" matrix: allow_failures: @@ -16,7 +16,7 @@ matrix: before_install: - - wget dist.neo4j.org/neo4j-community-$NEO_VERSION-unix.tar.gz > null + - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - neo4j-community-$NEO_VERSION/bin/neo4j start > null - composer self-update diff --git a/README.md b/README.md index 810757f0..b3499123 100644 --- a/README.md +++ b/README.md @@ -31,16 +31,18 @@ Neo4j is a transactional, open-source graph database. A graph database manages d | <= 2.1.5 | No | | >= 2.1.6 | Yes | | 2.2 | Yes | +| 2.3 | Yes | #### Neo4j Feature Support | **Feature** | **Supported?** | |----------------------|----------------| -| Auth | Yes | -| Remote Cypher | Yes | -| Transactions | Yes | -| High Availability | Yes | -| Embedded JVM support | No | +| Auth | Yes | +| Remote Cypher | Yes | +| Transactions | Yes | +| High Availability | Yes | +| Embedded JVM support | No | +| Binary Protocol | In progress | ### Requirements diff --git a/src/Command/Core/CoreGetLabelsCommand.php b/src/Command/Core/CoreGetLabelsCommand.php index 1e7051e9..54a35d33 100644 --- a/src/Command/Core/CoreGetLabelsCommand.php +++ b/src/Command/Core/CoreGetLabelsCommand.php @@ -21,6 +21,6 @@ class CoreGetLabelsCommand extends AbstractCommand public function execute() { - return $this->process(self::METHOD, self::PATH, null, $this->connection); + return $this->process(self::METHOD, self::PATH, null, $this->connection, ['in_use' => 0]); } } diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index 7b9fc391..485bf4be 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -78,14 +78,9 @@ public function testDropIndex() public function testListIndexes() { - $this->markTestSkipped('Investigate labels management via rest api'); - //$this->client->createIndex('List1', 'property'); - //$this->client->createIndex('List2', 'property'); - sleep(2); + $this->client->createIndex('List1', 'property'); + $this->client->createIndex('List2', 'property'); $response = $this->client->listIndexes(); - $indexes = $response->getBody(); - print_r($indexes); - $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); } From eac99270b33341b5146ef995ef4cd58ff47297c4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:43:47 -0700 Subject: [PATCH 018/217] move packagist to GA --- README.md | 4 ++-- composer.json | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b3499123..2dc2bd82 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Neo4j-PHP-Client -## A PHP Client for the Neo4j ReST API with Enterprise Support +## An Enterprise Grade Client for Neo4j [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) [![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) @@ -65,7 +65,7 @@ You can: Add the library to your composer dependencies : ```bash -composer require neoxygen/neoclient +composer require graphaware/neo4j-php-client ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : diff --git a/composer.json b/composer.json index f5cf3ba1..432ad6b1 100644 --- a/composer.json +++ b/composer.json @@ -1,20 +1,22 @@ { - "name": "neoxygen/neoclient", + "name": "graphaware/neo4j-php-client", "type": "library", - "description": "NeoClient is the most advanced Http Client for Neo4j", + "description": "Neo4jPHP is the most advanced PHP Client for Neo4j", "keywords": [ "graph", "neo4j", "cluster", "client", - "high-availibility" + "high-availibility", + "bolt", + "binary" ], - "homepage": "http://neoxygen.io", + "homepage": "http://graphaware.com", "license": "MIT", "authors": [ { "name": "Christophe Willemsen", - "email": "chris@neoxygen.io" + "email": "christophe@graphaware.com" } ], "require": { From 659f9f7a8ea6738372301c285f9e811d52b99691 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:45:40 -0700 Subject: [PATCH 019/217] fix travis to use neo enterprise --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 734bec88..bbee43c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,8 @@ matrix: before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - - neo4j-community-$NEO_VERSION/bin/neo4j start > null + - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null + - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null - composer self-update before_script: From 4bc6e38dfc5720192c5d19830a7c36b60729303b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:48:59 -0700 Subject: [PATCH 020/217] fixed test --- tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index 485bf4be..b552ec85 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -81,6 +81,7 @@ public function testListIndexes() $this->client->createIndex('List1', 'property'); $this->client->createIndex('List2', 'property'); $response = $this->client->listIndexes(); + $indexes = $response->getBody(); $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); } From 55110cdad36fe80e4216ed257cb266c715bfbe65 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:52:12 -0700 Subject: [PATCH 021/217] add client to description --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 432ad6b1..57b3a232 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "graphaware/neo4j-php-client", "type": "library", - "description": "Neo4jPHP is the most advanced PHP Client for Neo4j", + "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", "keywords": [ "graph", "neo4j", From f340edd173b451687eb01e87ac0c438f96708a67 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:54:27 -0700 Subject: [PATCH 022/217] adapted badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dc2bd82..035b41ae 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## An Enterprise Grade Client for Neo4j [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) -[![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) +[![Latest Stable Version](https://poser.pugx.org/graphaware/neo4j-php-client/v/stable.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Latest Unstable Version](https://poser.pugx.org/neoxygen/neoclient/v/unstable.svg)](https://packagist.org/packages/neoxygen/neoclient) [![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/neoxygen/neoclient) From 2d0bb09551213ce9995e4fe51f289cabfe36821e Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:48:02 +0200 Subject: [PATCH 023/217] travis slight modification --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b407abef..913a8d63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,9 @@ before_install: - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - neo4j-community-$NEO_VERSION/bin/neo4j start > null - composer self-update - - COMPOSER_ROOT_VERSION=dev-master composer install before_script: - #- composer install --prefer-source --no-interaction + - composer install --prefer-source --no-interaction - mv tests/database_settings.yml.dist tests/database_settings.yml script: From 3313d2e337a03bce0faadacf6e52e969c1657553 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:50:39 +0200 Subject: [PATCH 024/217] last neo versions for tests builds --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 913a8d63..bbee43c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,8 @@ php: env: - NEO_VERSION="2.1.6" - - NEO_VERSION="2.1.8" - - NEO_VERSION="2.2.5" - - NEO_VERSION="2.3.0-M03" + - NEO_VERSION="2.2.6" + - NEO_VERSION="2.3.0" matrix: allow_failures: @@ -17,9 +16,9 @@ matrix: before_install: - - wget dist.neo4j.org/neo4j-community-$NEO_VERSION-unix.tar.gz > null - - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - - neo4j-community-$NEO_VERSION/bin/neo4j start > null + - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null + - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null + - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null - composer self-update before_script: From 2c18fb678451580af30c5da3163fc9316bab39a6 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:51:08 +0200 Subject: [PATCH 025/217] last v for 2.1 series is 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bbee43c2..a1c47870 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.0 env: - - NEO_VERSION="2.1.6" + - NEO_VERSION="2.1.8" - NEO_VERSION="2.2.6" - NEO_VERSION="2.3.0" From 1af0d8edad3b5b929543a54494444ebf309cff48 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:51:25 +0200 Subject: [PATCH 026/217] reverted --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a1c47870..bbee43c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.0 env: - - NEO_VERSION="2.1.8" + - NEO_VERSION="2.1.6" - NEO_VERSION="2.2.6" - NEO_VERSION="2.3.0" From b158009a0e493cba2f9d40fb73f16938fe1ba109 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 15:11:25 +0200 Subject: [PATCH 027/217] mark indexes via rest api as skipped --- .../NeoClient/Tests/Functional/CoreCommandsTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index c209aa5a..7b9fc391 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -75,12 +75,16 @@ public function testDropIndex() $this->assertFalse($this->client->isIndexed('Drop', 'user')); } + public function testListIndexes() { - $this->client->createIndex('List1', 'property'); - $this->client->createIndex('List2', 'property'); + $this->markTestSkipped('Investigate labels management via rest api'); + //$this->client->createIndex('List1', 'property'); + //$this->client->createIndex('List2', 'property'); + sleep(2); $response = $this->client->listIndexes(); $indexes = $response->getBody(); + print_r($indexes); $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); From d4094290232cb20d8beb4eacc8aa3e57d2be5c36 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 15:22:48 +0200 Subject: [PATCH 028/217] correct link to travis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17fb532d..faec30ea 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## A PHP Client for the Neo4j ReST API with Enterprise Support -[![Build Status](https://travis-ci.org/neoxygen/neo4j-neoclient.svg?branch=master)](https://travis-ci.org/neoxygen/neo4j-neoclient) +[![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) [![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Latest Unstable Version](https://poser.pugx.org/neoxygen/neoclient/v/unstable.svg)](https://packagist.org/packages/neoxygen/neoclient) From a3c1ba50e9691f3c0168942b92915d24caad202a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 25 Oct 2015 21:54:19 +0100 Subject: [PATCH 029/217] rebased --- .travis.yml | 5 +++++ README.md | 12 +++++++----- src/Command/Core/CoreGetLabelsCommand.php | 2 +- .../NeoClient/Tests/Functional/CoreCommandsTest.php | 9 ++------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbee43c2..f2a2ac07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,13 @@ matrix: before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null +<<<<<<< d4094290232cb20d8beb4eacc8aa3e57d2be5c36 - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null +======= + - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null + - neo4j-community-$NEO_VERSION/bin/neo4j start > null +>>>>>>> fixed get labels not returning unused labels in 2.3 - composer self-update before_script: diff --git a/README.md b/README.md index faec30ea..f1843614 100644 --- a/README.md +++ b/README.md @@ -31,16 +31,18 @@ Neo4j is a transactional, open-source graph database. A graph database manages d | <= 2.1.5 | No | | >= 2.1.6 | Yes | | 2.2 | Yes | +| 2.3 | Yes | #### Neo4j Feature Support | **Feature** | **Supported?** | |----------------------|----------------| -| Auth | Yes | -| Remote Cypher | Yes | -| Transactions | Yes | -| High Availability | Yes | -| Embedded JVM support | No | +| Auth | Yes | +| Remote Cypher | Yes | +| Transactions | Yes | +| High Availability | Yes | +| Embedded JVM support | No | +| Binary Protocol | In progress | ### Requirements diff --git a/src/Command/Core/CoreGetLabelsCommand.php b/src/Command/Core/CoreGetLabelsCommand.php index 1e7051e9..54a35d33 100644 --- a/src/Command/Core/CoreGetLabelsCommand.php +++ b/src/Command/Core/CoreGetLabelsCommand.php @@ -21,6 +21,6 @@ class CoreGetLabelsCommand extends AbstractCommand public function execute() { - return $this->process(self::METHOD, self::PATH, null, $this->connection); + return $this->process(self::METHOD, self::PATH, null, $this->connection, ['in_use' => 0]); } } diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index 7b9fc391..485bf4be 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -78,14 +78,9 @@ public function testDropIndex() public function testListIndexes() { - $this->markTestSkipped('Investigate labels management via rest api'); - //$this->client->createIndex('List1', 'property'); - //$this->client->createIndex('List2', 'property'); - sleep(2); + $this->client->createIndex('List1', 'property'); + $this->client->createIndex('List2', 'property'); $response = $this->client->listIndexes(); - $indexes = $response->getBody(); - print_r($indexes); - $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); } From fc51c2d05caddde2d9acd507db9eae9185062d1b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 25 Oct 2015 21:55:21 +0100 Subject: [PATCH 030/217] fixed travis --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index f2a2ac07..2ffe6daf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ matrix: before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null +<<<<<<< a3c1ba50e9691f3c0168942b92915d24caad202a <<<<<<< d4094290232cb20d8beb4eacc8aa3e57d2be5c36 - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null @@ -24,6 +25,10 @@ before_install: - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - neo4j-community-$NEO_VERSION/bin/neo4j start > null >>>>>>> fixed get labels not returning unused labels in 2.3 +======= + - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null + - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null +>>>>>>> fix travis to use neo enterprise - composer self-update before_script: From 2521991580690c761ed37099b4ff0147bc7fb6aa Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:48:59 -0700 Subject: [PATCH 031/217] fixed test --- tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php index 485bf4be..b552ec85 100644 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php @@ -81,6 +81,7 @@ public function testListIndexes() $this->client->createIndex('List1', 'property'); $this->client->createIndex('List2', 'property'); $response = $this->client->listIndexes(); + $indexes = $response->getBody(); $this->assertArrayHasKey('List1', $indexes); $this->assertArrayHasKey('List2', $indexes); } From dd9998ef76f4d498b624bbe49d8a574956a1274d Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 23 Oct 2015 12:54:27 -0700 Subject: [PATCH 032/217] adapted badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1843614..2e09a41d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## A PHP Client for the Neo4j ReST API with Enterprise Support [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) -[![Latest Stable Version](https://poser.pugx.org/neoxygen/neoclient/v/stable.svg)](https://packagist.org/packages/neoxygen/neoclient) +[![Latest Stable Version](https://poser.pugx.org/graphaware/neo4j-php-client/v/stable.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![Latest Unstable Version](https://poser.pugx.org/neoxygen/neoclient/v/unstable.svg)](https://packagist.org/packages/neoxygen/neoclient) [![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/neoxygen/neoclient) From f55391485c1168faad6d1545b426d13fba216e0a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 2 Oct 2015 22:06:06 +0200 Subject: [PATCH 033/217] Statement object --- src/Transaction/AbstractTransaction.php | 97 ------------------- src/Transaction/Statement.php | 84 ---------------- src/Transaction/StatementCollection.php | 61 ------------ src/Transaction/TransactionInterface.php | 20 ---- .../AutoFlushableTransactionUnitTest.php | 34 ------- .../StatementCollectionUnitTest.php | 43 -------- tests/Unit/Transaction/StatementUnitTest.php | 54 ----------- 7 files changed, 393 deletions(-) delete mode 100644 src/Transaction/AbstractTransaction.php delete mode 100644 src/Transaction/Statement.php delete mode 100644 src/Transaction/StatementCollection.php delete mode 100644 src/Transaction/TransactionInterface.php delete mode 100644 tests/Unit/Transaction/AutoFlushableTransactionUnitTest.php delete mode 100644 tests/Unit/Transaction/StatementCollectionUnitTest.php delete mode 100644 tests/Unit/Transaction/StatementUnitTest.php diff --git a/src/Transaction/AbstractTransaction.php b/src/Transaction/AbstractTransaction.php deleted file mode 100644 index 64e57171..00000000 --- a/src/Transaction/AbstractTransaction.php +++ /dev/null @@ -1,97 +0,0 @@ -setMode($mode); - $this->tag = $tag; - } - - /** - * @param string $mode - */ - protected function setMode($mode) - { - if ($mode !== TransactionInterface::TRANSACTION_WRITE && $mode !== TransactionInterface::TRANSACTION_READ) { - throw new InvalidArgumentException(sprintf('The mode "%s" is not a valid Transactional mode', $mode)); - } - - $this->mode = $mode; - } - - /** - * @return string - */ - public function getMode() - { - return $this->mode; - } - - /** - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * @return boolean - */ - public function isCommitted() - { - return $this->isCommitted; - } - - /** - * @return boolean - */ - public function isRunning() - { - return $this->isRunning; - } - - /** - * @return boolean - */ - public function isRolledBack() - { - return $this->isRolledBack; - } - - -} \ No newline at end of file diff --git a/src/Transaction/Statement.php b/src/Transaction/Statement.php deleted file mode 100644 index 2d824357..00000000 --- a/src/Transaction/Statement.php +++ /dev/null @@ -1,84 +0,0 @@ -query = (string) $query; - $this->parameters = $parameters; - $this->tag = $tag; - $this->includeStats = (bool) $includeStats; - } - - /** - * @param string $query - * @param array $parameters - * @param string|null $tag - * @param bool|false $includeStats - * @return \GraphAware\Neo4j\Client\Transaction\Statement - */ - public static function create($query, array $parameters = [], $tag = null, $includeStats = false) - { - return new self($query, $parameters, $tag, $includeStats); - } - - /** - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * @return array - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * @return string|null - */ - public function getTag() - { - return $this->tag; - } - - /** - * @return boolean - */ - public function hasIncludeStats() - { - return $this->includeStats; - } -} \ No newline at end of file diff --git a/src/Transaction/StatementCollection.php b/src/Transaction/StatementCollection.php deleted file mode 100644 index 566f89f2..00000000 --- a/src/Transaction/StatementCollection.php +++ /dev/null @@ -1,61 +0,0 @@ -tag = $tag; - } - - /** - * @return \GraphAware\Neo4j\Client\Transaction\Statement[] - */ - public function getStatements() - { - return $this->statements; - } - - /** - * @param \GraphAware\Neo4j\Client\Transaction\Statement $statement - */ - public function add(Statement $statement) - { - $this->statements[] = $statement; - } - - /** - * @return int - */ - public function getCount() - { - return count($this->statements); - } - - /** - * @return bool - */ - public function isEmpty() - { - return empty($this->statements); - } - - /** - * @return null|string - */ - public function getTag() - { - return $this->tag; - } -} \ No newline at end of file diff --git a/src/Transaction/TransactionInterface.php b/src/Transaction/TransactionInterface.php deleted file mode 100644 index c0e36850..00000000 --- a/src/Transaction/TransactionInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -assertInstanceOf(AutoFlushableTransaction::class, $tx); - $this->assertInstanceOf(TransactionInterface::class, $tx); - $this->assertEquals(10, $tx->getTreshold()); - $this->assertNull($tx->getTag()); - $this->assertCount(0, $tx->getStatements()); - $this->assertFalse($tx->isRunning()); - $this->assertFalse($tx->isRolledBack()); - $this->assertFalse($tx->isCommitted()); - } - - public function testPushToTransaction() - { - $tx = new AutoFlushableTransaction(10); - $tx->pushQuery('MATCH (n) RETURN n'); - $this->assertCount(1, $tx->getStatements()); - $this->assertFalse($tx->isCommitted()); - } -} \ No newline at end of file diff --git a/tests/Unit/Transaction/StatementCollectionUnitTest.php b/tests/Unit/Transaction/StatementCollectionUnitTest.php deleted file mode 100644 index cd42ab8f..00000000 --- a/tests/Unit/Transaction/StatementCollectionUnitTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertInstanceOf(StatementCollection::class, $coll); - $this->assertCount(0, $coll->getStatements()); - $this->assertNull($coll->getTag()); - $this->assertTrue($coll->isEmpty()); - } - - public function testCollectionWithStatements() - { - $coll = new StatementCollection(); - $coll->add($this->getQuery()); - $this->assertCount(1, $coll->getStatements()); - $this->assertFalse($coll->isEmpty()); - $this->assertEquals(1, $coll->getCount()); - } - - public function testCollectionWithTag() - { - $coll = new StatementCollection('coll'); - $this->assertEquals('coll', $coll->getTag()); - } - - private function getQuery() - { - return Statement::create('MATCH (n) RETURN count(n)'); - } -} \ No newline at end of file diff --git a/tests/Unit/Transaction/StatementUnitTest.php b/tests/Unit/Transaction/StatementUnitTest.php deleted file mode 100644 index be7e2543..00000000 --- a/tests/Unit/Transaction/StatementUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ -getQuery()); - $this->assertInstanceOf(Statement::class, $st); - $this->assertEquals($this->getQuery(), $st->getQuery()); - $this->assertInternalType('array', $st->getParameters()); - $this->assertCount(0, $st->getParameters()); - $this->assertNull($st->getTag()); - $this->assertFalse($st->hasIncludeStats()); - } - - public function testStatementWithFullSignature() - { - $st = new Statement($this->getQuery(), ['id' => 1], 'example.tag', true); - $this->assertCount(1, $st->getParameters()); - $this->assertNotNull($st->getTag()); - $this->assertEquals(1, $st->getParameters()['id']); - $this->assertTrue($st->hasIncludeStats()); - $this->assertEquals('example.tag', $st->getTag()); - } - - public function testStatementStaticCreation() - { - $st = Statement::create($this->getQuery(), ['ID' => 2], 'static.tag'); - $this->assertInstanceOf(Statement::class, $st); - $this->assertEquals('static.tag', $st->getTag()); - $this->assertEquals(2, $st->getParameters()['ID']); - $this->assertFalse($st->hasIncludeStats()); - } - - public function testStatementSkippingParamsAndTag() - { - $st = Statement::create($this->getQuery(), [], null, true); - $this->assertTrue($st->hasIncludeStats()); - } - - private function getQuery() - { - return 'MATCH (n) RETURN count(n)'; - } -} \ No newline at end of file From 5ac5096d506103fd51f7c028fa30baf84e6bfb2e Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 18 Oct 2015 14:47:06 +0200 Subject: [PATCH 034/217] deps update --- composer.json | 3 +- composer.lock | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 964a78d4..4070d446 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "symfony/config": "^2.7", "symfony/dependency-injection": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-response-formatter": "^1.0" + "graphaware/neo4j-response-formatter": "^1.0", + "graphaware/neo4j-common": "^1.2" }, "require-dev": { "phpunit/phpunit": "4.*" diff --git a/composer.lock b/composer.lock index df5af3a0..9b412e70 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,54 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1e2080dcbd6beadf4a3b724d143a4a0e", + "hash": "b81667577443d534e4cb755b24030016", "packages": [ + { + "name": "graphaware/neo4j-common", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/graphaware/neo4j-php-commons.git", + "reference": "b9289c3b3fa80c239b51524bc52aacf05148116e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b9289c3b3fa80c239b51524bc52aacf05148116e", + "reference": "b9289c3b3fa80c239b51524bc52aacf05148116e", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "GraphAware\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ApacheV2" + ], + "authors": [ + { + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + } + ], + "description": "Common Utilities library for Neo4j", + "keywords": [ + "cypher", + "database", + "graph", + "neo4j", + "statement" + ], + "time": "2015-10-11 23:26:08" + }, { "name": "graphaware/neo4j-response-formatter", "version": "1.2.0", @@ -294,6 +340,50 @@ ], "time": "2015-08-31 09:17:37" }, + { + "name": "myclabs/php-enum", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2015-07-22 16:14:03" + }, { "name": "psr/http-message", "version": "1.0", From 13c0c611c0789ea121df0c91314e6384a47cfb57 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 25 Oct 2015 21:50:56 +0100 Subject: [PATCH 035/217] removed legacy code preparing for tck compliance --- composer.json | 3 +- .../NeoClientExtension.php | 2 +- src/Transaction/AutoFlushableTransaction.php | 74 ------------------- 3 files changed, 3 insertions(+), 76 deletions(-) delete mode 100644 src/Transaction/AutoFlushableTransaction.php diff --git a/composer.json b/composer.json index 4070d446..8ff904c9 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ }, "autoload": { "psr-4": { - "GraphAware\\Neo4j\\Client\\": "src/" + "Neoxygen\\NeoClient\\": "src/", + "GraphAware\\Neo4j\\": "src/" } }, "autoload-dev": { diff --git a/src/DependencyInjection/NeoClientExtension.php b/src/DependencyInjection/NeoClientExtension.php index 5375586e..0ebe2e43 100644 --- a/src/DependencyInjection/NeoClientExtension.php +++ b/src/DependencyInjection/NeoClientExtension.php @@ -131,7 +131,7 @@ private function addRegisteredExtensionsDefinitions($config, $container) // Registering Core Commands $this->registerCoreExtension('neoclient_core', array('class' => 'Neoxygen\NeoClient\Extension\NeoClientCoreExtension')); - $this->registerCoreExtension('neoclient_auth', array('class' => 'Neoxygen\NeoClient\Extension\NeoClientAuthExtension')); + //$this->registerCoreExtension('neoclient_auth', array('class' => 'Neoxygen\NeoClient\Extension\NeoClientAuthExtension')); } private function registerCoreExtension($alias, $props) diff --git a/src/Transaction/AutoFlushableTransaction.php b/src/Transaction/AutoFlushableTransaction.php deleted file mode 100644 index d521b3ae..00000000 --- a/src/Transaction/AutoFlushableTransaction.php +++ /dev/null @@ -1,74 +0,0 @@ -treshold = (int) $treshold; - $this->statementsCollection = new StatementCollection(); - parent::__construct($mode, $tag); - } - - public function commit() - { - - } - - public function rollback() - { - - } - - /** - * @param \GraphAware\Neo4j\Client\Transaction\Statement $statement - */ - public function push(Statement $statement) - { - $this->statementsCollection->add($statement); - if ($this->statementsCollection->getCount() >= $this->treshold) { - $this->commit(); - } - } - - /** - * @param string $query - * @param array $parameters - */ - public function pushQuery($query, array $parameters = []) - { - $this->push(Statement::create($query, $parameters)); - } - - /** - * @return int - */ - public function getTreshold() - { - return $this->treshold; - } - - /** - * @return \GraphAware\Neo4j\Client\Transaction\Statement[] - */ - public function getStatements() - { - return $this->statementsCollection->getStatements(); - } -} \ No newline at end of file From 6e86ca972e9cf76091244af549cf20a6f5188d72 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 5 Nov 2015 23:02:57 +0100 Subject: [PATCH 036/217] fix composer --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8ff904c9..b6eefa51 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "http", "high-availibility" ], - "homepage": "http://neoxygen.io", + "homepage": "http://graphaware.com", "license": "MIT", "authors": [ { @@ -29,7 +29,7 @@ "symfony/dependency-injection": "^2.7", "symfony/event-dispatcher": "^2.7", "graphaware/neo4j-response-formatter": "^1.0", - "graphaware/neo4j-common": "^1.2" + "graphaware/neo4j-common": "^1.2" }, "require-dev": { "phpunit/phpunit": "4.*" From 75317f19733950b918097344f367fcb1caf9f7f2 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 5 Nov 2015 23:36:48 +0100 Subject: [PATCH 037/217] neo4j bc change for tx rollback handled --- src/Transaction/Transaction.php | 37 ++++++++++++++- .../IssueTransactionServerRollBackTest.php | 45 +++++++++++++++++++ 2 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index cf2df950..5dc7185c 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -2,6 +2,7 @@ namespace Neoxygen\NeoClient\Transaction; +use Neoxygen\NeoClient\Exception\HttpException; use Neoxygen\NeoClient\Extension\NeoClientCoreExtension; use Neoxygen\NeoClient\Exception\Neo4jException; @@ -42,6 +43,8 @@ class Transaction */ private $results = []; + private $version; + /** * @param null $conn * @param \Neoxygen\NeoClient\Extension\NeoClientCoreExtension $extension @@ -70,7 +73,17 @@ public function __construct($conn = null, NeoClientCoreExtension $extension, $qu public function pushQuery($query, array $parameters = array()) { $this->checkIfOpened(); - $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn)); + try { + $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn)); + } catch (Neo4jException $e) { + $this->version = $this->client->getNeo4jVersion(); + $this->rollback(); + throw $e; + } catch (HttpException $e) { + $this->rollback(); + throw $e; + } + $result = $response->getResult(); $this->results[] = $result; @@ -120,7 +133,15 @@ public function commit() public function rollback() { $this->checkIfOpened(); - $response = $this->handleResponse($this->client->rollBackTransaction($this->transactionId)); + if ($this->isAbove225Version()) { + $this->active = false; + return true; + } + try { + $response = $this->handleResponse($this->client->rollBackTransaction($this->transactionId)); + } catch (HttpException $e) { + + } $this->active = false; return $response; @@ -193,4 +214,16 @@ private function handleResponse($response) return $this->client->handleHttpResponse($response); } + + private function isAbove225Version() + { + if (null !== $this->version) { + $v = (int) str_replace('.', '', trim($this->version)); + if ($v > 225) { + return true; + } + } + + return false; + } } diff --git a/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php b/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php new file mode 100644 index 00000000..ce8fdc4a --- /dev/null +++ b/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php @@ -0,0 +1,45 @@ +addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') + ->setAutoFormatResponse(true) + //->enableNewFormattingService() + ->build(); + } + + public function testIssueDescription() + { + $conn = $this->getConnection(); + $conn->createSchemaUniqueConstraint('User', 'name'); + $conn->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); + $conn->sendCypherQuery('CREATE (n:User {name:"Chris"})'); + + $tx = $conn->createTransaction(); + try { + $tx->pushQuery('CREATE (n:User {name:"Chris"})'); + } catch (Neo4jException $e) { + // + } + + $this->assertFalse($tx->isActive()); + + } +} \ No newline at end of file From 8e40cf325ed9807c0b4289f5d985edc22dbf94a4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 19 Nov 2015 14:42:25 +0100 Subject: [PATCH 038/217] updated travis to 2.3.1 --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbee43c2..ecb6986c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,7 @@ env: - NEO_VERSION="2.1.6" - NEO_VERSION="2.2.6" - NEO_VERSION="2.3.0" - -matrix: - allow_failures: - - php: 7.0 + - NEO_VERSION="2.3.1" before_install: From b2383782c55d04f04cad71a70d9a327d674aeeab Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 19 Nov 2015 14:47:32 +0100 Subject: [PATCH 039/217] update travis --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ffe6daf..bbee43c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,18 +17,8 @@ matrix: before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null -<<<<<<< a3c1ba50e9691f3c0168942b92915d24caad202a -<<<<<<< d4094290232cb20d8beb4eacc8aa3e57d2be5c36 - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null -======= - - tar -xzf neo4j-community-$NEO_VERSION-unix.tar.gz > null - - neo4j-community-$NEO_VERSION/bin/neo4j start > null ->>>>>>> fixed get labels not returning unused labels in 2.3 -======= - - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null ->>>>>>> fix travis to use neo enterprise - composer self-update before_script: From 54bde4bbe9d50896eb3c864d4e5eb92a760fa038 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 19 Nov 2015 15:48:53 +0100 Subject: [PATCH 040/217] added bolt as dependency --- .travis.yml | 9 +- composer.json | 1 + composer.lock | 314 ++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 242 insertions(+), 82 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbee43c2..2584a3af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,7 @@ php: - 7.0 env: - - NEO_VERSION="2.1.6" - - NEO_VERSION="2.2.6" - - NEO_VERSION="2.3.0" - -matrix: - allow_failures: - - php: 7.0 - + - NEO_VERSION="2.3.1" before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null diff --git a/composer.json b/composer.json index b6eefa51..8360a9bc 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ ], "require": { "php": ">= 5.5", + "graphaware/neo4j-bolt": "1.0.x-dev", "guzzlehttp/guzzle": "^6.0", "monolog/monolog": "~1.1", "symfony/yaml": "^2.7", diff --git a/composer.lock b/composer.lock index 9b412e70..ec037920 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,138 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b81667577443d534e4cb755b24030016", + "hash": "220b1aadc378e0a44d11c32f13da8642", + "content-hash": "bfabb08d6cef541943a1d8d354989e59", "packages": [ + { + "name": "doctrine/collections", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2015-04-14 22:21:58" + }, + { + "name": "graphaware/neo4j-bolt", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/graphaware/neo4j-bolt-php.git", + "reference": "59f5057abc0d804e037bdf2ff2d3184fc7837ad6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/59f5057abc0d804e037bdf2ff2d3184fc7837ad6", + "reference": "59f5057abc0d804e037bdf2ff2d3184fc7837ad6", + "shasum": "" + }, + "require": { + "doctrine/collections": "^1.3", + "graphaware/neo4j-common": "^1.7", + "monolog/monolog": "^1.16", + "symfony/console": "^2.7", + "symfony/event-dispatcher": "^2.7" + }, + "require-dev": { + "behat/behat": "~3.0.4", + "neoxygen/neoclient": "^3.3", + "phpunit/phpunit": "^4.8", + "symfony/stopwatch": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "GraphAware\\Bolt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + } + ], + "description": "Neo4j Bolt Binary Protocol PHP Driver", + "time": "2015-11-06 20:00:55" + }, { "name": "graphaware/neo4j-common", - "version": "1.2.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "b9289c3b3fa80c239b51524bc52aacf05148116e" + "reference": "642f8edafbaf11965f1e23bba8c4481c6266f570" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b9289c3b3fa80c239b51524bc52aacf05148116e", - "reference": "b9289c3b3fa80c239b51524bc52aacf05148116e", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/642f8edafbaf11965f1e23bba8c4481c6266f570", + "reference": "642f8edafbaf11965f1e23bba8c4481c6266f570", "shasum": "" }, "require": { @@ -50,7 +168,7 @@ "neo4j", "statement" ], - "time": "2015-10-11 23:26:08" + "time": "2015-11-07 02:32:34" }, { "name": "graphaware/neo4j-response-formatter", @@ -157,16 +275,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "97fe7210def29451ec74923b27e552238defd75a" + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", - "reference": "97fe7210def29451ec74923b27e552238defd75a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", "shasum": "" }, "require": { @@ -204,20 +322,20 @@ "keywords": [ "promise" ], - "time": "2015-08-15 19:37:21" + "time": "2015-10-15 22:28:00" }, { "name": "guzzlehttp/psr7", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", "shasum": "" }, "require": { @@ -262,20 +380,20 @@ "stream", "uri" ], - "time": "2015-08-15 19:32:36" + "time": "2015-11-03 01:34:55" }, { "name": "monolog/monolog", - "version": "1.17.1", + "version": "1.17.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", "shasum": "" }, "require": { @@ -289,10 +407,11 @@ "aws/aws-sdk-php": "^2.4.9", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.11", + "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", "swiftmailer/swiftmailer": "~5.3", "videlalvaro/php-amqplib": "~2.4" @@ -338,7 +457,7 @@ "logging", "psr-3" ], - "time": "2015-08-31 09:17:37" + "time": "2015-10-14 12:51:02" }, { "name": "myclabs/php-enum", @@ -473,25 +592,22 @@ }, { "name": "symfony/config", - "version": "v2.7.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61" + "reference": "831f88908b51b9ce945f5e6f402931d1ac544423" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61", + "url": "https://api.github.com/repos/symfony/config/zipball/831f88908b51b9ce945f5e6f402931d1ac544423", + "reference": "831f88908b51b9ce945f5e6f402931d1ac544423", "shasum": "" }, "require": { "php": ">=5.3.9", "symfony/filesystem": "~2.3" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -519,20 +635,76 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-09-21 15:02:29" + "time": "2015-10-11 09:39:48" + }, + { + "name": "symfony/console", + "version": "v2.7.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "5efd632294c8320ea52492db22292ff853a43766" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/5efd632294c8320ea52492db22292ff853a43766", + "reference": "5efd632294c8320ea52492db22292ff853a43766", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-10-20 14:38:46" }, { "name": "symfony/dependency-injection", - "version": "v2.7.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" + "reference": "af284e795ec8a08c80d1fc47518fd23004b89847" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/af284e795ec8a08c80d1fc47518fd23004b89847", + "reference": "af284e795ec8a08c80d1fc47518fd23004b89847", "shasum": "" }, "require": { @@ -544,7 +716,6 @@ "require-dev": { "symfony/config": "~2.2", "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", "symfony/yaml": "~2.1" }, "suggest": { @@ -579,20 +750,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-09-15 08:30:42" + "time": "2015-10-27 15:38:06" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" + "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a5db5ea887763fa3a31a5471b512ff1596d9b8", + "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8", "shasum": "" }, "require": { @@ -603,7 +774,6 @@ "symfony/config": "~2.0,>=2.0.5", "symfony/dependency-injection": "~2.6", "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", "symfony/stopwatch": "~2.3" }, "suggest": { @@ -637,28 +807,25 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-09-22 13:49:29" + "time": "2015-10-11 09:39:48" }, { "name": "symfony/filesystem", - "version": "v2.7.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" + "reference": "56fd6df73be859323ff97418d97edc1d756df6df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/56fd6df73be859323ff97418d97edc1d756df6df", + "reference": "56fd6df73be859323ff97418d97edc1d756df6df", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -686,28 +853,25 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-09-09 17:42:36" + "time": "2015-10-18 20:23:18" }, { "name": "symfony/yaml", - "version": "v2.7.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d", + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -735,7 +899,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-09-14 14:14:09" + "time": "2015-10-11 09:39:48" } ], "packages-dev": [ @@ -904,16 +1068,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.3", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f", - "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -962,7 +1126,7 @@ "testing", "xunit" ], - "time": "2015-09-14 06:51:16" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -1144,16 +1308,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.10", + "version": "4.8.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "463163747474815c5ccd4ae12b5b355ec12158e8" + "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/463163747474815c5ccd4ae12b5b355ec12158e8", - "reference": "463163747474815c5ccd4ae12b5b355ec12158e8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", + "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", "shasum": "" }, "require": { @@ -1212,7 +1376,7 @@ "testing", "xunit" ], - "time": "2015-10-01 09:14:30" + "time": "2015-11-11 11:32:49" }, { "name": "phpunit/phpunit-mock-objects", @@ -1504,16 +1668,16 @@ }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -1551,7 +1715,7 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", @@ -1644,7 +1808,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "graphaware/neo4j-bolt": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From 1b414bc47bb637cdc6f12745f6043538dabdbe22 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 9 Jan 2016 22:59:00 +0100 Subject: [PATCH 041/217] removed no more used stuff --- benchmark/benchmark.php | 166 - benchmark/cypher_benchmark_import.cqs.cql | 2956 ----------------- benchmark/results.txt | 18 - composer.json | 9 +- composer.lock | 436 ++- phpunit.xml | 9 +- src/Connection/Connection.php | 140 +- .../NeoClient/Tests/ClientBuildTest.php | 79 - .../Tests/Formatting/GAFormattingTest.php | 96 - .../Tests/Functional/CoreCommandsTest.php | 125 - .../Helper/SchemaContainsIndexConstraint.php | 47 - .../NeoClient/Tests/Issues/Issue58Test.php | 52 - .../Issues/IssuePropertyWithZeroValueTest.php | 31 - .../Issues/IssueSOResultDuplicationTest.php | 44 - .../NeoClient/Tests/NeoClientTest.php | 30 - .../Tests/Schema/GraphUnitTestCase.php | 17 - .../NeoClient/Tests/Schema/SchemaUnitTest.php | 30 - tests/Unit/Connection/ConnectionUnitTest.php | 23 + tests/Unit/Stub/DummyDriver.php | 30 + tests/database_settings.yml.dist | 13 - tests/setNeoToken.sh | 2 - 21 files changed, 277 insertions(+), 4076 deletions(-) delete mode 100644 benchmark/benchmark.php delete mode 100644 benchmark/cypher_benchmark_import.cqs.cql delete mode 100644 benchmark/results.txt delete mode 100644 tests/Neoxygen/NeoClient/Tests/ClientBuildTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Formatting/GAFormattingTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Helper/SchemaContainsIndexConstraint.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Issues/Issue58Test.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Issues/IssuePropertyWithZeroValueTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Issues/IssueSOResultDuplicationTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/NeoClientTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Schema/GraphUnitTestCase.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Schema/SchemaUnitTest.php create mode 100644 tests/Unit/Connection/ConnectionUnitTest.php create mode 100644 tests/Unit/Stub/DummyDriver.php delete mode 100644 tests/database_settings.yml.dist delete mode 100755 tests/setNeoToken.sh diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php deleted file mode 100644 index 612ceac8..00000000 --- a/benchmark/benchmark.php +++ /dev/null @@ -1,166 +0,0 @@ -setAutoFormatResponse(true) - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->build(); - - $i++; -} -$usage = convert(memory_get_peak_usage(true)); -$end = microtime(true); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage); -$output .= PHP_EOL.'--------------------------'.PHP_EOL; -$client = null; -$i = null; - -// ----- Client Instantation with DI cache - -$output .= 'Benchmarking client instatation with cache enabled, 1000 runs'.PHP_EOL; - -$start = microtime(true); -$i = 0; -while ($i < 1000) { - $client = ClientBuilder::create() - ->enableCache(__DIR__.'/../cache/') - ->setAutoFormatResponse(true) - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->build(); - - $i++; -} -$usage = convert(memory_get_peak_usage(true)); -$end = microtime(true); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage); -$output .= PHP_EOL.'--------------------------'.PHP_EOL; - -$client = null; -$i = null; - - -// ---------- Running 1000 statements with immediate tx commits - -$output .= 'Running 1000 statements with immediate tx commits'.PHP_EOL; - -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - -$start = microtime(true); -for ($i=0; $i < 1000; $i++) { - $q = 'CREATE (n:Benchmark {tx_id:{id}})'; - $p = ['id' => $i]; - $client->sendCypherQuery($q, $p); -} -$end = microtime(true); -$usage = convert(memory_get_peak_usage(true)); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage).PHP_EOL; -$output .= '--------------------------'.PHP_EOL; - -$client = null; -$i = null; -$p = null; -$q = null; - -// ---------- Running 1000 statements with immediate tx commits - -$output .= 'Running 1000 statements in one transaction commit, separate requests using the TransactionManager'.PHP_EOL; - -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - -$start = microtime(true); -$tx = $client->createTransaction(); -for ($i=0; $i < 1000; $i++) { - $q = 'CREATE (n:Benchmark {tx_id:{id}})'; - $p = ['id' => $i]; - $tx->pushQuery($q, $p); -} -$tx->commit(); -$end = microtime(true); -$usage = convert(memory_get_peak_usage(true)); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage).PHP_EOL; -$output .= '--------------------------'.PHP_EOL; - -$client = null; -$i = null; -$p = null; -$q = null; - - -// ---------- Running 1000 statements with immediate tx commits - -$output .= 'Running 1000 statements in one transaction commit, same request'.PHP_EOL; - -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - //->setAutoFormatResponse(true) - ->build(); - -$start = microtime(true); -$statements = []; -for ($i=0; $i < 1000; $i++) { - $q = 'CREATE (n {tx_id:{id}})'; - $p = ['id' => $i]; - $st = [ - 'statement' => $q, - 'parameters' => $p - ]; - $statements[] = $st; -} -$client->sendMultiple($statements); -$end = microtime(true); -$usage = convert(memory_get_peak_usage(true)); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage).PHP_EOL; -$output .= '--------------------------'.PHP_EOL; - -$client = null; -$i = null; -$p = null; -$q = null; - -// ----- Handling big graph response format - -$output .= 'Handling big graph Response format, 1000 nodes with more edges'.PHP_EOL; -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); -$client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - -$start = microtime(true); -$q = 'MATCH (n) OPTIONAL MATCH (n)-[r]-() RETURN r,n LIMIT 1000'; -$r = $client->sendCypherQuery($q)->getResult(); -$end = microtime(true); -$usage = convert(memory_get_peak_usage(true)); -$diff = $end - $start; -$output .= sprintf('Runned in %s seconds, using %s memory', $diff, $usage).PHP_EOL; -$output .= '--------------------------'.PHP_EOL; - - -file_put_contents($outputfile, $output); diff --git a/benchmark/cypher_benchmark_import.cqs.cql b/benchmark/cypher_benchmark_import.cqs.cql deleted file mode 100644 index 265fd1d9..00000000 --- a/benchmark/cypher_benchmark_import.cqs.cql +++ /dev/null @@ -1,2956 +0,0 @@ -CREATE CONSTRAINT ON (person:Person) ASSERT person.neogen_id IS UNIQUE; -CREATE CONSTRAINT ON (company:Company) ASSERT company.neogen_id IS UNIQUE; -CREATE CONSTRAINT ON (country:Country) ASSERT country.neogen_id IS UNIQUE; -MERGE (n1:Person {neogen_id: 'c62990ce73e6d491e37b470135cb316f2db9d493' })SET n1 :User -, n1.firstname = 'Keshaun', n1.lastname = 'Bode', n1.birth_date = '1996-03-14 05:33:12', n1._id = 'b2d6791c-fb27-3905-976d-4ffbfc84f5f8', n1.login = 'goodwin.vada', n1.password = 'd8b9a611a37dacda472780bcfda9d6a8d476727f', n1.email = 'carroll.rhoda@bechtelarabbott.com'; -MERGE (n2:Person {neogen_id: 'c2a86e100979c561fec03007e024bad8aa7c564a' })SET n2 :User -, n2.firstname = 'Jose', n2.lastname = 'Leannon', n2.birth_date = '1993-03-21 22:52:10', n2._id = '67f27607-3138-36b9-946c-8cc4ba23657a', n2.login = 'eduardo78', n2.password = '29139d618e21623bd3f1ecc18b687f817e9b6300', n2.email = 'kturcotte@yahoo.com'; -MERGE (n3:Person {neogen_id: '0255ffe4a9cce0874e94d9eeef4de1abea7f4d99' })SET n3 :User -, n3.firstname = 'Maiya', n3.lastname = 'Mann', n3.birth_date = '1977-02-12 20:20:57', n3._id = 'e8816b4c-f11c-369a-b8b8-4f11444529ff', n3.login = 'boyer.silas', n3.password = '6eef5b3a25d8d1b9f6eeb0bc617b8008314990a0', n3.email = 'clarabelle47@wolffglover.com'; -MERGE (n4:Person {neogen_id: '1f669d7af94cc0e6056e523c18f3931a5328997f' })SET n4 :User -, n4.firstname = 'Tyrese', n4.lastname = 'Bauch', n4.birth_date = '1981-07-04 00:19:17', n4._id = 'a05c193a-0f86-394a-8c91-ee3b2ca1e462', n4.login = 'quinton16', n4.password = '91222a0d77cb92b46b52a826e618cd92cea014fe', n4.email = 'emard.abigail@gmail.com'; -MERGE (n5:Person {neogen_id: 'e86fd0839733b6375a87bd90a225c927c55dfe54' })SET n5 :User -, n5.firstname = 'Faustino', n5.lastname = 'Bergstrom', n5.birth_date = '1974-04-15 01:26:04', n5._id = 'e791538a-7188-36f5-ae30-8a3fc7a5e38f', n5.login = 'imani.nienow', n5.password = '399a156e76cf811a4714cf1bd89160dd4702b15c', n5.email = 'kasandra.schumm@yahoo.com'; -MERGE (n6:Person {neogen_id: '91c24aabef628d7c13d87c1612915adabb34a7bc' })SET n6 :User -, n6.firstname = 'Dawn', n6.lastname = 'Smitham', n6.birth_date = '1972-10-26 21:28:05', n6._id = 'c28b0a4a-521c-3637-bf57-1cd15b2d4e5e', n6.login = 'zkunde', n6.password = '7758323cf6a12a4d410646c749da95289a72ca7b', n6.email = 'blaise90@hotmail.com'; -MERGE (n7:Person {neogen_id: 'a34285d82cece257f8aecebe2e37568ac65ac879' })SET n7 :User -, n7.firstname = 'Aryanna', n7.lastname = 'Ebert', n7.birth_date = '1988-02-18 18:39:01', n7._id = '39d8d0e3-0e9b-3507-a928-97856e50624c', n7.login = 'williamson.lourdes', n7.password = 'ff2c0902e67284c37f69ecd57e07e4ac960b6431', n7.email = 'jakubowski.isabella@hotmail.com'; -MERGE (n8:Person {neogen_id: 'b00c3ab02ada32ba8a8e03812568e59c3c5672d1' })SET n8 :User -, n8.firstname = 'Tony', n8.lastname = 'Brown', n8.birth_date = '1977-05-23 14:59:21', n8._id = '41790f09-2284-300c-aa78-31efc05b30ca', n8.login = 'mo\'connell', n8.password = 'e9c84225f53999dad78acb7e4b75d85f7ae4ef5d', n8.email = 'jana.reichel@hotmail.com'; -MERGE (n9:Person {neogen_id: '228cb0176a0b2a1fc216f3291b8aab61d656ad42' })SET n9 :User -, n9.firstname = 'Tabitha', n9.lastname = 'Emard', n9.birth_date = '1983-07-15 00:14:30', n9._id = 'd784fd74-2ecd-356c-a866-4cdcd7d37a3a', n9.login = 'vkoch', n9.password = '56ad1f238ea1e70714ca91f246f9f06ec399d113', n9.email = 'keon.kuhlman@hotmail.com'; -MERGE (n10:Person {neogen_id: '7f49977234368dbb2985a63a75f62a3186d85324' })SET n10 :User -, n10.firstname = 'Kenyatta', n10.lastname = 'Pollich', n10.birth_date = '1980-10-06 03:46:50', n10._id = '32394b41-e3b8-3cf1-966e-0b3b22897310', n10.login = 'janelle06', n10.password = 'b1db50211e51ad13966fbc5fd36255275d0f2f2d', n10.email = 'adelia87@champlin.com'; -MERGE (n11:Person {neogen_id: '395b6237597b0799c36774a46309375689bb3369' })SET n11 :User -, n11.firstname = 'Willa', n11.lastname = 'Lowe', n11.birth_date = '1979-12-08 21:43:36', n11._id = '38dd3b70-26fa-3e73-9de8-47f878d4bfb6', n11.login = 'leffler.sophie', n11.password = '2d9e03d17cc1081a9742713cb7cfad2116300381', n11.email = 'magnus99@lynchgorczany.com'; -MERGE (n12:Person {neogen_id: '73dd06112b104505075a1d6bf2779c0b63b9f49c' })SET n12 :User -, n12.firstname = 'Nico', n12.lastname = 'Dickinson', n12.birth_date = '1975-08-23 22:01:10', n12._id = '27a9bec1-591c-3dc6-b5f1-51c11e662026', n12.login = 'durgan.pedro', n12.password = 'cd3da6d39227947b873d17e3ac1f309e92a8f384', n12.email = 'lheidenreich@hotmail.com'; -MERGE (n13:Person {neogen_id: 'e91d676adbb54507a96154f7654d9a348c569620' })SET n13 :User -, n13.firstname = 'Erich', n13.lastname = 'Adams', n13.birth_date = '1985-04-21 04:03:40', n13._id = '29eca8b2-e2d4-3db8-b734-aece12b66340', n13.login = 'kris.janis', n13.password = '56f61e542a936068aa986e06b8080809cd19c215', n13.email = 'whermann@gmail.com'; -MERGE (n14:Person {neogen_id: '63a1657b3294aa3d06b7e5a0c61ebe863e6860ba' })SET n14 :User -, n14.firstname = 'Tristian', n14.lastname = 'Ryan', n14.birth_date = '1984-07-15 16:05:35', n14._id = '18435de8-4ef0-387f-8999-fcc624381a6a', n14.login = 'leuschke.linda', n14.password = 'b407d80df705867670d10649f24e4e760bfe65ab', n14.email = 'imacejkovic@yahoo.com'; -MERGE (n15:Person {neogen_id: 'b423d5b3361ca49b2b7b6c27078be6e0e9456a6d' })SET n15 :User -, n15.firstname = 'Maybelle', n15.lastname = 'Runte', n15.birth_date = '1982-06-17 06:11:14', n15._id = '87d7a1a0-c60a-329e-b636-00d56ed2530d', n15.login = 'xheidenreich', n15.password = '34f00aeb719081f8777c0a1a98513bc780b77a17', n15.email = 'schulist.jarvis@gmail.com'; -MERGE (n16:Person {neogen_id: '129e6ce0d12bb68891f7dfcd142b58967e6e54f0' })SET n16 :User -, n16.firstname = 'Jerald', n16.lastname = 'Metz', n16.birth_date = '1975-07-16 04:30:12', n16._id = '28b1c113-8d78-3f2a-85a2-abd640ed9a10', n16.login = 'houston49', n16.password = '1224a59542a3b23d9b3190bf0900a8d6a8088ade', n16.email = 'keyshawn.o\'hara@hahn.biz'; -MERGE (n17:Person {neogen_id: 'd442e9e1d1b6d40d8b11c4484f29651d020dea9b' })SET n17 :User -, n17.firstname = 'Kevin', n17.lastname = 'Mills', n17.birth_date = '1983-07-28 05:56:06', n17._id = 'be36b4f7-47bf-3f8b-abb5-a02d40e4cc7d', n17.login = 'brett94', n17.password = '05959bbe8cb0482f2580c5aecc2561890fb0e1ec', n17.email = 'kaylee18@hotmail.com'; -MERGE (n18:Person {neogen_id: '329f7dca4da2732ec5d6e23d2f935c853ef89a98' })SET n18 :User -, n18.firstname = 'Joel', n18.lastname = 'Kunze', n18.birth_date = '1984-12-17 00:10:29', n18._id = '23475900-e278-3c65-84eb-145aa45ac372', n18.login = 'cameron16', n18.password = '6e6ad0f20d7d116c62b26443dc7b96845b7d0b39', n18.email = 'qo\'connell@ritchiewiegand.com'; -MERGE (n19:Person {neogen_id: 'eb1e8fca719e5cef959e9d2e83e17d355c073eac' })SET n19 :User -, n19.firstname = 'Anissa', n19.lastname = 'Jacobs', n19.birth_date = '1987-08-23 21:52:28', n19._id = '3f325c73-7e6d-32c5-979b-424a512e3d11', n19.login = 'halvorson.vito', n19.password = '235ca0ade94bfe1d7b272c13aa18c13f357508eb', n19.email = 'geraldine.anderson@yahoo.com'; -MERGE (n20:Person {neogen_id: '5bfe73de5ef8872b8d5cf4c8957a0d60a53e9f62' })SET n20 :User -, n20.firstname = 'Kayleigh', n20.lastname = 'Goyette', n20.birth_date = '1982-07-14 04:51:45', n20._id = 'd870b5e4-7cf5-327e-ae9a-84882dc74e79', n20.login = 'fsanford', n20.password = '6c686d3c0e46cc43e159537e6e18557c1733460f', n20.email = 'douglas.susie@stamm.biz'; -MERGE (n21:Person {neogen_id: '36aa6a591d5c8c06a533a9abbc987d2eafa02ec8' })SET n21 :User -, n21.firstname = 'Coy', n21.lastname = 'Johnston', n21.birth_date = '1991-02-02 02:55:23', n21._id = '03591cc7-ce98-3936-8f0d-dfce7ee7ec70', n21.login = 'sstrosin', n21.password = 'a0494786737520a19c2560ce3f6140d16675f156', n21.email = 'kgoodwin@yahoo.com'; -MERGE (n22:Person {neogen_id: '1a7c70f9843a77754029acfabe29b7918dbb5133' })SET n22 :User -, n22.firstname = 'Coby', n22.lastname = 'Heathcote', n22.birth_date = '1991-06-26 17:42:07', n22._id = '7b8e088a-9898-3be0-a2db-3f64baae11b4', n22.login = 'mohr.brandt', n22.password = '358784c514fb29677f6706eb03cd25d0de826c6a', n22.email = 'steuber.kellie@hotmail.com'; -MERGE (n23:Person {neogen_id: 'e460f665c39e8ecca1e3d0207db9afdeaf3ef956' })SET n23 :User -, n23.firstname = 'Reggie', n23.lastname = 'Hintz', n23.birth_date = '1986-06-18 05:13:58', n23._id = 'ebd60cee-e538-3812-b07f-8cc11339484c', n23.login = 'fframi', n23.password = 'e8c879b7983955a8678d5f741c8a6c3e4b8c63a4', n23.email = 'pgrant@yahoo.com'; -MERGE (n24:Person {neogen_id: '437482f18265305234b475b83c3124099d047da0' })SET n24 :User -, n24.firstname = 'Ilene', n24.lastname = 'Waters', n24.birth_date = '1969-08-15 10:24:35', n24._id = 'b655aaa2-488c-30d0-bd76-0d0b1eb54550', n24.login = 'romaine.cartwright', n24.password = '4ebc19e1208c84d188545bb736038c373a0cd9f3', n24.email = 'hzemlak@gmail.com'; -MERGE (n25:Person {neogen_id: '0356b932af59ac7c307a62046cde810771c5fad2' })SET n25 :User -, n25.firstname = 'Cornell', n25.lastname = 'Kuphal', n25.birth_date = '1982-09-18 12:50:32', n25._id = '61dc4125-7a0c-3db8-9d9b-a2998845726a', n25.login = 'phegmann', n25.password = 'e303eeb9c8aec9339973abf15d9a930244940355', n25.email = 'schumm.alysson@hayeskulas.net'; -MERGE (n26:Person {neogen_id: '1429ae65f5d08ecb7dce51a2ef1ad5f1b1e32d2f' })SET n26 :User -, n26.firstname = 'Thad', n26.lastname = 'Veum', n26.birth_date = '1983-05-01 03:07:03', n26._id = 'be47392f-4e7b-3478-9ba7-9f130ca251c7', n26.login = 'hblanda', n26.password = '22867fed7298951517bcc5fec93badf31f7169f5', n26.email = 'hboyle@schoen.net'; -MERGE (n27:Person {neogen_id: '21e0cd030367d80c9c26a1d8b96676e74520a387' })SET n27 :User -, n27.firstname = 'Mercedes', n27.lastname = 'Howell', n27.birth_date = '1973-09-01 03:16:47', n27._id = '42104280-cd61-3366-8902-fe8f2a467eb0', n27.login = 'ibrahim85', n27.password = '6a5061cf5f228bda8c57ff5bd60d8a4de2157e06', n27.email = 'mortimer.rolfson@gmail.com'; -MERGE (n28:Person {neogen_id: 'd6b7259fb94280a40099e3680848b800ed68c2dc' })SET n28 :User -, n28.firstname = 'Sheridan', n28.lastname = 'Murray', n28.birth_date = '1991-04-16 00:38:33', n28._id = 'a760a510-19be-3f60-8a2f-63eb3d1aa126', n28.login = 'isabel90', n28.password = '84a229127efc6ab7bbcdc9f3c38526853a6ccc28', n28.email = 'dsatterfield@gmail.com'; -MERGE (n29:Person {neogen_id: 'eb49b83b4034241eb524c67a41a9cbc65f7974e9' })SET n29 :User -, n29.firstname = 'Rosella', n29.lastname = 'Hahn', n29.birth_date = '1969-09-19 01:01:07', n29._id = '5edb2c03-dca4-3ba5-99ce-a8c0756e271c', n29.login = 'parker.augustus', n29.password = 'b1b3e536ae0ab099bae8a26cac02770b368cbfe2', n29.email = 'pasquale09@jast.com'; -MERGE (n30:Person {neogen_id: '6d6b95d3d6926204e5ed30c507ab9e57f57b52c1' })SET n30 :User -, n30.firstname = 'Wyatt', n30.lastname = 'Schroeder', n30.birth_date = '1982-10-07 17:02:32', n30._id = 'f3adbd65-00b1-3806-ac8d-e937d8828c89', n30.login = 'schneider.alyson', n30.password = 'f117832215a70fb2110a0b1d2b0a707f66b4ad62', n30.email = 'zechariah10@yahoo.com'; -MERGE (n31:Person {neogen_id: 'efccfbc3c505c2d32d0af3ca9aad956911f4dc9d' })SET n31 :User -, n31.firstname = 'Ruthe', n31.lastname = 'Cronin', n31.birth_date = '1968-12-16 00:31:00', n31._id = '3909ac4b-1dd7-35ff-820c-fba910dab628', n31.login = 'mcglynn.cullen', n31.password = 'd2c81b18cbd8f3dc27ddbaea2048dbaf8a9bf696', n31.email = 'simone.kuhlman@swiftmosciski.biz'; -MERGE (n32:Person {neogen_id: '487896bb5bbced6d6b2c0c426fbb5be432cbc836' })SET n32 :User -, n32.firstname = 'Thea', n32.lastname = 'Grimes', n32.birth_date = '1985-04-22 07:15:55', n32._id = '2fcdf4f2-320f-3704-afda-265dd68f140a', n32.login = 'gerardo.dach', n32.password = '39d48d78044a8990c17b9137d4867bf3e3c2862d', n32.email = 'murray.catharine@gmail.com'; -MERGE (n33:Person {neogen_id: 'fe53517f05b51b4a605c4eca6d0ae816cc7e6025' })SET n33 :User -, n33.firstname = 'Khalil', n33.lastname = 'Wilderman', n33.birth_date = '1975-04-15 19:27:41', n33._id = '429a9302-6147-39ea-a59b-1ccf6c54664d', n33.login = 'marcelle12', n33.password = '282e8dfbf936c6f9de8edbd0d33105f1e7033a02', n33.email = 'reynolds.ethel@hotmail.com'; -MERGE (n34:Person {neogen_id: '7acce967500edc4bccd11d1a77ca564205ec3de7' })SET n34 :User -, n34.firstname = 'Jacklyn', n34.lastname = 'Schuppe', n34.birth_date = '1992-02-14 09:18:55', n34._id = '10f7e4d9-0ac6-3c08-ba96-62ef527735ee', n34.login = 'hparisian', n34.password = 'f809508a788c72176c54dc0455f5a2101b21377f', n34.email = 'baylee.lesch@hotmail.com'; -MERGE (n35:Person {neogen_id: '7576e35ac4262cec100478de9a5f2c1842782e40' })SET n35 :User -, n35.firstname = 'Darby', n35.lastname = 'Sawayn', n35.birth_date = '1995-01-19 01:50:02', n35._id = 'e1c40736-a12e-3760-8f7e-b55f982070ca', n35.login = 'daniel.louvenia', n35.password = '4c16f8ef3c9b629e760b5b13a9cae56914f353a8', n35.email = 'addie.blick@yahoo.com'; -MERGE (n36:Person {neogen_id: 'ca5080b9c61ef64de6be9ebb45b0da27f8383ba4' })SET n36 :User -, n36.firstname = 'Ashley', n36.lastname = 'Toy', n36.birth_date = '1989-01-03 21:10:21', n36._id = '27b21a43-85b6-373b-aaf9-f61bc2a6ef70', n36.login = 'zaria.jones', n36.password = '1ec44feff9ce3da24cff7fb0360345b548e10eed', n36.email = 'wiza.marietta@moen.org'; -MERGE (n37:Person {neogen_id: 'e072894b2ef63931245cc8d12c00ee5a75000348' })SET n37 :User -, n37.firstname = 'Kristoffer', n37.lastname = 'Wyman', n37.birth_date = '1983-08-02 15:59:40', n37._id = '1ce122a2-f374-3cf9-8a65-8eb32474ffd2', n37.login = 'peggie36', n37.password = '19746921b58ab47f9bf79f42fd5d0e484693c389', n37.email = 'lon85@gmail.com'; -MERGE (n38:Person {neogen_id: '9344561bbe3f78f36b49b8b0db715748d08adb71' })SET n38 :User -, n38.firstname = 'Bradford', n38.lastname = 'Adams', n38.birth_date = '1984-07-17 03:50:31', n38._id = '234c87ee-8b8c-321e-9ba6-d541831dc29c', n38.login = 'mschowalter', n38.password = 'b0f04e38f9c03df993f2c52fe1c6717808c2b8cb', n38.email = 'gislason.kaleigh@gmail.com'; -MERGE (n39:Person {neogen_id: 'b36f583925c7401bf8bdf05624c1787d247808ee' })SET n39 :User -, n39.firstname = 'Javon', n39.lastname = 'O\'Keefe', n39.birth_date = '1996-09-10 16:04:04', n39._id = 'b06ada5e-3945-3b54-ae4b-55d4610392b9', n39.login = 'brutherford', n39.password = '07d7ff0ce066657c44942d0e9b539ad6dc6298e8', n39.email = 'orland.schuppe@gleason.com'; -MERGE (n40:Person {neogen_id: '78181c17030700adf7f3b4ff58a10e45c8a1dec9' })SET n40 :User -, n40.firstname = 'Lupe', n40.lastname = 'Bernier', n40.birth_date = '1991-04-08 05:18:32', n40._id = '6d839542-16b6-394f-a42a-b1205af1a5f8', n40.login = 'tluettgen', n40.password = 'b85afbf0dcd39589acd7e5849eb290f6eb16160e', n40.email = 'abuckridge@yahoo.com'; -MERGE (n41:Person {neogen_id: '7292bfd676c37ab1c7592988ef2869dd30fed5af' })SET n41 :User -, n41.firstname = 'Hayley', n41.lastname = 'Feest', n41.birth_date = '1974-08-12 14:01:09', n41._id = 'f0d55f15-c1be-364c-ab8a-924db7bd8c9b', n41.login = 'vickie71', n41.password = '5b01e42a18216df9bbaf51380a45facf40be11c9', n41.email = 'xeichmann@upton.biz'; -MERGE (n42:Person {neogen_id: '7d569f263185864951dcd71d9f2fa2448700e7f4' })SET n42 :User -, n42.firstname = 'Travon', n42.lastname = 'Altenwerth', n42.birth_date = '1978-08-20 12:17:42', n42._id = '73fef4e9-b9e8-3859-b1a2-b83ed673c291', n42.login = 'hwilkinson', n42.password = 'f902bffdcb20167a2574aae1259d5f4815f10c8e', n42.email = 'jweber@hotmail.com'; -MERGE (n43:Person {neogen_id: 'd0bc3aac2e92405cb035e3ce69aeff45624ee808' })SET n43 :User -, n43.firstname = 'Shanel', n43.lastname = 'Wilkinson', n43.birth_date = '1975-05-08 10:45:12', n43._id = 'caaf0319-93ff-3b02-874a-e35ac256df5b', n43.login = 'wschroeder', n43.password = 'd7202a57c00ea0fca26c529e48a82e52da9c8878', n43.email = 'rey.witting@white.info'; -MERGE (n44:Person {neogen_id: 'd0073abd9b840a10a6d9ab50ead8c297ce922d02' })SET n44 :User -, n44.firstname = 'Jayde', n44.lastname = 'Emard', n44.birth_date = '1967-03-08 06:54:18', n44._id = '57976a65-2463-37a4-b4b6-be8b91b2b0b8', n44.login = 'ohuels', n44.password = 'ce1bfc4546de96c409c56052f308d5c928ff4a86', n44.email = 'lockman.aliza@hotmail.com'; -MERGE (n45:Person {neogen_id: '0dd4c2062bb19203c4067a8cf3ac1f7ce5dc5212' })SET n45 :User -, n45.firstname = 'Helen', n45.lastname = 'Christiansen', n45.birth_date = '1966-09-04 15:54:01', n45._id = '42783cba-ab03-3d27-8014-48d2cc989705', n45.login = 'karina.towne', n45.password = '029783db56b5161adc1caf6e7aa86cccd9267eba', n45.email = 'windler.myriam@bogisich.com'; -MERGE (n46:Person {neogen_id: '715310d2d175b12f9771f91de52363208f2c3d3b' })SET n46 :User -, n46.firstname = 'Jadon', n46.lastname = 'Ankunding', n46.birth_date = '1979-08-16 09:14:22', n46._id = '6ceec967-e379-3a26-8425-70730cc2c2aa', n46.login = 'hdicki', n46.password = 'df841de0981e4cccb46481a589da61d91281b8a7', n46.email = 'iklein@gorczanyglover.com'; -MERGE (n47:Person {neogen_id: '13e0b8a8090d77b45fd0bc90e3349e34b757d8b0' })SET n47 :User -, n47.firstname = 'Princess', n47.lastname = 'Hamill', n47.birth_date = '1992-04-18 23:24:48', n47._id = '1f11fca8-68ab-37ce-87ab-e72476f27429', n47.login = 'norval80', n47.password = 'a8be56d8288c3f723652b38a4820d28dd1b7e4b0', n47.email = 'fahey.westley@yahoo.com'; -MERGE (n48:Person {neogen_id: 'd3961619e0dafdae6c7956139befcb0e6d1f7b17' })SET n48 :User -, n48.firstname = 'Leda', n48.lastname = 'Fritsch', n48.birth_date = '1974-06-23 13:13:48', n48._id = 'a19a4e8c-5bc3-3395-8657-ff4eaa1ccdca', n48.login = 'bartell.lon', n48.password = '980b80bc4f10339f6550fdab3f9e946144b2f97a', n48.email = 'rcormier@hotmail.com'; -MERGE (n49:Person {neogen_id: '17a5040aa85e6044be23fe462b194282353d16f0' })SET n49 :User -, n49.firstname = 'Dan', n49.lastname = 'Lubowitz', n49.birth_date = '1984-01-05 17:57:08', n49._id = '139e7b09-b4d4-3659-939d-aa46b610e3ac', n49.login = 'bradford.gerlach', n49.password = 'd0a4e7b7ae513f41db902ea0049a15759550ce9a', n49.email = 'afton.reilly@yahoo.com'; -MERGE (n50:Person {neogen_id: '0e822961597614fa6c430bb0684512ee0f5de25f' })SET n50 :User -, n50.firstname = 'Oscar', n50.lastname = 'Schumm', n50.birth_date = '1977-09-20 12:58:31', n50._id = '65f78e15-9378-3fa2-8b17-21a338675ce7', n50.login = 'mmorissette', n50.password = 'e7a8cd8e119d5609e52f050a4b7accc1c3d27af4', n50.email = 'belle.sauer@hotmail.com'; -MERGE (n51:Person {neogen_id: '078a7228238b3bc1c2c5af6a1b303332fcba3df1' })SET n51 :User -, n51.firstname = 'Brandon', n51.lastname = 'Tremblay', n51.birth_date = '1966-10-12 08:15:17', n51._id = '3fa74784-44f2-337f-9ac0-b0d71eb0efa3', n51.login = 'witting.ralph', n51.password = '5bf0eb6a7db48b3f99fc11d0fc07bb2d09b2c320', n51.email = 'adams.grayson@gmail.com'; -MERGE (n52:Person {neogen_id: '934e081e0d9dbb5e91184f2b5134ae234ef39c06' })SET n52 :User -, n52.firstname = 'Jayce', n52.lastname = 'Rolfson', n52.birth_date = '1965-12-06 16:32:28', n52._id = 'e4858cd8-97aa-312a-ad5c-ad48c20f954a', n52.login = 'tebert', n52.password = '363d2bfe287c107cf2da07fb96179b4c187994fc', n52.email = 'hobart.jerde@champlingusikowski.com'; -MERGE (n53:Person {neogen_id: '6103e446d774219c792db87f1b4f41fa0b7b56d5' })SET n53 :User -, n53.firstname = 'Keara', n53.lastname = 'Ebert', n53.birth_date = '1996-01-06 14:11:17', n53._id = 'b78a8c04-ebdc-3c66-8be3-b8ae4b9f4253', n53.login = 'janderson', n53.password = '527b27b91e49a97a5b61dd7bde388c8ee5bada99', n53.email = 'micheal.mcdermott@gmail.com'; -MERGE (n54:Person {neogen_id: '80fa4f7ab558e07d6b63c7775ea0055b6ec5e8ad' })SET n54 :User -, n54.firstname = 'Reta', n54.lastname = 'Beatty', n54.birth_date = '1967-08-20 03:49:10', n54._id = 'dc6e3f56-98ae-3f35-bad4-791692f3733f', n54.login = 'mayert.rhianna', n54.password = '29faad9a803765d51ab92e920940a53e30da85ce', n54.email = 'nicole95@yahoo.com'; -MERGE (n55:Person {neogen_id: '92e89970a7a83595bfe037b22b2eb95c054fa4a7' })SET n55 :User -, n55.firstname = 'Seamus', n55.lastname = 'Wiegand', n55.birth_date = '1991-04-07 06:07:28', n55._id = '72a8aaab-4bd1-3270-96d5-411567e93ccb', n55.login = 'dietrich.emelie', n55.password = '61797b9af716f4047a4475ff1cc70199e8a89238', n55.email = 'hane.wade@kreiger.info'; -MERGE (n56:Person {neogen_id: '87c9edc33c71308e5b30e327d29ae3c73ab36e71' })SET n56 :User -, n56.firstname = 'Jacinthe', n56.lastname = 'Prosacco', n56.birth_date = '1983-05-05 10:36:55', n56._id = 'd20f778c-efb0-38a1-812c-ab6a6752c3ab', n56.login = 'dena.bradtke', n56.password = '98f49db11b07b6ed1745342f113e830c6bdc2d7a', n56.email = 'pink.boyer@yahoo.com'; -MERGE (n57:Person {neogen_id: '6d4abda76817ce478b3b3a26d936349581904633' })SET n57 :User -, n57.firstname = 'Vito', n57.lastname = 'Hayes', n57.birth_date = '1995-07-23 23:38:47', n57._id = 'afeaf518-3ce1-39a2-adc9-d179173bd126', n57.login = 'nickolas.wuckert', n57.password = '86922a58b1b6d21a98792fed04a4ac241ad50499', n57.email = 'ignatius67@hartmann.net'; -MERGE (n58:Person {neogen_id: 'aa3d12a01c11956a82da640085db2c341ce4679a' })SET n58 :User -, n58.firstname = 'Alvena', n58.lastname = 'Windler', n58.birth_date = '1987-08-25 01:10:10', n58._id = 'b40e3669-434a-3ea8-b2d6-940b30c4581d', n58.login = 'cordelia06', n58.password = '1e141cfeb3a3617ba9b78d50ba8a94503d4a2cda', n58.email = 'christopher49@oharapadberg.info'; -MERGE (n59:Person {neogen_id: 'edfdfd5437acb2333bf49077ad0c96d3d592306e' })SET n59 :User -, n59.firstname = 'Aleen', n59.lastname = 'Torp', n59.birth_date = '1995-11-03 13:28:47', n59._id = '091e8334-ebcd-35bb-b256-46791f402b12', n59.login = 'xmante', n59.password = 'f1f439fd50ce61e3f8b1feade0245ea9a6ad51e8', n59.email = 'macejkovic.madisyn@thiel.com'; -MERGE (n60:Person {neogen_id: '080f494d531b099c4361e29bf7fb475cf7ab0f18' })SET n60 :User -, n60.firstname = 'Alisha', n60.lastname = 'Lockman', n60.birth_date = '1990-08-01 20:24:57', n60._id = 'ff5a1e51-5707-3e3b-9610-a147247b9f67', n60.login = 'gdaugherty', n60.password = 'ac37ee559bb4120d9995fd2e20381d8282076742', n60.email = 'jesus.mann@hotmail.com'; -MERGE (n61:Person {neogen_id: 'ad45314c86cd96751b7f71fde4e2b4ff981f1708' })SET n61 :User -, n61.firstname = 'Marshall', n61.lastname = 'Sauer', n61.birth_date = '1979-07-05 03:13:37', n61._id = '6e326b56-12f4-34de-954d-159b3a9b4654', n61.login = 'yolanda.little', n61.password = 'def6e42454c48b43c1776dce27e6fb43a998cb1d', n61.email = 'bschmitt@yahoo.com'; -MERGE (n62:Person {neogen_id: '9226424a7d2a3924025fc77478967daba092d49f' })SET n62 :User -, n62.firstname = 'Anne', n62.lastname = 'Swift', n62.birth_date = '1986-05-13 04:29:20', n62._id = '40a65528-ca29-389b-84c3-93b3536c9d54', n62.login = 'roger67', n62.password = '5847a9533fc3d3cf2ca0d1ccd0d774df28c14f75', n62.email = 'pauline68@gmail.com'; -MERGE (n63:Person {neogen_id: 'e01a989dde0be0d7c90600277c34ce3e22783ad6' })SET n63 :User -, n63.firstname = 'Sonya', n63.lastname = 'Kihn', n63.birth_date = '1967-09-12 00:00:18', n63._id = '41d5142e-740f-3948-9dea-b855bd61c4f4', n63.login = 'kassulke.pietro', n63.password = 'b3842d9a3f03a9f6fd8ca0d3c8f4df318f01ba10', n63.email = 'dyundt@kertzmann.com'; -MERGE (n64:Person {neogen_id: '7fd556b0c5b0a28295b9a25c508ce7d397d504b4' })SET n64 :User -, n64.firstname = 'Kathleen', n64.lastname = 'Hudson', n64.birth_date = '1966-03-16 21:43:09', n64._id = '50635b34-6740-3e9e-ab99-274a2f1af623', n64.login = 'hgoodwin', n64.password = 'c725756fe355eed23122cacd62059f8221365929', n64.email = 'hcasper@hotmail.com'; -MERGE (n65:Person {neogen_id: 'c8a7857f40c081b087789d15bd0cb6a1066cf92f' })SET n65 :User -, n65.firstname = 'Eldred', n65.lastname = 'Pagac', n65.birth_date = '1983-02-24 11:34:39', n65._id = '0ced8392-6aad-30b3-802d-180a4098bdf3', n65.login = 'newell.sauer', n65.password = '41090788c401cd4fa2d8517912a589dc04a0ddbf', n65.email = 'izabella.lowe@hotmail.com'; -MERGE (n66:Person {neogen_id: '1b37f077a7e708fe97a3ec6eb4710ad518d80523' })SET n66 :User -, n66.firstname = 'Verdie', n66.lastname = 'Hahn', n66.birth_date = '1987-10-14 23:00:42', n66._id = 'e8eacd8c-7d6f-326c-b763-985e9dc54935', n66.login = 'carrie.mcclure', n66.password = 'af739edd0e124546cd6e849fd3a9864842671117', n66.email = 'hshanahan@yahoo.com'; -MERGE (n67:Person {neogen_id: '4a360d91f3908d84ec52254507ddd01da75e3598' })SET n67 :User -, n67.firstname = 'Tito', n67.lastname = 'Emmerich', n67.birth_date = '1984-06-21 22:45:09', n67._id = '51e3e162-0801-3b72-9519-8708f25156f1', n67.login = 'trever72', n67.password = 'c96d6e04c9386f0fcc9d53ac83ef059ea1f07bf9', n67.email = 'devon.ortiz@mullerhane.com'; -MERGE (n68:Person {neogen_id: '5930cb0a973febbfddd69815ad89daff8e32a04d' })SET n68 :User -, n68.firstname = 'Antwon', n68.lastname = 'Wintheiser', n68.birth_date = '1987-07-01 22:21:40', n68._id = 'b9699aee-82cc-3627-b740-854bfef8b695', n68.login = 'owen.vonrueden', n68.password = '71e24f4e2aa5e5cb69c2d9b0071701a256bd7a5f', n68.email = 'josefa.romaguera@yahoo.com'; -MERGE (n69:Person {neogen_id: '4cacc2970a5a6010c004f9705b6dfe719631b4da' })SET n69 :User -, n69.firstname = 'Schuyler', n69.lastname = 'Smith', n69.birth_date = '1972-12-16 10:52:06', n69._id = '6047237e-0113-3744-bc24-579ff6c77745', n69.login = 'afarrell', n69.password = 'f3706d3dc1110eb03190887713c933d633efca43', n69.email = 'elsie.sipes@batz.info'; -MERGE (n70:Person {neogen_id: '8d3f34e70602bd6e7022d6744c89a86631281902' })SET n70 :User -, n70.firstname = 'Foster', n70.lastname = 'Farrell', n70.birth_date = '1984-01-02 02:59:28', n70._id = '34ae823b-af02-326d-88a8-9fb47b22dcde', n70.login = 'zbruen', n70.password = '6a4a5810dd7ea50adf795f93c03291e66289b9a4', n70.email = 'antone.schuster@yahoo.com'; -MERGE (n71:Person {neogen_id: 'f5ec47665229162c5f133e45df7c1c4719c086e2' })SET n71 :User -, n71.firstname = 'Guiseppe', n71.lastname = 'Bins', n71.birth_date = '1989-01-01 17:59:17', n71._id = 'fd69befb-b4b1-3473-85fd-3f7a9909eb6b', n71.login = 'margret96', n71.password = '9284af30cae9f2ae265eb621f1058a91d6671969', n71.email = 'oda.hilpert@borer.com'; -MERGE (n72:Person {neogen_id: '761424aa04a2763b890a2ce8bc8281b5e8871b28' })SET n72 :User -, n72.firstname = 'Berta', n72.lastname = 'Schoen', n72.birth_date = '1977-12-25 11:07:36', n72._id = '89e5e058-aa6a-3f4a-bbe9-1540bd7330a0', n72.login = 'baumbach.fred', n72.password = '676e11ae9360fc6e8488b5ede75533d7292fdea3', n72.email = 'joey.hintz@hotmail.com'; -MERGE (n73:Person {neogen_id: 'a876e55d685abbe5d64fdda851a7c0c4ce4a9a57' })SET n73 :User -, n73.firstname = 'Paul', n73.lastname = 'Franecki', n73.birth_date = '1983-03-21 07:16:13', n73._id = '04045908-37ed-3c67-b1b1-daaa15f31d27', n73.login = 'stoltenberg.rosetta', n73.password = '062d4e1430bac447abf5e615d739166e95d5c472', n73.email = 'jasen47@bauch.com'; -MERGE (n74:Person {neogen_id: '3a04537da7e41a33cf9b52d639b06b68ed93c5e8' })SET n74 :User -, n74.firstname = 'Jesus', n74.lastname = 'Dietrich', n74.birth_date = '1990-03-24 10:19:20', n74._id = 'b4605b11-e443-3764-8c26-823f0f6689eb', n74.login = 'ozella02', n74.password = '9bf172f785c2259dec9e209c0cb7ba6b9c7b583f', n74.email = 'ivy34@wunschsauer.biz'; -MERGE (n75:Person {neogen_id: 'a3056f1b93e5bd39711e4747f2d8ac9fbb26ea15' })SET n75 :User -, n75.firstname = 'Torrey', n75.lastname = 'Durgan', n75.birth_date = '1989-10-17 04:38:05', n75._id = '99e70f88-15bc-3da9-b483-4c6af6af9ae6', n75.login = 'elmira.wolff', n75.password = '0acd197b672d5658c428efebe9546596075e87af', n75.email = 'olson.alvis@wiegandconn.com'; -MERGE (n76:Person {neogen_id: 'e6a55237ac77266ecbeb9eb7f1fc4beb054ff2ad' })SET n76 :User -, n76.firstname = 'Erich', n76.lastname = 'Kuhic', n76.birth_date = '1993-05-17 18:43:11', n76._id = '522feb3d-cd40-3551-9114-9ab559c9901e', n76.login = 'wehner.margarita', n76.password = '9e86df750ec36f1cae560f4aea496b31ae9bd342', n76.email = 'smurazik@harberklein.biz'; -MERGE (n77:Person {neogen_id: '06ca4e810753d72c7b481a042b30d11e997cd7be' })SET n77 :User -, n77.firstname = 'Paxton', n77.lastname = 'Stracke', n77.birth_date = '1971-07-13 11:37:15', n77._id = 'c946a211-b429-31b2-89a9-ed10e8829ad7', n77.login = 'vmacejkovic', n77.password = '0035b520aaeb074375cd23d0b19e10e273e1b297', n77.email = 'jaren63@hotmail.com'; -MERGE (n78:Person {neogen_id: 'd25dae3f8cb04a349abc352810cb4bcc9e8ce329' })SET n78 :User -, n78.firstname = 'Theron', n78.lastname = 'Orn', n78.birth_date = '1979-03-26 07:42:35', n78._id = '28f61ee8-add3-3c0f-bb36-0bb741138e64', n78.login = 'fbraun', n78.password = '2665e86c87ba88d84418b6d8378d5377ba43ecea', n78.email = 'heloise.hintz@will.com'; -MERGE (n79:Person {neogen_id: '9ee53d45baa20f4b844c176f98f2e17a77c8cc20' })SET n79 :User -, n79.firstname = 'Clemens', n79.lastname = 'Bogan', n79.birth_date = '1987-07-19 04:52:06', n79._id = 'bfc5f822-54cf-3fdf-84fd-8a83041e6cf9', n79.login = 'jgrady', n79.password = 'c5de083da463d4ce7a4fb0b4861fb18474ade354', n79.email = 'vschuppe@wardabbott.com'; -MERGE (n80:Person {neogen_id: '16dea280f00a4b0b23494e716e68297b35527388' })SET n80 :User -, n80.firstname = 'Danika', n80.lastname = 'Robel', n80.birth_date = '1976-04-08 06:40:52', n80._id = '0e94aa48-14ba-35e5-b38a-bf81a368ea03', n80.login = 'prohan', n80.password = '5320db9c594a9a6f3146723b789b26e67e6f445d', n80.email = 'okuhlman@gmail.com'; -MERGE (n81:Person {neogen_id: 'a6c90a718fded165b37324dd7f5c862fd5e1d240' })SET n81 :User -, n81.firstname = 'Kailee', n81.lastname = 'Shields', n81.birth_date = '1972-05-16 11:19:43', n81._id = 'e1c52638-1805-36c2-a860-c1077538fb6f', n81.login = 'zetta.hodkiewicz', n81.password = 'd7511a8d8418846024deaa4421736f8c3314a994', n81.email = 'toy.jaime@yahoo.com'; -MERGE (n82:Person {neogen_id: '342b76f3cbc20284b64afb0d90066a2a5b918b1d' })SET n82 :User -, n82.firstname = 'Wilburn', n82.lastname = 'Spinka', n82.birth_date = '1976-10-01 23:21:42', n82._id = '68766680-d65c-35a7-ad6c-a3c051384c82', n82.login = 'pink33', n82.password = 'a80d306d18343e0838bdb41ea037bb145a253b3b', n82.email = 'clement39@baumbach.net'; -MERGE (n83:Person {neogen_id: '4135b36219492bc7fa7752e44cf4917e26846cb3' })SET n83 :User -, n83.firstname = 'Erich', n83.lastname = 'Bernier', n83.birth_date = '1996-05-22 20:01:01', n83._id = '0477f491-d808-3a9b-8ce0-7f0352c6c6fb', n83.login = 'harris.mariela', n83.password = '8770e5750b52f84b259202df0986ed2cc6393760', n83.email = 'cleveland.jones@west.net'; -MERGE (n84:Person {neogen_id: 'bee2fda25ecaaef451c0d578f92aa597085e2eae' })SET n84 :User -, n84.firstname = 'Micaela', n84.lastname = 'Boehm', n84.birth_date = '1996-04-14 14:26:00', n84._id = 'dc40db53-0c1f-31de-8772-0114c9f8aedf', n84.login = 'lexie17', n84.password = '1b34845b760bc2515a7aadd7d299ec800149704a', n84.email = 'goldner.chasity@hotmail.com'; -MERGE (n85:Person {neogen_id: '6fbc37af6070af7cec2f01abea158d2515815ab7' })SET n85 :User -, n85.firstname = 'Shany', n85.lastname = 'Glover', n85.birth_date = '1967-09-21 20:22:19', n85._id = '9b041060-986a-3335-9cbc-aa815652710c', n85.login = 'cathrine33', n85.password = 'c46a65124fc39d0520054e25bc6d131f1452934f', n85.email = 'damien.schuppe@kovacekcruickshank.com'; -MERGE (n86:Person {neogen_id: '60296a81c7831a178f5e595f3a0afbeafa979b6a' })SET n86 :User -, n86.firstname = 'Ignatius', n86.lastname = 'Larson', n86.birth_date = '1967-12-01 14:02:28', n86._id = 'd53bc864-c512-3213-b443-2a2da1c93f37', n86.login = 'jamal.brekke', n86.password = '99ee1893398fd720dcaf3afe791500e86ccc2798', n86.email = 'tcrooks@luettgenhilpert.com'; -MERGE (n87:Person {neogen_id: '753ac35ae0d3db69e6e3e8f01b5feb1a10d25324' })SET n87 :User -, n87.firstname = 'Ericka', n87.lastname = 'Ankunding', n87.birth_date = '1987-03-05 17:02:34', n87._id = 'ad8b4524-e157-3091-a489-53a1318aa625', n87.login = 'jarrett.o\'kon', n87.password = 'b987456a285dd9cb82784db431c004b25bea42bf', n87.email = 'mcglynn.katlyn@hotmail.com'; -MERGE (n88:Person {neogen_id: 'b774a03257a603e8aeabd33f7058ef2585c668c2' })SET n88 :User -, n88.firstname = 'Rudolph', n88.lastname = 'Rau', n88.birth_date = '1992-09-14 07:13:29', n88._id = '295bed6f-85b2-3db0-b3bf-8e07da29901c', n88.login = 'lluettgen', n88.password = 'ea9c09cb99e15f1953e930fb305efe62dd36309c', n88.email = 'ledner.bennie@muller.com'; -MERGE (n89:Person {neogen_id: 'd99001b64af5818a4d8a45b7d19c9030fb9f113b' })SET n89 :User -, n89.firstname = 'Samanta', n89.lastname = 'Rice', n89.birth_date = '1967-05-26 10:00:03', n89._id = 'ae77e007-fc57-3500-8631-2fd0e16327fe', n89.login = 'paucek.xander', n89.password = '7bb76642d5b105353501cb0c8dccc7487fa61ab8', n89.email = 'annette.konopelski@donnellyrolfson.com'; -MERGE (n90:Person {neogen_id: 'b21b66c67e5e219d3699b7cd3b01bc85559723c8' })SET n90 :User -, n90.firstname = 'Zion', n90.lastname = 'Reynolds', n90.birth_date = '1970-01-13 10:08:19', n90._id = '9e892bc9-fef4-306a-8536-e82b8e43457e', n90.login = 'cartwright.jaylon', n90.password = 'a699dedb89169cc3bb86103dd2ce7abb850de7cb', n90.email = 'ambrose.dooley@lakinhagenes.com'; -MERGE (n91:Person {neogen_id: 'ee9958a1e2f510725e07060ab98bfc3c52631ad0' })SET n91 :User -, n91.firstname = 'Miles', n91.lastname = 'Brown', n91.birth_date = '1987-10-22 10:26:02', n91._id = '9c91fd28-709c-3978-a05f-97d159db5d08', n91.login = 'lukas.o\'conner', n91.password = '06c1490e5fee3cc2f213b875b20477e1e9115595', n91.email = 'mathilde95@haley.com'; -MERGE (n92:Person {neogen_id: '90a76c42243c02fdc6a4e71df9157db03835a596' })SET n92 :User -, n92.firstname = 'Delbert', n92.lastname = 'Auer', n92.birth_date = '1987-07-27 13:26:37', n92._id = '002cdeeb-7757-385f-8507-d33051f1b179', n92.login = 'lprosacco', n92.password = 'a00c68435dbec39d0c61417a98e1235780b9e3a9', n92.email = 'pascale.schiller@yahoo.com'; -MERGE (n93:Person {neogen_id: '74a6a4d734526a4b50fe04375a4b6e050160b45c' })SET n93 :User -, n93.firstname = 'Zoey', n93.lastname = 'Dickens', n93.birth_date = '1992-10-27 14:55:42', n93._id = 'e6fecd3d-bed2-39fc-87ce-457eaa4915d2', n93.login = 'cummerata.theresia', n93.password = 'db3ec2e552b476e7368671d71ef6cabb06159495', n93.email = 'ghirthe@hotmail.com'; -MERGE (n94:Person {neogen_id: 'ca830ba8fd8f964dd9c0acde0b740a3b1248be28' })SET n94 :User -, n94.firstname = 'Eino', n94.lastname = 'Kub', n94.birth_date = '1971-05-06 16:24:37', n94._id = '4d069b2c-109a-3bcb-bd4b-1ac266d44bfe', n94.login = 'rosetta49', n94.password = '8565f5bbe07ef08fcc46f40e02f12912c0d0f082', n94.email = 'fwillms@wyman.com'; -MERGE (n95:Person {neogen_id: 'ffd1a890a9f73ac02082f7db037e0ce8c5959282' })SET n95 :User -, n95.firstname = 'Adrian', n95.lastname = 'Beer', n95.birth_date = '1993-03-21 15:49:43', n95._id = 'e423bfb4-9edf-3340-911c-08a5fb8672f5', n95.login = 'lheathcote', n95.password = '78904c99f50ca2e7784892953290600d0350f078', n95.email = 'kari77@kozey.biz'; -MERGE (n96:Person {neogen_id: '604235ffc325dcc5b47c5920f6827874d1bfb43a' })SET n96 :User -, n96.firstname = 'Malachi', n96.lastname = 'Turner', n96.birth_date = '1967-11-18 05:11:24', n96._id = '65fba185-dd65-3f3d-b44f-fba004a4cb33', n96.login = 'nolan.lonie', n96.password = '931333ad21c3e37385d7261596560f8ece0d85fc', n96.email = 'afeil@hotmail.com'; -MERGE (n97:Person {neogen_id: 'aaa75fc2ae6db70aa1cdb68510214e8785a2652f' })SET n97 :User -, n97.firstname = 'Kari', n97.lastname = 'Conroy', n97.birth_date = '1985-11-21 13:21:36', n97._id = '73120cfe-d295-318f-8e99-52afe272f0ec', n97.login = 'fahey.tyrese', n97.password = 'e4be84a24eee247ec3154de83c5c43213a19c788', n97.email = 'wiley61@gmail.com'; -MERGE (n98:Person {neogen_id: '79152ebe88e3b35b5430b4ae13cb7098c9d0dab1' })SET n98 :User -, n98.firstname = 'Lafayette', n98.lastname = 'Franecki', n98.birth_date = '1984-05-07 21:24:39', n98._id = 'f28858c7-2271-32cf-aa5a-befdc4acab19', n98.login = 'anibal.price', n98.password = '39c23ca15b4eef41c7b20f91c4c33732e57a4e4c', n98.email = 'porter40@hotmail.com'; -MERGE (n99:Person {neogen_id: 'c6a14d0165046d9f6007ff4d69479b43237ffa1a' })SET n99 :User -, n99.firstname = 'Gene', n99.lastname = 'Wiegand', n99.birth_date = '1970-01-23 08:38:25', n99._id = '8d7638ab-a9c2-3538-b519-d64ef1cd0935', n99.login = 'maggio.rosemary', n99.password = '56e731371680282dd7edbc8262ff81cd8a6e2f59', n99.email = 'baby80@pfannerstill.com'; -MERGE (n100:Person {neogen_id: 'b496b98d8e827cd4b7c5d388ffb997b144a95cc6' })SET n100 :User -, n100.firstname = 'Reta', n100.lastname = 'O\'Conner', n100.birth_date = '1975-11-20 20:49:18', n100._id = '8dd442dd-fcf5-3536-bce1-97980bf89c0e', n100.login = 'arlie37', n100.password = 'd46a1607b913ef0cfe05befa52f1864355be1d7e', n100.email = 'boyle.jamir@emard.com'; -MERGE (n101:Person {neogen_id: '6ab07a613101bfa5b5f78902bbd6124cf10e7364' })SET n101 :User -, n101.firstname = 'Ramiro', n101.lastname = 'Heathcote', n101.birth_date = '1966-09-28 11:56:56', n101._id = '6b6f1aaf-daaa-3c1d-8d05-d10965854658', n101.login = 'cruickshank.eugene', n101.password = 'c5a77303fe80866d5d1bad186c02284984115e45', n101.email = 'bbechtelar@hotmail.com'; -MERGE (n102:Person {neogen_id: '945d6e556c28548d63b7fcae05a95b04d1738892' })SET n102 :User -, n102.firstname = 'Desmond', n102.lastname = 'Blanda', n102.birth_date = '1978-03-04 05:50:10', n102._id = '040181de-0967-3b95-bc4c-b6b0e9d4716b', n102.login = 'icrooks', n102.password = '372c897926f96da2049ea3b935f62723e385c184', n102.email = 'lorenz.grimes@willmsoreilly.net'; -MERGE (n103:Person {neogen_id: 'ccc5611a937cbfccfca03ab9ed79eb87af51f0c7' })SET n103 :User -, n103.firstname = 'Percy', n103.lastname = 'Pouros', n103.birth_date = '1980-11-25 19:45:40', n103._id = 'ca6ec3d1-9842-33cb-8150-16022c4ab607', n103.login = 'annabelle.cassin', n103.password = 'eb7bd7d30bfcf802c244c921164de8c42e5c4d93', n103.email = 'henri.windler@harvey.com'; -MERGE (n104:Person {neogen_id: '001f4c541f8cb2566c94a6ee1728fb7cd9d18556' })SET n104 :User -, n104.firstname = 'Jacky', n104.lastname = 'Abernathy', n104.birth_date = '1994-04-23 23:38:46', n104._id = 'bf8c9fa5-d811-35d3-8df3-1290654ce5da', n104.login = 'marielle.batz', n104.password = 'd14a3f32af97822818be752181992a9ed311d540', n104.email = 'abbigail54@bechtelarwhite.com'; -MERGE (n105:Person {neogen_id: '1bb17c499b15c8649883baa35db738fe747da313' })SET n105 :User -, n105.firstname = 'Yolanda', n105.lastname = 'Welch', n105.birth_date = '1996-07-21 01:19:51', n105._id = 'a5e8e234-abea-343e-bdf7-4eb62c562c9c', n105.login = 'umurray', n105.password = '983c31f7d7b85c56cd667fbf3fbdd991722f3095', n105.email = 'emely83@ullrichbauch.com'; -MERGE (n106:Person {neogen_id: '811316e156c27d096d588ed8a802216638547b3f' })SET n106 :User -, n106.firstname = 'Zita', n106.lastname = 'Bruen', n106.birth_date = '1980-01-12 08:49:10', n106._id = '5cbb2677-fff8-3439-801a-4d5db275b5ef', n106.login = 'brandi.smith', n106.password = 'c18b00c1936328fb9f3f02856aa351db40a64ebe', n106.email = 'gulgowski.brandi@schuppe.net'; -MERGE (n107:Person {neogen_id: '0acd7a2041bfdf61d6987aebd2f6b32160d72c25' })SET n107 :User -, n107.firstname = 'Kasandra', n107.lastname = 'Quigley', n107.birth_date = '1992-08-12 19:40:13', n107._id = '0dd4693c-58ab-3ba4-a8ac-9c843561412f', n107.login = 'yryan', n107.password = 'c7fe5c79f39abb6143037490a280f7580dcfc713', n107.email = 'abauch@gutmannkoch.com'; -MERGE (n108:Person {neogen_id: '80017e2bd4565b13f91e658adb620d7077101419' })SET n108 :User -, n108.firstname = 'Demarcus', n108.lastname = 'Stokes', n108.birth_date = '1996-06-03 09:51:29', n108._id = 'd370960d-cf3b-382e-b963-fdb1497fc4e9', n108.login = 'schroeder.neil', n108.password = '98c552d3e22681c2b7f0ff441a0147fd9ab43ff3', n108.email = 'luettgen.halle@corwin.net'; -MERGE (n109:Person {neogen_id: 'ff82a3ef73f03d623396511e7a0ddac1165e2d3e' })SET n109 :User -, n109.firstname = 'Dandre', n109.lastname = 'Reilly', n109.birth_date = '1994-07-16 16:20:23', n109._id = 'cb9dbd04-1428-324f-bb22-718b8f5a75d6', n109.login = 'devyn.haley', n109.password = '17eef9f156a21c64f5c102fddb5f8e924718591e', n109.email = 'vryan@spencerkris.biz'; -MERGE (n110:Person {neogen_id: '2f62a03b286270e81f1f1b1b7ce3984ebc159ce4' })SET n110 :User -, n110.firstname = 'Marilie', n110.lastname = 'Moore', n110.birth_date = '1994-06-15 09:10:24', n110._id = '530ac94f-16bc-3622-b9b7-cbe3b8ba6494', n110.login = 'russel79', n110.password = 'c64b199ab0f8f4537fbb539bcab412d09264925b', n110.email = 'gregoria.conroy@koeppzboncak.com'; -MERGE (n111:Person {neogen_id: 'fbfd80a0568db5625e57d592a273225e9c0643da' })SET n111 :User -, n111.firstname = 'Peyton', n111.lastname = 'Hermann', n111.birth_date = '1983-03-10 01:55:58', n111._id = 'ff53f23d-c4ba-3c20-b348-e1e43b9092f7', n111.login = 'ogibson', n111.password = '99cef7586a2fb35a0f2f9ac512be8be902c94e5c', n111.email = 'abbie10@gmail.com'; -MERGE (n112:Person {neogen_id: '7f4ec7e828e48bc20a0b726cdc95c437f804518d' })SET n112 :User -, n112.firstname = 'Loyce', n112.lastname = 'Smith', n112.birth_date = '1991-11-07 10:22:00', n112._id = '9411d62c-5b7e-3042-a245-0fd2e9b3a569', n112.login = 'marquardt.arianna', n112.password = '468b7d6feea4a2b7fe8a665cbcd390a3f3488d43', n112.email = 'wilmer86@gmail.com'; -MERGE (n113:Person {neogen_id: 'bac2f77f67a405d8d587aec7ba09c79f7fe00c51' })SET n113 :User -, n113.firstname = 'Nia', n113.lastname = 'Wisoky', n113.birth_date = '1970-04-10 04:33:59', n113._id = '0113937d-e817-3950-be25-12e42a7f9fe1', n113.login = 'sarina.paucek', n113.password = '3a120c172dbc751f56112711e388c89e49f3453b', n113.email = 'cole.leif@yahoo.com'; -MERGE (n114:Person {neogen_id: 'b515b2266dd1857c57ea889217089bda578c22b9' })SET n114 :User -, n114.firstname = 'Natasha', n114.lastname = 'Koelpin', n114.birth_date = '1967-11-01 14:27:20', n114._id = '4b7f21ca-6781-303c-beef-44cecc94e767', n114.login = 'cielo.schiller', n114.password = '7f2a11887d1230d0579dad48a97cb07758ad0c83', n114.email = 'jordy67@kautzer.info'; -MERGE (n115:Person {neogen_id: 'c836799f0bb21b9d3037fea08a631b28c41602af' })SET n115 :User -, n115.firstname = 'Izabella', n115.lastname = 'Crooks', n115.birth_date = '1996-11-08 05:19:03', n115._id = 'bada5e3d-bcf5-33fb-bb46-0c38e3c19853', n115.login = 'reese42', n115.password = '67a73f15d2c1290befe455715b1ba47df7eb5637', n115.email = 'idell00@yahoo.com'; -MERGE (n116:Person {neogen_id: 'dd3f7f09b4dd4ef58fb577f13afaca70ff8880e3' })SET n116 :User -, n116.firstname = 'Miracle', n116.lastname = 'Schneider', n116.birth_date = '1966-04-01 10:42:22', n116._id = 'f9af8b01-cec2-354c-9383-e63a3acc13f0', n116.login = 'lgrant', n116.password = '0a2eed52f8dd6ef7da892aba09e2bad3e66418a2', n116.email = 'herman.horace@yahoo.com'; -MERGE (n117:Person {neogen_id: '0d796a231414114308c4a4db115a36ce20c4ce82' })SET n117 :User -, n117.firstname = 'Alivia', n117.lastname = 'Howell', n117.birth_date = '1979-05-29 06:53:05', n117._id = 'a46e4d67-3b8b-3f94-91d3-77a088e85b7f', n117.login = 'sschuppe', n117.password = 'cb754fce8b4bcc645198307447ffbe8c82680a10', n117.email = 'vbednar@morissette.com'; -MERGE (n118:Person {neogen_id: '944106f83f728431f94b3c9620e65a1c1b8cc5b1' })SET n118 :User -, n118.firstname = 'Natasha', n118.lastname = 'Kunde', n118.birth_date = '1966-07-31 10:43:55', n118._id = 'ea295e77-7933-3956-b8bf-d12e765b3a9b', n118.login = 'conroy.mark', n118.password = 'eec6e0b581019ff6ad317ad8a0ed4912905237d2', n118.email = 'dana00@gutkowskicarroll.org'; -MERGE (n119:Person {neogen_id: '59e13832e56ce664bade9fb01f3152da6702c4bf' })SET n119 :User -, n119.firstname = 'Deron', n119.lastname = 'Gaylord', n119.birth_date = '1984-04-07 12:52:37', n119._id = '69f1d43a-60d5-3d4f-a655-47bd041af826', n119.login = 'maximillia68', n119.password = '3dfc193c9735300973761f8f5a6dd045ffd73b14', n119.email = 'sabryna97@hotmail.com'; -MERGE (n120:Person {neogen_id: '1c21ddc85e57fd78a1b08988aae456502de74196' })SET n120 :User -, n120.firstname = 'Mohammad', n120.lastname = 'Kovacek', n120.birth_date = '1974-11-23 03:10:46', n120._id = 'c6aa9349-4d3f-3e17-8814-27f4e88a1085', n120.login = 'amaya05', n120.password = 'a782b652ec0ac7ca775163f3ce891b0c12de6960', n120.email = 'bmetz@gmail.com'; -MERGE (n121:Person {neogen_id: '48b3194ff368c8ae84292ce4a3ac1190e42de15a' })SET n121 :User -, n121.firstname = 'Gia', n121.lastname = 'Kuhic', n121.birth_date = '1988-03-10 22:39:42', n121._id = '3feb59d9-25e8-3611-83df-f3d13c6f160e', n121.login = 'jennyfer88', n121.password = '76c71774df655e1027fb2ec6c523f7ef0627b7e1', n121.email = 'crystal.gorczany@gmail.com'; -MERGE (n122:Person {neogen_id: 'c053e6e3c57ea966e86e20c888120755407ec141' })SET n122 :User -, n122.firstname = 'Zola', n122.lastname = 'Treutel', n122.birth_date = '1965-10-13 01:56:50', n122._id = '94fd9a45-808e-307c-b04d-bdad8807598d', n122.login = 'noble.maggio', n122.password = '43a71dfed69169a698dfa47d1f5d6ddfcb7d1135', n122.email = 'perry.leannon@yahoo.com'; -MERGE (n123:Person {neogen_id: '59d887d38b3a24de6355cb24bdc744ecf36682e3' })SET n123 :User -, n123.firstname = 'Selina', n123.lastname = 'Cummerata', n123.birth_date = '1983-10-18 12:15:03', n123._id = '8893641c-af8b-38fc-95b6-ac0e220776c2', n123.login = 'elaina15', n123.password = '9b08a652ff8a330116322b2c8bcf3dfa4f1afb74', n123.email = 'baron27@pourosbotsford.biz'; -MERGE (n124:Person {neogen_id: '7905dd9d20b5ee150f58a728908cb9d7283b9bd5' })SET n124 :User -, n124.firstname = 'Jaeden', n124.lastname = 'Schneider', n124.birth_date = '1975-07-24 07:33:37', n124._id = '0bb30ecd-bd50-339d-977c-94d45d851027', n124.login = 'kunde.alexandro', n124.password = '8c0384705ef05775a612bc65b6b08b42e9042786', n124.email = 'lexi.quigley@nader.com'; -MERGE (n125:Person {neogen_id: 'cf998f13edd68f8b5c03d89a06cb3f28ea7a9f7a' })SET n125 :User -, n125.firstname = 'Abel', n125.lastname = 'Prosacco', n125.birth_date = '1992-06-24 22:16:42', n125._id = 'ecb6ecf6-1a4d-3543-aeb9-a08771084231', n125.login = 'javier.brekke', n125.password = '8e32f5252025e5765c99473559b1ce6630477e16', n125.email = 'fschmitt@hotmail.com'; -MERGE (n126:Person {neogen_id: 'b7621e103f518d4246b467d26c2af3a7af407bc3' })SET n126 :User -, n126.firstname = 'Khalid', n126.lastname = 'Hagenes', n126.birth_date = '1967-09-23 23:47:20', n126._id = '5cc18cd0-07f4-310b-a801-aff52f0a6d92', n126.login = 'amiya76', n126.password = '05bf08293d4f66ba2b0ee39842b7d0e14c8cb00a', n126.email = 'eokuneva@watsicagutmann.com'; -MERGE (n127:Person {neogen_id: '48869b25407d57f7aaf52184a9549f7498364d86' })SET n127 :User -, n127.firstname = 'Clair', n127.lastname = 'Bernier', n127.birth_date = '1971-11-13 01:52:16', n127._id = 'b248bf92-6d30-3704-8c8f-7ff0e7af9aee', n127.login = 'rasheed.gerhold', n127.password = '1e920dbfcf38b37fe567477998a6419719f02caf', n127.email = 'jakayla.schumm@gmail.com'; -MERGE (n128:Person {neogen_id: '46be28685c7e02823c8e16024ab3b7a36eaa02be' })SET n128 :User -, n128.firstname = 'Kraig', n128.lastname = 'Hermiston', n128.birth_date = '1984-03-29 15:02:33', n128._id = 'dab6a98b-9b45-3e4e-ab81-ec892792af5a', n128.login = 'angelita29', n128.password = 'a7bd3cef9e108d97f204c6c3dcc7108fd48a6050', n128.email = 'avis37@hotmail.com'; -MERGE (n129:Person {neogen_id: '28e831ed772b20d0c7e9a170c1a539c1564fe581' })SET n129 :User -, n129.firstname = 'Leonor', n129.lastname = 'Homenick', n129.birth_date = '1977-11-21 10:52:33', n129._id = '7d14bd02-1bfe-3194-8c3e-61e17e44bb36', n129.login = 'kennedi95', n129.password = '52d2579b328c31f116cbda636a2c38af9ea8214c', n129.email = 'treutel.josiah@hellercronin.com'; -MERGE (n130:Person {neogen_id: '3a2eca5abb59281afea5fbd04898bbc784992529' })SET n130 :User -, n130.firstname = 'Freddy', n130.lastname = 'Rath', n130.birth_date = '1977-02-02 14:07:09', n130._id = 'a8fb57ea-d590-37c8-b0ea-7745e6c13e6c', n130.login = 'daphne.grimes', n130.password = 'b04dadab5a66901681e9b4845e96f26c7975ff2e', n130.email = 'elise.ritchie@tillman.info'; -MERGE (n131:Person {neogen_id: '643e33fdc6e0a571aa846fdd67a712c1e93ab63a' })SET n131 :User -, n131.firstname = 'Annabel', n131.lastname = 'Kohler', n131.birth_date = '1985-10-14 11:11:38', n131._id = '89299b7a-e66b-3dcd-93f6-5c71ba2b11ed', n131.login = 'dino.collins', n131.password = 'a728e4a0d063ca99a16fc9818ffcb843c82d1034', n131.email = 'schuppe.jessyca@kuphalhaag.net'; -MERGE (n132:Person {neogen_id: 'aef5ccd2957ee1ac89bb4cd6ccdc1b2383bb023c' })SET n132 :User -, n132.firstname = 'Roberta', n132.lastname = 'McGlynn', n132.birth_date = '1972-02-08 09:45:19', n132._id = '427ddbd8-29a0-32e7-a920-825ec3efb641', n132.login = 'afay', n132.password = '92eea47f760b1a104de75f0545a23cbae86bc0ff', n132.email = 'rex17@von.biz'; -MERGE (n133:Person {neogen_id: 'b27006498af3481cca308577ee5ded1a085eea65' })SET n133 :User -, n133.firstname = 'Kristina', n133.lastname = 'Ernser', n133.birth_date = '1965-10-30 07:41:41', n133._id = 'dd412ee1-7151-3d61-a87a-9ae011c5ed61', n133.login = 'erdman.madeline', n133.password = 'b96d2afe76643dfd6a01878dd62fa15975fb93ee', n133.email = 'nickolas64@gmail.com'; -MERGE (n134:Person {neogen_id: 'af453a25dfb1b6f7430cd9fe8330efff5e159b05' })SET n134 :User -, n134.firstname = 'Margaret', n134.lastname = 'Ward', n134.birth_date = '1972-07-18 07:52:52', n134._id = 'a761d36a-d66c-3025-a5bb-6bbd5f39aa09', n134.login = 'arlie.langosh', n134.password = '9be284987dc07613d1f307a1e2edab8f8cb8f4f8', n134.email = 'lziemann@wiegand.com'; -MERGE (n135:Person {neogen_id: '6eb86405c337e182cabd44b785f62175332257a6' })SET n135 :User -, n135.firstname = 'Jackie', n135.lastname = 'Stoltenberg', n135.birth_date = '1982-11-01 21:59:38', n135._id = '25c4fb73-4ae1-32a5-9716-f965c6d0757e', n135.login = 'hstracke', n135.password = '4a0a8caae5952e3aa44093bff61cd54302eaeda8', n135.email = 'jacobs.judson@hotmail.com'; -MERGE (n136:Person {neogen_id: '96b970de835e3e91c4f8fea5da0e8a34765a0760' })SET n136 :User -, n136.firstname = 'Ariane', n136.lastname = 'Wuckert', n136.birth_date = '1980-05-20 13:05:06', n136._id = '3c0cc233-6310-38c0-8b05-2eb2ab2408f4', n136.login = 'kulas.broderick', n136.password = '44f903f03c43ed3db51e9122b9fc705654b9589a', n136.email = 'hauck.markus@yahoo.com'; -MERGE (n137:Person {neogen_id: '810dbc68a8d1999d450ca91dca77501e3b3017d1' })SET n137 :User -, n137.firstname = 'Rod', n137.lastname = 'Larson', n137.birth_date = '1984-01-03 18:26:53', n137._id = '0b637576-4df0-351c-9649-69e11b179bae', n137.login = 'kelton.feeney', n137.password = '3ddcd56237da4de7dac81df95d638b04b9c0326d', n137.email = 'lina.hansen@schuppe.biz'; -MERGE (n138:Person {neogen_id: '7b2ecf8f4db61ff7e47d0953ec43d535b8207e4c' })SET n138 :User -, n138.firstname = 'Hank', n138.lastname = 'Bogan', n138.birth_date = '1983-08-06 16:29:35', n138._id = 'a9607903-f20f-3782-8833-b183d8781bbf', n138.login = 'elnora.douglas', n138.password = '1aa2cf45d00bcf083180820a0a1e3edd4684cf41', n138.email = 'pfannerstill.judd@thiel.com'; -MERGE (n139:Person {neogen_id: 'a89c1d966990cfa2999d375aaf21505cd8451efd' })SET n139 :User -, n139.firstname = 'Laura', n139.lastname = 'Rohan', n139.birth_date = '1968-12-02 05:51:21', n139._id = '606394a2-563f-338d-ad0c-8c8f46d96291', n139.login = 'unolan', n139.password = 'cc593239f29d3861ecbe67913308759b6b85a83e', n139.email = 'neva.brown@hotmail.com'; -MERGE (n140:Person {neogen_id: 'b952dfe9061d1169e1d87a387cf80d2adac15216' })SET n140 :User -, n140.firstname = 'Darrell', n140.lastname = 'Pagac', n140.birth_date = '1989-06-01 11:05:29', n140._id = 'a14969dd-690b-324b-b0fe-35bb5a1ebdf1', n140.login = 'robert80', n140.password = 'd686c8da44832af123080e8f7b146f0022634e85', n140.email = 'dahlia.aufderhar@gmail.com'; -MERGE (n141:Person {neogen_id: 'd6dd4ebf30a78e8267fe095ecf96cdb99b849ac9' })SET n141 :User -, n141.firstname = 'Jamal', n141.lastname = 'Thompson', n141.birth_date = '1984-05-08 09:11:22', n141._id = '13e0821a-a6b8-3d14-955c-2478d62df521', n141.login = 'judson26', n141.password = 'f8c8d6fd9282f635b104d2739e340952d33f8dd6', n141.email = 'helena91@hotmail.com'; -MERGE (n142:Person {neogen_id: '7297aadb2e7a4505c66ba6e5eefa5ed1372a03e7' })SET n142 :User -, n142.firstname = 'Albin', n142.lastname = 'Hartmann', n142.birth_date = '1974-12-04 21:34:12', n142._id = '27ab759a-4f8e-32de-9450-8fdac5c30426', n142.login = 'cpfeffer', n142.password = 'a7d30c185b07a841e4f4edcff44d2c0b342dfbaa', n142.email = 'jannie76@hotmail.com'; -MERGE (n143:Person {neogen_id: '050f53adcc91bdc58bfef47098e1bc9a41894089' })SET n143 :User -, n143.firstname = 'Brant', n143.lastname = 'Halvorson', n143.birth_date = '1971-07-15 04:56:09', n143._id = '6c7a6e7f-b328-3a70-b2e9-087acf7a2660', n143.login = 'hailee69', n143.password = '7711acf79dc9c5957a957e8e5d3d6ec7c367557b', n143.email = 'felicita03@swaniawski.info'; -MERGE (n144:Person {neogen_id: '8c6a51bcfb661d1c42ce30ce40de8803a28d1ad8' })SET n144 :User -, n144.firstname = 'Amely', n144.lastname = 'Gleichner', n144.birth_date = '1981-04-12 00:39:52', n144._id = 'd9f92acf-d1cf-3718-bd9a-176b245ea0fa', n144.login = 'myron93', n144.password = 'dd6c58e235c18cc3f51ece3d7a8b2ba8fe157aa7', n144.email = 'alexandra.rowe@durgan.net'; -MERGE (n145:Person {neogen_id: 'dc7bc263f54743833f1fdfd721662b520e49775e' })SET n145 :User -, n145.firstname = 'Noah', n145.lastname = 'Weimann', n145.birth_date = '1985-07-01 11:51:08', n145._id = '0f1ece18-fd53-3b85-96d8-f0fd414ec7e3', n145.login = 'lindgren.dallin', n145.password = '5d2c3ba48eebbb4560e5c0195eaacf023c7ae5f2', n145.email = 'gregg.baumbach@hotmail.com'; -MERGE (n146:Person {neogen_id: '0689c3114f03f34f89fdd10e51fb618cb59dc180' })SET n146 :User -, n146.firstname = 'Ignatius', n146.lastname = 'Boyle', n146.birth_date = '1985-06-14 22:01:35', n146._id = '9624e24b-2147-3e23-ba11-a5fc536925f0', n146.login = 'pouros.jettie', n146.password = 'c2e5873719f8418f1a791c3d24dd23a758f128be', n146.email = 'kroberts@yahoo.com'; -MERGE (n147:Person {neogen_id: '6f54a7f5855f486b63dc4b11c21f27d9dc9013d9' })SET n147 :User -, n147.firstname = 'Leopold', n147.lastname = 'Kohler', n147.birth_date = '1971-09-06 13:07:48', n147._id = 'a641635e-1f04-3f21-a463-4a15128150df', n147.login = 'john28', n147.password = '3e366cd6acc0b48de0892fc2127fc6f34d04b121', n147.email = 'burnice.quitzon@barrows.com'; -MERGE (n148:Person {neogen_id: 'c9fbc763c610fb046eb5b92ddc51e94c6f738766' })SET n148 :User -, n148.firstname = 'Lorine', n148.lastname = 'Gottlieb', n148.birth_date = '1992-06-16 11:40:29', n148._id = '72cb4f28-2af2-31ea-858a-0f1b847948be', n148.login = 'bleuschke', n148.password = '0c2a334ec45fe773c25245a0562cb946295f71e6', n148.email = 'terrence81@rippin.biz'; -MERGE (n149:Person {neogen_id: '04cbebb5f8086a5e059318522f4cd231a872441d' })SET n149 :User -, n149.firstname = 'Talia', n149.lastname = 'Howe', n149.birth_date = '1978-07-02 12:18:52', n149._id = '8a977b62-2fdb-3a20-82ff-1dc8be51f38b', n149.login = 'hansen.neoma', n149.password = 'b94db48c61682be43ca4f3f26ed3f08afd0edd58', n149.email = 'edgar80@bahringer.com'; -MERGE (n150:Person {neogen_id: '325b10850fe7e5f01e2dc43e3b3e4e5009085eb8' })SET n150 :User -, n150.firstname = 'Price', n150.lastname = 'Powlowski', n150.birth_date = '1974-05-15 03:24:59', n150._id = '72b0bc46-e3bf-3f67-81fe-c9a77ac146ed', n150.login = 'kshlerin.jeromy', n150.password = '71f1bda2ec822abc853c348d45c4f780f56b36bb', n150.email = 'maverick90@reilly.com'; -MERGE (n151:Person {neogen_id: '27571993f06a943f443721257a72be10db899f74' })SET n151 :User -, n151.firstname = 'Lesly', n151.lastname = 'Schuppe', n151.birth_date = '1976-10-17 01:02:28', n151._id = 'bee3ccf5-4b80-3fed-96a2-917953e2ca41', n151.login = 'flatley.milton', n151.password = '7f7cc40a0c016d8a68efd110a327e62105dde51e', n151.email = 'maci.crist@hotmail.com'; -MERGE (n152:Person {neogen_id: '548ef000ade1b8bc4b5f24eada154ebed43595e9' })SET n152 :User -, n152.firstname = 'Marshall', n152.lastname = 'Lehner', n152.birth_date = '1991-09-22 01:44:42', n152._id = '279ed47e-7ace-3308-9a73-01157dcfc98e', n152.login = 'deja36', n152.password = 'e718c5a487a880e4ab0845c71be627415ba19cec', n152.email = 'gwaters@gmail.com'; -MERGE (n153:Person {neogen_id: '2ea4b0ec86c7412131b7f907720b4234463706d0' })SET n153 :User -, n153.firstname = 'Willy', n153.lastname = 'Walker', n153.birth_date = '1979-06-08 14:12:39', n153._id = '234bac3b-5713-3296-bda1-90bb8e7d868c', n153.login = 'alexandrea69', n153.password = '084020fd05e228167db68ab292a55855a6e31151', n153.email = 'ocie.dicki@hotmail.com'; -MERGE (n154:Person {neogen_id: '10fbcc2a404e88260429c12fadc4fe2f58ec0775' })SET n154 :User -, n154.firstname = 'Constantin', n154.lastname = 'Williamson', n154.birth_date = '1973-07-21 02:36:58', n154._id = 'f89a5727-cc82-3d9f-a52e-4fd0581af438', n154.login = 'mikayla.dietrich', n154.password = '529d8c7d7d6f2d29055d3d9e659adf769d7bea77', n154.email = 'hoppe.pat@yahoo.com'; -MERGE (n155:Person {neogen_id: '69b94f8991717680dc16b5401b8c79204a0ed61b' })SET n155 :User -, n155.firstname = 'Jazmyn', n155.lastname = 'Legros', n155.birth_date = '1966-08-16 07:34:13', n155._id = 'b74f5e46-50f3-30c1-8663-0b2800f9269a', n155.login = 'ebogan', n155.password = 'a8675bec5f59972a6640bf86f61166453bc8d180', n155.email = 'walker.alexane@schuppe.com'; -MERGE (n156:Person {neogen_id: '507f6e0a7e6e3ba48141fd188eeb95765c371029' })SET n156 :User -, n156.firstname = 'Dedric', n156.lastname = 'Ryan', n156.birth_date = '1988-08-12 00:40:04', n156._id = '34f3bf4d-2413-33f8-90dd-8ac0cbd340c6', n156.login = 'casper.prince', n156.password = '751bf98f814d04c05e3c3fc209f1d393e6d1a374', n156.email = 'tosinski@smitham.com'; -MERGE (n157:Person {neogen_id: '077c57a649698b5ea3d702d53fc8266327db8497' })SET n157 :User -, n157.firstname = 'Rocio', n157.lastname = 'Hartmann', n157.birth_date = '1979-05-08 09:48:50', n157._id = 'd3b4a230-a85b-37ab-8c69-65e62fb4e0d8', n157.login = 'kamren18', n157.password = '7788f6f9e6807d930cc30e01ce63258acb2fd311', n157.email = 'brayan.mcclure@hotmail.com'; -MERGE (n158:Person {neogen_id: 'b7ae7fdc255c0ea48d6779742566fbb30334e453' })SET n158 :User -, n158.firstname = 'Allan', n158.lastname = 'Conroy', n158.birth_date = '1985-10-12 17:05:14', n158._id = 'fb99720b-6f36-3510-9b7a-9fada23f9e4a', n158.login = 'katelyn77', n158.password = 'ba2f135e8f2b2ca073c016ab078c6fc39f1a7e13', n158.email = 'serenity99@gmail.com'; -MERGE (n159:Person {neogen_id: '14d8de7525453177a07a74cc1bca6a247c63bed3' })SET n159 :User -, n159.firstname = 'Chadd', n159.lastname = 'O\'Reilly', n159.birth_date = '1981-04-13 05:11:42', n159._id = '510fecab-135f-3652-b898-897e2618336b', n159.login = 'zbreitenberg', n159.password = 'dfa5d95208d4619d4099de07cc28903571883c45', n159.email = 'ondricka.marcelino@emardweimann.com'; -MERGE (n160:Person {neogen_id: '4cc407ecff8f8b545e05ab8c5b92890bc4145bf6' })SET n160 :User -, n160.firstname = 'Jade', n160.lastname = 'Aufderhar', n160.birth_date = '1973-01-25 02:17:42', n160._id = '85b6f7b5-a89e-3324-8f1d-7c56814c523b', n160.login = 'eschuster', n160.password = '1249bd8444f739ccb8d86c754cac33d9120b0050', n160.email = 'apfannerstill@dickinsonwolff.net'; -MERGE (n161:Person {neogen_id: '9ca04f1a154ef61908eed1bbb96634ca6bce85ce' })SET n161 :User -, n161.firstname = 'Freddy', n161.lastname = 'Bradtke', n161.birth_date = '1973-04-30 06:09:59', n161._id = '29f8cb2c-c273-3d84-bd9b-ba72137ab5b5', n161.login = 'ivah.waters', n161.password = '548273082a53497e12aba77f79858be32f646915', n161.email = 'elvera67@gmail.com'; -MERGE (n162:Person {neogen_id: '89dc779733960a7169f993d9c0855593c5d7b6c1' })SET n162 :User -, n162.firstname = 'Constantin', n162.lastname = 'Cartwright', n162.birth_date = '1969-01-22 13:40:47', n162._id = '4d8a0d00-037e-3479-b817-6aa7bb00e549', n162.login = 'edythe89', n162.password = '1791f7cbe2da6275315c283b8a7af954210ad316', n162.email = 'amparo14@gmail.com'; -MERGE (n163:Person {neogen_id: '73d959df32e20af4c453aaf3e576a098650c1b92' })SET n163 :User -, n163.firstname = 'Gayle', n163.lastname = 'Bauch', n163.birth_date = '1970-08-19 10:33:30', n163._id = 'd9ccb5e8-754f-3f31-9e1c-6c9ca80b8f8b', n163.login = 'ekautzer', n163.password = '32cec4b5b96b0141d3c8145eebff6fc257dfb321', n163.email = 'bgislason@larkinmarquardt.com'; -MERGE (n164:Person {neogen_id: 'f473aac6204ee0282ec6668b9b3a224b4a34694a' })SET n164 :User -, n164.firstname = 'Francisco', n164.lastname = 'Satterfield', n164.birth_date = '1987-03-10 10:30:55', n164._id = '09f487fa-7aaf-30cb-9c1c-92b63af219ab', n164.login = 'kirlin.lora', n164.password = '561bf09ab15152dc48289d37ec605a5655a71ada', n164.email = 'otho37@hotmail.com'; -MERGE (n165:Person {neogen_id: '53def9a533c5f2557ea8da63a21d03e6aa8aece7' })SET n165 :User -, n165.firstname = 'Dominic', n165.lastname = 'Johnson', n165.birth_date = '1982-07-08 03:03:37', n165._id = '76e3eb6b-4c1e-3b0c-a26c-386e78c1fc42', n165.login = 'rylan42', n165.password = 'f0d529b72f410bbc1a28be2d31ba313d4001aa1d', n165.email = 'fcummings@hotmail.com'; -MERGE (n166:Person {neogen_id: '11317921f24a93bad7ff365aa6da93f4020c7169' })SET n166 :User -, n166.firstname = 'Jessyca', n166.lastname = 'Botsford', n166.birth_date = '1965-07-15 19:07:48', n166._id = 'd7945a15-0e71-3344-bdc2-2c26d176d249', n166.login = 'conn.aurelio', n166.password = 'b8ea1313d748e99db57d989adc2cc7e833bceaab', n166.email = 'sofia.bechtelar@yahoo.com'; -MERGE (n167:Person {neogen_id: '3f2e335c5e8bb1215ddb7b728d06f96592e9703a' })SET n167 :User -, n167.firstname = 'Mark', n167.lastname = 'Dicki', n167.birth_date = '1984-08-05 09:07:47', n167._id = '898ed554-d468-3f5b-bd2b-7a29fe4f1813', n167.login = 'henderson.dickens', n167.password = '262e42137d22beacf48e7002961424d80e6d6334', n167.email = 'arianna97@jones.com'; -MERGE (n168:Person {neogen_id: '363cd779ae324b7da34c8068e2df3c203775be91' })SET n168 :User -, n168.firstname = 'Mozelle', n168.lastname = 'Bosco', n168.birth_date = '1978-06-24 13:29:36', n168._id = 'aa962ba5-3188-3a2f-b3e4-ea2679f21209', n168.login = 'eriberto20', n168.password = '4273837c894e6ba2cec76fbc99b9fda97ad12866', n168.email = 'deon67@yahoo.com'; -MERGE (n169:Person {neogen_id: 'd8a98738586fceb188e36c110abc42ce822b2afd' })SET n169 :User -, n169.firstname = 'Samson', n169.lastname = 'Schumm', n169.birth_date = '1974-01-08 02:40:43', n169._id = 'd514ac64-d553-39a1-a741-447aa338ae3f', n169.login = 'borer.bryon', n169.password = 'e680d85e005f79ce43f512c7228642c314d55cd6', n169.email = 'winfield.macejkovic@labadiebauch.info'; -MERGE (n170:Person {neogen_id: 'ebd3a8dbf1becfc3812abb13109593257974a5bd' })SET n170 :User -, n170.firstname = 'Wilburn', n170.lastname = 'Kessler', n170.birth_date = '1995-04-08 15:39:30', n170._id = '1fcc4519-97ca-33c5-bea1-f93749a5e9e6', n170.login = 'corkery.ressie', n170.password = '8916fd980887b59a8484b22a7498cc5446f329dc', n170.email = 'kemmer.caleigh@littelkuvalis.net'; -MERGE (n171:Person {neogen_id: '841e98630cef2c27dd5aae6a8c0c520cd6c47bfe' })SET n171 :User -, n171.firstname = 'Nathanial', n171.lastname = 'Halvorson', n171.birth_date = '1986-10-26 21:34:38', n171._id = '76fd1ca3-3331-32e1-99a5-45656b11bd9b', n171.login = 'rutherford.arthur', n171.password = '399a5b22b4179239793254e61b2411626d6d3d14', n171.email = 'elenor.quigley@hotmail.com'; -MERGE (n172:Person {neogen_id: '8421fb1154ad07bdeaf2e05312e24d2f9583931a' })SET n172 :User -, n172.firstname = 'Mina', n172.lastname = 'Nicolas', n172.birth_date = '1995-05-14 16:49:07', n172._id = '7660a579-ebb8-36c4-9867-9dab5a3165be', n172.login = 'cielo33', n172.password = 'a721fec4c2c12fe8cb1b93128844f260e20ffa3a', n172.email = 'elisa13@hintz.com'; -MERGE (n173:Person {neogen_id: 'd954d220047318c61fdd598566c031b59e0e7bd5' })SET n173 :User -, n173.firstname = 'Damien', n173.lastname = 'Effertz', n173.birth_date = '1991-12-25 15:23:44', n173._id = '8f66c491-8d15-3105-b53c-6d854902af57', n173.login = 'olangosh', n173.password = 'd4a513d8072775ab68ca325e5b51cf3c89433a94', n173.email = 'cruickshank.douglas@gmail.com'; -MERGE (n174:Person {neogen_id: '26dc8bdb2a23677240f3f2e4e73361b54c250e84' })SET n174 :User -, n174.firstname = 'Dejah', n174.lastname = 'Wolff', n174.birth_date = '1980-10-09 21:45:43', n174._id = '4fdb112e-62a0-3053-95c8-540b58cb2cf5', n174.login = 'mhuel', n174.password = 'd01bae9e13e3194a84c07c61ae6cf2b89c9e5723', n174.email = 'camron.fahey@hotmail.com'; -MERGE (n175:Person {neogen_id: 'b2f5dca45b7c7d982ecb2b65d44900367398d33d' })SET n175 :User -, n175.firstname = 'Dovie', n175.lastname = 'Schumm', n175.birth_date = '1965-07-17 11:02:38', n175._id = 'a3e2d645-e365-3012-82aa-304c89493427', n175.login = 'destiny.olson', n175.password = 'b18ef7ee27dffb9c1856550719f0d64640a7ab71', n175.email = 'abner93@hotmail.com'; -MERGE (n176:Person {neogen_id: '09fb16728d240dc71b5ca2952a13c001e18fce46' })SET n176 :User -, n176.firstname = 'Ernest', n176.lastname = 'Johns', n176.birth_date = '1974-05-17 08:50:05', n176._id = 'f7a71b58-1033-3c52-9a5f-3b7101f5a8e9', n176.login = 'nelle.hilpert', n176.password = 'fe7ffb881905577ba097dc7e3023c973d9f12eda', n176.email = 'beahan.jaunita@lynch.org'; -MERGE (n177:Person {neogen_id: '1505e8ef23e9f1a15533bff1d3eb37f7cff5d891' })SET n177 :User -, n177.firstname = 'Angeline', n177.lastname = 'Hickle', n177.birth_date = '1976-09-17 03:44:25', n177._id = '708e90d9-ff1b-3780-907d-7ddeaa0c8309', n177.login = 'wehner.verda', n177.password = '0c9f9cd3bba9d534f30de1ee7112092cffe78e0b', n177.email = 'boyle.marjory@yahoo.com'; -MERGE (n178:Person {neogen_id: 'edd14fbc30504bf7729c61706663a3f30c2f54e3' })SET n178 :User -, n178.firstname = 'Broderick', n178.lastname = 'Sauer', n178.birth_date = '1982-01-08 11:39:54', n178._id = '1ecbd195-aaf9-3e60-87a1-631be0605256', n178.login = 'mohr.naomi', n178.password = '1ca7a4b37dda604e3b290b1ea048e9f1a349f9c3', n178.email = 'rowe.lauryn@ryan.com'; -MERGE (n179:Person {neogen_id: '8ddf8ed4d14bf453c4fa6440fac3ca5ccdeaced7' })SET n179 :User -, n179.firstname = 'Elias', n179.lastname = 'Ortiz', n179.birth_date = '1982-08-07 08:08:52', n179._id = 'fd359d00-7236-3c8f-ae71-532affdf00e3', n179.login = 'julianne01', n179.password = 'd322849cf4dd2a82e87b2ded46ce7b295cc19600', n179.email = 'velda82@walkerritchie.info'; -MERGE (n180:Person {neogen_id: '0c0eb6f49a1f4e02f828c6e261f90e45eea2e09b' })SET n180 :User -, n180.firstname = 'Petra', n180.lastname = 'Eichmann', n180.birth_date = '1966-08-03 19:59:44', n180._id = 'eaee6f43-1195-36f3-8219-73e6e3afcfb1', n180.login = 'alanis35', n180.password = 'e96eea691317d2baa90f63397b4abfa60130657b', n180.email = 'nicolas.stephania@spinkatorp.com'; -MERGE (n181:Person {neogen_id: '1a49c4b79d94e3153e2322710ae1ebea33cb7627' })SET n181 :User -, n181.firstname = 'Turner', n181.lastname = 'Turcotte', n181.birth_date = '1996-03-05 03:30:27', n181._id = '7e856a6a-ce26-33c0-a977-2ed7046ee838', n181.login = 'dhettinger', n181.password = '8f3013808e910352019e3a9dfa2aae559582cb39', n181.email = 'stanton67@hotmail.com'; -MERGE (n182:Person {neogen_id: '3c78bbedc0dbe3b809822e62b79da30a7eeca59d' })SET n182 :User -, n182.firstname = 'Adaline', n182.lastname = 'Larkin', n182.birth_date = '1995-05-27 10:31:28', n182._id = '537aa3b0-7604-3bec-94bc-3fa9bb748f8b', n182.login = 'fbaumbach', n182.password = '8ec8060d76e0ebb5ac6aed957777f06458f6d3cd', n182.email = 'qmonahan@yahoo.com'; -MERGE (n183:Person {neogen_id: '245d0e4533027c20fde2627d92288383e61d2032' })SET n183 :User -, n183.firstname = 'Jason', n183.lastname = 'Hudson', n183.birth_date = '1983-02-09 21:32:41', n183._id = '253e3e3f-62a3-339a-a020-6ac1d75c095d', n183.login = 'msanford', n183.password = 'c403169246116b17dfd7c4666563aa09c45a6cb4', n183.email = 'fbartell@hotmail.com'; -MERGE (n184:Person {neogen_id: 'b19f7b3436e5744d8edd01ec4f31a492bc9fdcdc' })SET n184 :User -, n184.firstname = 'Rowland', n184.lastname = 'Muller', n184.birth_date = '1980-12-25 06:11:14', n184._id = '5e1e56c4-f577-3877-8873-544e98515cbc', n184.login = 'raynor.ernest', n184.password = '101e714b7a68d6ac4ee9ce1b6c68f12d4ef2a7f5', n184.email = 'waters.nora@haag.biz'; -MERGE (n185:Person {neogen_id: '78c1e4851e648db2423cb49689d4709db7d4e328' })SET n185 :User -, n185.firstname = 'Mariela', n185.lastname = 'Runte', n185.birth_date = '1993-08-10 22:22:51', n185._id = 'bf75b353-ea00-3bcd-ba64-e94b174365b6', n185.login = 'xschinner', n185.password = 'f94ed0cf0c2bd65e4918e4ae895982cc5467e94b', n185.email = 'mitchell.roslyn@toymckenzie.com'; -MERGE (n186:Person {neogen_id: '6bf4931a6f5999e23eda98ecbe2833fd761f1aff' })SET n186 :User -, n186.firstname = 'Jaeden', n186.lastname = 'Flatley', n186.birth_date = '1976-03-10 16:05:34', n186._id = '889d2266-c871-3ecd-bb33-450b8d2e9dea', n186.login = 'jacquelyn.kovacek', n186.password = 'b301cf50a8b7eb93a85cafb70e6baa932ca1967d', n186.email = 'glover.morgan@gmail.com'; -MERGE (n187:Person {neogen_id: 'df41f8baa31058f38db3835e9ce1e5d7a7509b98' })SET n187 :User -, n187.firstname = 'Sigurd', n187.lastname = 'Volkman', n187.birth_date = '1989-04-11 16:33:38', n187._id = '6e80c54f-df45-304c-9d63-59717424ff0b', n187.login = 'dorothea.steuber', n187.password = '2b29d1d7deaddfe38f26682190e65cfffb7850a2', n187.email = 'greyson75@gmail.com'; -MERGE (n188:Person {neogen_id: 'bf4fcce2c61b81d9b373756a10b8e5174feb649e' })SET n188 :User -, n188.firstname = 'Darby', n188.lastname = 'Gorczany', n188.birth_date = '1983-03-01 21:03:09', n188._id = '27c6fc28-193a-337a-b4b9-bea421a0b4e1', n188.login = 'rodriguez.marlen', n188.password = '7025aa760a6ff8750135663b16f028307a67684e', n188.email = 'koepp.florian@turner.org'; -MERGE (n189:Person {neogen_id: 'a42e9004b1c0c450de5d4e0bf100e3b049d91ba1' })SET n189 :User -, n189.firstname = 'Frances', n189.lastname = 'Spinka', n189.birth_date = '1993-06-16 14:21:00', n189._id = '6a0985e0-3eac-3cff-af40-0daf2fa08974', n189.login = 'shanahan.alisha', n189.password = '59c04a26f600b6be99a6db192f2c01f76a9aff1e', n189.email = 'mcglynn.keshaun@orn.net'; -MERGE (n190:Person {neogen_id: '4c7fa839c1cfd332a0e0219ba58fba13a2690da9' })SET n190 :User -, n190.firstname = 'Peggie', n190.lastname = 'Osinski', n190.birth_date = '1976-11-30 10:03:59', n190._id = '7266da63-7ab3-39ef-9f7e-13ffbd1ce86c', n190.login = 'qrunte', n190.password = 'f6566d6aeecec6190e89cd578788e84c4d927ae2', n190.email = 'leffler.pink@gmail.com'; -MERGE (n191:Person {neogen_id: 'df85322c512bc371e442aaf340accc4525c032f9' })SET n191 :User -, n191.firstname = 'Maggie', n191.lastname = 'Beahan', n191.birth_date = '1981-06-04 12:37:35', n191._id = 'a292f40f-743e-3c45-99fb-c2bb82d1446f', n191.login = 'brenna.schultz', n191.password = '254e31065407ac878045b0e58bfca7f9c2c76cf9', n191.email = 'yost.russ@gmail.com'; -MERGE (n192:Person {neogen_id: '11a43c241f6e881a6ec74652dae2aa7559ab1105' })SET n192 :User -, n192.firstname = 'Amos', n192.lastname = 'Wilkinson', n192.birth_date = '1967-09-19 18:44:36', n192._id = 'c994dc73-84e3-3abf-8b39-4cf4adfb40f2', n192.login = 'walter.konopelski', n192.password = 'b3948daf775bb0ca3474cea4312e2dd1aad0333f', n192.email = 'ccorwin@hilll.net'; -MERGE (n193:Person {neogen_id: '1261cf743c34dd72fe1e81aec8b8cdef2a34a7e3' })SET n193 :User -, n193.firstname = 'Lisette', n193.lastname = 'Morissette', n193.birth_date = '1983-08-15 17:08:20', n193._id = '2e1f4ad5-874c-3566-be96-d2c23459b129', n193.login = 'lesley.williamson', n193.password = '4eeff1a7df04876c4fc326c35c7ee26e7091c066', n193.email = 'tlangosh@gmail.com'; -MERGE (n194:Person {neogen_id: '6e572a32c78d2a69eae0ee354ff714fa612ef3c3' })SET n194 :User -, n194.firstname = 'Edd', n194.lastname = 'Kuphal', n194.birth_date = '1986-11-19 23:59:37', n194._id = 'cc87574d-a1bb-3e91-8288-262fc999afc1', n194.login = 'shanahan.rossie', n194.password = '8f5f3532544398a2d1dd030186b83a81026936d6', n194.email = 'andres.shanahan@hotmail.com'; -MERGE (n195:Person {neogen_id: 'f6666ef134b87829b1fccb8c7c4cdf5ad89341ca' })SET n195 :User -, n195.firstname = 'Amaya', n195.lastname = 'Schmeler', n195.birth_date = '1983-06-08 01:12:04', n195._id = 'b608ad89-4a4d-32fc-b729-3e871837b42b', n195.login = 'mayert.payton', n195.password = '2a4eed9ba427d9efc3215ea03f4cc642804dc860', n195.email = 'beaulah.rohan@balistreri.com'; -MERGE (n196:Person {neogen_id: '263683d7302cd389cd2df8e0c6e9f47a21cccf66' })SET n196 :User -, n196.firstname = 'Alexander', n196.lastname = 'Kozey', n196.birth_date = '1975-03-29 05:01:45', n196._id = '9ffa1e8a-8cb1-3ef0-a20a-ad83ba6858cf', n196.login = 'conor.mohr', n196.password = 'fbaac6b42d1ee781ba7dc0da6f5ba7a9f67a1eea', n196.email = 'kuvalis.barney@gmail.com'; -MERGE (n197:Person {neogen_id: '7f2cb43e114b17af5f390cb3da321c2cfa556fd0' })SET n197 :User -, n197.firstname = 'Catherine', n197.lastname = 'Huels', n197.birth_date = '1984-01-04 18:57:08', n197._id = '186d9c1a-d5d4-305e-9857-d5054dd2d012', n197.login = 'ksmith', n197.password = '42431c67dce4a3c543994a4c425c91f88ba1beb9', n197.email = 'mossie92@hotmail.com'; -MERGE (n198:Person {neogen_id: '6a3d646bfff62920bfb51816cf6e97cd929e787f' })SET n198 :User -, n198.firstname = 'Rosario', n198.lastname = 'Reilly', n198.birth_date = '1973-12-31 18:51:18', n198._id = 'e5a61e39-37af-3e84-8d90-dbd20678b283', n198.login = 'zboncak.cleve', n198.password = '9d8d04742bcd4b1af8fdbb9f52b59198e419d08f', n198.email = 'adams.leon@yahoo.com'; -MERGE (n199:Person {neogen_id: '4c06b2bcb33d7da0aacd2281ec52f946f2e9da8c' })SET n199 :User -, n199.firstname = 'Johnathon', n199.lastname = 'Witting', n199.birth_date = '1979-04-19 05:42:48', n199._id = '8b7a2c7d-d94f-337c-9586-0b3bd59b9c7f', n199.login = 'timothy38', n199.password = '80433f55fe52406283b2f20eb055b1ff645849f0', n199.email = 'bernier.dorcas@gulgowski.biz'; -MERGE (n200:Person {neogen_id: '49a76f2b22b8e005eff3f537973753bd24c09462' })SET n200 :User -, n200.firstname = 'Shemar', n200.lastname = 'Cronin', n200.birth_date = '1996-10-23 06:08:19', n200._id = 'e7e7055d-309b-3cb1-8ce2-d8bb38a16c6c', n200.login = 'qlakin', n200.password = 'c8600330ea309326df4302c1e146b962bfdde23a', n200.email = 'leannon.winnifred@gmail.com'; -MERGE (n201:Person {neogen_id: 'cb7fc3158c7338e79b358527c4aa71f2d3c5682e' })SET n201 :User -, n201.firstname = 'Kyra', n201.lastname = 'Daugherty', n201.birth_date = '1983-06-21 08:18:06', n201._id = 'cf07e696-a11e-3d2a-981a-bf2d3b3135e1', n201.login = 'xkub', n201.password = '9183749d307dee6150ba00034046383c9099b176', n201.email = 'anissa.heller@yahoo.com'; -MERGE (n202:Person {neogen_id: '21c3e3dd6f1b9eff34656e80253dc4078a31cbed' })SET n202 :User -, n202.firstname = 'Buford', n202.lastname = 'Beer', n202.birth_date = '1970-04-02 08:00:27', n202._id = 'bc337146-c68e-3ef8-aeef-c1e07f54be92', n202.login = 'sawayn.jerald', n202.password = '172b001aab6a0ac775baf2934f21620c830c6ff9', n202.email = 'darryl72@witting.biz'; -MERGE (n203:Person {neogen_id: '0a19f7113038fe56100eacb727d17120ebff65a1' })SET n203 :User -, n203.firstname = 'Lonzo', n203.lastname = 'Kuhlman', n203.birth_date = '1989-11-26 06:59:27', n203._id = '5eebc9ba-58cb-3723-b3b9-08d9dacd4791', n203.login = 'kale63', n203.password = 'bf1c0fd70ae8664b941a1425d3509a4d0190c298', n203.email = 'jhegmann@hotmail.com'; -MERGE (n204:Person {neogen_id: 'fdd5252376737c228109597d77d2b38c5397642a' })SET n204 :User -, n204.firstname = 'Abner', n204.lastname = 'Bartell', n204.birth_date = '1986-02-04 13:18:51', n204._id = '3dbfd152-1cc9-3b56-95c7-c975474b7ee0', n204.login = 'roger.bednar', n204.password = 'e15cf6016fc9d6f02301e430744e0a993ee65caf', n204.email = 'fkilback@yahoo.com'; -MERGE (n205:Person {neogen_id: 'd5cd41bd57475d3f8a106a0e2983cefac0216a86' })SET n205 :User -, n205.firstname = 'Alverta', n205.lastname = 'Jacobson', n205.birth_date = '1979-11-01 14:27:30', n205._id = '8984aeca-4572-35a0-aaa8-de6391647d8d', n205.login = 'adella.kemmer', n205.password = '6ae7b17bcad6e3a644c2f585ff4aa88eb0ecfc8a', n205.email = 'weber.alice@hotmail.com'; -MERGE (n206:Person {neogen_id: '9f5553c0f9052a3ed804ce40511583f689c6bcb3' })SET n206 :User -, n206.firstname = 'Kirk', n206.lastname = 'Fahey', n206.birth_date = '1979-07-09 02:00:36', n206._id = 'b4a2ade6-632e-35ac-a406-5724fac4c13b', n206.login = 'rogahn.halie', n206.password = 'a0aa4eefe61c58321971f950e62e058448236bf7', n206.email = 'pfannerstill.jeffery@hotmail.com'; -MERGE (n207:Person {neogen_id: 'ae640eef5cebb28848363f0721696bbe1781c28c' })SET n207 :User -, n207.firstname = 'Johnnie', n207.lastname = 'Graham', n207.birth_date = '1970-05-05 04:44:09', n207._id = '43c4b8a4-30c0-31f1-bf1a-763fe0304be9', n207.login = 'heidenreich.annetta', n207.password = 'd050c673ab276d197f6f25db4e77064c716738cd', n207.email = 'oscar.marvin@klein.com'; -MERGE (n208:Person {neogen_id: 'eaf584bdd402ebf900a7530d4fddb220682ce4d9' })SET n208 :User -, n208.firstname = 'Melany', n208.lastname = 'O\'Keefe', n208.birth_date = '1977-11-16 08:09:45', n208._id = 'c318adad-7eda-327e-8f1a-ac81bb3c70e8', n208.login = 'hane.henri', n208.password = 'cd4f93b071ccca5b7d88818285d7a37049157951', n208.email = 'blanda.lillie@gmail.com'; -MERGE (n209:Person {neogen_id: '3d5cac90c7447f84d31b5c336f5509a7e4dd5038' })SET n209 :User -, n209.firstname = 'Alexandre', n209.lastname = 'Pfeffer', n209.birth_date = '1969-10-26 21:57:26', n209._id = 'bd84cf41-bd2f-388a-a12e-2da786ac6807', n209.login = 'sonny97', n209.password = '056ce3cc705a56645a228b8d43d7a206fc76aab9', n209.email = 'graham.adrian@willms.com'; -MERGE (n210:Person {neogen_id: '0b0b948d2b400df9f64798fac4d14d2c1d533d27' })SET n210 :User -, n210.firstname = 'Eduardo', n210.lastname = 'Ritchie', n210.birth_date = '1971-04-11 17:51:26', n210._id = 'bd6735af-f0e2-39ea-a3b8-a6c5103f997a', n210.login = 'makenzie35', n210.password = '889cd101307dc2d42195931e9141d3c8c0a8129c', n210.email = 'ivory.sawayn@yahoo.com'; -MERGE (n211:Person {neogen_id: '94c919125a89a79edf85f60f2eb52712ebf5dadd' })SET n211 :User -, n211.firstname = 'Arlo', n211.lastname = 'Greenfelder', n211.birth_date = '1970-03-15 03:09:08', n211._id = '1d63df43-e147-364e-9bc8-e1b885916e75', n211.login = 'richard.christiansen', n211.password = '03fcd34df252506de2b0c6db6c15fc8d53e6adc1', n211.email = 'fae.hermann@hotmail.com'; -MERGE (n212:Person {neogen_id: 'e431edd2e9663c60c028d032c948bbf006325348' })SET n212 :User -, n212.firstname = 'Winfield', n212.lastname = 'Torphy', n212.birth_date = '1979-12-15 20:21:19', n212._id = '40168525-ac33-360a-b8e5-7b35bf58b59d', n212.login = 'qcrist', n212.password = '8755af69423992383b160d17b507b1cc3e143424', n212.email = 'pagac.camylle@nolan.com'; -MERGE (n213:Person {neogen_id: '59b27f0092bf0028263b484892aff2353c045420' })SET n213 :User -, n213.firstname = 'Finn', n213.lastname = 'Roberts', n213.birth_date = '1981-03-02 04:07:43', n213._id = '56038fdd-cb4d-3741-a126-d2e307c3779d', n213.login = 'stroman.jacynthe', n213.password = '5d6943a781de1a0969ca8623bfb2b09021cf6452', n213.email = 'alexandro88@swaniawski.biz'; -MERGE (n214:Person {neogen_id: '5fe96bfdc4a603720bb395b223fd383429eec4c0' })SET n214 :User -, n214.firstname = 'Stan', n214.lastname = 'O\'Reilly', n214.birth_date = '1985-10-13 17:53:50', n214._id = 'ab9e8338-ebf4-32ed-bff4-b914f8764c25', n214.login = 'neva.turcotte', n214.password = '1e151106d673c3c40dddea65be0c51baa99a66ba', n214.email = 'carroll.scottie@hansenschinner.com'; -MERGE (n215:Person {neogen_id: 'b8b01a22f4e5af53c724611dc8abdad0429de496' })SET n215 :User -, n215.firstname = 'Stefanie', n215.lastname = 'Rutherford', n215.birth_date = '1994-11-15 22:42:05', n215._id = 'b4771ad2-1b93-3de7-9c95-3ae16a65f180', n215.login = 'estell22', n215.password = '0f33792f98a2b5873527f2026af2ab1c69536019', n215.email = 'jasmin.flatley@hotmail.com'; -MERGE (n216:Person {neogen_id: '2256c24980bca911b207f26b097c4dff0585f023' })SET n216 :User -, n216.firstname = 'Albert', n216.lastname = 'Mraz', n216.birth_date = '1975-05-18 04:28:04', n216._id = '31bebe42-0a9e-39e4-82f7-bf7a01cb297c', n216.login = 'icie.cronin', n216.password = '5ff58e29afd04c32a9077f2e568fe24eb13c650b', n216.email = 'kaycee89@turner.com'; -MERGE (n217:Person {neogen_id: 'bff2173be57ac59331b2ce0f1b04cedee1aecb56' })SET n217 :User -, n217.firstname = 'Kevon', n217.lastname = 'Morar', n217.birth_date = '1966-06-22 04:57:58', n217._id = '9e3e01f7-ef53-3b40-ae5c-0d22e878acaa', n217.login = 'bschumm', n217.password = '3f9c1067c1c7f728ea5825fb7591aaf0ef397768', n217.email = 'lryan@wymankessler.info'; -MERGE (n218:Person {neogen_id: 'a878424df724fa5da6a7888aa0229d543abd4805' })SET n218 :User -, n218.firstname = 'Hilton', n218.lastname = 'Mante', n218.birth_date = '1977-08-21 01:48:47', n218._id = 'd01f2f0b-0bbf-3fd7-b8e2-d1e6cf8c7528', n218.login = 'jean.durgan', n218.password = '5fd295c4a9124b0913498dcc440ef263fa69207d', n218.email = 'nico.crist@kirlin.com'; -MERGE (n219:Person {neogen_id: '575a372ff3319622567a7451fdd4ebdbe4cb957b' })SET n219 :User -, n219.firstname = 'Kasey', n219.lastname = 'Wilkinson', n219.birth_date = '1977-10-09 04:49:21', n219._id = '44bd0158-551b-38fc-96dd-0950a8cf5f1f', n219.login = 'ksmitham', n219.password = '6150a5ff8655e4877567fdc1d533472c4c068fbd', n219.email = 'jaquelin.batz@dickinsonkihn.com'; -MERGE (n220:Person {neogen_id: '5c1c3e55a1d6d193584575067a195d17cb95a80c' })SET n220 :User -, n220.firstname = 'Fidel', n220.lastname = 'Herzog', n220.birth_date = '1984-04-23 23:23:28', n220._id = '0f817b8f-6b4f-361b-9461-37cbd928b9ca', n220.login = 'maxine.rosenbaum', n220.password = '2ea5e05580d26622243925fb4e52b63f85941cc6', n220.email = 'donnelly.sage@hotmail.com'; -MERGE (n221:Person {neogen_id: '2f851840553b7cbd3348e9a218c5235a8ad85bf7' })SET n221 :User -, n221.firstname = 'Augusta', n221.lastname = 'Robel', n221.birth_date = '1970-09-18 08:22:08', n221._id = '96dbec0f-856b-3cc9-961c-db9dc49db98a', n221.login = 'royal.becker', n221.password = '3504f2dd6e4b2344b51eb820951a32e09c6e263f', n221.email = 'turner.ike@yahoo.com'; -MERGE (n222:Person {neogen_id: '19ea6df74f89a8944831e08bcb2e6fa48fa11dc1' })SET n222 :User -, n222.firstname = 'Chasity', n222.lastname = 'Williamson', n222.birth_date = '1988-02-11 05:18:57', n222._id = '64c101ae-20be-3634-a00e-5b9adffa3e17', n222.login = 'wgislason', n222.password = 'b9265b6ddeba6435b56ed96e2fcdfd7c13a14661', n222.email = 'nhermann@yahoo.com'; -MERGE (n223:Person {neogen_id: 'cb68723e946a836b2618138a91384f45934f076b' })SET n223 :User -, n223.firstname = 'Tara', n223.lastname = 'Nolan', n223.birth_date = '1978-08-15 01:53:00', n223._id = '220a7d99-7c86-3801-bb0c-4ffdc596c16b', n223.login = 'khayes', n223.password = '03201feba706f8744de94fc6da9372f58244f260', n223.email = 'brady60@gmail.com'; -MERGE (n224:Person {neogen_id: 'c07556f354a234f7f230b198beab6b21e41d7eb8' })SET n224 :User -, n224.firstname = 'Lela', n224.lastname = 'Blick', n224.birth_date = '1996-07-08 15:34:54', n224._id = '92d247fc-4d0f-363a-b15f-9c099f3e3ad3', n224.login = 'deckow.joyce', n224.password = 'f69e725c27354fc3be8d2703b5c4ac2b86afc2a1', n224.email = 'jon59@hayes.com'; -MERGE (n225:Person {neogen_id: '265d23b95722a0d795f1d97aed67404d42278137' })SET n225 :User -, n225.firstname = 'Darryl', n225.lastname = 'Langosh', n225.birth_date = '1985-07-17 23:59:33', n225._id = '79965583-fdee-3f20-a4d8-532e5e7240be', n225.login = 'bruce86', n225.password = 'f0af73ff1f8e0037aa40d3b4f796351ea3d91edc', n225.email = 'jude20@gmail.com'; -MERGE (n226:Person {neogen_id: 'f3f66575cc5fa8ab1afec6b24bed9d09da6d965f' })SET n226 :User -, n226.firstname = 'Zackery', n226.lastname = 'Schmitt', n226.birth_date = '1989-08-18 18:40:44', n226._id = '2f1700b4-6f94-32a3-aa2b-729f82eac45f', n226.login = 'dreichel', n226.password = 'beb79a6f14d1eb87f920339012879beee1186486', n226.email = 'candelario.mraz@murazikparker.com'; -MERGE (n227:Person {neogen_id: '2b9b0f69a8b96c720373501a1a9d9bddedc023bf' })SET n227 :User -, n227.firstname = 'Raheem', n227.lastname = 'Barrows', n227.birth_date = '1968-01-08 07:32:41', n227._id = '214abe10-e910-39bc-b87b-46feed56db83', n227.login = 'hmohr', n227.password = '952540c183784b488f90e42f7de1e4d8f45383bb', n227.email = 'larkin.kennedi@gmail.com'; -MERGE (n228:Person {neogen_id: '67ea417a6633feaac39e999d441beffa24c6256a' })SET n228 :User -, n228.firstname = 'Shaun', n228.lastname = 'Romaguera', n228.birth_date = '1978-03-14 02:30:07', n228._id = '119779f8-ff84-3184-9f1f-de4a108847a2', n228.login = 'chadd.feeney', n228.password = '5e93a2a4bdfab6aed7809f11deeef43cdce3e999', n228.email = 'o\'reilly.palma@windlerkovacek.org'; -MERGE (n229:Person {neogen_id: '5f6c273c02343609c923248a25fb7e4887ed84f1' })SET n229 :User -, n229.firstname = 'Brielle', n229.lastname = 'Luettgen', n229.birth_date = '1980-04-05 15:41:07', n229._id = 'd4a1d479-4fb0-35db-a903-ba40a7615b47', n229.login = 'mireille.goodwin', n229.password = '1de78f093a77989db2366778699b8ac10b994a08', n229.email = 'hgerlach@yahoo.com'; -MERGE (n230:Person {neogen_id: 'ec8d77c73409736342395d03cace69a1b109eebf' })SET n230 :User -, n230.firstname = 'Walton', n230.lastname = 'Mertz', n230.birth_date = '1984-04-12 12:26:33', n230._id = '4bb07507-49f9-3458-bbd1-2033a87c834d', n230.login = 'bjohnson', n230.password = '5b1e6f681ab5ea99f66e0ce741d5f0c5d84219ff', n230.email = 'mckayla.wisoky@gmail.com'; -MERGE (n231:Person {neogen_id: 'a35e1acd295d12b2f871e3d69d2409cfe8df3a30' })SET n231 :User -, n231.firstname = 'Marie', n231.lastname = 'McKenzie', n231.birth_date = '1986-09-10 09:16:02', n231._id = '9c30e383-38a5-36db-9f40-01fffa03e742', n231.login = 'ansel.conroy', n231.password = '720b611ec8b7ffb6d3cdeaf55d089cd0f5608add', n231.email = 'june.weissnat@naderschamberger.org'; -MERGE (n232:Person {neogen_id: '748bb512c715fbbdb127d999a803293d14f68200' })SET n232 :User -, n232.firstname = 'Oren', n232.lastname = 'Vandervort', n232.birth_date = '1971-08-25 15:14:24', n232._id = '3c49eec0-01df-3e4b-9d41-9e4b02bee260', n232.login = 'gulgowski.domingo', n232.password = '32815ce0e29e7341d1a704696efd619c968f74e0', n232.email = 'jarvis.d\'amore@yahoo.com'; -MERGE (n233:Person {neogen_id: '114b0f2972de89a3b007c8bfbf2f72d7ccb6d792' })SET n233 :User -, n233.firstname = 'Magali', n233.lastname = 'Bailey', n233.birth_date = '1992-01-31 13:08:04', n233._id = '1c7fa9e5-f7ba-3cae-a4fd-4c8767401128', n233.login = 'fkoch', n233.password = '8151e37bec1327aff4fddb5e03b14613cc312e63', n233.email = 'o\'conner.jarred@barrows.com'; -MERGE (n234:Person {neogen_id: '136f11619cc7884ce02e791836d9d845253bf30a' })SET n234 :User -, n234.firstname = 'Harry', n234.lastname = 'Crona', n234.birth_date = '1969-02-13 00:54:27', n234._id = 'bb9f746c-53a3-31c8-a154-8f3fc971ab27', n234.login = 'wilhelmine.bayer', n234.password = 'cae93cc48875dfced14d2d85ac59c90b9dd9d8c1', n234.email = 'melvina06@gmail.com'; -MERGE (n235:Person {neogen_id: '8aba002e790299973feffb9291afb4807d3f2b40' })SET n235 :User -, n235.firstname = 'Coby', n235.lastname = 'Stiedemann', n235.birth_date = '1979-04-09 00:07:57', n235._id = 'd90ceb45-943e-3ba5-855e-38cb997bc118', n235.login = 'ward.mayert', n235.password = 'f1d1fb5de33ec6911dc8c39d49b6c0e772aba125', n235.email = 'zulauf.lonnie@torp.com'; -MERGE (n236:Person {neogen_id: 'afcee22279ae7dea7c7a6e3868e2c847910753c5' })SET n236 :User -, n236.firstname = 'Carol', n236.lastname = 'O\'Hara', n236.birth_date = '1977-10-07 03:53:26', n236._id = 'fe9ca2e4-367f-31af-b949-0e1062255f87', n236.login = 'feil.pauline', n236.password = 'c9395985a9965fc717c502c646ec3e30510e2c95', n236.email = 'jarrell.pfeffer@yahoo.com'; -MERGE (n237:Person {neogen_id: '9190657f721648cf82c1773364cc01da0e3a7d99' })SET n237 :User -, n237.firstname = 'Lexie', n237.lastname = 'King', n237.birth_date = '1996-07-30 11:50:38', n237._id = '1e43569c-78f0-3e1b-ad51-1081e176b723', n237.login = 'jordi.runte', n237.password = '80fa4675cf0bfb0858223fff6e7d0526e268e582', n237.email = 'sanford.lionel@hackett.org'; -MERGE (n238:Person {neogen_id: '66b5405b8a868695101203baa48512967baf84ff' })SET n238 :User -, n238.firstname = 'Krystel', n238.lastname = 'Rempel', n238.birth_date = '1982-07-11 10:27:10', n238._id = 'd77e51a5-641e-3758-a925-c7cfa75b7554', n238.login = 'kuphal.callie', n238.password = '5b07ef5fea7d0909e2ab1ba9e72c29e82128e23e', n238.email = 'guiseppe57@kemmer.com'; -MERGE (n239:Person {neogen_id: '4e990a1fa26d0d8747a39794a3698a422c674d7a' })SET n239 :User -, n239.firstname = 'Lesley', n239.lastname = 'Lehner', n239.birth_date = '1974-09-23 02:10:00', n239._id = '3e839e04-3876-3e34-b16c-3a6714ade77e', n239.login = 'veum.vern', n239.password = 'ea47b3b6a25fa7ee3031bc83d24210b192ad17a4', n239.email = 'jedidiah.simonis@yahoo.com'; -MERGE (n240:Person {neogen_id: '1a2a361ee730592475f1631f6db94f3411c5e100' })SET n240 :User -, n240.firstname = 'Vincenza', n240.lastname = 'Rutherford', n240.birth_date = '1993-05-30 15:47:46', n240._id = '1121d91e-5681-3583-a765-900fca666ac0', n240.login = 'ashton.nitzsche', n240.password = '8bc838e4162a74f68839dd6a3ac60be862d25682', n240.email = 'omer.gleason@hotmail.com'; -MERGE (n241:Person {neogen_id: 'c8ecbae3548c1a12a3c59e3c0217712903d280d2' })SET n241 :User -, n241.firstname = 'Kiera', n241.lastname = 'Ruecker', n241.birth_date = '1989-12-14 08:29:25', n241._id = 'a2378aac-c556-388e-a9eb-ef367fb7b3f0', n241.login = 'pablo84', n241.password = 'bc8333fa5526a04b61e1bc76201d9fcde59a44b4', n241.email = 'schoen.sharon@wintheiser.com'; -MERGE (n242:Person {neogen_id: 'acf37d7ce43aea1eff3f5586e1660ff7baf215e6' })SET n242 :User -, n242.firstname = 'Leonora', n242.lastname = 'Leuschke', n242.birth_date = '1967-12-01 21:07:23', n242._id = '198dd8e1-9471-3157-9831-52c486d6ade0', n242.login = 'nils.schinner', n242.password = '5cd18101824a515d363b78ffca5228dfd01e44cc', n242.email = 'dedric.mraz@greenholt.com'; -MERGE (n243:Person {neogen_id: '7a8c12178bf97acdf7018b6cc159965ed5985720' })SET n243 :User -, n243.firstname = 'Talon', n243.lastname = 'Dickinson', n243.birth_date = '1995-10-07 12:23:10', n243._id = '6862dbd2-234a-3abe-ac79-822c7798a190', n243.login = 'molson', n243.password = 'dc74a4be1673e10b967ec9b30bad5afe98a99618', n243.email = 'zackary.nienow@gmail.com'; -MERGE (n244:Person {neogen_id: 'ebb43acb6967615089a8c79843998c8c28336a0e' })SET n244 :User -, n244.firstname = 'Isobel', n244.lastname = 'Yost', n244.birth_date = '1989-04-28 14:10:09', n244._id = '4e8a0c77-f735-37aa-958f-7edf9311f1f0', n244.login = 'spinka.lora', n244.password = '72b48184f019bac5e9181b4d2ad5c97db8996dae', n244.email = 'egoyette@gmail.com'; -MERGE (n245:Person {neogen_id: '1c7f23a62ddcd4b63c5f43fbfd94d4ce39bd7ac2' })SET n245 :User -, n245.firstname = 'Mary', n245.lastname = 'Wiegand', n245.birth_date = '1966-09-22 22:07:04', n245._id = 'f4e038bf-c5da-351b-8b27-ed865bba9359', n245.login = 'hodkiewicz.maybell', n245.password = '4da5d8c42b23709f48ae036fd5210abd9c9fcc28', n245.email = 'xschoen@rogahn.com'; -MERGE (n246:Person {neogen_id: '9533caa59e0ca8ad2200dc388f8bfff65aeae6f2' })SET n246 :User -, n246.firstname = 'Morris', n246.lastname = 'Satterfield', n246.birth_date = '1967-07-22 00:04:02', n246._id = 'd939e764-3a8d-3011-9152-862b9a089cfc', n246.login = 'imarks', n246.password = 'e30f7c20f93b00b04b3018f468bf36bf8493c148', n246.email = 'mvon@gmail.com'; -MERGE (n247:Person {neogen_id: 'db428b9fe9f24076f2eb9bcdc27032ef1b099f35' })SET n247 :User -, n247.firstname = 'Petra', n247.lastname = 'Kiehn', n247.birth_date = '1993-06-25 09:41:26', n247._id = '6bf82535-8d04-3a02-b632-e6dc05008559', n247.login = 'osinski.leslie', n247.password = '3be6621d42c1a0cf8352a19a7d850c65f842564b', n247.email = 'zemlak.fernando@ernser.com'; -MERGE (n248:Person {neogen_id: 'da55ae7d4f7a63542dd166b6da647a81e549dba1' })SET n248 :User -, n248.firstname = 'Osvaldo', n248.lastname = 'Donnelly', n248.birth_date = '1973-03-05 14:37:27', n248._id = 'eb4be109-994e-395f-abfc-5dd368010ea5', n248.login = 'dorian.buckridge', n248.password = '9f4197d8fa9e8b07afa8af9516ad8126eaf322e7', n248.email = 'micah03@hotmail.com'; -MERGE (n249:Person {neogen_id: '3ca6c89c657ebfd5a8dbfa0b227d70bfaf71dbc8' })SET n249 :User -, n249.firstname = 'Jorge', n249.lastname = 'Walker', n249.birth_date = '1979-05-29 20:11:35', n249._id = '46221ee7-ecd9-32ff-8e43-7dfbbfea79c5', n249.login = 'zthompson', n249.password = '16d9e1111ab2030c2a84ec466196f8d72a3ed7a7', n249.email = 'nrolfson@yahoo.com'; -MERGE (n250:Person {neogen_id: '35bc4ac59f43f0660f2e3b32a2985d926bd68442' })SET n250 :User -, n250.firstname = 'Giovanna', n250.lastname = 'Paucek', n250.birth_date = '1983-01-27 09:32:41', n250._id = 'd801eb24-5a3e-3d94-a656-8378762796c3', n250.login = 'hilll.vito', n250.password = 'a9e234faf41a257a64caddca35e6a95d7143db01', n250.email = 'erna.pacocha@brekke.com'; -MERGE (n251:Person {neogen_id: 'fd0ba481e6e050638dd5c142f8164a1a380215d6' })SET n251 :User -, n251.firstname = 'Josianne', n251.lastname = 'Kirlin', n251.birth_date = '1980-05-19 04:09:36', n251._id = 'bddf9005-dc78-30b7-a1ce-d83aeb042578', n251.login = 'gaylord.kenton', n251.password = 'd8fbf2d690bba129edd70ff87409c5512a82dfa0', n251.email = 'eveline25@terry.com'; -MERGE (n252:Person {neogen_id: '72d9a08177829f518eb84b1b68a8e9ed815bed1d' })SET n252 :User -, n252.firstname = 'Guillermo', n252.lastname = 'Fay', n252.birth_date = '1982-02-21 12:20:51', n252._id = 'ca6b6376-66dd-358f-8614-41187d74d22a', n252.login = 'doug64', n252.password = 'c73ff95a6cc2076366d13084d45e23a701c7110c', n252.email = 'isabell.ebert@witting.com'; -MERGE (n253:Person {neogen_id: 'ca7a42bc933ec5a68286686ee69a6005d961c591' })SET n253 :User -, n253.firstname = 'Twila', n253.lastname = 'Pfeffer', n253.birth_date = '1981-12-01 14:33:00', n253._id = 'e27cc89e-e70f-335d-bd9b-4f2378c2ec18', n253.login = 'millie.grimes', n253.password = 'ac5d71b713bd3d435117c07c3bd5093f49011f27', n253.email = 'ehilll@haag.com'; -MERGE (n254:Person {neogen_id: 'f93dccf58a3a8dcfdae533e06af6fe0eaa84f8ef' })SET n254 :User -, n254.firstname = 'Katelyn', n254.lastname = 'Johnston', n254.birth_date = '1975-02-24 06:00:16', n254._id = '1da920f2-f540-382b-ba59-8935d82226ed', n254.login = 'ejenkins', n254.password = '53d6c456a38244dd7a45202cd871e3ec360c0e8e', n254.email = 'rupert.mcclure@goyette.net'; -MERGE (n255:Person {neogen_id: 'a4eadbfb34db3d458ef45990f5934844472b23f8' })SET n255 :User -, n255.firstname = 'Laila', n255.lastname = 'Larson', n255.birth_date = '1975-06-28 07:12:59', n255._id = '7464f8b7-d6bb-3a26-93dc-a51859ad9124', n255.login = 'nicolette.kuhn', n255.password = '2bf5257d1d2b798205dd6b129a94a76714c86fce', n255.email = 'nigel00@gmail.com'; -MERGE (n256:Person {neogen_id: '0894835a07f158a6991e7b040af30ced02304587' })SET n256 :User -, n256.firstname = 'Hal', n256.lastname = 'Robel', n256.birth_date = '1993-11-23 06:22:49', n256._id = 'ec7bc909-9815-3307-82ad-7d2f327bc36d', n256.login = 'marley47', n256.password = '9650474418d5d48250365f2d978b166a8c0cf862', n256.email = 'awintheiser@yahoo.com'; -MERGE (n257:Person {neogen_id: '933ed5eead72f88cd38905119111953c8b76e714' })SET n257 :User -, n257.firstname = 'Giovani', n257.lastname = 'Legros', n257.birth_date = '1976-07-27 09:52:32', n257._id = 'edfe39d6-9476-3e1a-be62-8a62a7576714', n257.login = 'lavinia.nader', n257.password = 'da6ad93206c84f489585395e41ab08fa2e36ac2b', n257.email = 'hand.selina@klocko.com'; -MERGE (n258:Person {neogen_id: 'e9d84b3878e7d95ca2df5b94768dbb715737625e' })SET n258 :User -, n258.firstname = 'Bell', n258.lastname = 'Botsford', n258.birth_date = '1982-10-14 08:18:45', n258._id = '7a023aa8-45f0-3661-b3ac-dfbee091f34e', n258.login = 'annabell.brekke', n258.password = 'f5d40220a16a7fe726c060d25e4bf0ba7620e2c0', n258.email = 'dmueller@yahoo.com'; -MERGE (n259:Person {neogen_id: '60980687fbdfe5f3cb7f7f5def48d6fa83584769' })SET n259 :User -, n259.firstname = 'Brian', n259.lastname = 'Green', n259.birth_date = '1978-10-28 00:27:14', n259._id = '4e48b35d-c136-3c4c-9f6f-3f695c40c527', n259.login = 'littel.bailey', n259.password = 'd9c0ebb4342001707ffc3741fd1a47da0ed62ceb', n259.email = 'jaylan17@gmail.com'; -MERGE (n260:Person {neogen_id: '723744092da0586d5091294096d355c0e8cea8df' })SET n260 :User -, n260.firstname = 'Gladyce', n260.lastname = 'Schultz', n260.birth_date = '1985-09-20 13:56:28', n260._id = 'a331ff6c-3491-36c2-92dc-abce7876298c', n260.login = 'hermina.jerde', n260.password = 'd503c98c0287cb8cc6f1a68b884f8284cd6058b6', n260.email = 'ernie.torphy@durgan.com'; -MERGE (n261:Person {neogen_id: '02274fff865da36ee6bbee7594701785cdbb7317' })SET n261 :User -, n261.firstname = 'Virginia', n261.lastname = 'Herman', n261.birth_date = '1968-05-28 01:52:51', n261._id = '97391325-fa8e-35c9-aa32-5b8ceb505d09', n261.login = 'myah45', n261.password = '000716d7492af634dd17513ca160e76392e869ec', n261.email = 'tshanahan@yahoo.com'; -MERGE (n262:Person {neogen_id: '108472faa899b8aa8257c8f5ff4b0852a672e8c7' })SET n262 :User -, n262.firstname = 'Nikko', n262.lastname = 'Yundt', n262.birth_date = '1976-02-08 17:30:16', n262._id = '50ea0702-d626-3e6b-8138-686b94e37ea9', n262.login = 'gisselle96', n262.password = '0369fe6426614c4a7d9cca4c7e5460af5df9120c', n262.email = 'tromp.magdalen@sporerokuneva.com'; -MERGE (n263:Person {neogen_id: '4cd46d628e87145e153bacfdde78dd3d69bfb087' })SET n263 :User -, n263.firstname = 'Treva', n263.lastname = 'Cronin', n263.birth_date = '1978-04-05 01:17:53', n263._id = '2be234e4-c9e5-3953-b650-1d0a4ba8b0fb', n263.login = 'onolan', n263.password = '2f6b85c8b08684184ef7b43e19d9e34cb0a4b9b0', n263.email = 'ganderson@yahoo.com'; -MERGE (n264:Person {neogen_id: 'fb619ca578bc56cebaf2bb8bc855ccf3f42ce712' })SET n264 :User -, n264.firstname = 'Reagan', n264.lastname = 'Wintheiser', n264.birth_date = '1979-12-29 18:02:10', n264._id = 'e4a77530-89bc-34d9-aad6-0e94bc710794', n264.login = 'mtreutel', n264.password = '040fdc0ff0ba84dc373c01d41dd43a8b6f440b1a', n264.email = 'skoch@pouroswintheiser.info'; -MERGE (n265:Person {neogen_id: 'f78d82f348502f841fcdde81f69403dfed7cb35d' })SET n265 :User -, n265.firstname = 'Clark', n265.lastname = 'Dietrich', n265.birth_date = '1986-01-10 15:34:56', n265._id = '77fc706c-b4c7-3b4d-b4c8-dd2dbe787411', n265.login = 'gabriel73', n265.password = '831e2f2c0ddced83ba2fc0acb4132b47144ae085', n265.email = 'kilback.horace@howelllockman.com'; -MERGE (n266:Person {neogen_id: '8f85240d30ac791b951c5c06f74dcadada484f4b' })SET n266 :User -, n266.firstname = 'Dorris', n266.lastname = 'Mayer', n266.birth_date = '1986-02-23 15:48:00', n266._id = '4a9f09ff-0004-340e-81e2-abc071e1796c', n266.login = 'hirthe.logan', n266.password = 'fb1d0cf71e710830d507872fc6ee21b8884b0465', n266.email = 'rhane@rueckerhand.com'; -MERGE (n267:Person {neogen_id: '7e4e18d2f8b70ed11f790ed578945ae660a863ee' })SET n267 :User -, n267.firstname = 'Clarabelle', n267.lastname = 'King', n267.birth_date = '1990-10-29 21:09:46', n267._id = 'a1b5bb53-00ee-3c4c-b551-db498af31a95', n267.login = 'rebekah.heidenreich', n267.password = 'f7fa535c8ae482d123befa31e1f41971580a7238', n267.email = 'kenton26@hotmail.com'; -MERGE (n268:Person {neogen_id: '210aa1a398b7a352c177d7ed4bebbfd102bcf962' })SET n268 :User -, n268.firstname = 'Joelle', n268.lastname = 'Oberbrunner', n268.birth_date = '1993-07-10 11:12:58', n268._id = '3f111f76-7f4f-3599-bb41-d525f7bf95e0', n268.login = 'eweimann', n268.password = 'd64481ce6c99fb9aefbe140234584aced9bbfc50', n268.email = 'ibradtke@yahoo.com'; -MERGE (n269:Person {neogen_id: 'e19217623952283995a1e04810bbdcd45a200e36' })SET n269 :User -, n269.firstname = 'Bo', n269.lastname = 'Nienow', n269.birth_date = '1967-07-08 04:51:36', n269._id = 'dec66ca1-6c31-37d3-9014-68edc20fe873', n269.login = 'smitham.santa', n269.password = '77da33e08d2636ddbab791356762f2e820d09c27', n269.email = 'cindy.mccullough@yahoo.com'; -MERGE (n270:Person {neogen_id: 'dbecb6a820be702b422dde7bd8e6165c5a66a29a' })SET n270 :User -, n270.firstname = 'Katrine', n270.lastname = 'Marquardt', n270.birth_date = '1984-11-26 03:21:05', n270._id = '2c3bbe4e-b802-364a-9d0f-2141df016c6b', n270.login = 'hessel.jailyn', n270.password = '752b4f87da703dbc1b112d343a1bd0df17df23ac', n270.email = 'amya24@gmail.com'; -MERGE (n271:Person {neogen_id: '58056dffa35c3ae311aa4cabe463c85d2637ac44' })SET n271 :User -, n271.firstname = 'Deion', n271.lastname = 'Toy', n271.birth_date = '1975-11-13 18:01:45', n271._id = '1c35a2a2-9b2d-3816-8551-2e58c8faa96f', n271.login = 'anibal67', n271.password = 'f33e1ff24a2adacbf2ae9ac1ac6d27dff22a3b39', n271.email = 'fsipes@yahoo.com'; -MERGE (n272:Person {neogen_id: '6dc277b74ae6fb407d05b8a753f3eaba06b945be' })SET n272 :User -, n272.firstname = 'Gaston', n272.lastname = 'Mante', n272.birth_date = '1972-04-30 20:25:00', n272._id = 'eb5df893-de40-3619-b159-7949fc357ef3', n272.login = 'chandler81', n272.password = '37b464ce49d41c67b4600c73824d25817dbd6c91', n272.email = 'jessy95@hotmail.com'; -MERGE (n273:Person {neogen_id: 'b49ae26bb3729c3c87616ac5751a2dd9877190bf' })SET n273 :User -, n273.firstname = 'Mohamed', n273.lastname = 'Emard', n273.birth_date = '1996-01-10 14:26:20', n273._id = 'de743997-88d2-3c90-9b33-66ae0d1d114f', n273.login = 'stokes.cory', n273.password = '1576a12d00ac34f0c1913f617aeeaa165e7472ac', n273.email = 'harmony.kulas@wilkinsonokuneva.com'; -MERGE (n274:Person {neogen_id: '1b7285b4dde882c0e197738532d5492481a44fb7' })SET n274 :User -, n274.firstname = 'Berenice', n274.lastname = 'Lesch', n274.birth_date = '1973-09-18 19:58:49', n274._id = '2f7cb1fb-d759-3bc1-89d3-9726f7046e57', n274.login = 'konopelski.marjory', n274.password = '172410ef5445db8a8cff972e27257a8764ab519d', n274.email = 'skiles.ebony@gmail.com'; -MERGE (n275:Person {neogen_id: '3fc66d72bcedf6a946d27c49cd9b9cb753c7f5e2' })SET n275 :User -, n275.firstname = 'Marcos', n275.lastname = 'Flatley', n275.birth_date = '1994-12-12 22:34:58', n275._id = 'd491829e-3cf2-38c9-a09f-4db31795d140', n275.login = 'gustave.jacobi', n275.password = '9ae76b7f3e67d9237c82ccdaefbe4812911a4f34', n275.email = 'jrussel@kassulkeaufderhar.com'; -MERGE (n276:Person {neogen_id: '2369e0221c2d2db795270bf8a2871cd4d4bfbc50' })SET n276 :User -, n276.firstname = 'Arianna', n276.lastname = 'Lockman', n276.birth_date = '1972-10-05 12:28:29', n276._id = '369dc5ee-73f1-3d8c-98ec-56bf52c6c5f7', n276.login = 'madilyn.bartell', n276.password = 'a8da369ce0ad914f22581e8ad6f805d915918ac8', n276.email = 'zschroeder@schamberger.com'; -MERGE (n277:Person {neogen_id: 'fc7e019b36cb1ed17cf84cdce685e0c6e21d7948' })SET n277 :User -, n277.firstname = 'Francisco', n277.lastname = 'Block', n277.birth_date = '1966-07-05 03:42:07', n277._id = 'b000db92-0eed-3f97-987c-84d5b8267541', n277.login = 'award', n277.password = '37cbc763c5985a743cd989a3274afa3b3fe638fa', n277.email = 'carley.raynor@yahoo.com'; -MERGE (n278:Person {neogen_id: 'c68701838be1dd99df706ca5b5b3ce0c7a2d2a25' })SET n278 :User -, n278.firstname = 'Verna', n278.lastname = 'Nader', n278.birth_date = '1970-02-20 23:51:50', n278._id = 'eaea0a26-1fe7-3bdc-b188-0ceeb4ecbb93', n278.login = 'vbahringer', n278.password = 'e050dbe6d30dbb4544a408e432c3af7e22ede94e', n278.email = 'sarai.bruen@jast.info'; -MERGE (n279:Person {neogen_id: '2933faefa426ffac13ac31507a75f6976ae094a0' })SET n279 :User -, n279.firstname = 'Arlie', n279.lastname = 'Roberts', n279.birth_date = '1986-07-12 21:30:11', n279._id = '654316e5-82fc-337a-83f2-06c45d7e85a3', n279.login = 'spencer.gabrielle', n279.password = '5bbc86f354446f5b03b60e6467a8ff0c7b2cb17e', n279.email = 'bradly.muller@hotmail.com'; -MERGE (n280:Person {neogen_id: '5f6484e7e532be925cc33afe934c9dce00fee44e' })SET n280 :User -, n280.firstname = 'Noel', n280.lastname = 'Sporer', n280.birth_date = '1974-03-10 18:10:29', n280._id = '283c1dd2-2a9c-389d-bdc0-013c498f208c', n280.login = 'berge.nayeli', n280.password = 'c53271e9606486dc405eb2de4563998ff504eb24', n280.email = 'hugh.dickens@barrowsjakubowski.com'; -MERGE (n281:Person {neogen_id: '89fa17bd47b5ffa2b1b3cb0187a6cba3a25193a9' })SET n281 :User -, n281.firstname = 'Ena', n281.lastname = 'Satterfield', n281.birth_date = '1994-06-23 01:00:20', n281._id = '539d8295-a209-35bf-bbb0-9f38414e3f0b', n281.login = 'christiansen.kade', n281.password = '4df9f1efbda070acd8f03db23d96bbd5636b7abb', n281.email = 'dsawayn@greenfelder.com'; -MERGE (n282:Person {neogen_id: '568f313578c1ce26208c7428341262f8454e7dac' })SET n282 :User -, n282.firstname = 'Carolyn', n282.lastname = 'Goodwin', n282.birth_date = '1987-05-10 12:22:14', n282._id = '4d19066f-ae9a-33eb-b0d6-0f8ce03cdace', n282.login = 'vboyle', n282.password = '61f5f7e19573053747c32c60f2c3f0fd54e9bffc', n282.email = 'gschaden@gmail.com'; -MERGE (n283:Person {neogen_id: 'ec48e20e64147aad38d29a3f7617c35cbcbab116' })SET n283 :User -, n283.firstname = 'Clementina', n283.lastname = 'Dach', n283.birth_date = '1984-07-13 05:57:17', n283._id = '2c18573e-4ed2-3f1c-bbe7-949bc5d172ed', n283.login = 'tboyer', n283.password = '24ca1013a92398b1b2ffe1a496f33db75b95c659', n283.email = 'mante.myrna@hotmail.com'; -MERGE (n284:Person {neogen_id: '0d9acf4b17abfad3fea8bb2d5245dc67868efbfa' })SET n284 :User -, n284.firstname = 'Dianna', n284.lastname = 'Nikolaus', n284.birth_date = '1980-04-04 05:50:08', n284._id = '97040a1f-01d9-322f-86e6-9e6693fb88c7', n284.login = 'mathilde64', n284.password = '3a0e5227b28208dec481541c48a51216cd603c88', n284.email = 'trowe@swaniawskiweimann.com'; -MERGE (n285:Person {neogen_id: 'eaaea28d14889583583e2229b4bf9a96ea206c5d' })SET n285 :User -, n285.firstname = 'Una', n285.lastname = 'Hodkiewicz', n285.birth_date = '1989-02-07 08:32:16', n285._id = '21589486-da16-3457-aa1f-11fa24285940', n285.login = 'icummerata', n285.password = '1fe43fc02db3d1d759c9cde611728f85b0d2aaf7', n285.email = 'deshaun02@gmail.com'; -MERGE (n286:Person {neogen_id: '5eff91a5cfb0ff3e22e0718990d67407f3009dc1' })SET n286 :User -, n286.firstname = 'Kari', n286.lastname = 'Anderson', n286.birth_date = '1984-09-01 21:34:25', n286._id = 'cd549c61-670e-35a2-adf4-4278dd36e5a7', n286.login = 'jeanie27', n286.password = '6dc49a307242538f265858a7fca3a66beea42e86', n286.email = 'estell.daniel@gmail.com'; -MERGE (n287:Person {neogen_id: '7c849cd7febfc81140fb0da9b3fbce2ce4ab3450' })SET n287 :User -, n287.firstname = 'Abbie', n287.lastname = 'Volkman', n287.birth_date = '1983-04-12 12:12:10', n287._id = 'e396341f-16c7-3a3f-be78-47dddd9beae5', n287.login = 'pansy81', n287.password = 'd2e96b4b0890c2ee79563e2577d9301a39f9cee8', n287.email = 'estel.lueilwitz@hesseltillman.com'; -MERGE (n288:Person {neogen_id: 'd310f5bc087cccde9fca60400686f9785778f155' })SET n288 :User -, n288.firstname = 'Fatima', n288.lastname = 'Windler', n288.birth_date = '1969-03-24 17:30:51', n288._id = '28b3bd89-26dc-373f-9459-a67cdbf77991', n288.login = 'berge.abdul', n288.password = '98806d8e0023a2d3bd387023473417436dfedfa7', n288.email = 'heidenreich.josue@glover.com'; -MERGE (n289:Person {neogen_id: 'dbee80571750b0252d194d66f6331d4e1284a380' })SET n289 :User -, n289.firstname = 'Paige', n289.lastname = 'Anderson', n289.birth_date = '1965-08-19 08:18:12', n289._id = '7536d54a-01f2-3bb0-abc4-631cffe9eea6', n289.login = 'wyatt.schneider', n289.password = '0f5662aa990013ccc49c82eab08a2a92af76c7c1', n289.email = 'rosendo.graham@hotmail.com'; -MERGE (n290:Person {neogen_id: '1ea4e538b96b5450c2f3a3dc9f191fd2d9236fc4' })SET n290 :User -, n290.firstname = 'Christa', n290.lastname = 'Koss', n290.birth_date = '1986-09-30 21:17:59', n290._id = 'c9fe643d-483d-39b9-a911-510f92207318', n290.login = 'ritchie.aurelie', n290.password = '3d8d23edaabf4a011af8fabcd1fd9ae4159772ea', n290.email = 'mkuphal@yahoo.com'; -MERGE (n291:Person {neogen_id: '307731a4da6aa1bb1af70b817632ffdfaacf64f8' })SET n291 :User -, n291.firstname = 'Lupe', n291.lastname = 'Tillman', n291.birth_date = '1990-02-15 20:46:01', n291._id = '28260f60-d121-388f-ba8a-38b9909634c6', n291.login = 'frederick61', n291.password = '018d90cbaa3da6c374e92e4d75c71f26c5f38404', n291.email = 'asha74@bode.com'; -MERGE (n292:Person {neogen_id: '3b6cd9d45f6ab333be9fc69508ceb8ad95183298' })SET n292 :User -, n292.firstname = 'Madonna', n292.lastname = 'Kunze', n292.birth_date = '1976-04-12 00:06:04', n292._id = '2b8179e5-b748-3d6b-8520-bd4352cc623d', n292.login = 'cordell.pacocha', n292.password = '3da41d00cf2b4304043f00e663f161eac48db33e', n292.email = 'marvin38@yahoo.com'; -MERGE (n293:Person {neogen_id: 'e5ba1788dcb05ebb95196f82d041fda5322e667e' })SET n293 :User -, n293.firstname = 'Monica', n293.lastname = 'Wilkinson', n293.birth_date = '1967-09-08 18:28:06', n293._id = 'ce9eeb29-fbe8-335e-98dc-e457d103bdad', n293.login = 'ronny99', n293.password = 'c068ebd345f45d64b7ff4483e2b312d73b633ae6', n293.email = 'pouros.kyleigh@yahoo.com'; -MERGE (n294:Person {neogen_id: 'b9fd941d418bfb77baae7bd039570241283bc33d' })SET n294 :User -, n294.firstname = 'Harrison', n294.lastname = 'Mitchell', n294.birth_date = '1986-04-29 18:24:56', n294._id = '4fa9509e-b170-322b-b5a1-dbb70efa0683', n294.login = 'koepp.paxton', n294.password = 'f1e0adbfc1aa75f05938a05a0c83c8726087a9f1', n294.email = 'aschmitt@gmail.com'; -MERGE (n295:Person {neogen_id: '5f48856abdf81ea109508367060fffea0d8b8de7' })SET n295 :User -, n295.firstname = 'Donny', n295.lastname = 'Marquardt', n295.birth_date = '1992-01-29 23:26:45', n295._id = '35672d67-8a5f-345f-93e5-4047c2768d4f', n295.login = 'mayer.granville', n295.password = 'cd848f52219cfdfb8588d1cc91116d774b0304f3', n295.email = 'schaden.arnaldo@kunzeritchie.com'; -MERGE (n296:Person {neogen_id: '07cd8353f5d5fedd6aeff0874dac02448d51889a' })SET n296 :User -, n296.firstname = 'Katarina', n296.lastname = 'West', n296.birth_date = '1981-04-19 19:31:51', n296._id = 'b88cfb5a-3938-3dab-aff9-f0c2b711e981', n296.login = 'pshanahan', n296.password = '1bc2c99801eb9aa5b26a4aa9c39ca5b294d758be', n296.email = 'genesis.d\'amore@gmail.com'; -MERGE (n297:Person {neogen_id: '17e26cf494f009a5e0ff3b6ff54b32ad6bdd029e' })SET n297 :User -, n297.firstname = 'Johan', n297.lastname = 'Dietrich', n297.birth_date = '1974-10-28 09:50:18', n297._id = '2786f7e6-2b2a-3d95-9245-b6472a5d7ac1', n297.login = 'vlegros', n297.password = 'abbcdb003c749aa24d497a620aaf732946c63d1f', n297.email = 'brakus.shania@gmail.com'; -MERGE (n298:Person {neogen_id: 'e3a6fe861fd6073f66dc26691438a1ec0b76557e' })SET n298 :User -, n298.firstname = 'Magdalen', n298.lastname = 'Denesik', n298.birth_date = '1967-05-25 14:04:34', n298._id = '8368b687-3d2d-327f-b6b4-17ef9b8c999a', n298.login = 'oda.gorczany', n298.password = '1bfaba96490bde5a65565d73663e97d91efb55ce', n298.email = 'ullrich.ezequiel@schulist.org'; -MERGE (n299:Person {neogen_id: '88eaa80cf6278e4b3f61557e7f1d77ed2d666b6a' })SET n299 :User -, n299.firstname = 'Selmer', n299.lastname = 'Flatley', n299.birth_date = '1995-12-14 16:56:44', n299._id = '2d951464-b5fd-3015-9088-469f18e5b6bc', n299.login = 'eluettgen', n299.password = '300917c534782f7b8381999852201eaf6932f143', n299.email = 'kohler.marcelle@gmail.com'; -MERGE (n300:Person {neogen_id: '9db5a3b079eae5b3702e634217fb604f1c5f3fee' })SET n300 :User -, n300.firstname = 'Jude', n300.lastname = 'Grady', n300.birth_date = '1993-03-12 19:24:11', n300._id = 'e4126f6b-a514-36a5-9379-a2c0c1cbf406', n300.login = 'chelsey72', n300.password = '0f9ce958613c64aa789dfdb8a0e22713526efe2d', n300.email = 'wehner.efrain@hotmail.com'; -MERGE (n301:Person {neogen_id: '7a87c5e2b1a26c074b16041a3713622f9cf52391' })SET n301 :User -, n301.firstname = 'General', n301.lastname = 'Fisher', n301.birth_date = '1982-11-28 01:23:42', n301._id = '90c482bb-92ac-3b99-a430-ba7f6a813cc0', n301.login = 'javonte82', n301.password = '8d1b6e6fd130d62914ad0945b38ed88fb6eb1ee3', n301.email = 'joesph.bergstrom@denesik.com'; -MERGE (n302:Person {neogen_id: '2eb28d8b3f2ed31215c4dd1a565b7b79b18ce789' })SET n302 :User -, n302.firstname = 'Nyasia', n302.lastname = 'Sawayn', n302.birth_date = '1996-05-25 13:40:25', n302._id = '5d5a1b79-0011-30f0-accc-18a56842bdc1', n302.login = 'aconroy', n302.password = 'a599596e6a2f275287530ac654de36a8be15d0c4', n302.email = 'cleora28@johnson.net'; -MERGE (n303:Person {neogen_id: 'b2d0110e9a4fbac7a29d583f03446e39e21a8d26' })SET n303 :User -, n303.firstname = 'Stella', n303.lastname = 'Schneider', n303.birth_date = '1993-07-19 17:32:12', n303._id = '8040f1ba-ba10-385e-8385-cc41f474853b', n303.login = 'beatty.isabel', n303.password = '7f32562a03354ee4785cc0c3839f17b1b06c69de', n303.email = 'nathen00@gmail.com'; -MERGE (n304:Person {neogen_id: '42989211c22964ba1fe7f876c655ff3572591b9b' })SET n304 :User -, n304.firstname = 'Angie', n304.lastname = 'Boyer', n304.birth_date = '1972-04-25 06:58:34', n304._id = '955782b3-6e57-320f-9969-4a03f74423d4', n304.login = 'roberto05', n304.password = 'cc0b6693b065b99d30cfdb45431e82fa1677e368', n304.email = 'predovic.arvid@homenickjacobi.com'; -MERGE (n305:Person {neogen_id: '6d49cc29a37c69baaad95b5acc480aaa30e3f79a' })SET n305 :User -, n305.firstname = 'Pattie', n305.lastname = 'Jaskolski', n305.birth_date = '1990-07-20 09:14:55', n305._id = 'ff0b6706-5492-3c95-9e10-f6d98d9a4d17', n305.login = 'johnson.manley', n305.password = 'ebed4d5dbfb7473bccfb3d837bc7fd169f51fa44', n305.email = 'quincy25@yahoo.com'; -MERGE (n306:Person {neogen_id: '34109a9df834b1bd90e123034b490af702b5925b' })SET n306 :User -, n306.firstname = 'Orrin', n306.lastname = 'Nader', n306.birth_date = '1971-10-05 20:40:17', n306._id = 'd9372897-6758-34e4-938c-044055482606', n306.login = 'dameon75', n306.password = '51a5e9a0e82d3064321a4f9d1b61db999abb469a', n306.email = 'cglover@yahoo.com'; -MERGE (n307:Person {neogen_id: 'a43d40a63e920c35801eb5ab1964ade3efefc9ad' })SET n307 :User -, n307.firstname = 'Devan', n307.lastname = 'Purdy', n307.birth_date = '1968-06-24 21:11:17', n307._id = '09a19bc1-4ac1-3e6a-8960-058e635c6db7', n307.login = 'chauncey.d\'amore', n307.password = 'fbfec8c161e3f779964462695c720f2d11915bf0', n307.email = 'maryam37@will.org'; -MERGE (n308:Person {neogen_id: 'bff80b168cd3eab2057d53fb2d231b5d2ba16f68' })SET n308 :User -, n308.firstname = 'Jaiden', n308.lastname = 'Schuppe', n308.birth_date = '1987-05-18 01:20:42', n308._id = 'ae616252-2334-35e8-8bdb-b83b50c69b0f', n308.login = 'rlowe', n308.password = '018f83af62aad8fdf953545345da2178bb269eaa', n308.email = 'kaleb.sanford@gmail.com'; -MERGE (n309:Person {neogen_id: 'eb1455e2af0d012d595df3b357eb05178e020e39' })SET n309 :User -, n309.firstname = 'Orval', n309.lastname = 'Johns', n309.birth_date = '1987-11-05 17:09:19', n309._id = '829ec364-f7aa-3b73-8df4-2811056d45de', n309.login = 'paolo.donnelly', n309.password = 'a189700f7ee0e9057e2b897f49921b52abd38bb5', n309.email = 'rwitting@gmail.com'; -MERGE (n310:Person {neogen_id: '7264c78f90d1d0055146fae4d23734ad9fc0d572' })SET n310 :User -, n310.firstname = 'Birdie', n310.lastname = 'Ritchie', n310.birth_date = '1994-03-15 02:35:25', n310._id = '3aea7898-adf5-3e08-8dc8-1098d84ec0e1', n310.login = 'zosinski', n310.password = 'cb601cdb6c915680e82adbb7de811bc904b9f68f', n310.email = 'alivia.doyle@hilll.com'; -MERGE (n311:Person {neogen_id: 'd2561b74570e0ef6108e5bead6b631c1b4f90f40' })SET n311 :User -, n311.firstname = 'Gabriel', n311.lastname = 'Cormier', n311.birth_date = '1966-08-17 20:41:40', n311._id = '15807a9b-85f1-3543-9efc-ed0064aab121', n311.login = 'syble75', n311.password = '49343384f20ec6cb04ef52a2f6df404cfae6a106', n311.email = 'jamaal64@gmail.com'; -MERGE (n312:Person {neogen_id: 'ace08d15a8d75222a943319d10d816ccae735eef' })SET n312 :User -, n312.firstname = 'Laila', n312.lastname = 'Prosacco', n312.birth_date = '1968-02-18 13:10:26', n312._id = '7f3d18e1-22c0-3f21-ba2b-df87d628a59b', n312.login = 'francisco17', n312.password = '4948537c874314773f964108e56bdecc09870961', n312.email = 'wwilliamson@okeefekuphal.org'; -MERGE (n313:Person {neogen_id: '717f773bcfff8186ec171c57f973625821ef16ca' })SET n313 :User -, n313.firstname = 'Noel', n313.lastname = 'Waters', n313.birth_date = '1989-11-18 22:55:22', n313._id = '6620a509-c2ab-3b9a-8997-163e8fe70842', n313.login = 'adonis.ruecker', n313.password = '0dd3b685beb18b9a8a28c4a2602ce609fd244018', n313.email = 'tyrique99@kling.com'; -MERGE (n314:Person {neogen_id: '1ea412f526bdbc55c0472b6eab748915c3c4e9f5' })SET n314 :User -, n314.firstname = 'Bradford', n314.lastname = 'Daniel', n314.birth_date = '1996-05-11 13:27:52', n314._id = '7c4bc9b6-8d4a-3d01-b8b2-ac78e6f5b4aa', n314.login = 'pasquale53', n314.password = '268315df91f143bed5c22c496bd7cadc64ee1981', n314.email = 'brooklyn.ondricka@yahoo.com'; -MERGE (n315:Person {neogen_id: '51453ad4f1e2a71a0f016b21b5d35d49cb7d5635' })SET n315 :User -, n315.firstname = 'Brielle', n315.lastname = 'Pouros', n315.birth_date = '1986-05-15 05:55:14', n315._id = 'cca942af-f53d-3bfd-b6a4-7c130acfa35e', n315.login = 'magdalena36', n315.password = 'acaed09152636699119613d6b55f529cc3488fda', n315.email = 'rcassin@cormier.com'; -MERGE (n316:Person {neogen_id: '8c09617a4e20799869d5c7b6cc1f983af5925599' })SET n316 :User -, n316.firstname = 'Deborah', n316.lastname = 'Zemlak', n316.birth_date = '1975-11-26 01:45:11', n316._id = '546a7a48-e057-3f92-97d8-16a8656422d5', n316.login = 'lydia99', n316.password = '397adae372b7db7d1faff7f267adcaf3e2d7c320', n316.email = 'mckenzie.paucek@yahoo.com'; -MERGE (n317:Person {neogen_id: 'd8a877c32321984ac184e50c8280f3b6df9d37bd' })SET n317 :User -, n317.firstname = 'Margarete', n317.lastname = 'Ryan', n317.birth_date = '1979-03-28 06:24:29', n317._id = '9c417bfb-1446-3ad5-a5b7-f476887c41c1', n317.login = 'ubartell', n317.password = 'bb77911db0676d928ac81d71a92424fdf1a45dad', n317.email = 'bernice55@kuphalbrekke.com'; -MERGE (n318:Person {neogen_id: 'f773dadf2c510e54b7881f58dd737d41a4ac670c' })SET n318 :User -, n318.firstname = 'Percival', n318.lastname = 'Hermann', n318.birth_date = '1989-11-07 12:15:59', n318._id = 'f19a9347-2414-3e9b-80ba-2413b12c6ccc', n318.login = 'claire78', n318.password = '68e4829c159f82aaad286c7782a7ffdfe2155f35', n318.email = 'cummerata.ludwig@yahoo.com'; -MERGE (n319:Person {neogen_id: '5a80030cf5c0c3be6bf2bcdd9e53566c1da6279e' })SET n319 :User -, n319.firstname = 'Nola', n319.lastname = 'Rosenbaum', n319.birth_date = '1968-05-17 18:35:17', n319._id = '063b8e69-3283-38ca-a188-adf61b1f146c', n319.login = 'norene.reichert', n319.password = 'c19604e0388efea85a7a6560253f59ef2e5548c7', n319.email = 'ischowalter@kubcremin.com'; -MERGE (n320:Person {neogen_id: '535ffc6e799eee190ad70e180fbed26e9748edc3' })SET n320 :User -, n320.firstname = 'Kadin', n320.lastname = 'DuBuque', n320.birth_date = '1994-03-26 19:53:38', n320._id = 'e12ea749-ea99-3718-a03f-4d86750565bc', n320.login = 'elias.schmidt', n320.password = '19d2fc8e67cbb5fc2a7ee0bc65ea46a5cab9e7b4', n320.email = 'tomasa35@gmail.com'; -MERGE (n321:Person {neogen_id: '3f1f5d6c524496e80da6ddb5edeee12f8fc729c4' })SET n321 :User -, n321.firstname = 'Ignacio', n321.lastname = 'Cormier', n321.birth_date = '1973-10-26 13:57:24', n321._id = 'e7dcddae-fa78-3297-9da7-57f58ee5022f', n321.login = 'mavis48', n321.password = 'dbe6742f849cf8c2308af91ddc7f304c68b64456', n321.email = 'retha86@gmail.com'; -MERGE (n322:Person {neogen_id: 'f15df598dcb4d42ca6032ab83462cc01efb58aac' })SET n322 :User -, n322.firstname = 'Jeremie', n322.lastname = 'Hansen', n322.birth_date = '1976-09-24 14:28:48', n322._id = 'b578fc4b-cf85-3dea-a99c-8c0126db4ff4', n322.login = 'dino.grady', n322.password = '43488ce2ff83ae022607baaf4f2c2755ec82ded9', n322.email = 'cole.gregorio@hartmann.com'; -MERGE (n323:Person {neogen_id: '13d3c53a471218cb3b485397cc159d13b50a150a' })SET n323 :User -, n323.firstname = 'Alf', n323.lastname = 'Bechtelar', n323.birth_date = '1993-01-29 00:56:22', n323._id = '805777fb-861d-364c-b68d-fb0f72ee2404', n323.login = 'mallory58', n323.password = '420244045f95c1fa2c38b9c135b276a5cd90968f', n323.email = 'badams@gottlieb.biz'; -MERGE (n324:Person {neogen_id: 'cfb9791beee8bfe025290d5610efe6914d231726' })SET n324 :User -, n324.firstname = 'Sonya', n324.lastname = 'Dietrich', n324.birth_date = '1969-01-21 20:31:44', n324._id = '491a7eea-8ba7-384d-88d9-999e74ff3692', n324.login = 'reggie.schimmel', n324.password = 'f62db8345b770652e64631d1023a49a0e2311399', n324.email = 'gdeckow@pfeffer.net'; -MERGE (n325:Person {neogen_id: 'fb25b8721d034823e205f43275a44f7db74c0f84' })SET n325 :User -, n325.firstname = 'Kaya', n325.lastname = 'Thiel', n325.birth_date = '1967-07-29 16:04:47', n325._id = 'dbdcdef7-69f3-3aaf-bb54-d6dc4de0a16f', n325.login = 'lorena78', n325.password = '6a93ecf9ccfcad5db3642e1647c01c57f5124431', n325.email = 'marc53@gmail.com'; -MERGE (n326:Person {neogen_id: '54d63b3a800e780eb3a706564942595813f02262' })SET n326 :User -, n326.firstname = 'Mandy', n326.lastname = 'Purdy', n326.birth_date = '1980-09-08 03:25:09', n326._id = '5c9a0c1d-e1a3-3c9f-90de-5e13aac2dca2', n326.login = 'carmella74', n326.password = '3a31f82901b2780798e33979a94c4cb9b146efc7', n326.email = 'noelia46@swift.com'; -MERGE (n327:Person {neogen_id: '6cf6c76570628d0ac6592c84533ca4bddf5dfa33' })SET n327 :User -, n327.firstname = 'Joanne', n327.lastname = 'Jerde', n327.birth_date = '1965-12-03 00:41:17', n327._id = 'e3d37937-8842-3cd3-9964-d9bd0d5fd850', n327.login = 'zkuhlman', n327.password = '758591536517afb59631df11099f58586bb8a49a', n327.email = 'dexter12@yahoo.com'; -MERGE (n328:Person {neogen_id: '7800ddf4a82cc99f6ce9b99cae5c86c64361269d' })SET n328 :User -, n328.firstname = 'Genesis', n328.lastname = 'Rolfson', n328.birth_date = '1991-10-14 00:58:59', n328._id = 'ec2c2a50-0800-3c3e-89bb-e2b777cee813', n328.login = 'bryan', n328.password = 'a56cc2c3d5153941d07f49e17ae43635c24cd677', n328.email = 'ppollich@johnsonerdman.com'; -MERGE (n329:Person {neogen_id: '73c0b24fb02334b97d822e8325274a7b415fe719' })SET n329 :User -, n329.firstname = 'Salvador', n329.lastname = 'Rosenbaum', n329.birth_date = '1971-08-01 07:28:50', n329._id = '9a1355ae-4b0c-3441-9906-9acfe7559861', n329.login = 'goyette.easter', n329.password = 'd015627863a6768c7ffb6c43c9d70e2d9d4ea5c7', n329.email = 'faustino80@yahoo.com'; -MERGE (n330:Person {neogen_id: '838b0d9f4187be244847fb55a9f22478533d64ca' })SET n330 :User -, n330.firstname = 'Vallie', n330.lastname = 'Reynolds', n330.birth_date = '1994-10-08 17:23:12', n330._id = '43f22ae1-2db1-381d-b216-586a4f5dd98d', n330.login = 'bullrich', n330.password = 'de0ba122a13b73e151700979e086552b60105a3a', n330.email = 'ward.russell@weber.com'; -MERGE (n331:Person {neogen_id: '4cb4f717953aac35f48d0463f9661568835e84b2' })SET n331 :User -, n331.firstname = 'Demond', n331.lastname = 'Nienow', n331.birth_date = '1971-04-28 18:00:15', n331._id = '1a697535-1c70-3b1a-a982-efd1a5e11483', n331.login = 'michel.adams', n331.password = '2a77f8131d52c81d6207d16bed4515c78cd2a456', n331.email = 'cartwright.kira@rolfson.com'; -MERGE (n332:Person {neogen_id: 'b5dc7e81fbb8af88a817d8730ffafa018cd2d373' })SET n332 :User -, n332.firstname = 'Flossie', n332.lastname = 'Fritsch', n332.birth_date = '1982-02-07 04:16:45', n332._id = '0c7340df-693d-381f-a4b0-e6cd585958fd', n332.login = 'abe90', n332.password = 'a5a657ebfdc7987ed266a4be669d633db00efddc', n332.email = 'emard.winnifred@yahoo.com'; -MERGE (n333:Person {neogen_id: '51b922440d7b923c96ed7cc0753b0f80461e0bda' })SET n333 :User -, n333.firstname = 'Frederic', n333.lastname = 'Kris', n333.birth_date = '1982-06-19 05:06:13', n333._id = '1a3d897a-d46f-3251-88bd-3af8773ea2d3', n333.login = 'rhianna.wolf', n333.password = 'e31aa50ab22002b9b181ebf661b271f4f119db93', n333.email = 'lritchie@steuber.com'; -MERGE (n334:Person {neogen_id: '2ed30b7ca0456f17d475614c4397b0a685776a81' })SET n334 :User -, n334.firstname = 'Dave', n334.lastname = 'Schamberger', n334.birth_date = '1969-09-07 11:33:38', n334._id = '4ac425ac-978a-31b4-b935-fd690e55aaa3', n334.login = 'zcorkery', n334.password = '81aaa83b851eeb4348c3e57305b9d40883c6125c', n334.email = 'dschmitt@goodwin.biz'; -MERGE (n335:Person {neogen_id: '422482db04b448cc41a0c404c3a5e96c4c81142b' })SET n335 :User -, n335.firstname = 'Abigail', n335.lastname = 'Howe', n335.birth_date = '1994-08-28 06:02:10', n335._id = '812aecc5-f0f5-3934-b6ca-9a1436628a1d', n335.login = 'rutherford.filomena', n335.password = '7b379fba68ff3a20eb706edccdff8a575be29e28', n335.email = 'amari.pollich@hotmail.com'; -MERGE (n336:Person {neogen_id: '026302844f3d9e1cb10cb36138cf3b3c38f6e5c8' })SET n336 :User -, n336.firstname = 'Vito', n336.lastname = 'Torphy', n336.birth_date = '1966-05-23 17:37:32', n336._id = 'd3f58d57-bf4a-36f8-8030-59e751d31f46', n336.login = 'uprice', n336.password = '843c1bcdf94531657f97c464225b7fc44a6eaf77', n336.email = 'purdy.oscar@hotmail.com'; -MERGE (n337:Person {neogen_id: '0c4a14c3a594cf7509f686df837b1afc5cfcce1e' })SET n337 :User -, n337.firstname = 'Irving', n337.lastname = 'Batz', n337.birth_date = '1969-06-14 19:04:51', n337._id = 'b0e6be25-a761-3b28-991e-26951b5a7383', n337.login = 'ibergstrom', n337.password = '3f62256bb823810c2407553f22a63c9161eb2cc5', n337.email = 'hayes.angus@reinger.com'; -MERGE (n338:Person {neogen_id: '109fcc0217e317b7e0bd82d17021b39134306fc4' })SET n338 :User -, n338.firstname = 'Evie', n338.lastname = 'Lindgren', n338.birth_date = '1973-08-09 07:18:55', n338._id = 'dc44b3ae-2625-3b63-b225-af62b83e01fc', n338.login = 'christy.zieme', n338.password = '9a7839cae2233047b3f642c10d75f016a13d8356', n338.email = 'cassin.maximo@hotmail.com'; -MERGE (n339:Person {neogen_id: '0568123b8124855e357326025000f8c55bdcb249' })SET n339 :User -, n339.firstname = 'Sharon', n339.lastname = 'Smith', n339.birth_date = '1975-04-05 02:56:38', n339._id = 'c64ff61e-5bf1-36da-9663-571d99ab0b94', n339.login = 'newton.schuppe', n339.password = 'bafbbb52718587ffa75d46c6ee17f3e04bc5fd40', n339.email = 'egreenfelder@beer.com'; -MERGE (n340:Person {neogen_id: '142b769f1af7cd7e0ebb8ebd4748f3f1bd1910ef' })SET n340 :User -, n340.firstname = 'Davin', n340.lastname = 'Christiansen', n340.birth_date = '1979-01-29 05:45:33', n340._id = 'a589b47d-b99f-36d8-be6e-7e5f33ed9076', n340.login = 'glangworth', n340.password = '99ae2d32ef93616b771bf8cb0b1e6cc00e55ba14', n340.email = 'king.monserrat@yahoo.com'; -MERGE (n341:Person {neogen_id: '65bcd275918bf6b75f6a9afd664351df26c7381e' })SET n341 :User -, n341.firstname = 'Gloria', n341.lastname = 'Cormier', n341.birth_date = '1986-12-03 17:53:10', n341._id = '6a1bbe03-5b15-3687-bb10-00f2886a8bac', n341.login = 'general40', n341.password = '4b67d308a4a8ba962e29286884c950102216a2df', n341.email = 'mara.robel@cassin.org'; -MERGE (n342:Person {neogen_id: 'd1d6cb9258f9f028a7e3c771288c223af90cabd3' })SET n342 :User -, n342.firstname = 'Claud', n342.lastname = 'Lueilwitz', n342.birth_date = '1975-02-20 21:18:12', n342._id = '25a8c381-7bab-3725-aaf5-abf691f726ca', n342.login = 'tia.lesch', n342.password = 'f455f7c527c7ce77485dc42a94a5d94d9037ec7d', n342.email = 'rdare@leffler.com'; -MERGE (n343:Person {neogen_id: '0347d147b2de2d2868c9ca5a08fb2aae81e85e29' })SET n343 :User -, n343.firstname = 'Rhea', n343.lastname = 'Smitham', n343.birth_date = '1985-04-16 13:19:01', n343._id = '4a39767c-72fa-3304-a1e5-20d7f0e5fe58', n343.login = 'theodora14', n343.password = '0c04142dec92a414c51c4ff96c4ea4a832a753f4', n343.email = 'bjacobi@yahoo.com'; -MERGE (n344:Person {neogen_id: '0b3a539828760700abd511e34b4d7bb9431db7f0' })SET n344 :User -, n344.firstname = 'Herminia', n344.lastname = 'Kerluke', n344.birth_date = '1971-07-10 01:12:04', n344._id = 'cc0acd66-59d7-3ac5-977a-72fb78f43b50', n344.login = 'ralph.lemke', n344.password = '5e8cb99f6a633a4bcca3e189cf4b84f3b939e7f0', n344.email = 'sstokes@gmail.com'; -MERGE (n345:Person {neogen_id: '996bd505f8df8ea259cbc6ceeb6f56f6dbfde3a6' })SET n345 :User -, n345.firstname = 'Vivianne', n345.lastname = 'Konopelski', n345.birth_date = '1989-05-18 08:55:49', n345._id = 'ad345c34-cdff-3e20-8a58-7e2e4b13aa3f', n345.login = 'rjohnston', n345.password = 'f9edf1a7860c8d287b2cc8be0c9e5694da0e5c74', n345.email = 'julian.lowe@yahoo.com'; -MERGE (n346:Person {neogen_id: 'ff354c73119ba7787bf6d4e916e25f2a1bc1e051' })SET n346 :User -, n346.firstname = 'Judy', n346.lastname = 'Graham', n346.birth_date = '1971-02-22 16:54:37', n346._id = '9fa8d8d6-0e98-3973-9c62-909b894cddb8', n346.login = 'cummerata.hoyt', n346.password = '76bd2b4ce37b3982190cf3f4fe4d0c32b16f7573', n346.email = 'marisa54@schroeder.com'; -MERGE (n347:Person {neogen_id: 'beaafbc0151b33888c18083cb4777135db149072' })SET n347 :User -, n347.firstname = 'Jaeden', n347.lastname = 'Koepp', n347.birth_date = '1991-05-04 00:19:50', n347._id = '48acecf6-9daa-3c28-b67e-1d167fb254b6', n347.login = 'leda.kuhn', n347.password = '48c656cf223cfbdc208bff320ad3763f65e1b583', n347.email = 'brandt40@carterhettinger.org'; -MERGE (n348:Person {neogen_id: 'aa6fa9cfe7d49e575702466fdf918e01e31309a0' })SET n348 :User -, n348.firstname = 'Fay', n348.lastname = 'Roob', n348.birth_date = '1969-06-13 20:48:29', n348._id = 'b8106253-ee4e-315f-ae77-3aac313876e9', n348.login = 'jhoeger', n348.password = 'ffa9f02f432b7d5a99728d07622ddcc0339ff996', n348.email = 'wgreenfelder@bogan.com'; -MERGE (n349:Person {neogen_id: 'bc904bd63f9d7d80c7386dfbfb1f420d11ec87d6' })SET n349 :User -, n349.firstname = 'Cyrus', n349.lastname = 'Schimmel', n349.birth_date = '1968-10-01 19:06:27', n349._id = '0d6a3044-baec-312e-b2cc-4c74384df58e', n349.login = 'karli.hartmann', n349.password = '0f9c5fdee7234e477a8785d87e8b6f75b8597d11', n349.email = 'karley94@ward.com'; -MERGE (n350:Person {neogen_id: 'fda68a2353c538bd6f511db92a43d3cc011ecbe4' })SET n350 :User -, n350.firstname = 'Mabelle', n350.lastname = 'Roob', n350.birth_date = '1973-10-23 11:24:25', n350._id = 'd5d82505-63ac-3f2f-995e-5ee82261c166', n350.login = 'frida17', n350.password = '40a4a455cebe76c814492345c6869227e835bab2', n350.email = 'lehner.eladio@thiel.org'; -MERGE (n351:Person {neogen_id: '3e9a84351f3959948dc549fb74a0dea92ee97764' })SET n351 :User -, n351.firstname = 'Lynn', n351.lastname = 'Kertzmann', n351.birth_date = '1980-03-23 00:05:18', n351._id = 'fca2144d-9d63-3919-9eb5-4d5519543dfd', n351.login = 'juliana.green', n351.password = '1d7398923782c506c689f9c4291531d78fe65ab6', n351.email = 'lavada.schamberger@torphyschroeder.org'; -MERGE (n352:Person {neogen_id: 'd12120fbe173dc77e94f85e1aac899388410f3c2' })SET n352 :User -, n352.firstname = 'Maude', n352.lastname = 'Dibbert', n352.birth_date = '1977-01-06 22:12:39', n352._id = 'ca5e0d34-583b-3886-abad-072867546407', n352.login = 'max.bartell', n352.password = 'a1342e22812a13a501a6f50f7095d69753699dfd', n352.email = 'bfay@hotmail.com'; -MERGE (n353:Person {neogen_id: '505b540894bb52c1b6ab9b456a77a5de3676aa70' })SET n353 :User -, n353.firstname = 'Isabella', n353.lastname = 'Hammes', n353.birth_date = '1992-09-15 14:11:00', n353._id = '8f7f422c-0bc8-3eac-a4c0-ce9c36d19de7', n353.login = 'rconn', n353.password = 'f7bafe2ed885c7b80474e9fbfa09dc74fcd384a8', n353.email = 'jdietrich@braun.com'; -MERGE (n354:Person {neogen_id: 'a8eaaf936d157d0b72f758817b2373b0103834e3' })SET n354 :User -, n354.firstname = 'Caleb', n354.lastname = 'Cremin', n354.birth_date = '1973-10-02 09:10:30', n354._id = '85bbe586-40df-3d3e-94f1-a8b8922c675f', n354.login = 'tpollich', n354.password = '4d8d34861c62851dd6f00d00c826f67ebce7bd7c', n354.email = 'fd\'amore@gmail.com'; -MERGE (n355:Person {neogen_id: 'a18c3913f9b9ac588e1290a7b724a557531f291d' })SET n355 :User -, n355.firstname = 'Hobart', n355.lastname = 'Goldner', n355.birth_date = '1974-06-12 23:54:08', n355._id = 'b69af12f-5f6e-3548-85af-07d24ecec79e', n355.login = 'owelch', n355.password = '833919410662afc13df6c8ac9c3654ac9d2c08db', n355.email = 'anabelle.pacocha@yahoo.com'; -MERGE (n356:Person {neogen_id: '67d9ecf41ad733d6ddd15241dabd446ea2c7b025' })SET n356 :User -, n356.firstname = 'Alessandra', n356.lastname = 'Hermiston', n356.birth_date = '1973-03-31 12:42:28', n356._id = '04a2ebbb-5931-3d96-b53e-b669931f95ff', n356.login = 'yblick', n356.password = '2ad9645d65a776ba2b1f0e1f8460dff00caa14df', n356.email = 'shodkiewicz@huelsteuber.net'; -MERGE (n357:Person {neogen_id: '2379551139dd3e91ad7780d51bb7aaef51e43099' })SET n357 :User -, n357.firstname = 'Laverna', n357.lastname = 'Pfannerstill', n357.birth_date = '1981-12-30 20:06:48', n357._id = '61c88006-6fb8-36f5-b324-93b41875eff7', n357.login = 'keeling.alan', n357.password = 'b1db6d193c2d6521172f5f8c46b1de87c2ddc876', n357.email = 'bgrant@dare.biz'; -MERGE (n358:Person {neogen_id: '13d23cf79a2322263cc94243492e51f0fc8a5de5' })SET n358 :User -, n358.firstname = 'Lottie', n358.lastname = 'Von', n358.birth_date = '1970-08-01 18:46:31', n358._id = '460a93c3-01ba-3460-a3f8-cae122350d55', n358.login = 'ibrahim98', n358.password = '6f2952e8ca3679cfd181a5c0b628002ae90fe819', n358.email = 'zhauck@weber.info'; -MERGE (n359:Person {neogen_id: 'ee33aa9b8393ebbbf23cba98384d4e39d9954989' })SET n359 :User -, n359.firstname = 'River', n359.lastname = 'DuBuque', n359.birth_date = '1968-05-31 10:53:16', n359._id = 'ca8b2cf9-631f-3bd7-b13d-bbf98e4749f7', n359.login = 'woodrow.ryan', n359.password = '9234ccc8b2a5adb295977a67b6a019e7b61fec8d', n359.email = 'moen.lucius@gmail.com'; -MERGE (n360:Person {neogen_id: '419d504bd92511a25f79a93b8ceea77240857c62' })SET n360 :User -, n360.firstname = 'Cristobal', n360.lastname = 'Witting', n360.birth_date = '1995-03-25 08:48:05', n360._id = 'cfb7a319-40aa-3d6a-a6e2-06e41683e63b', n360.login = 'jarrod.langworth', n360.password = '6d5391aa24f829a3210215a32763dceb7aafd0c3', n360.email = 'emma.mueller@gmail.com'; -MERGE (n361:Person {neogen_id: 'e926e6eab6deaa8a8b5ef82099b5ac0882bed6f1' })SET n361 :User -, n361.firstname = 'Laron', n361.lastname = 'Hartmann', n361.birth_date = '1982-08-30 02:51:13', n361._id = '6c28b654-9dbc-3a59-a761-62dfe70cab0b', n361.login = 'wlynch', n361.password = 'f669479835e78a25da6a6411814b5a73bd5110ea', n361.email = 'alexys.hoeger@mante.net'; -MERGE (n362:Person {neogen_id: '4d5cdfc4b73119d028f117112bed2ebb968cffb2' })SET n362 :User -, n362.firstname = 'Maximilian', n362.lastname = 'Renner', n362.birth_date = '1969-06-01 04:32:51', n362._id = '00feff7d-45d6-3040-9705-2a1756ce6261', n362.login = 'xzavier.swift', n362.password = '764ca9440116ec2fa82602f82826fc5ccdb17170', n362.email = 'bkihn@hotmail.com'; -MERGE (n363:Person {neogen_id: 'bd697a1b806e9ac7cb71d64905e3999da13b7173' })SET n363 :User -, n363.firstname = 'Derrick', n363.lastname = 'Stamm', n363.birth_date = '1970-10-27 05:55:50', n363._id = '2911b78f-f729-37e2-9539-810ab48a2204', n363.login = 'otorphy', n363.password = '912aa5b66bdc87a4f2790641035f524002505c22', n363.email = 'mbecker@raynorweimann.biz'; -MERGE (n364:Person {neogen_id: 'f7e6cb351b5730f017bcd1bec69443993ec2ecfc' })SET n364 :User -, n364.firstname = 'Cary', n364.lastname = 'Marvin', n364.birth_date = '1971-04-15 00:26:51', n364._id = '2f2e0c98-7414-39dd-a394-e83a32694096', n364.login = 'harley38', n364.password = '8884478294cf80267bb26a6ec3831ed150435753', n364.email = 'hglover@funk.biz'; -MERGE (n365:Person {neogen_id: '667e1419ec23da6978093b7ed53ce1548e5dbdab' })SET n365 :User -, n365.firstname = 'Horace', n365.lastname = 'McLaughlin', n365.birth_date = '1974-04-17 15:59:36', n365._id = '2008878e-973f-3cfb-99c2-8855059604b4', n365.login = 'winona57', n365.password = '64240c4572706ea733c6dd8c942a1c0b6f4be4a4', n365.email = 'wdaniel@stromanabernathy.com'; -MERGE (n366:Person {neogen_id: '474992a501d9920d8f9153e7476077870666f2cb' })SET n366 :User -, n366.firstname = 'Savanna', n366.lastname = 'Hickle', n366.birth_date = '1979-09-21 15:49:02', n366._id = '9fe8a933-5132-3642-82e2-300b79135efb', n366.login = 'dorian.bauch', n366.password = 'cc86b417dc81f539aba2805a43c1a8c4869e4fb8', n366.email = 'bayer.hettie@gmail.com'; -MERGE (n367:Person {neogen_id: 'd3f1b7aef15d82063c624cf02537e944f63c7200' })SET n367 :User -, n367.firstname = 'Ford', n367.lastname = 'Daniel', n367.birth_date = '1966-03-26 17:26:56', n367._id = 'a7a308df-82e3-30e7-99cc-10e7a56b7580', n367.login = 'keebler.stefan', n367.password = '3e91cdaa974c4bf058c252d9bf502691590f1c7d', n367.email = 'ybashirian@hotmail.com'; -MERGE (n368:Person {neogen_id: '151bea602159b22d2fccd6cb106b86c7d14fba94' })SET n368 :User -, n368.firstname = 'Eddie', n368.lastname = 'Ryan', n368.birth_date = '1993-02-27 06:31:08', n368._id = '635d9b54-1e9a-3ee2-baa4-1372306afb67', n368.login = 'vsmitham', n368.password = '55ec96353f542af5d726a4cd6dbf790bcb9670cc', n368.email = 'ppacocha@hotmail.com'; -MERGE (n369:Person {neogen_id: 'a4e1d21f043e112fa7c51c4a67a0612ecd00c6d4' })SET n369 :User -, n369.firstname = 'Sydnee', n369.lastname = 'Gibson', n369.birth_date = '1974-03-20 13:29:31', n369._id = '648717e0-c496-3259-99e0-3055063debf1', n369.login = 'henriette06', n369.password = 'a868c06b84669901112aea855ed2a0ffda37a10a', n369.email = 'brionna43@boyer.net'; -MERGE (n370:Person {neogen_id: 'fa96cbe1cdc403facf2120617dfd5d1701f6d2c3' })SET n370 :User -, n370.firstname = 'Kimberly', n370.lastname = 'Bernhard', n370.birth_date = '1978-04-18 22:38:25', n370._id = 'f9bec468-fd74-38b3-9ec4-6f9815af5f0a', n370.login = 'jbarton', n370.password = 'c30c88ff8baf2f1d1bccd9de36210edd21ed80b4', n370.email = 'grimes.alden@hotmail.com'; -MERGE (n371:Person {neogen_id: 'fb9f42ba17cbbd682c59b108afbda34ea9a80ec4' })SET n371 :User -, n371.firstname = 'Ali', n371.lastname = 'Fadel', n371.birth_date = '1969-08-27 13:58:30', n371._id = '1b637281-340c-35c8-acd4-c36a8caf6c62', n371.login = 'ottilie.breitenberg', n371.password = 'aeaab95aab503bbdfaba1743376623cc61a2d5f7', n371.email = 'goyette.hailie@gmail.com'; -MERGE (n372:Person {neogen_id: '588c913096a34635751d204022d4fa7fe6ae087e' })SET n372 :User -, n372.firstname = 'Virgie', n372.lastname = 'Mitchell', n372.birth_date = '1990-11-22 10:51:31', n372._id = '2964debf-fa34-3f8a-a7c1-712d847bd654', n372.login = 'legros.reuben', n372.password = 'd68e98b52ae20a320ee6da1fc68ac76592e55eb1', n372.email = 'xabshire@westbayer.com'; -MERGE (n373:Person {neogen_id: '9ca9682c8a327dead171e7ff5b91f65ea13ab300' })SET n373 :User -, n373.firstname = 'Jessie', n373.lastname = 'Kertzmann', n373.birth_date = '1970-03-03 10:39:28', n373._id = '9c0f57bd-04a5-317a-87d4-c77772b74971', n373.login = 'veum.elsie', n373.password = 'f44592ee4804c0bd7c17154509d724622562d096', n373.email = 'juliet93@nitzsche.com'; -MERGE (n374:Person {neogen_id: '613940d5682a89c7ccf619d123afac3f77481749' })SET n374 :User -, n374.firstname = 'Pat', n374.lastname = 'Zemlak', n374.birth_date = '1969-05-17 23:50:17', n374._id = '96360759-120a-371b-acfb-adb9289559f1', n374.login = 'kaylie.boyle', n374.password = '9f66fc9422a15356d8aa4ef1f5c3ff372345b857', n374.email = 'liza74@hotmail.com'; -MERGE (n375:Person {neogen_id: 'caaf9c93d6e7d1c9600ab233916eec81c6614fa4' })SET n375 :User -, n375.firstname = 'Emery', n375.lastname = 'Gutmann', n375.birth_date = '1991-01-01 09:18:36', n375._id = '67caf1b8-7f76-3850-9543-4d03deee9f5b', n375.login = 'ywillms', n375.password = 'efa830fd8feb91f972e5e7c97aa2697577a8d0a9', n375.email = 'batz.dannie@gmail.com'; -MERGE (n376:Person {neogen_id: '9a2f5af7bf52970916f43c4fed0e53d09e4c9cbd' })SET n376 :User -, n376.firstname = 'Bartholome', n376.lastname = 'Beier', n376.birth_date = '1977-08-17 19:07:28', n376._id = '34a67254-32dc-3db9-b370-327cc53c6633', n376.login = 'vergie10', n376.password = 'a672673096bd99d73e3cbd2b991aaf5b204e0743', n376.email = 'dean.bahringer@yahoo.com'; -MERGE (n377:Person {neogen_id: 'd493dfdd3b7d7ede77e0fc358acdd5cb65026827' })SET n377 :User -, n377.firstname = 'Elouise', n377.lastname = 'Bednar', n377.birth_date = '1975-07-22 01:23:40', n377._id = 'b996cabf-79e2-3ffd-b97a-af2bfa58287e', n377.login = 'flavio11', n377.password = '4f16bf3bd75386020e6be27302c6cd1faac67271', n377.email = 'wreynolds@gmail.com'; -MERGE (n378:Person {neogen_id: 'ebfac5314351627c45a3ca988df5180342906501' })SET n378 :User -, n378.firstname = 'Rosendo', n378.lastname = 'McCullough', n378.birth_date = '1991-03-17 01:10:50', n378._id = 'ff8a5034-cad4-379f-bb63-1c007b769452', n378.login = 'apaucek', n378.password = '8c6ac24b35e1a68ce7fcfbec74cae7aa5bda17a1', n378.email = 'clarkin@gmail.com'; -MERGE (n379:Person {neogen_id: '2bb7dd4d935a50d5b0fc8adc41b91c4140b74df0' })SET n379 :User -, n379.firstname = 'Khalil', n379.lastname = 'Zemlak', n379.birth_date = '1971-09-01 06:23:41', n379._id = '645745a7-7dac-3a1a-8408-745b7eeba6dc', n379.login = 'fannie.beier', n379.password = 'c1425b1273a3749418fcb24d2605a314f865e99d', n379.email = 'saul.doyle@simonis.info'; -MERGE (n380:Person {neogen_id: '7e25180a96766faeaa6e96f0a108bcf56024b43f' })SET n380 :User -, n380.firstname = 'Gerry', n380.lastname = 'Mann', n380.birth_date = '1984-01-06 21:42:08', n380._id = '6e0214fd-f99f-3a70-bf46-97f6385a47e3', n380.login = 'xsauer', n380.password = 'f6fdf6814a3ab8ec2224fb81eca3d8f2c52c081f', n380.email = 'austen89@gmail.com'; -MERGE (n381:Person {neogen_id: '8531ea25d35ba20f524b6638444ab90a3682c979' })SET n381 :User -, n381.firstname = 'Brandyn', n381.lastname = 'Ondricka', n381.birth_date = '1965-09-03 01:14:50', n381._id = '9328a64e-9f04-3103-89a3-8e24f900eb2b', n381.login = 'vwiza', n381.password = 'a4434480cd5246635f63db6b18fee8197e7dcbde', n381.email = 'clotilde68@ebert.com'; -MERGE (n382:Person {neogen_id: '4cd6de3e0063f699060015002beea5e9f0410800' })SET n382 :User -, n382.firstname = 'Tre', n382.lastname = 'Hayes', n382.birth_date = '1980-07-11 14:20:22', n382._id = '63e5ec8d-7ec2-3470-a9d0-3fc1a7df4b08', n382.login = 'jast.larue', n382.password = 'fd8a7e2c47cbf61afc5ccfeebf0a4d067b5db808', n382.email = 'carmel.gleichner@hotmail.com'; -MERGE (n383:Person {neogen_id: '2964feb400181f68cf3467daed99f6190b986aa2' })SET n383 :User -, n383.firstname = 'Emile', n383.lastname = 'Towne', n383.birth_date = '1970-06-06 06:01:05', n383._id = 'e46be659-90b1-3833-ac64-338a9a5e7471', n383.login = 'jeffrey31', n383.password = 'a423168ecb49c88321d54449036692dd149abcef', n383.email = 'becker.nelda@goldner.com'; -MERGE (n384:Person {neogen_id: '6f0ac790159d6bbf42fdc70bb5f7538a55d9d1de' })SET n384 :User -, n384.firstname = 'Amari', n384.lastname = 'Rau', n384.birth_date = '1989-03-12 04:17:14', n384._id = '14336af9-b93c-3a87-bbda-1d5a18488af6', n384.login = 'felipa49', n384.password = '176d207b16044c98f0470acd08a809f0f89864d4', n384.email = 'alana.sporer@terrywehner.com'; -MERGE (n385:Person {neogen_id: '3d4668662fab756447b8434beba3aa724ce23fb5' })SET n385 :User -, n385.firstname = 'Russ', n385.lastname = 'O\'Conner', n385.birth_date = '1995-10-11 07:56:58', n385._id = '7f7bf70f-2122-302d-bf20-54e6a8f96e41', n385.login = 'mathias61', n385.password = 'a1e6c528cf1924e77927b9ef198ef9858437bb22', n385.email = 'estelle83@klein.com'; -MERGE (n386:Person {neogen_id: '2b95c6db46a989ce76d8bf21362238d00653864b' })SET n386 :User -, n386.firstname = 'Libbie', n386.lastname = 'Cormier', n386.birth_date = '1994-04-12 23:27:09', n386._id = '363ed694-db59-3691-b6a0-6498c577aef1', n386.login = 'alexane.boyle', n386.password = 'df7935c3739c44760ab7cf33c51498fe5d777109', n386.email = 'loren.rempel@mueller.com'; -MERGE (n387:Person {neogen_id: '32c58bc3925ce1ba65800eba27c3675bc928af45' })SET n387 :User -, n387.firstname = 'Nicole', n387.lastname = 'Hartmann', n387.birth_date = '1976-03-27 19:06:31', n387._id = 'f5e91158-ac5e-3d00-9b3e-613d3a3a991a', n387.login = 'olueilwitz', n387.password = '98c0d5147fdf2c7f8c97fa78a967735d74b253af', n387.email = 'dach.lily@hotmail.com'; -MERGE (n388:Person {neogen_id: 'c39f7d19868c5a9f4f56bebd4f90188c076e4cf0' })SET n388 :User -, n388.firstname = 'Hellen', n388.lastname = 'Leffler', n388.birth_date = '1974-05-16 12:32:41', n388._id = '00814efd-7780-3e39-bb01-0b8a1f706d63', n388.login = 'vgoodwin', n388.password = 'f2c2608281c1a36b9e99629cdeb568db04ff681c', n388.email = 'armstrong.raegan@zboncak.com'; -MERGE (n389:Person {neogen_id: 'dc29b593e6b1771b786962f668cd53880b25d911' })SET n389 :User -, n389.firstname = 'Ashton', n389.lastname = 'Stoltenberg', n389.birth_date = '1966-04-08 23:34:22', n389._id = '6e791ade-94c8-36ed-94ae-705e372c8b3b', n389.login = 'minnie57', n389.password = '6299de7e2fb8d837a597752d874dae09a3d31dd6', n389.email = 'yolanda90@runolfssonpfannerstill.com'; -MERGE (n390:Person {neogen_id: 'c1c92894292b64c5d9607be75e7944cd56429dcd' })SET n390 :User -, n390.firstname = 'Cathy', n390.lastname = 'Rohan', n390.birth_date = '1979-08-31 21:09:04', n390._id = '197550b1-5220-3726-8fa6-e658527f2aec', n390.login = 'casper.osvaldo', n390.password = '2e13be1850675580d300d18fb424b87c58bc87f3', n390.email = 'hilll.mathew@wisozk.org'; -MERGE (n391:Person {neogen_id: '272d4e7b617c45599650c6f92b2597ac36542370' })SET n391 :User -, n391.firstname = 'Layne', n391.lastname = 'Hartmann', n391.birth_date = '1971-03-09 05:39:44', n391._id = '2567ad84-d36d-37c4-9bba-7d2d7e11bde2', n391.login = 'casper.favian', n391.password = '06d2c8798ddf1a22de2699c2c58883c4492daf72', n391.email = 'golden37@harber.biz'; -MERGE (n392:Person {neogen_id: '57b83321849bafebe4491e2c86ef1a16f64f20f1' })SET n392 :User -, n392.firstname = 'Eusebio', n392.lastname = 'Labadie', n392.birth_date = '1975-09-01 20:04:56', n392._id = '1a8a4996-4082-3faf-be76-66395c9a5141', n392.login = 'stark.moses', n392.password = '132f27f32eeb31b46619fdf46e2d92b64bb3bffd', n392.email = 'ejohns@yahoo.com'; -MERGE (n393:Person {neogen_id: '028ed5ae755bb1cc9148d16567f1253fabc1dd92' })SET n393 :User -, n393.firstname = 'Maeve', n393.lastname = 'Kub', n393.birth_date = '1978-04-20 12:03:03', n393._id = 'd827d6a8-b80b-35d8-b938-d3b1e279a76a', n393.login = 'ansel89', n393.password = '1aa450b30f5b837abbe91c7f4e214bef49c1a113', n393.email = 'senger.demario@franecki.com'; -MERGE (n394:Person {neogen_id: '0686b9976703cee7df9c18b6e67c6e238947c51c' })SET n394 :User -, n394.firstname = 'Ansley', n394.lastname = 'Kemmer', n394.birth_date = '1981-11-05 18:07:37', n394._id = '9ba0f59e-0b74-37db-808e-c171a6c85873', n394.login = 'khaley', n394.password = 'fa43104806975bbb6a7c085190600d5954639021', n394.email = 'senger.rhoda@kohlerbode.com'; -MERGE (n395:Person {neogen_id: 'ffe0a1e48c6f582a8438f60d1cc144e6b4b68357' })SET n395 :User -, n395.firstname = 'Salma', n395.lastname = 'Hansen', n395.birth_date = '1975-06-28 15:48:31', n395._id = '76a4801f-8474-34c2-9a81-cef7c8c91b57', n395.login = 'hoppe.shanna', n395.password = '297a9e242da094e5368ab44ab69a188b2269f2dc', n395.email = 'pollich.jermey@yahoo.com'; -MERGE (n396:Person {neogen_id: '6946d3043d00fcae5d48f53636684d50f6b673d5' })SET n396 :User -, n396.firstname = 'Ardella', n396.lastname = 'Konopelski', n396.birth_date = '1972-01-21 01:09:19', n396._id = '6a66953c-ca3a-391a-908e-382204d625dd', n396.login = 'tevin89', n396.password = 'bc3cb393672b3b1ccfc54fcf32c576cc80180048', n396.email = 'alek.hoeger@gmail.com'; -MERGE (n397:Person {neogen_id: 'f4eab9abdfb5fd13bbe010319b09e8ff8fc8ae40' })SET n397 :User -, n397.firstname = 'Jean', n397.lastname = 'Kuhic', n397.birth_date = '1968-12-26 05:17:50', n397._id = 'cb165060-e948-3f5d-82d8-68f80fb420cd', n397.login = 'carley.reinger', n397.password = '6eb953c0d6a06aae74e31b201faf865f512f7fa2', n397.email = 'wanda.hessel@gmail.com'; -MERGE (n398:Person {neogen_id: '9b603e25cfa7fd8987e97c4b9b0ac6558a05dce6' })SET n398 :User -, n398.firstname = 'Cassandra', n398.lastname = 'Mertz', n398.birth_date = '1990-07-19 03:39:20', n398._id = '66cde353-877a-3d06-ad1e-15d0f4263363', n398.login = 'beulah44', n398.password = '99e0ad2ebdfe99b3f148146fa9de3a00d49419a5', n398.email = 'schiller.chloe@boyerschulist.com'; -MERGE (n399:Person {neogen_id: '39fafdeaeb01b7876a201d367ee1f713f7977693' })SET n399 :User -, n399.firstname = 'Kattie', n399.lastname = 'Kreiger', n399.birth_date = '1969-12-05 22:13:49', n399._id = '65ec458b-5b68-3440-b252-46a8ba994fd1', n399.login = 'della71', n399.password = '1d57c6bb3db579a82c1a647864682710c20f9f1f', n399.email = 'felipa86@gmail.com'; -MERGE (n400:Person {neogen_id: '1d822e93817ac44c64bd5d0d7efc3ca189e75a80' })SET n400 :User -, n400.firstname = 'Paul', n400.lastname = 'Ortiz', n400.birth_date = '1973-10-01 14:52:57', n400._id = '1e68e0a3-7922-3292-b9ef-0a5a0655349e', n400.login = 'buckridge.blair', n400.password = '5f63a0c787894c296372aec8c73842008b9dc311', n400.email = 'grant.marlin@hotmail.com'; -MERGE (n401:Person {neogen_id: 'bfa4e694fd93efa59316211bfea75c15bd173253' })SET n401 :User -, n401.firstname = 'Kristopher', n401.lastname = 'Stanton', n401.birth_date = '1986-09-16 12:17:01', n401._id = '2cd9bfc0-3cc2-3c2a-a7ab-61e3a7f8344a', n401.login = 'sibyl92', n401.password = '7ca8e734bd21ced8b17ec2333170e6cdf9159d57', n401.email = 'jayda19@gmail.com'; -MERGE (n402:Person {neogen_id: 'ee28d52726c83f7fd78b50a3eac6fd35ad018b90' })SET n402 :User -, n402.firstname = 'Janiya', n402.lastname = 'Lynch', n402.birth_date = '1966-04-09 08:40:45', n402._id = '00f9e5e7-c82e-3e50-b8a2-80218f3e688b', n402.login = 'markus.jacobi', n402.password = '7a61628ed15a5bc07161600a777c376202f76ccf', n402.email = 'gwalsh@hotmail.com'; -MERGE (n403:Person {neogen_id: 'b06c06c393a97011bf7c3f6c544da4904e24fd86' })SET n403 :User -, n403.firstname = 'Narciso', n403.lastname = 'Feest', n403.birth_date = '1989-11-27 00:36:49', n403._id = 'b2a91c13-1e62-3385-8116-de4bd3727436', n403.login = 'qcorkery', n403.password = '7d2a4da672e2125339ca854e305fae918aec5f8c', n403.email = 'dortha80@kohler.com'; -MERGE (n404:Person {neogen_id: 'cf54851326ffc8dab2bfe77e615498da25c57af7' })SET n404 :User -, n404.firstname = 'Eladio', n404.lastname = 'Zemlak', n404.birth_date = '1973-07-24 04:45:32', n404._id = '216ea7c4-01f8-37bd-a6c7-030df04bc21d', n404.login = 'casimir32', n404.password = '313c3d3dfbf0f6b7309ce08dc1d94afe05b6f495', n404.email = 'mittie86@wisozk.com'; -MERGE (n405:Person {neogen_id: '4ee2a76cf0b997a3f94ee206f2b28735a878ce32' })SET n405 :User -, n405.firstname = 'Reyna', n405.lastname = 'Russel', n405.birth_date = '1989-03-11 19:31:34', n405._id = '99e41bf0-ce37-3824-9c91-50c5f9d6ff11', n405.login = 'bruen.keon', n405.password = '2f87fdbec1a6c0312c4d060a440dfbdddef9bac5', n405.email = 'streich.ubaldo@stromancrist.com'; -MERGE (n406:Person {neogen_id: 'e22b42ac5408a82a5df21412f24b176e26ba5819' })SET n406 :User -, n406.firstname = 'Buddy', n406.lastname = 'Torp', n406.birth_date = '1989-05-06 20:34:30', n406._id = 'c980c33a-a4e6-3e28-b0d9-af16e5594dd7', n406.login = 'jimmie.parker', n406.password = 'b19fc912bf9d394ebe6c4a7e1aa1f8918b0238ac', n406.email = 'manuel.pollich@hotmail.com'; -MERGE (n407:Person {neogen_id: 'adc0d665cef53d4cfa55feca0b239413cd4f8088' })SET n407 :User -, n407.firstname = 'Christina', n407.lastname = 'Hilpert', n407.birth_date = '1971-09-17 02:39:59', n407._id = 'ff55f75e-be6e-37e5-a053-f3b87f80049b', n407.login = 'buford70', n407.password = 'bd58b3e607006125dd6392829842879d4345d1fe', n407.email = 'padberg.lafayette@hotmail.com'; -MERGE (n408:Person {neogen_id: '181d38258aef2258510c5fb2a771727d6f8f9012' })SET n408 :User -, n408.firstname = 'Arely', n408.lastname = 'O\'Reilly', n408.birth_date = '1987-07-22 07:26:28', n408._id = 'cc41a255-96a9-3501-8bb0-abbf9c41da1d', n408.login = 'general84', n408.password = 'f31bdef0b46deebe60c849b58c96f7984a976bc4', n408.email = 'ukling@gmail.com'; -MERGE (n409:Person {neogen_id: 'fe8bfdc2d3e051eea407e590ecf560803533cf34' })SET n409 :User -, n409.firstname = 'Devon', n409.lastname = 'Bailey', n409.birth_date = '1977-03-08 09:50:06', n409._id = '3b579e48-0c75-3216-b60d-8536cd0f6a6e', n409.login = 'vita.vandervort', n409.password = '80f4f354727629764e3c09371ea7ae567c28692d', n409.email = 'kstanton@yahoo.com'; -MERGE (n410:Person {neogen_id: '461624e85265724b0c29c1b7f5db6b8aec952bad' })SET n410 :User -, n410.firstname = 'Daphnee', n410.lastname = 'Schiller', n410.birth_date = '1993-07-24 03:36:55', n410._id = 'ddfa51de-ae43-323e-9602-87877a18bc00', n410.login = 'devan60', n410.password = '788313cb511f043a9240dd27460785cb8c901023', n410.email = 'stracke.jessie@gmail.com'; -MERGE (n411:Person {neogen_id: 'a48d860c8893d52cce843277006237b4e0d30a60' })SET n411 :User -, n411.firstname = 'Nia', n411.lastname = 'D\'Amore', n411.birth_date = '1991-01-30 13:04:23', n411._id = '7cc4bfdf-39ed-3408-896b-7cf7defedd4e', n411.login = 'harry29', n411.password = '23c348387849d952f6417e1c84c68d49ddece889', n411.email = 'jalen94@hotmail.com'; -MERGE (n412:Person {neogen_id: '6fb8f33141660a336e36503dd8f587a3749657d4' })SET n412 :User -, n412.firstname = 'Susie', n412.lastname = 'Gulgowski', n412.birth_date = '1985-09-17 12:21:31', n412._id = 'de8a8cb5-bcc9-3158-a2da-505eedb959e7', n412.login = 'satterfield.gino', n412.password = 'd548114a88daef1b2b07a052ef91f2931d7b11c8', n412.email = 'dietrich.marlee@hotmail.com'; -MERGE (n413:Person {neogen_id: '34d689504b0514011aa71659760d732c6b039931' })SET n413 :User -, n413.firstname = 'Maynard', n413.lastname = 'Heaney', n413.birth_date = '1972-09-11 14:37:38', n413._id = 'c1bfe11e-3da7-3d30-ba9d-d5423f9490cd', n413.login = 'thora.satterfield', n413.password = 'ce41eb1fdca95a016dc9504d018e2e4782b6c014', n413.email = 'nnicolas@krajcik.com'; -MERGE (n414:Person {neogen_id: '3360bdf61046cf17073df8c8b7a7359b5130113d' })SET n414 :User -, n414.firstname = 'Laney', n414.lastname = 'Nolan', n414.birth_date = '1976-01-26 18:15:36', n414._id = '43a8d9f7-c367-3dde-8ae0-a0854391e114', n414.login = 'cormier.mauricio', n414.password = '0ff0d576629c26c593d9cfc4edd69403d3337288', n414.email = 'clement55@yahoo.com'; -MERGE (n415:Person {neogen_id: '46d293be3d94171c7aca62a07af8851ca10e6556' })SET n415 :User -, n415.firstname = 'Isabella', n415.lastname = 'Zieme', n415.birth_date = '1977-11-23 07:18:37', n415._id = 'f619a688-c63a-3bd2-b4b2-814ca04634cf', n415.login = 'candido.d\'amore', n415.password = '7c1afa7e20351c1c0728399c9ee5d7cbb3150745', n415.email = 'gkoepp@yahoo.com'; -MERGE (n416:Person {neogen_id: '34eeec19b07c392389749388544e50445d2d8767' })SET n416 :User -, n416.firstname = 'Mae', n416.lastname = 'Purdy', n416.birth_date = '1975-01-23 18:09:47', n416._id = '6c5f9b50-a3a9-32fe-a598-af95b0a5cb1e', n416.login = 'name.o\'connell', n416.password = 'dffb63a44f19c0c82a48f603336b02c8b983b26a', n416.email = 'tyra51@gmail.com'; -MERGE (n417:Person {neogen_id: '5e643ede98b2db4f11645ff534eefcbebd2dc653' })SET n417 :User -, n417.firstname = 'Maximillian', n417.lastname = 'Turcotte', n417.birth_date = '1979-02-07 21:08:51', n417._id = '63d48aa0-c4b9-3eed-979e-3e5d18c8a75e', n417.login = 'hand.garett', n417.password = 'b2fe1e6061dc64f2dc1f70ccefbfc99fd7f646fa', n417.email = 'russel33@goodwin.com'; -MERGE (n418:Person {neogen_id: '7a26a4f1fa4e5d46c7fcdfa7aa50e7a0180ebaa4' })SET n418 :User -, n418.firstname = 'Jose', n418.lastname = 'Wilkinson', n418.birth_date = '1983-04-18 10:50:18', n418._id = 'b913f001-e214-33f3-8c87-bf22d46d8684', n418.login = 'epollich', n418.password = '5db6f6eff352e693763c978ac65812b6c8a4de5a', n418.email = 'zdouglas@gmail.com'; -MERGE (n419:Person {neogen_id: '215530bcf5d03d81cd877721a54db9a8e2de4632' })SET n419 :User -, n419.firstname = 'Jovan', n419.lastname = 'Hansen', n419.birth_date = '1995-07-18 20:36:46', n419._id = '638d1481-2f36-3ad9-8316-dcfdf0b48072', n419.login = 'schneider.glenna', n419.password = '45ca66af35047cb931c8c169f5c4dfb6e29c5055', n419.email = 'maribel93@hintz.com'; -MERGE (n420:Person {neogen_id: 'f7174c7cc06c575917822e848af98b729baf3518' })SET n420 :User -, n420.firstname = 'Dariana', n420.lastname = 'Feeney', n420.birth_date = '1992-04-03 11:36:31', n420._id = '23c14258-6af6-3b61-b820-fb8e2afb2132', n420.login = 'dawson.von', n420.password = '09526461b4d7cbe10815930a617e83f2e0b29ae9', n420.email = 'monahan.adalberto@gmail.com'; -MERGE (n421:Person {neogen_id: 'ef2a86709c93e235b08f9ed17d2cb5e05b75f75a' })SET n421 :User -, n421.firstname = 'Toy', n421.lastname = 'Moore', n421.birth_date = '1983-02-13 00:55:04', n421._id = 'd0a2225f-c43f-3768-8f8e-dfac87ddb64c', n421.login = 'abby32', n421.password = '22d42fe3c171cb58cd5ad859f2fe07891c3a695c', n421.email = 'dexter86@bartellstiedemann.com'; -MERGE (n422:Person {neogen_id: '86e1a7cc22985b7e81f1bc890e3236f6fc554ae5' })SET n422 :User -, n422.firstname = 'Alex', n422.lastname = 'Bergstrom', n422.birth_date = '1972-09-04 10:50:27', n422._id = 'bfb8766b-ca35-3957-ace4-148c8240ac5a', n422.login = 'lyric.flatley', n422.password = '6db3ef5ea6b678c00943accc0478a7ce4c6106ca', n422.email = 'catherine.thiel@yahoo.com'; -MERGE (n423:Person {neogen_id: '85406d84256b54aded1215db30dba05839b45ff5' })SET n423 :User -, n423.firstname = 'Garth', n423.lastname = 'Torphy', n423.birth_date = '1981-10-30 08:47:32', n423._id = 'ac7bf23f-09b7-3ef7-b2cd-0137b65212c3', n423.login = 'willms.deshaun', n423.password = '514bfe675883d365d8520e8f705be4c901106aaf', n423.email = 'rory.bednar@strosin.net'; -MERGE (n424:Person {neogen_id: '7031abebd5f58e18d29bc89b8944a99d64e86f79' })SET n424 :User -, n424.firstname = 'Kallie', n424.lastname = 'Denesik', n424.birth_date = '1994-11-10 19:17:47', n424._id = '2ba432ad-fa3e-3653-be85-87000db0c734', n424.login = 'ybode', n424.password = 'e28a3bcd2cd9187ebf2538292850879a4b81b8c0', n424.email = 'gia.bogan@mcclure.info'; -MERGE (n425:Person {neogen_id: '424a591459adf6624ae52c1ed91d2b2f88e5af45' })SET n425 :User -, n425.firstname = 'Kathryn', n425.lastname = 'Reinger', n425.birth_date = '1991-10-10 11:28:48', n425._id = 'fda0b41b-3bec-300d-b4c0-511223dca64e', n425.login = 'franz.emmerich', n425.password = '8441f6b5c5708a05aa3979cf186920e2660bcde6', n425.email = 'kenneth.lind@klocko.org'; -MERGE (n426:Person {neogen_id: 'deed06ec110f950cca9bf04cf8ba2c9404bee6ba' })SET n426 :User -, n426.firstname = 'Nick', n426.lastname = 'Pfeffer', n426.birth_date = '1989-12-09 00:04:46', n426._id = 'db77ac2a-3a45-3320-bfde-cdc649068d34', n426.login = 'kmorar', n426.password = 'b8126ad457589975b2435b67f81a568912dea092', n426.email = 'lkoss@gmail.com'; -MERGE (n427:Person {neogen_id: 'bdb7d363904c5e8fb0d0006a991add284993d04b' })SET n427 :User -, n427.firstname = 'Sam', n427.lastname = 'Jakubowski', n427.birth_date = '1976-01-21 09:19:33', n427._id = '82a3b8f0-ea09-3b3f-bc5c-1871e36478cc', n427.login = 'wisoky.janessa', n427.password = '47a9fe530a8fe31a906d3a6033e9433f4d521af7', n427.email = 'otha24@tillmantreutel.com'; -MERGE (n428:Person {neogen_id: 'ca3758d2fc91f56e8166d084cc869fc1dabff173' })SET n428 :User -, n428.firstname = 'Makenzie', n428.lastname = 'Durgan', n428.birth_date = '1974-10-29 00:09:51', n428._id = '3af238e2-a35e-3d40-9bc4-5e4007c40a5a', n428.login = 'wortiz', n428.password = 'adeae55a3522d430247816828d49c309310b5620', n428.email = 'ellen29@yahoo.com'; -MERGE (n429:Person {neogen_id: 'e5d15cf0ac0b6fdc6482227e7fedaba6a5da4671' })SET n429 :User -, n429.firstname = 'Danny', n429.lastname = 'Auer', n429.birth_date = '1978-07-08 19:49:04', n429._id = '54009a19-d15b-35bb-9b9c-a0e0d5faabbe', n429.login = 'lawrence71', n429.password = 'bb89ba323329c5445143d9ad6b21d97733dcc9ce', n429.email = 'micheal17@yahoo.com'; -MERGE (n430:Person {neogen_id: '78893fd8ae0a297d50ede3737b8dce4784c343f1' })SET n430 :User -, n430.firstname = 'Madelyn', n430.lastname = 'Quitzon', n430.birth_date = '1996-03-18 04:34:33', n430._id = 'd735e35a-da38-30de-bf51-cce6eef85e4e', n430.login = 'karlee.jenkins', n430.password = '61b181aaabd9301cf27941c26279e1b5a9813a8f', n430.email = 'chris60@kassulkeschaden.biz'; -MERGE (n431:Person {neogen_id: '90123be9fcf3616b4bf13c642a87cce7a7323fa5' })SET n431 :User -, n431.firstname = 'Haylee', n431.lastname = 'Turner', n431.birth_date = '1979-02-24 03:41:57', n431._id = '03f1c80d-e1f5-30be-bfa5-71695b77a014', n431.login = 'renner.kendra', n431.password = 'c44fd3b107598f2529b5dd8230d873d45d421596', n431.email = 'tsporer@willms.biz'; -MERGE (n432:Person {neogen_id: '1928c7f46dfdc823aa7a574b9dcbcf9aeb3af586' })SET n432 :User -, n432.firstname = 'Chadrick', n432.lastname = 'Gerlach', n432.birth_date = '1985-12-29 09:41:58', n432._id = '69ce4c22-f98e-3d59-a858-f753605d004d', n432.login = 'lowe.alexandre', n432.password = '53c0e4ac05451e8850cb9c39f111521460f3ef43', n432.email = 'maida57@nolanmedhurst.info'; -MERGE (n433:Person {neogen_id: '94743f633f0e72d795969d6c8d3e697306a6e20c' })SET n433 :User -, n433.firstname = 'Mario', n433.lastname = 'Mante', n433.birth_date = '1982-08-30 04:21:45', n433._id = '0198f54a-adcf-3aa9-adaf-3050aa6bca01', n433.login = 'nsawayn', n433.password = '1a05f0b893ec0ef1dc5a8cb40d3a9311698533a4', n433.email = 'lhaag@breitenberg.com'; -MERGE (n434:Person {neogen_id: 'b41085a8fe31065a3b9a063a2a1e79cab816d74c' })SET n434 :User -, n434.firstname = 'Kay', n434.lastname = 'Doyle', n434.birth_date = '1989-05-13 09:13:22', n434._id = '746888b5-e5fa-3794-b15a-9c727c99502e', n434.login = 'matilda.metz', n434.password = 'f80932f2235032cf26e13814e23d4fd842be90ba', n434.email = 'mitchell.madisen@gmail.com'; -MERGE (n435:Person {neogen_id: '7c149631a99c78b2d277829cce7b9638d58c0d3d' })SET n435 :User -, n435.firstname = 'Torrey', n435.lastname = 'Balistreri', n435.birth_date = '1985-01-22 23:35:07', n435._id = 'c303bc14-7226-35ed-8e34-92816e844a72', n435.login = 'nswaniawski', n435.password = '4b1c6d200736b50628b39c24c6b42221f6a8397b', n435.email = 'grant62@yahoo.com'; -MERGE (n436:Person {neogen_id: '2cd34128bc8f45c13aa14b2678030a1ecc5105d2' })SET n436 :User -, n436.firstname = 'Diana', n436.lastname = 'Hickle', n436.birth_date = '1996-02-18 00:55:35', n436._id = '40b51a92-dab9-3b45-9db4-0e0d29ed35fb', n436.login = 'ila.little', n436.password = '64dfc0fea51d6a36892c38b563917ab48b2c4ff3', n436.email = 'kaitlyn.lynch@rodriguez.com'; -MERGE (n437:Person {neogen_id: '0d0f292a8416024dc33affd15f48691228837fb0' })SET n437 :User -, n437.firstname = 'Francesco', n437.lastname = 'Bailey', n437.birth_date = '1971-02-04 20:20:21', n437._id = 'c01c4022-f3df-35c5-840f-b582f8869d54', n437.login = 'bkilback', n437.password = '1db6fd20b36d2b6298093b713bcbf2c258ee1fe4', n437.email = 'fwalker@hotmail.com'; -MERGE (n438:Person {neogen_id: 'b04e481e49e823867884332b898b6afb79fa21ab' })SET n438 :User -, n438.firstname = 'Lilla', n438.lastname = 'Parisian', n438.birth_date = '1990-01-26 03:53:36', n438._id = '922cd0c7-aadb-3348-99e8-2a674e13d809', n438.login = 'jschultz', n438.password = '8fbb2ff44026ed62b0a6de0ed2f51dccfeede763', n438.email = 'spencer52@gmail.com'; -MERGE (n439:Person {neogen_id: 'bc7920f2447437dc59251694831410a675d22c69' })SET n439 :User -, n439.firstname = 'Shawn', n439.lastname = 'Renner', n439.birth_date = '1969-10-19 03:44:26', n439._id = '5bfa9993-9f1c-39d7-a779-34ed32de8b82', n439.login = 'vemard', n439.password = '209fc99d27279ccb6ad2ce1baf7b494695ed50e1', n439.email = 'emard.wilhelm@gmail.com'; -MERGE (n440:Person {neogen_id: '3fd54241fdd97a521b0eca3afea64eb7d3891b67' })SET n440 :User -, n440.firstname = 'Christophe', n440.lastname = 'Cruickshank', n440.birth_date = '1995-07-06 20:37:05', n440._id = 'f33cb514-2b9c-32ae-ace0-68b801de2e03', n440.login = 'hilpert.noah', n440.password = '49637e17dfa918fba8de2fedf3932dfa77b8b2de', n440.email = 'bridgette88@sauerblick.info'; -MERGE (n441:Person {neogen_id: '90be776b3a1d2b20e7d7fe51d9a0b620e96d0679' })SET n441 :User -, n441.firstname = 'Ryann', n441.lastname = 'Ritchie', n441.birth_date = '1968-09-04 22:53:21', n441._id = '0002ea26-6756-3939-a009-1c40abd90f4d', n441.login = 'marty00', n441.password = 'a7849f86f8de4ab855c324e3281b449fd310b36b', n441.email = 'zheathcote@schusterstroman.com'; -MERGE (n442:Person {neogen_id: 'd636c68e10a8fde8b3af4a9f6f951563b6a866d8' })SET n442 :User -, n442.firstname = 'Felicity', n442.lastname = 'Swift', n442.birth_date = '1980-11-08 21:30:11', n442._id = 'ee23daf9-951b-35d1-b656-b2ded88a13b0', n442.login = 'marisol48', n442.password = 'aa624e22b14c93d74ab1cd3366ae769d9765dc79', n442.email = 'emely59@gmail.com'; -MERGE (n443:Person {neogen_id: 'efe96dadd4d6d12651ffc04fa21fbd5becb52e3f' })SET n443 :User -, n443.firstname = 'Jedediah', n443.lastname = 'Olson', n443.birth_date = '1971-10-23 20:54:33', n443._id = '367628bc-9bb4-3210-bfab-2b12b24b5a1b', n443.login = 'dario.schneider', n443.password = '4b6de651b0caf98f3dd1114d9828786e726bdce7', n443.email = 'turner.neva@kingluettgen.org'; -MERGE (n444:Person {neogen_id: '9646977127602bce49467f9f19e7b6019848b95e' })SET n444 :User -, n444.firstname = 'Estevan', n444.lastname = 'Wolff', n444.birth_date = '1978-06-21 21:57:35', n444._id = 'c88da2cf-fb37-398c-861f-c6d65d317b5f', n444.login = 'eokuneva', n444.password = '5f72e73041548284fbb3de8d74c26db8f12727c2', n444.email = 'frankie96@schuster.org'; -MERGE (n445:Person {neogen_id: '737451f7e58a27f85d26e87a1ae2dd45cfa1078a' })SET n445 :User -, n445.firstname = 'Braden', n445.lastname = 'Nitzsche', n445.birth_date = '1969-04-12 05:32:14', n445._id = 'acdfcaa8-0909-3ddd-8701-bd7fb6d570fd', n445.login = 'jerod81', n445.password = '8439903956b9c3236be36ec7c78c2b09bca5f823', n445.email = 'efren56@walterbeer.com'; -MERGE (n446:Person {neogen_id: '48bd300ef7a0827c9349f3ab0606222b8dfcb3b9' })SET n446 :User -, n446.firstname = 'Renee', n446.lastname = 'Spinka', n446.birth_date = '1982-04-23 13:28:25', n446._id = '1ecc056b-5d46-3f8a-9cdd-cdd3a52de7fc', n446.login = 'phyllis58', n446.password = '62acd659f03b2e2fbfcff31b55daef82916e86c0', n446.email = 'laurel08@hotmail.com'; -MERGE (n447:Person {neogen_id: 'b900010c54fe4ab260b6db355089da641823d604' })SET n447 :User -, n447.firstname = 'Katlyn', n447.lastname = 'Feeney', n447.birth_date = '1970-07-28 21:43:05', n447._id = '3ff2d4f3-dd55-31e0-a5d5-cc07577d320d', n447.login = 'dfriesen', n447.password = '90dcd86db1fdc154aa2d4034d22af63dbfa6db3e', n447.email = 'ohand@hotmail.com'; -MERGE (n448:Person {neogen_id: '7d1e838db3cb4fc00b25b1dd3923fb74399edc7f' })SET n448 :User -, n448.firstname = 'Myrtie', n448.lastname = 'West', n448.birth_date = '1993-11-02 17:58:42', n448._id = '1f1026c4-46fb-3fd8-ba96-c81fc0d473dd', n448.login = 'delores54', n448.password = '4352545ed9e599157a20997d500f5a68e99b7315', n448.email = 'marietta.langworth@lockmanlueilwitz.biz'; -MERGE (n449:Person {neogen_id: '88b59c106d06372b6d32f146a17a6c25ec1724e5' })SET n449 :User -, n449.firstname = 'Everette', n449.lastname = 'Beahan', n449.birth_date = '1965-05-26 21:48:00', n449._id = '16b9ac47-2c40-39e2-adb3-830dfeef2e91', n449.login = 'nikko.kessler', n449.password = '764694d641c459b27f6585cf0575c322d6fed641', n449.email = 'joshua.kuphal@mcglynnrau.net'; -MERGE (n450:Person {neogen_id: 'a5d4783bf3c1f29cc2542f4ce9c65ba7d46080a8' })SET n450 :User -, n450.firstname = 'Dejon', n450.lastname = 'Pfeffer', n450.birth_date = '1966-09-25 19:01:17', n450._id = '6fe0864e-07bc-37d2-bdf3-45dfc6fcd023', n450.login = 'stuart55', n450.password = 'a1e03dbeaae02606e2cf33e2a91e75d67a10671c', n450.email = 'marguerite.d\'amore@mrazfriesen.net'; -MERGE (n451:Person {neogen_id: '598f8ae22aa784ba771102ebcdf35d972be7a289' })SET n451 :User -, n451.firstname = 'Lexus', n451.lastname = 'Pouros', n451.birth_date = '1972-07-20 13:55:52', n451._id = '312214d6-f538-3962-bd4c-136d9c811114', n451.login = 'zboncak.rachel', n451.password = '4b6149f690be7b1676fe968bb2805ae1b80f77b5', n451.email = 'art47@yahoo.com'; -MERGE (n452:Person {neogen_id: '35338e65a0e2f93fd6fe357409bf36eeee9c5a25' })SET n452 :User -, n452.firstname = 'Tad', n452.lastname = 'Kling', n452.birth_date = '1993-09-10 08:18:50', n452._id = 'e3482bfd-4927-3ca8-8e7b-58a18a1809e1', n452.login = 'penelope19', n452.password = 'bb313e93fb4f4a861d5db2e8415fd27f697a4298', n452.email = 'purdy.colleen@gmail.com'; -MERGE (n453:Person {neogen_id: 'edd6b7779e52f29c0ca768738c08f0c6897560d5' })SET n453 :User -, n453.firstname = 'Reece', n453.lastname = 'Erdman', n453.birth_date = '1966-11-13 07:20:54', n453._id = '01776c8f-4f3e-3b83-9fdc-bcffe705e6a2', n453.login = 'khuels', n453.password = '2cc772e1676fe2549a0b9d9994401d82aca4d43b', n453.email = 'fklocko@upton.com'; -MERGE (n454:Person {neogen_id: 'e270b161ab369c0ce328c08b27c0004f4d83170d' })SET n454 :User -, n454.firstname = 'Dorcas', n454.lastname = 'Stehr', n454.birth_date = '1984-10-09 21:53:22', n454._id = '143419cb-a3ed-321e-b762-d204b027e490', n454.login = 'micah.hansen', n454.password = '4972c015b440582ebf46695cac91b30542245df7', n454.email = 'blanda.candida@aufderharkiehn.com'; -MERGE (n455:Person {neogen_id: '98d629817a3eff1be85b2311275a6ab0ea8e04db' })SET n455 :User -, n455.firstname = 'Kellen', n455.lastname = 'Greenholt', n455.birth_date = '1969-05-09 05:26:35', n455._id = 'fb3b850e-a083-3f8a-9c7e-1b37e0043e83', n455.login = 'sfeest', n455.password = '7d5aaf51c63d6805d723b22db822047d7d6a5a39', n455.email = 'forest71@dubuquekessler.biz'; -MERGE (n456:Person {neogen_id: '755ff38c2091e35286dc0d0b2d951830769eab99' })SET n456 :User -, n456.firstname = 'Genevieve', n456.lastname = 'Grimes', n456.birth_date = '1980-11-10 16:38:05', n456._id = '218d885a-65ec-361d-beb7-b2fae5f0d453', n456.login = 'price.helena', n456.password = 'aaf266c55e20dc9dd5e1bd6a6f6a364d9599aefe', n456.email = 'zfarrell@rowemurazik.com'; -MERGE (n457:Person {neogen_id: '8a6ce3df78cb29f56d68e64e07e8a3bb9561d0c6' })SET n457 :User -, n457.firstname = 'Griffin', n457.lastname = 'Hills', n457.birth_date = '1966-02-17 06:13:13', n457._id = 'f66b5638-b59d-3a78-a20e-94f24c2f885f', n457.login = 'deckow.amelie', n457.password = 'a7758b9b41b26e5e7eb6675d66455c80a28c2f0e', n457.email = 'bailey.taya@mante.net'; -MERGE (n458:Person {neogen_id: '135678699b50eb1f1a1150e6854b538cfbe66d77' })SET n458 :User -, n458.firstname = 'Abby', n458.lastname = 'Bartell', n458.birth_date = '1970-04-25 19:20:10', n458._id = 'aca0dc91-ae9f-3e49-bd15-0f539d31b418', n458.login = 'jeff30', n458.password = '6b60f75b55c5f0706d6f1428588ecfeb88691991', n458.email = 'carley63@hotmail.com'; -MERGE (n459:Person {neogen_id: '66b59cc067f1bce3dbed0bfd0266e4f423edab11' })SET n459 :User -, n459.firstname = 'Eloise', n459.lastname = 'Koch', n459.birth_date = '1967-05-14 22:58:00', n459._id = '15d19c81-347a-3c8b-b64c-8d238210519f', n459.login = 'lbayer', n459.password = '6f7ef2276782ef9deca0e74c8faf2598eddbddca', n459.email = 'jacobs.foster@yahoo.com'; -MERGE (n460:Person {neogen_id: 'bde16cf828d410de0f1033085b41e5e5c7bee207' })SET n460 :User -, n460.firstname = 'Dena', n460.lastname = 'Pouros', n460.birth_date = '1979-02-23 03:22:38', n460._id = '0913cb78-69ac-33e7-bc9d-e84845f5239d', n460.login = 'uchamplin', n460.password = 'd38d496c85d57b366b8b1e64e0528e0297b6ff1e', n460.email = 'zgottlieb@king.info'; -MERGE (n461:Person {neogen_id: '5d9eaf7f6199e04bb0d69d6484c46fd402520f08' })SET n461 :User -, n461.firstname = 'Francesco', n461.lastname = 'Kuvalis', n461.birth_date = '1968-10-06 08:34:09', n461._id = '0d11fc8b-50c7-3978-be5d-289916305a79', n461.login = 'mitchell.maribel', n461.password = 'be957d6b534293da0cc48f7155b4d118b1d47677', n461.email = 'emelia31@yahoo.com'; -MERGE (n462:Person {neogen_id: '289d49441213ebdbcfc86fbae3e358d3c11df6db' })SET n462 :User -, n462.firstname = 'Maude', n462.lastname = 'Franecki', n462.birth_date = '1991-02-10 23:01:00', n462._id = 'fdef1327-b684-384a-b399-a88a370f5e5e', n462.login = 'jaquan.nader', n462.password = 'c398270f26dc34a2cb7514c30db547a27d2286dc', n462.email = 'ckuvalis@gmail.com'; -MERGE (n463:Person {neogen_id: '7293acccafd37e5de3714284be7bf81404ea7162' })SET n463 :User -, n463.firstname = 'Fausto', n463.lastname = 'Hoppe', n463.birth_date = '1978-08-22 22:39:04', n463._id = 'eceb791b-da2f-38e1-aa64-1ccbb31d8d3a', n463.login = 'verona.bauch', n463.password = '2ed8fb656dab765ac67a52a643044732c7d5d636', n463.email = 'kaleigh.heller@gmail.com'; -MERGE (n464:Person {neogen_id: 'b4a5ea2f55354c7b745148e9c3b154baa93216ab' })SET n464 :User -, n464.firstname = 'Sandra', n464.lastname = 'Crona', n464.birth_date = '1967-01-21 03:26:49', n464._id = 'e0917c74-52d5-32c9-89fa-80c6504aa70c', n464.login = 'berry.murray', n464.password = '2f34436d3abf96868f3a97118d2aaef2a4acce3e', n464.email = 'vwitting@crooks.com'; -MERGE (n465:Person {neogen_id: '4aafc48f629d5ce9682792ab6d27898c61d9e978' })SET n465 :User -, n465.firstname = 'Penelope', n465.lastname = 'Kuhic', n465.birth_date = '1985-09-24 19:11:53', n465._id = '484c8064-d194-3551-8203-4d599ee8665f', n465.login = 'tia.purdy', n465.password = 'a938beda1a4edb4b66cd88bf588cedfb8fb2bc11', n465.email = 'bette80@schamberger.com'; -MERGE (n466:Person {neogen_id: '9b227241edd1d7ae65e96e41a9de7d285ef100eb' })SET n466 :User -, n466.firstname = 'Joannie', n466.lastname = 'Schmeler', n466.birth_date = '1982-02-23 07:48:19', n466._id = 'c84cce11-be5e-399b-a652-20b74830e917', n466.login = 'price.felicity', n466.password = '4832411a9257895aebda01fd9efc2a5ac05f9419', n466.email = 'brenden40@williamson.com'; -MERGE (n467:Person {neogen_id: 'a38d9cb5250b6e4c2c52dc57e9da3172210140b7' })SET n467 :User -, n467.firstname = 'Mariam', n467.lastname = 'Kris', n467.birth_date = '1994-05-18 20:46:42', n467._id = 'bb561716-c9df-39bc-b6c3-830d79f032f2', n467.login = 'bfeeney', n467.password = 'f9cd4140cfd7078b05aecb43a27d60e513e5302b', n467.email = 'kristy.herzog@gutkowskimitchell.com'; -MERGE (n468:Person {neogen_id: '38b7b8ff76f693a208708f080c8bc820c023088e' })SET n468 :User -, n468.firstname = 'Jakob', n468.lastname = 'Kunde', n468.birth_date = '1977-03-27 00:01:22', n468._id = '6567715a-ceac-3014-837b-157ac21f4304', n468.login = 'darren.harvey', n468.password = '45ad3ce47465d9c76f59918cb99f5ef633099d46', n468.email = 'strosin.jameson@grimesgleichner.net'; -MERGE (n469:Person {neogen_id: '462780aa8040e5662090d8dc1bbf4a651ed3d3aa' })SET n469 :User -, n469.firstname = 'Jacklyn', n469.lastname = 'Tromp', n469.birth_date = '1992-06-14 13:05:38', n469._id = '98bbb8d7-6b70-3cb4-b63a-967e9d483e27', n469.login = 'ojakubowski', n469.password = '054ed103afc401a0f6b1e737002cc1fa72445768', n469.email = 'ferry.alfredo@yahoo.com'; -MERGE (n470:Person {neogen_id: '84c8761b30c46bab8d079677235ad7e1e442af16' })SET n470 :User -, n470.firstname = 'Rylan', n470.lastname = 'Eichmann', n470.birth_date = '1990-09-23 01:30:30', n470._id = '7b4951e2-aa7f-3229-88c7-e29468e623e7', n470.login = 'dickens.pierre', n470.password = '7f765deea7c81433cadb93f1821fd75781af3aee', n470.email = 'jarrod.lueilwitz@yahoo.com'; -MERGE (n471:Person {neogen_id: 'd059dd6742b4e5bc28fc04c52905efd28531fbdb' })SET n471 :User -, n471.firstname = 'Deven', n471.lastname = 'Stoltenberg', n471.birth_date = '1984-11-18 19:11:49', n471._id = 'a578f9b4-6569-3e53-9ae8-ade09973e838', n471.login = 'hillary.davis', n471.password = '309c21ab73fabb7cfad370a415e523be5de9eae7', n471.email = 'fhackett@gmail.com'; -MERGE (n472:Person {neogen_id: '7c8c3f901283fb0f5d0bb615303c6ccef7380b10' })SET n472 :User -, n472.firstname = 'Joe', n472.lastname = 'Cassin', n472.birth_date = '1993-04-09 10:23:56', n472._id = 'c1019417-376c-3fab-a5ce-9ff1856aac32', n472.login = 'christine75', n472.password = '8ff27806e998e24f65db0a4f90c05c7cb350362f', n472.email = 'tyrique21@wunsch.com'; -MERGE (n473:Person {neogen_id: '621bf910d48350af18f8ffb1d9b76fcbfa092de3' })SET n473 :User -, n473.firstname = 'Noemy', n473.lastname = 'Denesik', n473.birth_date = '1994-02-17 07:31:16', n473._id = 'b80e463d-1289-39ee-bebf-cdd73690fb4c', n473.login = 'eturner', n473.password = '1b21db2d096e1ae55542d5a2574b81afe9e27f65', n473.email = 'champlin.brigitte@hotmail.com'; -MERGE (n474:Person {neogen_id: '2ec276d0de625ed48ce25c6255af7964e2a1a0b9' })SET n474 :User -, n474.firstname = 'Vaughn', n474.lastname = 'Olson', n474.birth_date = '1976-05-15 15:07:47', n474._id = '92b39ba6-a178-347a-9d1c-485b2b1ff5a9', n474.login = 'lamar73', n474.password = '721843a5825852976d4423f9d85fae9500c44ace', n474.email = 'reginald.kuvalis@hotmail.com'; -MERGE (n475:Person {neogen_id: '5c4284d430cc6b94ecdb0000e78b0a77435ca129' })SET n475 :User -, n475.firstname = 'Rylee', n475.lastname = 'Morissette', n475.birth_date = '1995-08-29 05:54:28', n475._id = '13309d3f-06e8-3b8d-8c39-e1a42339bb63', n475.login = 'effertz.bernardo', n475.password = 'f5d2649466ecf9bb7da0556af1f4497d932d79b5', n475.email = 'ireilly@baileytromp.net'; -MERGE (n476:Person {neogen_id: '37abdd4b536218ca6a1fd8179df50be93f76599d' })SET n476 :User -, n476.firstname = 'Albert', n476.lastname = 'Yost', n476.birth_date = '1992-12-10 17:18:09', n476._id = 'aeb2e6a3-44e0-3fa1-a600-3b5d3ca1b8cc', n476.login = 'rprohaska', n476.password = '0799da7ff4a28247d02111a57a5d7003c23e6bd3', n476.email = 'carol89@yahoo.com'; -MERGE (n477:Person {neogen_id: 'eb3fbc364b0e4b46e58a9a1ef294fac8116aef97' })SET n477 :User -, n477.firstname = 'Hal', n477.lastname = 'Batz', n477.birth_date = '1981-12-17 09:56:36', n477._id = 'd280e3f6-2425-3d05-8d6f-25fda952f2a8', n477.login = 'guiseppe84', n477.password = '81ec9af46c3e6705debeaf328dbb57783b8a16de', n477.email = 'belle67@hotmail.com'; -MERGE (n478:Person {neogen_id: 'd00cf3ed3ab7a11ae281dc60f5a81bf8707e1bfe' })SET n478 :User -, n478.firstname = 'Antwon', n478.lastname = 'Koss', n478.birth_date = '1996-06-01 03:27:08', n478._id = '98a26140-920d-3eaf-a956-9da0755802ec', n478.login = 'marques.schmeler', n478.password = '7dbb2363b91b463b48038d8487f55cf85bff4128', n478.email = 'zlittel@waelchi.com'; -MERGE (n479:Person {neogen_id: '206d70467d89239e415a4c019ebd2f1f6d9507bc' })SET n479 :User -, n479.firstname = 'Karine', n479.lastname = 'Lueilwitz', n479.birth_date = '1972-10-14 01:56:48', n479._id = 'e4c899b0-9e6a-3d28-a7ec-ce295db4983f', n479.login = 'aniya.lehner', n479.password = '2d1fbbed374d8eddafe7318b497223ed5f8a11a8', n479.email = 'alessia.quitzon@gmail.com'; -MERGE (n480:Person {neogen_id: '2099c6b5bd32201e018d2740a003a6b61d6c339b' })SET n480 :User -, n480.firstname = 'Henriette', n480.lastname = 'Herzog', n480.birth_date = '1976-12-13 17:17:28', n480._id = 'fded0f8b-c269-3674-9e2c-b0a590705d38', n480.login = 'lera58', n480.password = 'f6865320fa610e3eaea52c63118f65252c1ec918', n480.email = 'jaleel34@gerholdweimann.org'; -MERGE (n481:Person {neogen_id: '044e36625d26f85c9929f770cfba538e104e9cbc' })SET n481 :User -, n481.firstname = 'Maybelle', n481.lastname = 'Mueller', n481.birth_date = '1987-02-21 14:56:53', n481._id = '319413ff-414e-3fab-ae52-064f1eaae6b9', n481.login = 'nosinski', n481.password = '27a517600bca8bac4f79d342b191a008b24fb618', n481.email = 'o\'keefe.jermain@hotmail.com'; -MERGE (n482:Person {neogen_id: '45b456af2240ac583a6fc54c77228f7389b42882' })SET n482 :User -, n482.firstname = 'Burley', n482.lastname = 'McKenzie', n482.birth_date = '1995-08-25 04:53:54', n482._id = '28354d8e-2df8-3e72-963e-8c99fdb9cb9b', n482.login = 'helene04', n482.password = '09a2bf611ab8ebf4a63ce937d9f7af6c53509dc6', n482.email = 'aufderhar.callie@roob.net'; -MERGE (n483:Person {neogen_id: 'b28e31d92e9b0cb2335845b51d0851e7a8211fcf' })SET n483 :User -, n483.firstname = 'Lloyd', n483.lastname = 'O\'Keefe', n483.birth_date = '1972-06-03 02:27:19', n483._id = '3d644bfa-5cac-3be5-9a95-20ca03b420cd', n483.login = 'swift.dina', n483.password = '72aa9810d4125d5a6bdd2177017382a5c0792c1b', n483.email = 'rocky.maggio@hotmail.com'; -MERGE (n484:Person {neogen_id: '8b98c18173526ee53470c0241d052fbace55d5fa' })SET n484 :User -, n484.firstname = 'Jessie', n484.lastname = 'Monahan', n484.birth_date = '1968-08-17 03:41:07', n484._id = '504dd818-b1dd-3d3f-8d48-71f685c31846', n484.login = 'audreanne.berge', n484.password = '6049a5137cc89a1c8f3bba20791fb5748b02bf54', n484.email = 'ricky.gerlach@jast.com'; -MERGE (n485:Person {neogen_id: '51b31360ee9077a3a37c6264e64640778bc6df15' })SET n485 :User -, n485.firstname = 'Bernie', n485.lastname = 'Klein', n485.birth_date = '1983-07-24 00:28:45', n485._id = '3db7f107-eb9b-3f06-9ae9-97725759b09b', n485.login = 'kemmer.darby', n485.password = 'b1e99c4438ca15cc3ba8df188a1c831b0666fe66', n485.email = 'zlangosh@krajcikconnelly.com'; -MERGE (n486:Person {neogen_id: '81c83e2e25697251b8f46ccd2a01adf65df6928a' })SET n486 :User -, n486.firstname = 'Chet', n486.lastname = 'Goyette', n486.birth_date = '1989-09-09 19:45:08', n486._id = 'e5639a00-dda8-3e38-b8c8-57deddae0922', n486.login = 'marisa87', n486.password = '41eba4b77881cdce8de098cd64258d12081addd4', n486.email = 'skreiger@jast.com'; -MERGE (n487:Person {neogen_id: '7f2eb2d3957725a9ae0a74534c462e454c41e67c' })SET n487 :User -, n487.firstname = 'Harvey', n487.lastname = 'Schroeder', n487.birth_date = '1966-05-08 04:43:07', n487._id = 'a2003e82-dbef-3a95-97c8-ffc79c5da835', n487.login = 'kirstin.jenkins', n487.password = '4d9c629111f3c715c846ba85c3d96b897dbe2646', n487.email = 'prohaska.audrey@schultz.com'; -MERGE (n488:Person {neogen_id: '1085bb5eb0592813930a4c8fd6ef7bab81e986ab' })SET n488 :User -, n488.firstname = 'Nicole', n488.lastname = 'Quitzon', n488.birth_date = '1976-06-15 20:41:05', n488._id = 'bbe62331-916f-3624-b99e-183d21680075', n488.login = 'greynolds', n488.password = '04d456c300439d269ed3c464a430c0de31f41f06', n488.email = 'weber.deron@hotmail.com'; -MERGE (n489:Person {neogen_id: '13cd52385b6df569996d6dfaa9ade0f38b89b384' })SET n489 :User -, n489.firstname = 'Antonetta', n489.lastname = 'Halvorson', n489.birth_date = '1982-05-21 22:56:01', n489._id = 'c6b963df-cf7e-339e-9d8a-11c48aa321f5', n489.login = 'rafael.becker', n489.password = 'f2b40e4fca853a415d73999e1b52439a858651e2', n489.email = 'owalker@hotmail.com'; -MERGE (n490:Person {neogen_id: '4468f44f7da8e225fdcee06465c30d790a8370df' })SET n490 :User -, n490.firstname = 'Reynold', n490.lastname = 'Grant', n490.birth_date = '1996-07-18 14:22:07', n490._id = '4d2f69ea-11d4-3dfa-b327-05588aaf824c', n490.login = 'jacobson.marquise', n490.password = '668a04d58c879f526556effd4e82692d29649d65', n490.email = 'colten93@sawayn.com'; -MERGE (n491:Person {neogen_id: '9fd366c333892819d6e93476adea31ab94666f57' })SET n491 :User -, n491.firstname = 'Webster', n491.lastname = 'Mayert', n491.birth_date = '1968-03-02 10:21:25', n491._id = '59ae826e-efda-350f-88ec-783e57d01e95', n491.login = 'fdibbert', n491.password = '0a5261979423e1037e33126e4f1acffb38c4ca5d', n491.email = 'raoul46@hotmail.com'; -MERGE (n492:Person {neogen_id: '924c558afbd1d73882e229349770ecb5fceb5608' })SET n492 :User -, n492.firstname = 'Armand', n492.lastname = 'Labadie', n492.birth_date = '1966-01-05 12:53:48', n492._id = '2ae5cb94-8ce9-3234-95a4-6a6af015810f', n492.login = 'turner.dach', n492.password = 'e5824eb2322332edac58a53a529b2a4788479e3f', n492.email = 'lamar62@gmail.com'; -MERGE (n493:Person {neogen_id: '8d72d8327fa46c27461b755e91ed7dc76c6e7ffd' })SET n493 :User -, n493.firstname = 'Cristobal', n493.lastname = 'Paucek', n493.birth_date = '1983-03-08 13:49:01', n493._id = '4aa3c728-cdf1-3c12-8b17-8c3eae546cc5', n493.login = 'stark.alejandrin', n493.password = '160c873630e8303ae581583fc03366f6c8e18b9f', n493.email = 'stroman.august@hotmail.com'; -MERGE (n494:Person {neogen_id: '2d77c61853e8db14f66b1d2ef18da3d267b41cd0' })SET n494 :User -, n494.firstname = 'Alexa', n494.lastname = 'Schmidt', n494.birth_date = '1978-01-18 11:44:26', n494._id = 'ae2121b6-40c6-3df2-890c-f05798f19db3', n494.login = 'shana05', n494.password = 'edf937b66d93b5f6933ffc4a58cdf2af9e6af116', n494.email = 'bergstrom.brook@kohler.com'; -MERGE (n495:Person {neogen_id: '99174ef47a4808802310dfef5e6f5ad1fd89f60c' })SET n495 :User -, n495.firstname = 'Elliott', n495.lastname = 'Streich', n495.birth_date = '1974-06-16 03:18:46', n495._id = 'c71015fd-6918-31e1-ab73-9fd6a12a14c5', n495.login = 'otto.wilkinson', n495.password = '04c05eb455a101e35256f41da93d285d268512f9', n495.email = 'bradley98@nikolaus.biz'; -MERGE (n496:Person {neogen_id: '2ad8503b2e84524c949d260359637dfe6213fe29' })SET n496 :User -, n496.firstname = 'Flavio', n496.lastname = 'Ferry', n496.birth_date = '1983-12-28 01:43:01', n496._id = '7b5c0d67-6151-3dee-ba4b-d77563b02c64', n496.login = 'lryan', n496.password = '390e0015136be66531e30f9d59f8ac2bda4c5111', n496.email = 'uemmerich@borer.org'; -MERGE (n497:Person {neogen_id: 'e08a313b38bcd75b4cd32a4b1bcc12bd460c70fb' })SET n497 :User -, n497.firstname = 'Angelita', n497.lastname = 'Weber', n497.birth_date = '1992-10-09 17:57:45', n497._id = '8c235fb1-3cad-3313-ab23-c1a5001ab12b', n497.login = 'hilpert.hilda', n497.password = '8df6e2d1da3e5cb934e524e8323219a127373f35', n497.email = 'kara09@pagac.com'; -MERGE (n498:Person {neogen_id: 'dc7e6bd296183ddb33e2ce04bb9d28616d44e030' })SET n498 :User -, n498.firstname = 'Jaydon', n498.lastname = 'Hammes', n498.birth_date = '1990-03-28 08:26:15', n498._id = '45d210a6-bdd0-3123-9eda-d2d6a68469c7', n498.login = 'kemmerich', n498.password = '21e2c4a8b8fecc5819ad0b9923faa5ed4263a48f', n498.email = 'romaguera.shany@osinski.com'; -MERGE (n499:Person {neogen_id: 'baea8be532e935b470ce0710d731ff38b32eb248' })SET n499 :User -, n499.firstname = 'Jeanie', n499.lastname = 'Hintz', n499.birth_date = '1971-08-19 15:33:49', n499._id = 'f055f894-5377-3a6f-81c3-994fc6631984', n499.login = 'wilford.deckow', n499.password = 'ed610af85e8e778a1c43d2e51cfbdffa719954de', n499.email = 'ottilie40@mitchell.com'; -MERGE (n500:Person {neogen_id: 'be0e2d786c6bbad21bff0c6e800f568c24559d92' })SET n500 :User -, n500.firstname = 'Dave', n500.lastname = 'Wunsch', n500.birth_date = '1990-06-03 00:34:10', n500._id = '3022b757-dd5f-3f82-9558-00d8223cbabb', n500.login = 'kuhlman.claudia', n500.password = 'bd5ace07e8c86f8b526b66e883c09dceeb7fa086', n500.email = 'runolfsdottir.rebeca@halvorson.com'; -MERGE (n501:Company {neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693' }) -SET n501.name = 'Schmidt, Kshlerin and Maggio', n501.activity = 'Cloned directional model'; -MERGE (n502:Company {neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513' }) -SET n502.name = 'Reynolds Inc', n502.activity = 'Distributed regional artificialintelligence'; -MERGE (n503:Company {neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e' }) -SET n503.name = 'Hansen-Botsford', n503.activity = 'Inverse composite standardization'; -MERGE (n504:Company {neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e' }) -SET n504.name = 'Larson, Schuppe and Stehr', n504.activity = 'Triple-buffered bottom-line methodology'; -MERGE (n505:Company {neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97' }) -SET n505.name = 'Buckridge-Kunze', n505.activity = 'Open-architected dedicated flexibility'; -MERGE (n506:Company {neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde' }) -SET n506.name = 'Gorczany Ltd', n506.activity = 'Reduced value-added hierarchy'; -MERGE (n507:Company {neogen_id: '13bb846033cf7d656e58cabc22e6d23b7ea994d5' }) -SET n507.name = 'Hayes-Lebsack', n507.activity = 'Advanced interactive knowledgeuser'; -MERGE (n508:Company {neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9' }) -SET n508.name = 'Fritsch-Kuhic', n508.activity = 'Realigned full-range knowledgebase'; -MERGE (n509:Company {neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd' }) -SET n509.name = 'Beahan LLC', n509.activity = 'Triple-buffered even-keeled groupware'; -MERGE (n510:Company {neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245' }) -SET n510.name = 'Little LLC', n510.activity = 'Reduced needs-based adapter'; -MERGE (n511:Company {neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32' }) -SET n511.name = 'Corwin, Schaefer and Effertz', n511.activity = 'Managed static intranet'; -MERGE (n512:Company {neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361' }) -SET n512.name = 'Nitzsche, Robel and Mante', n512.activity = 'Public-key hybrid matrices'; -MERGE (n513:Company {neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c' }) -SET n513.name = 'Rau, Hartmann and Kihn', n513.activity = 'Adaptive national migration'; -MERGE (n514:Company {neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19' }) -SET n514.name = 'Russel Ltd', n514.activity = 'Stand-alone heuristic orchestration'; -MERGE (n515:Company {neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1' }) -SET n515.name = 'Bahringer Ltd', n515.activity = 'Re-engineered holistic intranet'; -MERGE (n516:Company {neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da' }) -SET n516.name = 'Lubowitz, Hermann and Reichert', n516.activity = 'Cross-group transitional focusgroup'; -MERGE (n517:Company {neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da' }) -SET n517.name = 'Muller and Sons', n517.activity = 'Progressive methodical infrastructure'; -MERGE (n518:Company {neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357' }) -SET n518.name = 'Lebsack Group', n518.activity = 'Seamless radical functionalities'; -MERGE (n519:Company {neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751' }) -SET n519.name = 'Runte-Schmeler', n519.activity = 'Polarised fault-tolerant firmware'; -MERGE (n520:Company {neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12' }) -SET n520.name = 'Koepp-Fisher', n520.activity = 'Cross-group national localareanetwork'; -MERGE (n521:Company {neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281' }) -SET n521.name = 'Jones-Romaguera', n521.activity = 'Grass-roots needs-based definition'; -MERGE (n522:Company {neogen_id: 'f5017914486a5459729846842847ff40708e7948' }) -SET n522.name = 'Weissnat-Kertzmann', n522.activity = 'Right-sized nextgeneration firmware'; -MERGE (n523:Company {neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb' }) -SET n523.name = 'Heaney Ltd', n523.activity = 'Balanced interactive synergy'; -MERGE (n524:Company {neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3' }) -SET n524.name = 'Walsh Group', n524.activity = 'Robust motivating focusgroup'; -MERGE (n525:Company {neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570' }) -SET n525.name = 'Kuhn, Hartmann and Carter', n525.activity = 'Fully-configurable coherent firmware'; -MERGE (n526:Company {neogen_id: '659ce23acfa8bd130afbde4202194903211b3637' }) -SET n526.name = 'Watsica, Connelly and Farrell', n526.activity = 'Intuitive multi-state systemengine'; -MERGE (n527:Company {neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d' }) -SET n527.name = 'Donnelly-Beer', n527.activity = 'Mandatory reciprocal customerloyalty'; -MERGE (n528:Company {neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a' }) -SET n528.name = 'Littel-Heaney', n528.activity = 'Grass-roots high-level methodology'; -MERGE (n529:Company {neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3' }) -SET n529.name = 'O\'Connell, Herzog and Marquardt', n529.activity = 'Inverse bifurcated utilisation'; -MERGE (n530:Company {neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7' }) -SET n530.name = 'Feest and Sons', n530.activity = 'Future-proofed system-worthy opensystem'; -MERGE (n531:Company {neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f' }) -SET n531.name = 'Weissnat, Kautzer and Emmerich', n531.activity = 'Virtual scalable initiative'; -MERGE (n532:Company {neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf' }) -SET n532.name = 'Lueilwitz, Swaniawski and Kshlerin', n532.activity = 'Implemented intangible initiative'; -MERGE (n533:Company {neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36' }) -SET n533.name = 'Jones Ltd', n533.activity = 'Persevering analyzing data-warehouse'; -MERGE (n534:Company {neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212' }) -SET n534.name = 'Blanda, Conn and Feest', n534.activity = 'Monitored zeroadministration budgetarymanagement'; -MERGE (n535:Company {neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf' }) -SET n535.name = 'Grady, Thiel and McDermott', n535.activity = 'Organic intermediate securedline'; -MERGE (n536:Company {neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038' }) -SET n536.name = 'Grady, Rau and Jaskolski', n536.activity = 'Integrated asynchronous infrastructure'; -MERGE (n537:Company {neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50' }) -SET n537.name = 'Crooks-Shields', n537.activity = 'Robust 4thgeneration data-warehouse'; -MERGE (n538:Company {neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6' }) -SET n538.name = 'Muller-Sanford', n538.activity = 'Quality-focused zerotolerance alliance'; -MERGE (n539:Company {neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30' }) -SET n539.name = 'Kunze LLC', n539.activity = 'Automated discrete hub'; -MERGE (n540:Company {neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3' }) -SET n540.name = 'Jacobi, Barton and Haag', n540.activity = 'Multi-lateral multi-tasking infrastructure'; -MERGE (n541:Company {neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc' }) -SET n541.name = 'Daniel, Wisozk and Hilll', n541.activity = 'Upgradable zeroadministration matrix'; -MERGE (n542:Company {neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4' }) -SET n542.name = 'Stokes, McKenzie and Yost', n542.activity = 'De-engineered encompassing alliance'; -MERGE (n543:Company {neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f' }) -SET n543.name = 'Bergstrom-Effertz', n543.activity = 'Integrated transitional throughput'; -MERGE (n544:Company {neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388' }) -SET n544.name = 'Stark-Schneider', n544.activity = 'Cross-platform grid-enabled moderator'; -MERGE (n545:Company {neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1' }) -SET n545.name = 'Boehm and Sons', n545.activity = 'Organized mission-critical analyzer'; -MERGE (n546:Company {neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7' }) -SET n546.name = 'Runolfsdottir LLC', n546.activity = 'Integrated bi-directional archive'; -MERGE (n547:Company {neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef' }) -SET n547.name = 'Reinger, Collier and Blick', n547.activity = 'Customer-focused incremental function'; -MERGE (n548:Company {neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791' }) -SET n548.name = 'Kautzer-Boehm', n548.activity = 'Front-line interactive hierarchy'; -MERGE (n549:Company {neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4' }) -SET n549.name = 'Bahringer, Hauck and Trantow', n549.activity = 'Assimilated neutral support'; -MERGE (n550:Company {neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09' }) -SET n550.name = 'Batz, Oberbrunner and Conroy', n550.activity = 'Profit-focused dedicated middleware'; -MERGE (n551:Country {neogen_id: 'd2de65d3a49ff9edeae36f8c9d952b8fea92dd59' }) -SET n551.name = 'Latvia'; -MERGE (n552:Country {neogen_id: 'da45d7cd85d993ff24978eb4597cad8c23afd22e' }) -SET n552.name = 'Tuvalu'; -MERGE (n553:Country {neogen_id: 'b9968d48195b63c8dbd820a6475ee8bfc8645a5b' }) -SET n553.name = 'Korea'; -MERGE (n554:Country {neogen_id: '28a01485e037ec4a1c8532564597fefd96a683ca' }) -SET n554.name = 'Russian Federation'; -MERGE (n555:Country {neogen_id: '7f1638ed62f9de4ed8c4d86520332e1c82b9e313' }) -SET n555.name = 'Guinea-Bissau'; -MERGE (n556:Country {neogen_id: '86e93991561d912135b3c3fc66ab3cd74525c92f' }) -SET n556.name = 'Lesotho'; -MERGE (n557:Country {neogen_id: '882fb95aa4e1f4fa8bc39913f00e3c154b9dda93' }) -SET n557.name = 'Ukraine'; -MERGE (n558:Country {neogen_id: 'bf06976b4aced32b9fbe7b8c8ebbe2039aff994f' }) -SET n558.name = 'Colombia'; -MERGE (n559:Country {neogen_id: '135ad090e5bba95e8103b9cf303c6b0acee213f2' }) -SET n559.name = 'Micronesia'; -MERGE (n560:Country {neogen_id: '0c4bae2636b0cebe6f24801a110eca13319f77ba' }) -SET n560.name = 'Libyan Arab Jamahiriya'; -MERGE (n561:Country {neogen_id: '66fed4cc024f8f27379bc5b5c7f0a51f174ac664' }) -SET n561.name = 'Singapore'; -MERGE (n562:Country {neogen_id: '80ab7b529b9e6df4cd604703e914931aad03455d' }) -SET n562.name = 'Malta'; -MERGE (n563:Country {neogen_id: '97ebbd353da17dde16ffd5ac8cb6f720795bfa3f' }) -SET n563.name = 'Sierra Leone'; -MERGE (n564:Country {neogen_id: 'ffcd6eaafa4dc305656af63cf1de940ef886f2e9' }) -SET n564.name = 'Iraq'; -MERGE (n565:Country {neogen_id: '485940fec12971f1ec46968698207413ba68dbc4' }) -SET n565.name = 'Poland'; -MERGE (n566:Country {neogen_id: '0c5f07d83244e5c85270edc4ea35d90793cb3421' }) -SET n566.name = 'Jordan'; -MERGE (n567:Country {neogen_id: '39717c17124a7bee34d30a1ecefca34e821c12fb' }) -SET n567.name = 'French Southern Territories'; -MERGE (n568:Country {neogen_id: '09e2076636e200fb45f020e4cbf9d12ae9795134' }) -SET n568.name = 'Cocos (Keeling) Islands'; -MERGE (n569:Country {neogen_id: 'a80740aa2085fe1f39621130579fce89a35cd45f' }) -SET n569.name = 'Holy See (Vatican City State)'; -MERGE (n570:Country {neogen_id: 'f74a39c0f483489f02004d047483186a6c2cc666' }) -SET n570.name = 'Uganda'; -MERGE (n571:Country {neogen_id: '13c9fefe5cf91d8f4ec65c28164448ec9bdb5b4b' }) -SET n571.name = 'Uganda'; -MERGE (n572:Country {neogen_id: 'af8c039a15791bf9fe26d99472a953d2719ad695' }) -SET n572.name = 'Zimbabwe'; -MERGE (n573:Country {neogen_id: '87674406d5a7ce440e6d287c6408a3bba57a8023' }) -SET n573.name = 'French Polynesia'; -MERGE (n574:Country {neogen_id: 'b9ab3c5d0992149e169920c6e2f38dce7f70a116' }) -SET n574.name = 'Greenland'; -MERGE (n575:Country {neogen_id: 'be5a55be3eb296f7ab1510770c3d2f0a5e8aa3c9' }) -SET n575.name = 'Argentina'; -MERGE (n576:Country {neogen_id: 'f26123058c8f9d953cb7416f64b8c4b1cf08d07a' }) -SET n576.name = 'Svalbard & Jan Mayen Islands'; -MERGE (n577:Country {neogen_id: 'b9d3ded4a9ee89e108628cf9b76355020f9294a5' }) -SET n577.name = 'Cote d\'Ivoire'; -MERGE (n578:Country {neogen_id: 'f57e945750504c5c1da44b6e27ebc9a5f5c05466' }) -SET n578.name = 'Western Sahara'; -MERGE (n579:Country {neogen_id: 'a7e1e96ed04967669fb233f4daf4abd3587b97fd' }) -SET n579.name = 'Korea'; -MERGE (n580:Country {neogen_id: 'a5b6b078370f559f6970d079ba0b841fc8d4f31d' }) -SET n580.name = 'Moldova'; -MERGE (n581:Country {neogen_id: '763b826026614e3f554858e87079d5bb95d1ca82' }) -SET n581.name = 'Saint Martin'; -MERGE (n582:Country {neogen_id: '4e9522bc477be3cd8ad23edfff7ab8418a74da0c' }) -SET n582.name = 'Macedonia'; -MERGE (n583:Country {neogen_id: 'ae818388d7f1d5e9281342173cc8f175cdb17458' }) -SET n583.name = 'Svalbard & Jan Mayen Islands'; -MERGE (n584:Country {neogen_id: '67f9625f95b0c72e468ff41c58814fc373580309' }) -SET n584.name = 'Japan'; -MERGE (n585:Country {neogen_id: 'f6652c31ef47338033a83b7a8660a1523aa7f1af' }) -SET n585.name = 'Peru'; -MERGE (n586:Country {neogen_id: 'a7ec42ee6c79a05b8cf4c86e212640cc572a9891' }) -SET n586.name = 'French Polynesia'; -MERGE (n587:Country {neogen_id: 'c562d912be8b79dcd983d3abaacef9291339f093' }) -SET n587.name = 'Guatemala'; -MERGE (n588:Country {neogen_id: 'eff67cb0a9158cc786c317e67210378d3899baa5' }) -SET n588.name = 'Ireland'; -MERGE (n589:Country {neogen_id: 'aa1a5ba7b64cf9dc961589b109ac0468b10258f8' }) -SET n589.name = 'Azerbaijan'; -MERGE (n590:Country {neogen_id: '6bb2f5c03b289dd323150b3e6017b37d4a990338' }) -SET n590.name = 'Senegal'; -MERGE (n591:Country {neogen_id: '0cbb369343b7e4b46bcb3b8d63189a59398171e4' }) -SET n591.name = 'Sri Lanka'; -MERGE (n592:Country {neogen_id: '38e116584af4ac1c5838b818d9cc81d4498585e2' }) -SET n592.name = 'American Samoa'; -MERGE (n593:Country {neogen_id: '93248e65d9f387779f840078a5dea8da344307cc' }) -SET n593.name = 'Nicaragua'; -MERGE (n594:Country {neogen_id: '190cb206f0fcb0ffa8387f38fe6d357f3709d190' }) -SET n594.name = 'Georgia'; -MERGE (n595:Country {neogen_id: '393b33eff436bf78c85aa80c0daddcc3bdb7f445' }) -SET n595.name = 'Guam'; -MERGE (n596:Country {neogen_id: 'd2528800970294d7403e7dcca6a0396f1e521d9b' }) -SET n596.name = 'Saint Vincent and the Grenadines'; -MERGE (n597:Country {neogen_id: '2ff272072152a95ae07705d814a998426f893c45' }) -SET n597.name = 'Gibraltar'; -MERGE (n598:Country {neogen_id: 'b26dda3ea03f2dc2b8d8406f744a78e478f9db67' }) -SET n598.name = 'Korea'; -MERGE (n599:Country {neogen_id: '29446fbf4a102341394c092bc5e956b2e8796636' }) -SET n599.name = 'Guyana'; -MERGE (n600:Country {neogen_id: '42b5c4f8f836c1d43214bc0e8880466a6dbd6ba6' }) -SET n600.name = 'Costa Rica'; -MERGE (n601:Country {neogen_id: 'be6882be94aaaee6cb3a5e0630d21e103030c4d5' }) -SET n601.name = 'United Arab Emirates'; -MERGE (n602:Country {neogen_id: 'e0a793c227fcbe8f915fe1f011dc7b80ea8cca22' }) -SET n602.name = 'Saint Barthelemy'; -MERGE (n603:Country {neogen_id: '781c5f873945a71b1d19d6a54eef1187bc18e711' }) -SET n603.name = 'Paraguay'; -MERGE (n604:Country {neogen_id: 'e7c5802d727abc73a7dc580ebb73ea21d2b087fc' }) -SET n604.name = 'Ecuador'; -MERGE (n605:Country {neogen_id: 'f7f45e0f0601926888fe319ba44a77c7818c0a0b' }) -SET n605.name = 'Argentina'; -MERGE (n606:Country {neogen_id: 'b53fd0e3cf513dd1cc1579d6fc1b06603bd51859' }) -SET n606.name = 'Guadeloupe'; -MERGE (n607:Country {neogen_id: '9591d9da7ce34da76e554e712e77d995b7721043' }) -SET n607.name = 'Cape Verde'; -MERGE (n608:Country {neogen_id: '406c102467a8127f8174996b9b40c694670dc14c' }) -SET n608.name = 'Nauru'; -MERGE (n609:Country {neogen_id: '363ef7eae27a8114d98ba24e9ee4dc227f9c08f7' }) -SET n609.name = 'Monaco'; -MERGE (n610:Country {neogen_id: 'ebdd8d785ac2c9e74d02c057fa48ce532a25d444' }) -SET n610.name = 'Macao'; -MERGE (n611:Country {neogen_id: '11aca0e8c4bf1fe34c9397d5e6d3829f0a2cce72' }) -SET n611.name = 'Maldives'; -MERGE (n612:Country {neogen_id: 'aabb8746557e3694cfa98fc77fae547345fc48f3' }) -SET n612.name = 'Mauritania'; -MERGE (n613:Country {neogen_id: '89df4979c515576bddf24d9e232747e24bf9032b' }) -SET n613.name = 'Greenland'; -MERGE (n614:Country {neogen_id: '0d1f8eab74ea4751ed91ae0f048e22e1a9b150d7' }) -SET n614.name = 'Sweden'; -MERGE (n615:Country {neogen_id: '4fc057b67e2c477ff25fe507fb30813a63d0a2a4' }) -SET n615.name = 'Benin'; -MERGE (n616:Country {neogen_id: '0ec10ae0d17c83296173d1d48de9cea51c007a18' }) -SET n616.name = 'Hungary'; -MERGE (n617:Country {neogen_id: 'a1104181a4e3564e3565e8194bb22df6c29834f6' }) -SET n617.name = 'Luxembourg'; -MERGE (n618:Country {neogen_id: 'a4506847aaaeb73a5926717b258fd479653bb975' }) -SET n618.name = 'United Arab Emirates'; -MERGE (n619:Country {neogen_id: '27a80bdb0402c1934ade3081d046cf33eb9fc854' }) -SET n619.name = 'Cameroon'; -MERGE (n620:Country {neogen_id: 'd33bf489036b895de5cb06014036d8e0c64c0889' }) -SET n620.name = 'Namibia'; -MERGE (n621:Country {neogen_id: '34e341e434e30e0d3ae509aa07a5ea9570d5ae66' }) -SET n621.name = 'Bangladesh'; -MERGE (n622:Country {neogen_id: '8a7ee89f60932fab0973e25704066796b9d8b8fb' }) -SET n622.name = 'Puerto Rico'; -MERGE (n623:Country {neogen_id: '0950c61398035363cd32cf9cd4428ec4c85496b7' }) -SET n623.name = 'Mali'; -MERGE (n624:Country {neogen_id: '5a773b1fe481f4ae825b4f541512a4505f5a236e' }) -SET n624.name = 'Kenya'; -MERGE (n625:Country {neogen_id: '0e248d85f994ac46d0cedf8dafec5b41c68d2d8e' }) -SET n625.name = 'Morocco'; -MERGE (n626:Country {neogen_id: 'f2a3a1a0e9d4bd2c97829e31d6bdf350e277f4fc' }) -SET n626.name = 'Malawi'; -MERGE (n627:Country {neogen_id: '6b1aec6bf1e03bc9d14d0a4f76dd1855357e8bc6' }) -SET n627.name = 'Slovenia'; -MERGE (n628:Country {neogen_id: '3a1eacab7defdff6135d4a17ac95ae0a27d48085' }) -SET n628.name = 'Moldova'; -MERGE (n629:Country {neogen_id: '5cf08a7520a6220656dee74d32f3c19b7ed845d6' }) -SET n629.name = 'Liechtenstein'; -MERGE (n630:Country {neogen_id: '29a8a7b8607ab37aa89716ab0d87c677375dc179' }) -SET n630.name = 'Mozambique'; -MERGE (n631:Country {neogen_id: '708e9309cac32fd873ede7a2e5e24747575bd5f5' }) -SET n631.name = 'Malaysia'; -MERGE (n632:Country {neogen_id: 'a179d48762f45f5208d069e957a07a48ad2f220d' }) -SET n632.name = 'Guyana'; -MERGE (n633:Country {neogen_id: 'd3e6aa00f58eb7db08b48d356c9718939829ae3e' }) -SET n633.name = 'Mongolia'; -MERGE (n634:Country {neogen_id: '3d1d982079342183f7889fa8f4646d3918ac13f6' }) -SET n634.name = 'Myanmar'; -MERGE (n635:Country {neogen_id: '25c7a7f9d00adbab3b1ee9eb08c70de6679c49e6' }) -SET n635.name = 'Russian Federation'; -MERGE (n636:Country {neogen_id: '11c008853928b58f7cb11c767fdde0827a780e61' }) -SET n636.name = 'Croatia'; -MERGE (n637:Country {neogen_id: '459499fec0df957584d3c9d09423038991ee04c3' }) -SET n637.name = 'Dominica'; -MERGE (n638:Country {neogen_id: '6341d5407785e4a94711a5557afddd18f5bd6434' }) -SET n638.name = 'Bosnia and Herzegovina'; -MERGE (n639:Country {neogen_id: 'be466475ad163a0a5f6439d625c2dfcc026f4f67' }) -SET n639.name = 'Isle of Man'; -MERGE (n640:Country {neogen_id: 'b3239e2bc7392746b0d67429e73c4d3348fddb4e' }) -SET n640.name = 'Kenya'; -MERGE (n641:Country {neogen_id: 'bce8e29bc7bbbb3ac4e782a9b01ed36bd4f626ab' }) -SET n641.name = 'Thailand'; -MERGE (n642:Country {neogen_id: 'c32a90da46fb5fb902f67306fae10aefb9c031e6' }) -SET n642.name = 'Honduras'; -MERGE (n643:Country {neogen_id: 'f550f11cf5cfaa532bfe8acfec8612eba2727a56' }) -SET n643.name = 'Switzerland'; -MERGE (n644:Country {neogen_id: 'e10c17be9da0a9d7e99cb394be0e1ce48f5d8dde' }) -SET n644.name = 'Norfolk Island'; -MERGE (n645:Country {neogen_id: '891ff8be1680cbb4604807231a2d6c60f8bafbb1' }) -SET n645.name = 'Cameroon'; -MERGE (n646:Country {neogen_id: 'dd70cd00840d02b512e87187919d0c902ae67e84' }) -SET n646.name = 'Myanmar'; -MERGE (n647:Country {neogen_id: 'b6f4731891af494fab55bce276cf9c3088fc7713' }) -SET n647.name = 'Western Sahara'; -MERGE (n648:Country {neogen_id: '1d49f36fe3832ae6fc6680f35606385fa1f463ff' }) -SET n648.name = 'Greenland'; -MERGE (n649:Country {neogen_id: '81153d8e7ff7f823c53937951813139b920d19cd' }) -SET n649.name = 'Mauritania'; -MERGE (n650:Country {neogen_id: '8feba8ce538c8e0421697cdbab6fd392c9764bc6' }) -SET n650.name = 'Bouvet Island (Bouvetoya)'; -MATCH (s1:Person {neogen_id: 'c62990ce73e6d491e37b470135cb316f2db9d493'}), (e1:Company { neogen_id: '659ce23acfa8bd130afbde4202194903211b3637'}) -MERGE (s1)-[edge1:WORKS_AT]->(e1) -; -MATCH (s2:Person {neogen_id: 'c2a86e100979c561fec03007e024bad8aa7c564a'}), (e2:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s2)-[edge2:WORKS_AT]->(e2) -; -MATCH (s3:Person {neogen_id: '0255ffe4a9cce0874e94d9eeef4de1abea7f4d99'}), (e3:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s3)-[edge3:WORKS_AT]->(e3) -; -MATCH (s4:Person {neogen_id: '1f669d7af94cc0e6056e523c18f3931a5328997f'}), (e4:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s4)-[edge4:WORKS_AT]->(e4) -; -MATCH (s5:Person {neogen_id: 'e86fd0839733b6375a87bd90a225c927c55dfe54'}), (e5:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s5)-[edge5:WORKS_AT]->(e5) -; -MATCH (s6:Person {neogen_id: '91c24aabef628d7c13d87c1612915adabb34a7bc'}), (e6:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s6)-[edge6:WORKS_AT]->(e6) -; -MATCH (s7:Person {neogen_id: 'a34285d82cece257f8aecebe2e37568ac65ac879'}), (e7:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s7)-[edge7:WORKS_AT]->(e7) -; -MATCH (s8:Person {neogen_id: 'b00c3ab02ada32ba8a8e03812568e59c3c5672d1'}), (e8:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s8)-[edge8:WORKS_AT]->(e8) -; -MATCH (s9:Person {neogen_id: '228cb0176a0b2a1fc216f3291b8aab61d656ad42'}), (e9:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s9)-[edge9:WORKS_AT]->(e9) -; -MATCH (s10:Person {neogen_id: '7f49977234368dbb2985a63a75f62a3186d85324'}), (e10:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s10)-[edge10:WORKS_AT]->(e10) -; -MATCH (s11:Person {neogen_id: '395b6237597b0799c36774a46309375689bb3369'}), (e11:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s11)-[edge11:WORKS_AT]->(e11) -; -MATCH (s12:Person {neogen_id: '73dd06112b104505075a1d6bf2779c0b63b9f49c'}), (e12:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s12)-[edge12:WORKS_AT]->(e12) -; -MATCH (s13:Person {neogen_id: 'e91d676adbb54507a96154f7654d9a348c569620'}), (e13:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s13)-[edge13:WORKS_AT]->(e13) -; -MATCH (s14:Person {neogen_id: '63a1657b3294aa3d06b7e5a0c61ebe863e6860ba'}), (e14:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s14)-[edge14:WORKS_AT]->(e14) -; -MATCH (s15:Person {neogen_id: 'b423d5b3361ca49b2b7b6c27078be6e0e9456a6d'}), (e15:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s15)-[edge15:WORKS_AT]->(e15) -; -MATCH (s16:Person {neogen_id: '129e6ce0d12bb68891f7dfcd142b58967e6e54f0'}), (e16:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s16)-[edge16:WORKS_AT]->(e16) -; -MATCH (s17:Person {neogen_id: 'd442e9e1d1b6d40d8b11c4484f29651d020dea9b'}), (e17:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s17)-[edge17:WORKS_AT]->(e17) -; -MATCH (s18:Person {neogen_id: '329f7dca4da2732ec5d6e23d2f935c853ef89a98'}), (e18:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s18)-[edge18:WORKS_AT]->(e18) -; -MATCH (s19:Person {neogen_id: 'eb1e8fca719e5cef959e9d2e83e17d355c073eac'}), (e19:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s19)-[edge19:WORKS_AT]->(e19) -; -MATCH (s20:Person {neogen_id: '5bfe73de5ef8872b8d5cf4c8957a0d60a53e9f62'}), (e20:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s20)-[edge20:WORKS_AT]->(e20) -; -MATCH (s21:Person {neogen_id: '36aa6a591d5c8c06a533a9abbc987d2eafa02ec8'}), (e21:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s21)-[edge21:WORKS_AT]->(e21) -; -MATCH (s22:Person {neogen_id: '1a7c70f9843a77754029acfabe29b7918dbb5133'}), (e22:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s22)-[edge22:WORKS_AT]->(e22) -; -MATCH (s23:Person {neogen_id: 'e460f665c39e8ecca1e3d0207db9afdeaf3ef956'}), (e23:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s23)-[edge23:WORKS_AT]->(e23) -; -MATCH (s24:Person {neogen_id: '437482f18265305234b475b83c3124099d047da0'}), (e24:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s24)-[edge24:WORKS_AT]->(e24) -; -MATCH (s25:Person {neogen_id: '0356b932af59ac7c307a62046cde810771c5fad2'}), (e25:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s25)-[edge25:WORKS_AT]->(e25) -; -MATCH (s26:Person {neogen_id: '1429ae65f5d08ecb7dce51a2ef1ad5f1b1e32d2f'}), (e26:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s26)-[edge26:WORKS_AT]->(e26) -; -MATCH (s27:Person {neogen_id: '21e0cd030367d80c9c26a1d8b96676e74520a387'}), (e27:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s27)-[edge27:WORKS_AT]->(e27) -; -MATCH (s28:Person {neogen_id: 'd6b7259fb94280a40099e3680848b800ed68c2dc'}), (e28:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s28)-[edge28:WORKS_AT]->(e28) -; -MATCH (s29:Person {neogen_id: 'eb49b83b4034241eb524c67a41a9cbc65f7974e9'}), (e29:Company { neogen_id: '13bb846033cf7d656e58cabc22e6d23b7ea994d5'}) -MERGE (s29)-[edge29:WORKS_AT]->(e29) -; -MATCH (s30:Person {neogen_id: '6d6b95d3d6926204e5ed30c507ab9e57f57b52c1'}), (e30:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s30)-[edge30:WORKS_AT]->(e30) -; -MATCH (s31:Person {neogen_id: 'efccfbc3c505c2d32d0af3ca9aad956911f4dc9d'}), (e31:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s31)-[edge31:WORKS_AT]->(e31) -; -MATCH (s32:Person {neogen_id: '487896bb5bbced6d6b2c0c426fbb5be432cbc836'}), (e32:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s32)-[edge32:WORKS_AT]->(e32) -; -MATCH (s33:Person {neogen_id: 'fe53517f05b51b4a605c4eca6d0ae816cc7e6025'}), (e33:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s33)-[edge33:WORKS_AT]->(e33) -; -MATCH (s34:Person {neogen_id: '7acce967500edc4bccd11d1a77ca564205ec3de7'}), (e34:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s34)-[edge34:WORKS_AT]->(e34) -; -MATCH (s35:Person {neogen_id: '7576e35ac4262cec100478de9a5f2c1842782e40'}), (e35:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s35)-[edge35:WORKS_AT]->(e35) -; -MATCH (s36:Person {neogen_id: 'ca5080b9c61ef64de6be9ebb45b0da27f8383ba4'}), (e36:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s36)-[edge36:WORKS_AT]->(e36) -; -MATCH (s37:Person {neogen_id: 'e072894b2ef63931245cc8d12c00ee5a75000348'}), (e37:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s37)-[edge37:WORKS_AT]->(e37) -; -MATCH (s38:Person {neogen_id: '9344561bbe3f78f36b49b8b0db715748d08adb71'}), (e38:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s38)-[edge38:WORKS_AT]->(e38) -; -MATCH (s39:Person {neogen_id: 'b36f583925c7401bf8bdf05624c1787d247808ee'}), (e39:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s39)-[edge39:WORKS_AT]->(e39) -; -MATCH (s40:Person {neogen_id: '78181c17030700adf7f3b4ff58a10e45c8a1dec9'}), (e40:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s40)-[edge40:WORKS_AT]->(e40) -; -MATCH (s41:Person {neogen_id: '7292bfd676c37ab1c7592988ef2869dd30fed5af'}), (e41:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s41)-[edge41:WORKS_AT]->(e41) -; -MATCH (s42:Person {neogen_id: '7d569f263185864951dcd71d9f2fa2448700e7f4'}), (e42:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s42)-[edge42:WORKS_AT]->(e42) -; -MATCH (s43:Person {neogen_id: 'd0bc3aac2e92405cb035e3ce69aeff45624ee808'}), (e43:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s43)-[edge43:WORKS_AT]->(e43) -; -MATCH (s44:Person {neogen_id: 'd0073abd9b840a10a6d9ab50ead8c297ce922d02'}), (e44:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s44)-[edge44:WORKS_AT]->(e44) -; -MATCH (s45:Person {neogen_id: '0dd4c2062bb19203c4067a8cf3ac1f7ce5dc5212'}), (e45:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s45)-[edge45:WORKS_AT]->(e45) -; -MATCH (s46:Person {neogen_id: '715310d2d175b12f9771f91de52363208f2c3d3b'}), (e46:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s46)-[edge46:WORKS_AT]->(e46) -; -MATCH (s47:Person {neogen_id: '13e0b8a8090d77b45fd0bc90e3349e34b757d8b0'}), (e47:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s47)-[edge47:WORKS_AT]->(e47) -; -MATCH (s48:Person {neogen_id: 'd3961619e0dafdae6c7956139befcb0e6d1f7b17'}), (e48:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s48)-[edge48:WORKS_AT]->(e48) -; -MATCH (s49:Person {neogen_id: '17a5040aa85e6044be23fe462b194282353d16f0'}), (e49:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s49)-[edge49:WORKS_AT]->(e49) -; -MATCH (s50:Person {neogen_id: '0e822961597614fa6c430bb0684512ee0f5de25f'}), (e50:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s50)-[edge50:WORKS_AT]->(e50) -; -MATCH (s51:Person {neogen_id: '078a7228238b3bc1c2c5af6a1b303332fcba3df1'}), (e51:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s51)-[edge51:WORKS_AT]->(e51) -; -MATCH (s52:Person {neogen_id: '934e081e0d9dbb5e91184f2b5134ae234ef39c06'}), (e52:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s52)-[edge52:WORKS_AT]->(e52) -; -MATCH (s53:Person {neogen_id: '6103e446d774219c792db87f1b4f41fa0b7b56d5'}), (e53:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s53)-[edge53:WORKS_AT]->(e53) -; -MATCH (s54:Person {neogen_id: '80fa4f7ab558e07d6b63c7775ea0055b6ec5e8ad'}), (e54:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s54)-[edge54:WORKS_AT]->(e54) -; -MATCH (s55:Person {neogen_id: '92e89970a7a83595bfe037b22b2eb95c054fa4a7'}), (e55:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s55)-[edge55:WORKS_AT]->(e55) -; -MATCH (s56:Person {neogen_id: '87c9edc33c71308e5b30e327d29ae3c73ab36e71'}), (e56:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s56)-[edge56:WORKS_AT]->(e56) -; -MATCH (s57:Person {neogen_id: '6d4abda76817ce478b3b3a26d936349581904633'}), (e57:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s57)-[edge57:WORKS_AT]->(e57) -; -MATCH (s58:Person {neogen_id: 'aa3d12a01c11956a82da640085db2c341ce4679a'}), (e58:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s58)-[edge58:WORKS_AT]->(e58) -; -MATCH (s59:Person {neogen_id: 'edfdfd5437acb2333bf49077ad0c96d3d592306e'}), (e59:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s59)-[edge59:WORKS_AT]->(e59) -; -MATCH (s60:Person {neogen_id: '080f494d531b099c4361e29bf7fb475cf7ab0f18'}), (e60:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s60)-[edge60:WORKS_AT]->(e60) -; -MATCH (s61:Person {neogen_id: 'ad45314c86cd96751b7f71fde4e2b4ff981f1708'}), (e61:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s61)-[edge61:WORKS_AT]->(e61) -; -MATCH (s62:Person {neogen_id: '9226424a7d2a3924025fc77478967daba092d49f'}), (e62:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s62)-[edge62:WORKS_AT]->(e62) -; -MATCH (s63:Person {neogen_id: 'e01a989dde0be0d7c90600277c34ce3e22783ad6'}), (e63:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s63)-[edge63:WORKS_AT]->(e63) -; -MATCH (s64:Person {neogen_id: '7fd556b0c5b0a28295b9a25c508ce7d397d504b4'}), (e64:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s64)-[edge64:WORKS_AT]->(e64) -; -MATCH (s65:Person {neogen_id: 'c8a7857f40c081b087789d15bd0cb6a1066cf92f'}), (e65:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s65)-[edge65:WORKS_AT]->(e65) -; -MATCH (s66:Person {neogen_id: '1b37f077a7e708fe97a3ec6eb4710ad518d80523'}), (e66:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s66)-[edge66:WORKS_AT]->(e66) -; -MATCH (s67:Person {neogen_id: '4a360d91f3908d84ec52254507ddd01da75e3598'}), (e67:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s67)-[edge67:WORKS_AT]->(e67) -; -MATCH (s68:Person {neogen_id: '5930cb0a973febbfddd69815ad89daff8e32a04d'}), (e68:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s68)-[edge68:WORKS_AT]->(e68) -; -MATCH (s69:Person {neogen_id: '4cacc2970a5a6010c004f9705b6dfe719631b4da'}), (e69:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s69)-[edge69:WORKS_AT]->(e69) -; -MATCH (s70:Person {neogen_id: '8d3f34e70602bd6e7022d6744c89a86631281902'}), (e70:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s70)-[edge70:WORKS_AT]->(e70) -; -MATCH (s71:Person {neogen_id: 'f5ec47665229162c5f133e45df7c1c4719c086e2'}), (e71:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s71)-[edge71:WORKS_AT]->(e71) -; -MATCH (s72:Person {neogen_id: '761424aa04a2763b890a2ce8bc8281b5e8871b28'}), (e72:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s72)-[edge72:WORKS_AT]->(e72) -; -MATCH (s73:Person {neogen_id: 'a876e55d685abbe5d64fdda851a7c0c4ce4a9a57'}), (e73:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s73)-[edge73:WORKS_AT]->(e73) -; -MATCH (s74:Person {neogen_id: '3a04537da7e41a33cf9b52d639b06b68ed93c5e8'}), (e74:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s74)-[edge74:WORKS_AT]->(e74) -; -MATCH (s75:Person {neogen_id: 'a3056f1b93e5bd39711e4747f2d8ac9fbb26ea15'}), (e75:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s75)-[edge75:WORKS_AT]->(e75) -; -MATCH (s76:Person {neogen_id: 'e6a55237ac77266ecbeb9eb7f1fc4beb054ff2ad'}), (e76:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s76)-[edge76:WORKS_AT]->(e76) -; -MATCH (s77:Person {neogen_id: '06ca4e810753d72c7b481a042b30d11e997cd7be'}), (e77:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s77)-[edge77:WORKS_AT]->(e77) -; -MATCH (s78:Person {neogen_id: 'd25dae3f8cb04a349abc352810cb4bcc9e8ce329'}), (e78:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s78)-[edge78:WORKS_AT]->(e78) -; -MATCH (s79:Person {neogen_id: '9ee53d45baa20f4b844c176f98f2e17a77c8cc20'}), (e79:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s79)-[edge79:WORKS_AT]->(e79) -; -MATCH (s80:Person {neogen_id: '16dea280f00a4b0b23494e716e68297b35527388'}), (e80:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s80)-[edge80:WORKS_AT]->(e80) -; -MATCH (s81:Person {neogen_id: 'a6c90a718fded165b37324dd7f5c862fd5e1d240'}), (e81:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s81)-[edge81:WORKS_AT]->(e81) -; -MATCH (s82:Person {neogen_id: '342b76f3cbc20284b64afb0d90066a2a5b918b1d'}), (e82:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s82)-[edge82:WORKS_AT]->(e82) -; -MATCH (s83:Person {neogen_id: '4135b36219492bc7fa7752e44cf4917e26846cb3'}), (e83:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s83)-[edge83:WORKS_AT]->(e83) -; -MATCH (s84:Person {neogen_id: 'bee2fda25ecaaef451c0d578f92aa597085e2eae'}), (e84:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s84)-[edge84:WORKS_AT]->(e84) -; -MATCH (s85:Person {neogen_id: '6fbc37af6070af7cec2f01abea158d2515815ab7'}), (e85:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s85)-[edge85:WORKS_AT]->(e85) -; -MATCH (s86:Person {neogen_id: '60296a81c7831a178f5e595f3a0afbeafa979b6a'}), (e86:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s86)-[edge86:WORKS_AT]->(e86) -; -MATCH (s87:Person {neogen_id: '753ac35ae0d3db69e6e3e8f01b5feb1a10d25324'}), (e87:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s87)-[edge87:WORKS_AT]->(e87) -; -MATCH (s88:Person {neogen_id: 'b774a03257a603e8aeabd33f7058ef2585c668c2'}), (e88:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s88)-[edge88:WORKS_AT]->(e88) -; -MATCH (s89:Person {neogen_id: 'd99001b64af5818a4d8a45b7d19c9030fb9f113b'}), (e89:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s89)-[edge89:WORKS_AT]->(e89) -; -MATCH (s90:Person {neogen_id: 'b21b66c67e5e219d3699b7cd3b01bc85559723c8'}), (e90:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s90)-[edge90:WORKS_AT]->(e90) -; -MATCH (s91:Person {neogen_id: 'ee9958a1e2f510725e07060ab98bfc3c52631ad0'}), (e91:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s91)-[edge91:WORKS_AT]->(e91) -; -MATCH (s92:Person {neogen_id: '90a76c42243c02fdc6a4e71df9157db03835a596'}), (e92:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s92)-[edge92:WORKS_AT]->(e92) -; -MATCH (s93:Person {neogen_id: '74a6a4d734526a4b50fe04375a4b6e050160b45c'}), (e93:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s93)-[edge93:WORKS_AT]->(e93) -; -MATCH (s94:Person {neogen_id: 'ca830ba8fd8f964dd9c0acde0b740a3b1248be28'}), (e94:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s94)-[edge94:WORKS_AT]->(e94) -; -MATCH (s95:Person {neogen_id: 'ffd1a890a9f73ac02082f7db037e0ce8c5959282'}), (e95:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s95)-[edge95:WORKS_AT]->(e95) -; -MATCH (s96:Person {neogen_id: '604235ffc325dcc5b47c5920f6827874d1bfb43a'}), (e96:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s96)-[edge96:WORKS_AT]->(e96) -; -MATCH (s97:Person {neogen_id: 'aaa75fc2ae6db70aa1cdb68510214e8785a2652f'}), (e97:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s97)-[edge97:WORKS_AT]->(e97) -; -MATCH (s98:Person {neogen_id: '79152ebe88e3b35b5430b4ae13cb7098c9d0dab1'}), (e98:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s98)-[edge98:WORKS_AT]->(e98) -; -MATCH (s99:Person {neogen_id: 'c6a14d0165046d9f6007ff4d69479b43237ffa1a'}), (e99:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s99)-[edge99:WORKS_AT]->(e99) -; -MATCH (s100:Person {neogen_id: 'b496b98d8e827cd4b7c5d388ffb997b144a95cc6'}), (e100:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s100)-[edge100:WORKS_AT]->(e100) -; -MATCH (s101:Person {neogen_id: '6ab07a613101bfa5b5f78902bbd6124cf10e7364'}), (e101:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s101)-[edge101:WORKS_AT]->(e101) -; -MATCH (s102:Person {neogen_id: '945d6e556c28548d63b7fcae05a95b04d1738892'}), (e102:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s102)-[edge102:WORKS_AT]->(e102) -; -MATCH (s103:Person {neogen_id: 'ccc5611a937cbfccfca03ab9ed79eb87af51f0c7'}), (e103:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s103)-[edge103:WORKS_AT]->(e103) -; -MATCH (s104:Person {neogen_id: '001f4c541f8cb2566c94a6ee1728fb7cd9d18556'}), (e104:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s104)-[edge104:WORKS_AT]->(e104) -; -MATCH (s105:Person {neogen_id: '1bb17c499b15c8649883baa35db738fe747da313'}), (e105:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s105)-[edge105:WORKS_AT]->(e105) -; -MATCH (s106:Person {neogen_id: '811316e156c27d096d588ed8a802216638547b3f'}), (e106:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s106)-[edge106:WORKS_AT]->(e106) -; -MATCH (s107:Person {neogen_id: '0acd7a2041bfdf61d6987aebd2f6b32160d72c25'}), (e107:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s107)-[edge107:WORKS_AT]->(e107) -; -MATCH (s108:Person {neogen_id: '80017e2bd4565b13f91e658adb620d7077101419'}), (e108:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s108)-[edge108:WORKS_AT]->(e108) -; -MATCH (s109:Person {neogen_id: 'ff82a3ef73f03d623396511e7a0ddac1165e2d3e'}), (e109:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s109)-[edge109:WORKS_AT]->(e109) -; -MATCH (s110:Person {neogen_id: '2f62a03b286270e81f1f1b1b7ce3984ebc159ce4'}), (e110:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s110)-[edge110:WORKS_AT]->(e110) -; -MATCH (s111:Person {neogen_id: 'fbfd80a0568db5625e57d592a273225e9c0643da'}), (e111:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s111)-[edge111:WORKS_AT]->(e111) -; -MATCH (s112:Person {neogen_id: '7f4ec7e828e48bc20a0b726cdc95c437f804518d'}), (e112:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s112)-[edge112:WORKS_AT]->(e112) -; -MATCH (s113:Person {neogen_id: 'bac2f77f67a405d8d587aec7ba09c79f7fe00c51'}), (e113:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s113)-[edge113:WORKS_AT]->(e113) -; -MATCH (s114:Person {neogen_id: 'b515b2266dd1857c57ea889217089bda578c22b9'}), (e114:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s114)-[edge114:WORKS_AT]->(e114) -; -MATCH (s115:Person {neogen_id: 'c836799f0bb21b9d3037fea08a631b28c41602af'}), (e115:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s115)-[edge115:WORKS_AT]->(e115) -; -MATCH (s116:Person {neogen_id: 'dd3f7f09b4dd4ef58fb577f13afaca70ff8880e3'}), (e116:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s116)-[edge116:WORKS_AT]->(e116) -; -MATCH (s117:Person {neogen_id: '0d796a231414114308c4a4db115a36ce20c4ce82'}), (e117:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s117)-[edge117:WORKS_AT]->(e117) -; -MATCH (s118:Person {neogen_id: '944106f83f728431f94b3c9620e65a1c1b8cc5b1'}), (e118:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s118)-[edge118:WORKS_AT]->(e118) -; -MATCH (s119:Person {neogen_id: '59e13832e56ce664bade9fb01f3152da6702c4bf'}), (e119:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s119)-[edge119:WORKS_AT]->(e119) -; -MATCH (s120:Person {neogen_id: '1c21ddc85e57fd78a1b08988aae456502de74196'}), (e120:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s120)-[edge120:WORKS_AT]->(e120) -; -MATCH (s121:Person {neogen_id: '48b3194ff368c8ae84292ce4a3ac1190e42de15a'}), (e121:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s121)-[edge121:WORKS_AT]->(e121) -; -MATCH (s122:Person {neogen_id: 'c053e6e3c57ea966e86e20c888120755407ec141'}), (e122:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s122)-[edge122:WORKS_AT]->(e122) -; -MATCH (s123:Person {neogen_id: '59d887d38b3a24de6355cb24bdc744ecf36682e3'}), (e123:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s123)-[edge123:WORKS_AT]->(e123) -; -MATCH (s124:Person {neogen_id: '7905dd9d20b5ee150f58a728908cb9d7283b9bd5'}), (e124:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s124)-[edge124:WORKS_AT]->(e124) -; -MATCH (s125:Person {neogen_id: 'cf998f13edd68f8b5c03d89a06cb3f28ea7a9f7a'}), (e125:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s125)-[edge125:WORKS_AT]->(e125) -; -MATCH (s126:Person {neogen_id: 'b7621e103f518d4246b467d26c2af3a7af407bc3'}), (e126:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s126)-[edge126:WORKS_AT]->(e126) -; -MATCH (s127:Person {neogen_id: '48869b25407d57f7aaf52184a9549f7498364d86'}), (e127:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s127)-[edge127:WORKS_AT]->(e127) -; -MATCH (s128:Person {neogen_id: '46be28685c7e02823c8e16024ab3b7a36eaa02be'}), (e128:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s128)-[edge128:WORKS_AT]->(e128) -; -MATCH (s129:Person {neogen_id: '28e831ed772b20d0c7e9a170c1a539c1564fe581'}), (e129:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s129)-[edge129:WORKS_AT]->(e129) -; -MATCH (s130:Person {neogen_id: '3a2eca5abb59281afea5fbd04898bbc784992529'}), (e130:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s130)-[edge130:WORKS_AT]->(e130) -; -MATCH (s131:Person {neogen_id: '643e33fdc6e0a571aa846fdd67a712c1e93ab63a'}), (e131:Company { neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}) -MERGE (s131)-[edge131:WORKS_AT]->(e131) -; -MATCH (s132:Person {neogen_id: 'aef5ccd2957ee1ac89bb4cd6ccdc1b2383bb023c'}), (e132:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s132)-[edge132:WORKS_AT]->(e132) -; -MATCH (s133:Person {neogen_id: 'b27006498af3481cca308577ee5ded1a085eea65'}), (e133:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s133)-[edge133:WORKS_AT]->(e133) -; -MATCH (s134:Person {neogen_id: 'af453a25dfb1b6f7430cd9fe8330efff5e159b05'}), (e134:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s134)-[edge134:WORKS_AT]->(e134) -; -MATCH (s135:Person {neogen_id: '6eb86405c337e182cabd44b785f62175332257a6'}), (e135:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s135)-[edge135:WORKS_AT]->(e135) -; -MATCH (s136:Person {neogen_id: '96b970de835e3e91c4f8fea5da0e8a34765a0760'}), (e136:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s136)-[edge136:WORKS_AT]->(e136) -; -MATCH (s137:Person {neogen_id: '810dbc68a8d1999d450ca91dca77501e3b3017d1'}), (e137:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s137)-[edge137:WORKS_AT]->(e137) -; -MATCH (s138:Person {neogen_id: '7b2ecf8f4db61ff7e47d0953ec43d535b8207e4c'}), (e138:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s138)-[edge138:WORKS_AT]->(e138) -; -MATCH (s139:Person {neogen_id: 'a89c1d966990cfa2999d375aaf21505cd8451efd'}), (e139:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s139)-[edge139:WORKS_AT]->(e139) -; -MATCH (s140:Person {neogen_id: 'b952dfe9061d1169e1d87a387cf80d2adac15216'}), (e140:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s140)-[edge140:WORKS_AT]->(e140) -; -MATCH (s141:Person {neogen_id: 'd6dd4ebf30a78e8267fe095ecf96cdb99b849ac9'}), (e141:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s141)-[edge141:WORKS_AT]->(e141) -; -MATCH (s142:Person {neogen_id: '7297aadb2e7a4505c66ba6e5eefa5ed1372a03e7'}), (e142:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s142)-[edge142:WORKS_AT]->(e142) -; -MATCH (s143:Person {neogen_id: '050f53adcc91bdc58bfef47098e1bc9a41894089'}), (e143:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s143)-[edge143:WORKS_AT]->(e143) -; -MATCH (s144:Person {neogen_id: '8c6a51bcfb661d1c42ce30ce40de8803a28d1ad8'}), (e144:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s144)-[edge144:WORKS_AT]->(e144) -; -MATCH (s145:Person {neogen_id: 'dc7bc263f54743833f1fdfd721662b520e49775e'}), (e145:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s145)-[edge145:WORKS_AT]->(e145) -; -MATCH (s146:Person {neogen_id: '0689c3114f03f34f89fdd10e51fb618cb59dc180'}), (e146:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s146)-[edge146:WORKS_AT]->(e146) -; -MATCH (s147:Person {neogen_id: '6f54a7f5855f486b63dc4b11c21f27d9dc9013d9'}), (e147:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s147)-[edge147:WORKS_AT]->(e147) -; -MATCH (s148:Person {neogen_id: 'c9fbc763c610fb046eb5b92ddc51e94c6f738766'}), (e148:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s148)-[edge148:WORKS_AT]->(e148) -; -MATCH (s149:Person {neogen_id: '04cbebb5f8086a5e059318522f4cd231a872441d'}), (e149:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s149)-[edge149:WORKS_AT]->(e149) -; -MATCH (s150:Person {neogen_id: '325b10850fe7e5f01e2dc43e3b3e4e5009085eb8'}), (e150:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s150)-[edge150:WORKS_AT]->(e150) -; -MATCH (s151:Person {neogen_id: '27571993f06a943f443721257a72be10db899f74'}), (e151:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s151)-[edge151:WORKS_AT]->(e151) -; -MATCH (s152:Person {neogen_id: '548ef000ade1b8bc4b5f24eada154ebed43595e9'}), (e152:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s152)-[edge152:WORKS_AT]->(e152) -; -MATCH (s153:Person {neogen_id: '2ea4b0ec86c7412131b7f907720b4234463706d0'}), (e153:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s153)-[edge153:WORKS_AT]->(e153) -; -MATCH (s154:Person {neogen_id: '10fbcc2a404e88260429c12fadc4fe2f58ec0775'}), (e154:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s154)-[edge154:WORKS_AT]->(e154) -; -MATCH (s155:Person {neogen_id: '69b94f8991717680dc16b5401b8c79204a0ed61b'}), (e155:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s155)-[edge155:WORKS_AT]->(e155) -; -MATCH (s156:Person {neogen_id: '507f6e0a7e6e3ba48141fd188eeb95765c371029'}), (e156:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s156)-[edge156:WORKS_AT]->(e156) -; -MATCH (s157:Person {neogen_id: '077c57a649698b5ea3d702d53fc8266327db8497'}), (e157:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s157)-[edge157:WORKS_AT]->(e157) -; -MATCH (s158:Person {neogen_id: 'b7ae7fdc255c0ea48d6779742566fbb30334e453'}), (e158:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s158)-[edge158:WORKS_AT]->(e158) -; -MATCH (s159:Person {neogen_id: '14d8de7525453177a07a74cc1bca6a247c63bed3'}), (e159:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s159)-[edge159:WORKS_AT]->(e159) -; -MATCH (s160:Person {neogen_id: '4cc407ecff8f8b545e05ab8c5b92890bc4145bf6'}), (e160:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s160)-[edge160:WORKS_AT]->(e160) -; -MATCH (s161:Person {neogen_id: '9ca04f1a154ef61908eed1bbb96634ca6bce85ce'}), (e161:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s161)-[edge161:WORKS_AT]->(e161) -; -MATCH (s162:Person {neogen_id: '89dc779733960a7169f993d9c0855593c5d7b6c1'}), (e162:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s162)-[edge162:WORKS_AT]->(e162) -; -MATCH (s163:Person {neogen_id: '73d959df32e20af4c453aaf3e576a098650c1b92'}), (e163:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s163)-[edge163:WORKS_AT]->(e163) -; -MATCH (s164:Person {neogen_id: 'f473aac6204ee0282ec6668b9b3a224b4a34694a'}), (e164:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s164)-[edge164:WORKS_AT]->(e164) -; -MATCH (s165:Person {neogen_id: '53def9a533c5f2557ea8da63a21d03e6aa8aece7'}), (e165:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s165)-[edge165:WORKS_AT]->(e165) -; -MATCH (s166:Person {neogen_id: '11317921f24a93bad7ff365aa6da93f4020c7169'}), (e166:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s166)-[edge166:WORKS_AT]->(e166) -; -MATCH (s167:Person {neogen_id: '3f2e335c5e8bb1215ddb7b728d06f96592e9703a'}), (e167:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s167)-[edge167:WORKS_AT]->(e167) -; -MATCH (s168:Person {neogen_id: '363cd779ae324b7da34c8068e2df3c203775be91'}), (e168:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s168)-[edge168:WORKS_AT]->(e168) -; -MATCH (s169:Person {neogen_id: 'd8a98738586fceb188e36c110abc42ce822b2afd'}), (e169:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s169)-[edge169:WORKS_AT]->(e169) -; -MATCH (s170:Person {neogen_id: 'ebd3a8dbf1becfc3812abb13109593257974a5bd'}), (e170:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s170)-[edge170:WORKS_AT]->(e170) -; -MATCH (s171:Person {neogen_id: '841e98630cef2c27dd5aae6a8c0c520cd6c47bfe'}), (e171:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s171)-[edge171:WORKS_AT]->(e171) -; -MATCH (s172:Person {neogen_id: '8421fb1154ad07bdeaf2e05312e24d2f9583931a'}), (e172:Company { neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}) -MERGE (s172)-[edge172:WORKS_AT]->(e172) -; -MATCH (s173:Person {neogen_id: 'd954d220047318c61fdd598566c031b59e0e7bd5'}), (e173:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s173)-[edge173:WORKS_AT]->(e173) -; -MATCH (s174:Person {neogen_id: '26dc8bdb2a23677240f3f2e4e73361b54c250e84'}), (e174:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s174)-[edge174:WORKS_AT]->(e174) -; -MATCH (s175:Person {neogen_id: 'b2f5dca45b7c7d982ecb2b65d44900367398d33d'}), (e175:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s175)-[edge175:WORKS_AT]->(e175) -; -MATCH (s176:Person {neogen_id: '09fb16728d240dc71b5ca2952a13c001e18fce46'}), (e176:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s176)-[edge176:WORKS_AT]->(e176) -; -MATCH (s177:Person {neogen_id: '1505e8ef23e9f1a15533bff1d3eb37f7cff5d891'}), (e177:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s177)-[edge177:WORKS_AT]->(e177) -; -MATCH (s178:Person {neogen_id: 'edd14fbc30504bf7729c61706663a3f30c2f54e3'}), (e178:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s178)-[edge178:WORKS_AT]->(e178) -; -MATCH (s179:Person {neogen_id: '8ddf8ed4d14bf453c4fa6440fac3ca5ccdeaced7'}), (e179:Company { neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6'}) -MERGE (s179)-[edge179:WORKS_AT]->(e179) -; -MATCH (s180:Person {neogen_id: '0c0eb6f49a1f4e02f828c6e261f90e45eea2e09b'}), (e180:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s180)-[edge180:WORKS_AT]->(e180) -; -MATCH (s181:Person {neogen_id: '1a49c4b79d94e3153e2322710ae1ebea33cb7627'}), (e181:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s181)-[edge181:WORKS_AT]->(e181) -; -MATCH (s182:Person {neogen_id: '3c78bbedc0dbe3b809822e62b79da30a7eeca59d'}), (e182:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s182)-[edge182:WORKS_AT]->(e182) -; -MATCH (s183:Person {neogen_id: '245d0e4533027c20fde2627d92288383e61d2032'}), (e183:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s183)-[edge183:WORKS_AT]->(e183) -; -MATCH (s184:Person {neogen_id: 'b19f7b3436e5744d8edd01ec4f31a492bc9fdcdc'}), (e184:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s184)-[edge184:WORKS_AT]->(e184) -; -MATCH (s185:Person {neogen_id: '78c1e4851e648db2423cb49689d4709db7d4e328'}), (e185:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s185)-[edge185:WORKS_AT]->(e185) -; -MATCH (s186:Person {neogen_id: '6bf4931a6f5999e23eda98ecbe2833fd761f1aff'}), (e186:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s186)-[edge186:WORKS_AT]->(e186) -; -MATCH (s187:Person {neogen_id: 'df41f8baa31058f38db3835e9ce1e5d7a7509b98'}), (e187:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s187)-[edge187:WORKS_AT]->(e187) -; -MATCH (s188:Person {neogen_id: 'bf4fcce2c61b81d9b373756a10b8e5174feb649e'}), (e188:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s188)-[edge188:WORKS_AT]->(e188) -; -MATCH (s189:Person {neogen_id: 'a42e9004b1c0c450de5d4e0bf100e3b049d91ba1'}), (e189:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s189)-[edge189:WORKS_AT]->(e189) -; -MATCH (s190:Person {neogen_id: '4c7fa839c1cfd332a0e0219ba58fba13a2690da9'}), (e190:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s190)-[edge190:WORKS_AT]->(e190) -; -MATCH (s191:Person {neogen_id: 'df85322c512bc371e442aaf340accc4525c032f9'}), (e191:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s191)-[edge191:WORKS_AT]->(e191) -; -MATCH (s192:Person {neogen_id: '11a43c241f6e881a6ec74652dae2aa7559ab1105'}), (e192:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s192)-[edge192:WORKS_AT]->(e192) -; -MATCH (s193:Person {neogen_id: '1261cf743c34dd72fe1e81aec8b8cdef2a34a7e3'}), (e193:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s193)-[edge193:WORKS_AT]->(e193) -; -MATCH (s194:Person {neogen_id: '6e572a32c78d2a69eae0ee354ff714fa612ef3c3'}), (e194:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s194)-[edge194:WORKS_AT]->(e194) -; -MATCH (s195:Person {neogen_id: 'f6666ef134b87829b1fccb8c7c4cdf5ad89341ca'}), (e195:Company { neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}) -MERGE (s195)-[edge195:WORKS_AT]->(e195) -; -MATCH (s196:Person {neogen_id: '263683d7302cd389cd2df8e0c6e9f47a21cccf66'}), (e196:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s196)-[edge196:WORKS_AT]->(e196) -; -MATCH (s197:Person {neogen_id: '7f2cb43e114b17af5f390cb3da321c2cfa556fd0'}), (e197:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s197)-[edge197:WORKS_AT]->(e197) -; -MATCH (s198:Person {neogen_id: '6a3d646bfff62920bfb51816cf6e97cd929e787f'}), (e198:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s198)-[edge198:WORKS_AT]->(e198) -; -MATCH (s199:Person {neogen_id: '4c06b2bcb33d7da0aacd2281ec52f946f2e9da8c'}), (e199:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s199)-[edge199:WORKS_AT]->(e199) -; -MATCH (s200:Person {neogen_id: '49a76f2b22b8e005eff3f537973753bd24c09462'}), (e200:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s200)-[edge200:WORKS_AT]->(e200) -; -MATCH (s201:Person {neogen_id: 'cb7fc3158c7338e79b358527c4aa71f2d3c5682e'}), (e201:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s201)-[edge201:WORKS_AT]->(e201) -; -MATCH (s202:Person {neogen_id: '21c3e3dd6f1b9eff34656e80253dc4078a31cbed'}), (e202:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s202)-[edge202:WORKS_AT]->(e202) -; -MATCH (s203:Person {neogen_id: '0a19f7113038fe56100eacb727d17120ebff65a1'}), (e203:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s203)-[edge203:WORKS_AT]->(e203) -; -MATCH (s204:Person {neogen_id: 'fdd5252376737c228109597d77d2b38c5397642a'}), (e204:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s204)-[edge204:WORKS_AT]->(e204) -; -MATCH (s205:Person {neogen_id: 'd5cd41bd57475d3f8a106a0e2983cefac0216a86'}), (e205:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s205)-[edge205:WORKS_AT]->(e205) -; -MATCH (s206:Person {neogen_id: '9f5553c0f9052a3ed804ce40511583f689c6bcb3'}), (e206:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s206)-[edge206:WORKS_AT]->(e206) -; -MATCH (s207:Person {neogen_id: 'ae640eef5cebb28848363f0721696bbe1781c28c'}), (e207:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s207)-[edge207:WORKS_AT]->(e207) -; -MATCH (s208:Person {neogen_id: 'eaf584bdd402ebf900a7530d4fddb220682ce4d9'}), (e208:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s208)-[edge208:WORKS_AT]->(e208) -; -MATCH (s209:Person {neogen_id: '3d5cac90c7447f84d31b5c336f5509a7e4dd5038'}), (e209:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s209)-[edge209:WORKS_AT]->(e209) -; -MATCH (s210:Person {neogen_id: '0b0b948d2b400df9f64798fac4d14d2c1d533d27'}), (e210:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s210)-[edge210:WORKS_AT]->(e210) -; -MATCH (s211:Person {neogen_id: '94c919125a89a79edf85f60f2eb52712ebf5dadd'}), (e211:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s211)-[edge211:WORKS_AT]->(e211) -; -MATCH (s212:Person {neogen_id: 'e431edd2e9663c60c028d032c948bbf006325348'}), (e212:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s212)-[edge212:WORKS_AT]->(e212) -; -MATCH (s213:Person {neogen_id: '59b27f0092bf0028263b484892aff2353c045420'}), (e213:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s213)-[edge213:WORKS_AT]->(e213) -; -MATCH (s214:Person {neogen_id: '5fe96bfdc4a603720bb395b223fd383429eec4c0'}), (e214:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s214)-[edge214:WORKS_AT]->(e214) -; -MATCH (s215:Person {neogen_id: 'b8b01a22f4e5af53c724611dc8abdad0429de496'}), (e215:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s215)-[edge215:WORKS_AT]->(e215) -; -MATCH (s216:Person {neogen_id: '2256c24980bca911b207f26b097c4dff0585f023'}), (e216:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s216)-[edge216:WORKS_AT]->(e216) -; -MATCH (s217:Person {neogen_id: 'bff2173be57ac59331b2ce0f1b04cedee1aecb56'}), (e217:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s217)-[edge217:WORKS_AT]->(e217) -; -MATCH (s218:Person {neogen_id: 'a878424df724fa5da6a7888aa0229d543abd4805'}), (e218:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s218)-[edge218:WORKS_AT]->(e218) -; -MATCH (s219:Person {neogen_id: '575a372ff3319622567a7451fdd4ebdbe4cb957b'}), (e219:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s219)-[edge219:WORKS_AT]->(e219) -; -MATCH (s220:Person {neogen_id: '5c1c3e55a1d6d193584575067a195d17cb95a80c'}), (e220:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s220)-[edge220:WORKS_AT]->(e220) -; -MATCH (s221:Person {neogen_id: '2f851840553b7cbd3348e9a218c5235a8ad85bf7'}), (e221:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s221)-[edge221:WORKS_AT]->(e221) -; -MATCH (s222:Person {neogen_id: '19ea6df74f89a8944831e08bcb2e6fa48fa11dc1'}), (e222:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s222)-[edge222:WORKS_AT]->(e222) -; -MATCH (s223:Person {neogen_id: 'cb68723e946a836b2618138a91384f45934f076b'}), (e223:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s223)-[edge223:WORKS_AT]->(e223) -; -MATCH (s224:Person {neogen_id: 'c07556f354a234f7f230b198beab6b21e41d7eb8'}), (e224:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s224)-[edge224:WORKS_AT]->(e224) -; -MATCH (s225:Person {neogen_id: '265d23b95722a0d795f1d97aed67404d42278137'}), (e225:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s225)-[edge225:WORKS_AT]->(e225) -; -MATCH (s226:Person {neogen_id: 'f3f66575cc5fa8ab1afec6b24bed9d09da6d965f'}), (e226:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s226)-[edge226:WORKS_AT]->(e226) -; -MATCH (s227:Person {neogen_id: '2b9b0f69a8b96c720373501a1a9d9bddedc023bf'}), (e227:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s227)-[edge227:WORKS_AT]->(e227) -; -MATCH (s228:Person {neogen_id: '67ea417a6633feaac39e999d441beffa24c6256a'}), (e228:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s228)-[edge228:WORKS_AT]->(e228) -; -MATCH (s229:Person {neogen_id: '5f6c273c02343609c923248a25fb7e4887ed84f1'}), (e229:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s229)-[edge229:WORKS_AT]->(e229) -; -MATCH (s230:Person {neogen_id: 'ec8d77c73409736342395d03cace69a1b109eebf'}), (e230:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s230)-[edge230:WORKS_AT]->(e230) -; -MATCH (s231:Person {neogen_id: 'a35e1acd295d12b2f871e3d69d2409cfe8df3a30'}), (e231:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s231)-[edge231:WORKS_AT]->(e231) -; -MATCH (s232:Person {neogen_id: '748bb512c715fbbdb127d999a803293d14f68200'}), (e232:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s232)-[edge232:WORKS_AT]->(e232) -; -MATCH (s233:Person {neogen_id: '114b0f2972de89a3b007c8bfbf2f72d7ccb6d792'}), (e233:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s233)-[edge233:WORKS_AT]->(e233) -; -MATCH (s234:Person {neogen_id: '136f11619cc7884ce02e791836d9d845253bf30a'}), (e234:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s234)-[edge234:WORKS_AT]->(e234) -; -MATCH (s235:Person {neogen_id: '8aba002e790299973feffb9291afb4807d3f2b40'}), (e235:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s235)-[edge235:WORKS_AT]->(e235) -; -MATCH (s236:Person {neogen_id: 'afcee22279ae7dea7c7a6e3868e2c847910753c5'}), (e236:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s236)-[edge236:WORKS_AT]->(e236) -; -MATCH (s237:Person {neogen_id: '9190657f721648cf82c1773364cc01da0e3a7d99'}), (e237:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s237)-[edge237:WORKS_AT]->(e237) -; -MATCH (s238:Person {neogen_id: '66b5405b8a868695101203baa48512967baf84ff'}), (e238:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s238)-[edge238:WORKS_AT]->(e238) -; -MATCH (s239:Person {neogen_id: '4e990a1fa26d0d8747a39794a3698a422c674d7a'}), (e239:Company { neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6'}) -MERGE (s239)-[edge239:WORKS_AT]->(e239) -; -MATCH (s240:Person {neogen_id: '1a2a361ee730592475f1631f6db94f3411c5e100'}), (e240:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s240)-[edge240:WORKS_AT]->(e240) -; -MATCH (s241:Person {neogen_id: 'c8ecbae3548c1a12a3c59e3c0217712903d280d2'}), (e241:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s241)-[edge241:WORKS_AT]->(e241) -; -MATCH (s242:Person {neogen_id: 'acf37d7ce43aea1eff3f5586e1660ff7baf215e6'}), (e242:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s242)-[edge242:WORKS_AT]->(e242) -; -MATCH (s243:Person {neogen_id: '7a8c12178bf97acdf7018b6cc159965ed5985720'}), (e243:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s243)-[edge243:WORKS_AT]->(e243) -; -MATCH (s244:Person {neogen_id: 'ebb43acb6967615089a8c79843998c8c28336a0e'}), (e244:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s244)-[edge244:WORKS_AT]->(e244) -; -MATCH (s245:Person {neogen_id: '1c7f23a62ddcd4b63c5f43fbfd94d4ce39bd7ac2'}), (e245:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s245)-[edge245:WORKS_AT]->(e245) -; -MATCH (s246:Person {neogen_id: '9533caa59e0ca8ad2200dc388f8bfff65aeae6f2'}), (e246:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s246)-[edge246:WORKS_AT]->(e246) -; -MATCH (s247:Person {neogen_id: 'db428b9fe9f24076f2eb9bcdc27032ef1b099f35'}), (e247:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s247)-[edge247:WORKS_AT]->(e247) -; -MATCH (s248:Person {neogen_id: 'da55ae7d4f7a63542dd166b6da647a81e549dba1'}), (e248:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s248)-[edge248:WORKS_AT]->(e248) -; -MATCH (s249:Person {neogen_id: '3ca6c89c657ebfd5a8dbfa0b227d70bfaf71dbc8'}), (e249:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s249)-[edge249:WORKS_AT]->(e249) -; -MATCH (s250:Person {neogen_id: '35bc4ac59f43f0660f2e3b32a2985d926bd68442'}), (e250:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s250)-[edge250:WORKS_AT]->(e250) -; -MATCH (s251:Person {neogen_id: 'fd0ba481e6e050638dd5c142f8164a1a380215d6'}), (e251:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s251)-[edge251:WORKS_AT]->(e251) -; -MATCH (s252:Person {neogen_id: '72d9a08177829f518eb84b1b68a8e9ed815bed1d'}), (e252:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s252)-[edge252:WORKS_AT]->(e252) -; -MATCH (s253:Person {neogen_id: 'ca7a42bc933ec5a68286686ee69a6005d961c591'}), (e253:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s253)-[edge253:WORKS_AT]->(e253) -; -MATCH (s254:Person {neogen_id: 'f93dccf58a3a8dcfdae533e06af6fe0eaa84f8ef'}), (e254:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s254)-[edge254:WORKS_AT]->(e254) -; -MATCH (s255:Person {neogen_id: 'a4eadbfb34db3d458ef45990f5934844472b23f8'}), (e255:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s255)-[edge255:WORKS_AT]->(e255) -; -MATCH (s256:Person {neogen_id: '0894835a07f158a6991e7b040af30ced02304587'}), (e256:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s256)-[edge256:WORKS_AT]->(e256) -; -MATCH (s257:Person {neogen_id: '933ed5eead72f88cd38905119111953c8b76e714'}), (e257:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s257)-[edge257:WORKS_AT]->(e257) -; -MATCH (s258:Person {neogen_id: 'e9d84b3878e7d95ca2df5b94768dbb715737625e'}), (e258:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s258)-[edge258:WORKS_AT]->(e258) -; -MATCH (s259:Person {neogen_id: '60980687fbdfe5f3cb7f7f5def48d6fa83584769'}), (e259:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s259)-[edge259:WORKS_AT]->(e259) -; -MATCH (s260:Person {neogen_id: '723744092da0586d5091294096d355c0e8cea8df'}), (e260:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s260)-[edge260:WORKS_AT]->(e260) -; -MATCH (s261:Person {neogen_id: '02274fff865da36ee6bbee7594701785cdbb7317'}), (e261:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s261)-[edge261:WORKS_AT]->(e261) -; -MATCH (s262:Person {neogen_id: '108472faa899b8aa8257c8f5ff4b0852a672e8c7'}), (e262:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s262)-[edge262:WORKS_AT]->(e262) -; -MATCH (s263:Person {neogen_id: '4cd46d628e87145e153bacfdde78dd3d69bfb087'}), (e263:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s263)-[edge263:WORKS_AT]->(e263) -; -MATCH (s264:Person {neogen_id: 'fb619ca578bc56cebaf2bb8bc855ccf3f42ce712'}), (e264:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s264)-[edge264:WORKS_AT]->(e264) -; -MATCH (s265:Person {neogen_id: 'f78d82f348502f841fcdde81f69403dfed7cb35d'}), (e265:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s265)-[edge265:WORKS_AT]->(e265) -; -MATCH (s266:Person {neogen_id: '8f85240d30ac791b951c5c06f74dcadada484f4b'}), (e266:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s266)-[edge266:WORKS_AT]->(e266) -; -MATCH (s267:Person {neogen_id: '7e4e18d2f8b70ed11f790ed578945ae660a863ee'}), (e267:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s267)-[edge267:WORKS_AT]->(e267) -; -MATCH (s268:Person {neogen_id: '210aa1a398b7a352c177d7ed4bebbfd102bcf962'}), (e268:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s268)-[edge268:WORKS_AT]->(e268) -; -MATCH (s269:Person {neogen_id: 'e19217623952283995a1e04810bbdcd45a200e36'}), (e269:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s269)-[edge269:WORKS_AT]->(e269) -; -MATCH (s270:Person {neogen_id: 'dbecb6a820be702b422dde7bd8e6165c5a66a29a'}), (e270:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s270)-[edge270:WORKS_AT]->(e270) -; -MATCH (s271:Person {neogen_id: '58056dffa35c3ae311aa4cabe463c85d2637ac44'}), (e271:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s271)-[edge271:WORKS_AT]->(e271) -; -MATCH (s272:Person {neogen_id: '6dc277b74ae6fb407d05b8a753f3eaba06b945be'}), (e272:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s272)-[edge272:WORKS_AT]->(e272) -; -MATCH (s273:Person {neogen_id: 'b49ae26bb3729c3c87616ac5751a2dd9877190bf'}), (e273:Company { neogen_id: '659ce23acfa8bd130afbde4202194903211b3637'}) -MERGE (s273)-[edge273:WORKS_AT]->(e273) -; -MATCH (s274:Person {neogen_id: '1b7285b4dde882c0e197738532d5492481a44fb7'}), (e274:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s274)-[edge274:WORKS_AT]->(e274) -; -MATCH (s275:Person {neogen_id: '3fc66d72bcedf6a946d27c49cd9b9cb753c7f5e2'}), (e275:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s275)-[edge275:WORKS_AT]->(e275) -; -MATCH (s276:Person {neogen_id: '2369e0221c2d2db795270bf8a2871cd4d4bfbc50'}), (e276:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s276)-[edge276:WORKS_AT]->(e276) -; -MATCH (s277:Person {neogen_id: 'fc7e019b36cb1ed17cf84cdce685e0c6e21d7948'}), (e277:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s277)-[edge277:WORKS_AT]->(e277) -; -MATCH (s278:Person {neogen_id: 'c68701838be1dd99df706ca5b5b3ce0c7a2d2a25'}), (e278:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s278)-[edge278:WORKS_AT]->(e278) -; -MATCH (s279:Person {neogen_id: '2933faefa426ffac13ac31507a75f6976ae094a0'}), (e279:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s279)-[edge279:WORKS_AT]->(e279) -; -MATCH (s280:Person {neogen_id: '5f6484e7e532be925cc33afe934c9dce00fee44e'}), (e280:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s280)-[edge280:WORKS_AT]->(e280) -; -MATCH (s281:Person {neogen_id: '89fa17bd47b5ffa2b1b3cb0187a6cba3a25193a9'}), (e281:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s281)-[edge281:WORKS_AT]->(e281) -; -MATCH (s282:Person {neogen_id: '568f313578c1ce26208c7428341262f8454e7dac'}), (e282:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s282)-[edge282:WORKS_AT]->(e282) -; -MATCH (s283:Person {neogen_id: 'ec48e20e64147aad38d29a3f7617c35cbcbab116'}), (e283:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s283)-[edge283:WORKS_AT]->(e283) -; -MATCH (s284:Person {neogen_id: '0d9acf4b17abfad3fea8bb2d5245dc67868efbfa'}), (e284:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s284)-[edge284:WORKS_AT]->(e284) -; -MATCH (s285:Person {neogen_id: 'eaaea28d14889583583e2229b4bf9a96ea206c5d'}), (e285:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s285)-[edge285:WORKS_AT]->(e285) -; -MATCH (s286:Person {neogen_id: '5eff91a5cfb0ff3e22e0718990d67407f3009dc1'}), (e286:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s286)-[edge286:WORKS_AT]->(e286) -; -MATCH (s287:Person {neogen_id: '7c849cd7febfc81140fb0da9b3fbce2ce4ab3450'}), (e287:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s287)-[edge287:WORKS_AT]->(e287) -; -MATCH (s288:Person {neogen_id: 'd310f5bc087cccde9fca60400686f9785778f155'}), (e288:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s288)-[edge288:WORKS_AT]->(e288) -; -MATCH (s289:Person {neogen_id: 'dbee80571750b0252d194d66f6331d4e1284a380'}), (e289:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s289)-[edge289:WORKS_AT]->(e289) -; -MATCH (s290:Person {neogen_id: '1ea4e538b96b5450c2f3a3dc9f191fd2d9236fc4'}), (e290:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s290)-[edge290:WORKS_AT]->(e290) -; -MATCH (s291:Person {neogen_id: '307731a4da6aa1bb1af70b817632ffdfaacf64f8'}), (e291:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s291)-[edge291:WORKS_AT]->(e291) -; -MATCH (s292:Person {neogen_id: '3b6cd9d45f6ab333be9fc69508ceb8ad95183298'}), (e292:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s292)-[edge292:WORKS_AT]->(e292) -; -MATCH (s293:Person {neogen_id: 'e5ba1788dcb05ebb95196f82d041fda5322e667e'}), (e293:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s293)-[edge293:WORKS_AT]->(e293) -; -MATCH (s294:Person {neogen_id: 'b9fd941d418bfb77baae7bd039570241283bc33d'}), (e294:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s294)-[edge294:WORKS_AT]->(e294) -; -MATCH (s295:Person {neogen_id: '5f48856abdf81ea109508367060fffea0d8b8de7'}), (e295:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s295)-[edge295:WORKS_AT]->(e295) -; -MATCH (s296:Person {neogen_id: '07cd8353f5d5fedd6aeff0874dac02448d51889a'}), (e296:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s296)-[edge296:WORKS_AT]->(e296) -; -MATCH (s297:Person {neogen_id: '17e26cf494f009a5e0ff3b6ff54b32ad6bdd029e'}), (e297:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s297)-[edge297:WORKS_AT]->(e297) -; -MATCH (s298:Person {neogen_id: 'e3a6fe861fd6073f66dc26691438a1ec0b76557e'}), (e298:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s298)-[edge298:WORKS_AT]->(e298) -; -MATCH (s299:Person {neogen_id: '88eaa80cf6278e4b3f61557e7f1d77ed2d666b6a'}), (e299:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s299)-[edge299:WORKS_AT]->(e299) -; -MATCH (s300:Person {neogen_id: '9db5a3b079eae5b3702e634217fb604f1c5f3fee'}), (e300:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s300)-[edge300:WORKS_AT]->(e300) -; -MATCH (s301:Person {neogen_id: '7a87c5e2b1a26c074b16041a3713622f9cf52391'}), (e301:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s301)-[edge301:WORKS_AT]->(e301) -; -MATCH (s302:Person {neogen_id: '2eb28d8b3f2ed31215c4dd1a565b7b79b18ce789'}), (e302:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s302)-[edge302:WORKS_AT]->(e302) -; -MATCH (s303:Person {neogen_id: 'b2d0110e9a4fbac7a29d583f03446e39e21a8d26'}), (e303:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s303)-[edge303:WORKS_AT]->(e303) -; -MATCH (s304:Person {neogen_id: '42989211c22964ba1fe7f876c655ff3572591b9b'}), (e304:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s304)-[edge304:WORKS_AT]->(e304) -; -MATCH (s305:Person {neogen_id: '6d49cc29a37c69baaad95b5acc480aaa30e3f79a'}), (e305:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s305)-[edge305:WORKS_AT]->(e305) -; -MATCH (s306:Person {neogen_id: '34109a9df834b1bd90e123034b490af702b5925b'}), (e306:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s306)-[edge306:WORKS_AT]->(e306) -; -MATCH (s307:Person {neogen_id: 'a43d40a63e920c35801eb5ab1964ade3efefc9ad'}), (e307:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s307)-[edge307:WORKS_AT]->(e307) -; -MATCH (s308:Person {neogen_id: 'bff80b168cd3eab2057d53fb2d231b5d2ba16f68'}), (e308:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s308)-[edge308:WORKS_AT]->(e308) -; -MATCH (s309:Person {neogen_id: 'eb1455e2af0d012d595df3b357eb05178e020e39'}), (e309:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s309)-[edge309:WORKS_AT]->(e309) -; -MATCH (s310:Person {neogen_id: '7264c78f90d1d0055146fae4d23734ad9fc0d572'}), (e310:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s310)-[edge310:WORKS_AT]->(e310) -; -MATCH (s311:Person {neogen_id: 'd2561b74570e0ef6108e5bead6b631c1b4f90f40'}), (e311:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s311)-[edge311:WORKS_AT]->(e311) -; -MATCH (s312:Person {neogen_id: 'ace08d15a8d75222a943319d10d816ccae735eef'}), (e312:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s312)-[edge312:WORKS_AT]->(e312) -; -MATCH (s313:Person {neogen_id: '717f773bcfff8186ec171c57f973625821ef16ca'}), (e313:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s313)-[edge313:WORKS_AT]->(e313) -; -MATCH (s314:Person {neogen_id: '1ea412f526bdbc55c0472b6eab748915c3c4e9f5'}), (e314:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s314)-[edge314:WORKS_AT]->(e314) -; -MATCH (s315:Person {neogen_id: '51453ad4f1e2a71a0f016b21b5d35d49cb7d5635'}), (e315:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s315)-[edge315:WORKS_AT]->(e315) -; -MATCH (s316:Person {neogen_id: '8c09617a4e20799869d5c7b6cc1f983af5925599'}), (e316:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s316)-[edge316:WORKS_AT]->(e316) -; -MATCH (s317:Person {neogen_id: 'd8a877c32321984ac184e50c8280f3b6df9d37bd'}), (e317:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s317)-[edge317:WORKS_AT]->(e317) -; -MATCH (s318:Person {neogen_id: 'f773dadf2c510e54b7881f58dd737d41a4ac670c'}), (e318:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s318)-[edge318:WORKS_AT]->(e318) -; -MATCH (s319:Person {neogen_id: '5a80030cf5c0c3be6bf2bcdd9e53566c1da6279e'}), (e319:Company { neogen_id: '13bb846033cf7d656e58cabc22e6d23b7ea994d5'}) -MERGE (s319)-[edge319:WORKS_AT]->(e319) -; -MATCH (s320:Person {neogen_id: '535ffc6e799eee190ad70e180fbed26e9748edc3'}), (e320:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s320)-[edge320:WORKS_AT]->(e320) -; -MATCH (s321:Person {neogen_id: '3f1f5d6c524496e80da6ddb5edeee12f8fc729c4'}), (e321:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s321)-[edge321:WORKS_AT]->(e321) -; -MATCH (s322:Person {neogen_id: 'f15df598dcb4d42ca6032ab83462cc01efb58aac'}), (e322:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s322)-[edge322:WORKS_AT]->(e322) -; -MATCH (s323:Person {neogen_id: '13d3c53a471218cb3b485397cc159d13b50a150a'}), (e323:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s323)-[edge323:WORKS_AT]->(e323) -; -MATCH (s324:Person {neogen_id: 'cfb9791beee8bfe025290d5610efe6914d231726'}), (e324:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s324)-[edge324:WORKS_AT]->(e324) -; -MATCH (s325:Person {neogen_id: 'fb25b8721d034823e205f43275a44f7db74c0f84'}), (e325:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s325)-[edge325:WORKS_AT]->(e325) -; -MATCH (s326:Person {neogen_id: '54d63b3a800e780eb3a706564942595813f02262'}), (e326:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s326)-[edge326:WORKS_AT]->(e326) -; -MATCH (s327:Person {neogen_id: '6cf6c76570628d0ac6592c84533ca4bddf5dfa33'}), (e327:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s327)-[edge327:WORKS_AT]->(e327) -; -MATCH (s328:Person {neogen_id: '7800ddf4a82cc99f6ce9b99cae5c86c64361269d'}), (e328:Company { neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}) -MERGE (s328)-[edge328:WORKS_AT]->(e328) -; -MATCH (s329:Person {neogen_id: '73c0b24fb02334b97d822e8325274a7b415fe719'}), (e329:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s329)-[edge329:WORKS_AT]->(e329) -; -MATCH (s330:Person {neogen_id: '838b0d9f4187be244847fb55a9f22478533d64ca'}), (e330:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s330)-[edge330:WORKS_AT]->(e330) -; -MATCH (s331:Person {neogen_id: '4cb4f717953aac35f48d0463f9661568835e84b2'}), (e331:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s331)-[edge331:WORKS_AT]->(e331) -; -MATCH (s332:Person {neogen_id: 'b5dc7e81fbb8af88a817d8730ffafa018cd2d373'}), (e332:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s332)-[edge332:WORKS_AT]->(e332) -; -MATCH (s333:Person {neogen_id: '51b922440d7b923c96ed7cc0753b0f80461e0bda'}), (e333:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s333)-[edge333:WORKS_AT]->(e333) -; -MATCH (s334:Person {neogen_id: '2ed30b7ca0456f17d475614c4397b0a685776a81'}), (e334:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s334)-[edge334:WORKS_AT]->(e334) -; -MATCH (s335:Person {neogen_id: '422482db04b448cc41a0c404c3a5e96c4c81142b'}), (e335:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s335)-[edge335:WORKS_AT]->(e335) -; -MATCH (s336:Person {neogen_id: '026302844f3d9e1cb10cb36138cf3b3c38f6e5c8'}), (e336:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s336)-[edge336:WORKS_AT]->(e336) -; -MATCH (s337:Person {neogen_id: '0c4a14c3a594cf7509f686df837b1afc5cfcce1e'}), (e337:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s337)-[edge337:WORKS_AT]->(e337) -; -MATCH (s338:Person {neogen_id: '109fcc0217e317b7e0bd82d17021b39134306fc4'}), (e338:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s338)-[edge338:WORKS_AT]->(e338) -; -MATCH (s339:Person {neogen_id: '0568123b8124855e357326025000f8c55bdcb249'}), (e339:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s339)-[edge339:WORKS_AT]->(e339) -; -MATCH (s340:Person {neogen_id: '142b769f1af7cd7e0ebb8ebd4748f3f1bd1910ef'}), (e340:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s340)-[edge340:WORKS_AT]->(e340) -; -MATCH (s341:Person {neogen_id: '65bcd275918bf6b75f6a9afd664351df26c7381e'}), (e341:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s341)-[edge341:WORKS_AT]->(e341) -; -MATCH (s342:Person {neogen_id: 'd1d6cb9258f9f028a7e3c771288c223af90cabd3'}), (e342:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s342)-[edge342:WORKS_AT]->(e342) -; -MATCH (s343:Person {neogen_id: '0347d147b2de2d2868c9ca5a08fb2aae81e85e29'}), (e343:Company { neogen_id: '13bb846033cf7d656e58cabc22e6d23b7ea994d5'}) -MERGE (s343)-[edge343:WORKS_AT]->(e343) -; -MATCH (s344:Person {neogen_id: '0b3a539828760700abd511e34b4d7bb9431db7f0'}), (e344:Company { neogen_id: '659ce23acfa8bd130afbde4202194903211b3637'}) -MERGE (s344)-[edge344:WORKS_AT]->(e344) -; -MATCH (s345:Person {neogen_id: '996bd505f8df8ea259cbc6ceeb6f56f6dbfde3a6'}), (e345:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s345)-[edge345:WORKS_AT]->(e345) -; -MATCH (s346:Person {neogen_id: 'ff354c73119ba7787bf6d4e916e25f2a1bc1e051'}), (e346:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s346)-[edge346:WORKS_AT]->(e346) -; -MATCH (s347:Person {neogen_id: 'beaafbc0151b33888c18083cb4777135db149072'}), (e347:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s347)-[edge347:WORKS_AT]->(e347) -; -MATCH (s348:Person {neogen_id: 'aa6fa9cfe7d49e575702466fdf918e01e31309a0'}), (e348:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s348)-[edge348:WORKS_AT]->(e348) -; -MATCH (s349:Person {neogen_id: 'bc904bd63f9d7d80c7386dfbfb1f420d11ec87d6'}), (e349:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s349)-[edge349:WORKS_AT]->(e349) -; -MATCH (s350:Person {neogen_id: 'fda68a2353c538bd6f511db92a43d3cc011ecbe4'}), (e350:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s350)-[edge350:WORKS_AT]->(e350) -; -MATCH (s351:Person {neogen_id: '3e9a84351f3959948dc549fb74a0dea92ee97764'}), (e351:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s351)-[edge351:WORKS_AT]->(e351) -; -MATCH (s352:Person {neogen_id: 'd12120fbe173dc77e94f85e1aac899388410f3c2'}), (e352:Company { neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6'}) -MERGE (s352)-[edge352:WORKS_AT]->(e352) -; -MATCH (s353:Person {neogen_id: '505b540894bb52c1b6ab9b456a77a5de3676aa70'}), (e353:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s353)-[edge353:WORKS_AT]->(e353) -; -MATCH (s354:Person {neogen_id: 'a8eaaf936d157d0b72f758817b2373b0103834e3'}), (e354:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s354)-[edge354:WORKS_AT]->(e354) -; -MATCH (s355:Person {neogen_id: 'a18c3913f9b9ac588e1290a7b724a557531f291d'}), (e355:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s355)-[edge355:WORKS_AT]->(e355) -; -MATCH (s356:Person {neogen_id: '67d9ecf41ad733d6ddd15241dabd446ea2c7b025'}), (e356:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s356)-[edge356:WORKS_AT]->(e356) -; -MATCH (s357:Person {neogen_id: '2379551139dd3e91ad7780d51bb7aaef51e43099'}), (e357:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s357)-[edge357:WORKS_AT]->(e357) -; -MATCH (s358:Person {neogen_id: '13d23cf79a2322263cc94243492e51f0fc8a5de5'}), (e358:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s358)-[edge358:WORKS_AT]->(e358) -; -MATCH (s359:Person {neogen_id: 'ee33aa9b8393ebbbf23cba98384d4e39d9954989'}), (e359:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s359)-[edge359:WORKS_AT]->(e359) -; -MATCH (s360:Person {neogen_id: '419d504bd92511a25f79a93b8ceea77240857c62'}), (e360:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s360)-[edge360:WORKS_AT]->(e360) -; -MATCH (s361:Person {neogen_id: 'e926e6eab6deaa8a8b5ef82099b5ac0882bed6f1'}), (e361:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s361)-[edge361:WORKS_AT]->(e361) -; -MATCH (s362:Person {neogen_id: '4d5cdfc4b73119d028f117112bed2ebb968cffb2'}), (e362:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s362)-[edge362:WORKS_AT]->(e362) -; -MATCH (s363:Person {neogen_id: 'bd697a1b806e9ac7cb71d64905e3999da13b7173'}), (e363:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s363)-[edge363:WORKS_AT]->(e363) -; -MATCH (s364:Person {neogen_id: 'f7e6cb351b5730f017bcd1bec69443993ec2ecfc'}), (e364:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s364)-[edge364:WORKS_AT]->(e364) -; -MATCH (s365:Person {neogen_id: '667e1419ec23da6978093b7ed53ce1548e5dbdab'}), (e365:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s365)-[edge365:WORKS_AT]->(e365) -; -MATCH (s366:Person {neogen_id: '474992a501d9920d8f9153e7476077870666f2cb'}), (e366:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s366)-[edge366:WORKS_AT]->(e366) -; -MATCH (s367:Person {neogen_id: 'd3f1b7aef15d82063c624cf02537e944f63c7200'}), (e367:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s367)-[edge367:WORKS_AT]->(e367) -; -MATCH (s368:Person {neogen_id: '151bea602159b22d2fccd6cb106b86c7d14fba94'}), (e368:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s368)-[edge368:WORKS_AT]->(e368) -; -MATCH (s369:Person {neogen_id: 'a4e1d21f043e112fa7c51c4a67a0612ecd00c6d4'}), (e369:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s369)-[edge369:WORKS_AT]->(e369) -; -MATCH (s370:Person {neogen_id: 'fa96cbe1cdc403facf2120617dfd5d1701f6d2c3'}), (e370:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s370)-[edge370:WORKS_AT]->(e370) -; -MATCH (s371:Person {neogen_id: 'fb9f42ba17cbbd682c59b108afbda34ea9a80ec4'}), (e371:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s371)-[edge371:WORKS_AT]->(e371) -; -MATCH (s372:Person {neogen_id: '588c913096a34635751d204022d4fa7fe6ae087e'}), (e372:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s372)-[edge372:WORKS_AT]->(e372) -; -MATCH (s373:Person {neogen_id: '9ca9682c8a327dead171e7ff5b91f65ea13ab300'}), (e373:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s373)-[edge373:WORKS_AT]->(e373) -; -MATCH (s374:Person {neogen_id: '613940d5682a89c7ccf619d123afac3f77481749'}), (e374:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s374)-[edge374:WORKS_AT]->(e374) -; -MATCH (s375:Person {neogen_id: 'caaf9c93d6e7d1c9600ab233916eec81c6614fa4'}), (e375:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s375)-[edge375:WORKS_AT]->(e375) -; -MATCH (s376:Person {neogen_id: '9a2f5af7bf52970916f43c4fed0e53d09e4c9cbd'}), (e376:Company { neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}) -MERGE (s376)-[edge376:WORKS_AT]->(e376) -; -MATCH (s377:Person {neogen_id: 'd493dfdd3b7d7ede77e0fc358acdd5cb65026827'}), (e377:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s377)-[edge377:WORKS_AT]->(e377) -; -MATCH (s378:Person {neogen_id: 'ebfac5314351627c45a3ca988df5180342906501'}), (e378:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s378)-[edge378:WORKS_AT]->(e378) -; -MATCH (s379:Person {neogen_id: '2bb7dd4d935a50d5b0fc8adc41b91c4140b74df0'}), (e379:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s379)-[edge379:WORKS_AT]->(e379) -; -MATCH (s380:Person {neogen_id: '7e25180a96766faeaa6e96f0a108bcf56024b43f'}), (e380:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s380)-[edge380:WORKS_AT]->(e380) -; -MATCH (s381:Person {neogen_id: '8531ea25d35ba20f524b6638444ab90a3682c979'}), (e381:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s381)-[edge381:WORKS_AT]->(e381) -; -MATCH (s382:Person {neogen_id: '4cd6de3e0063f699060015002beea5e9f0410800'}), (e382:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s382)-[edge382:WORKS_AT]->(e382) -; -MATCH (s383:Person {neogen_id: '2964feb400181f68cf3467daed99f6190b986aa2'}), (e383:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s383)-[edge383:WORKS_AT]->(e383) -; -MATCH (s384:Person {neogen_id: '6f0ac790159d6bbf42fdc70bb5f7538a55d9d1de'}), (e384:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s384)-[edge384:WORKS_AT]->(e384) -; -MATCH (s385:Person {neogen_id: '3d4668662fab756447b8434beba3aa724ce23fb5'}), (e385:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s385)-[edge385:WORKS_AT]->(e385) -; -MATCH (s386:Person {neogen_id: '2b95c6db46a989ce76d8bf21362238d00653864b'}), (e386:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s386)-[edge386:WORKS_AT]->(e386) -; -MATCH (s387:Person {neogen_id: '32c58bc3925ce1ba65800eba27c3675bc928af45'}), (e387:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s387)-[edge387:WORKS_AT]->(e387) -; -MATCH (s388:Person {neogen_id: 'c39f7d19868c5a9f4f56bebd4f90188c076e4cf0'}), (e388:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s388)-[edge388:WORKS_AT]->(e388) -; -MATCH (s389:Person {neogen_id: 'dc29b593e6b1771b786962f668cd53880b25d911'}), (e389:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s389)-[edge389:WORKS_AT]->(e389) -; -MATCH (s390:Person {neogen_id: 'c1c92894292b64c5d9607be75e7944cd56429dcd'}), (e390:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s390)-[edge390:WORKS_AT]->(e390) -; -MATCH (s391:Person {neogen_id: '272d4e7b617c45599650c6f92b2597ac36542370'}), (e391:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s391)-[edge391:WORKS_AT]->(e391) -; -MATCH (s392:Person {neogen_id: '57b83321849bafebe4491e2c86ef1a16f64f20f1'}), (e392:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s392)-[edge392:WORKS_AT]->(e392) -; -MATCH (s393:Person {neogen_id: '028ed5ae755bb1cc9148d16567f1253fabc1dd92'}), (e393:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s393)-[edge393:WORKS_AT]->(e393) -; -MATCH (s394:Person {neogen_id: '0686b9976703cee7df9c18b6e67c6e238947c51c'}), (e394:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s394)-[edge394:WORKS_AT]->(e394) -; -MATCH (s395:Person {neogen_id: 'ffe0a1e48c6f582a8438f60d1cc144e6b4b68357'}), (e395:Company { neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}) -MERGE (s395)-[edge395:WORKS_AT]->(e395) -; -MATCH (s396:Person {neogen_id: '6946d3043d00fcae5d48f53636684d50f6b673d5'}), (e396:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s396)-[edge396:WORKS_AT]->(e396) -; -MATCH (s397:Person {neogen_id: 'f4eab9abdfb5fd13bbe010319b09e8ff8fc8ae40'}), (e397:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s397)-[edge397:WORKS_AT]->(e397) -; -MATCH (s398:Person {neogen_id: '9b603e25cfa7fd8987e97c4b9b0ac6558a05dce6'}), (e398:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s398)-[edge398:WORKS_AT]->(e398) -; -MATCH (s399:Person {neogen_id: '39fafdeaeb01b7876a201d367ee1f713f7977693'}), (e399:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s399)-[edge399:WORKS_AT]->(e399) -; -MATCH (s400:Person {neogen_id: '1d822e93817ac44c64bd5d0d7efc3ca189e75a80'}), (e400:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s400)-[edge400:WORKS_AT]->(e400) -; -MATCH (s401:Person {neogen_id: 'bfa4e694fd93efa59316211bfea75c15bd173253'}), (e401:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s401)-[edge401:WORKS_AT]->(e401) -; -MATCH (s402:Person {neogen_id: 'ee28d52726c83f7fd78b50a3eac6fd35ad018b90'}), (e402:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s402)-[edge402:WORKS_AT]->(e402) -; -MATCH (s403:Person {neogen_id: 'b06c06c393a97011bf7c3f6c544da4904e24fd86'}), (e403:Company { neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}) -MERGE (s403)-[edge403:WORKS_AT]->(e403) -; -MATCH (s404:Person {neogen_id: 'cf54851326ffc8dab2bfe77e615498da25c57af7'}), (e404:Company { neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}) -MERGE (s404)-[edge404:WORKS_AT]->(e404) -; -MATCH (s405:Person {neogen_id: '4ee2a76cf0b997a3f94ee206f2b28735a878ce32'}), (e405:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s405)-[edge405:WORKS_AT]->(e405) -; -MATCH (s406:Person {neogen_id: 'e22b42ac5408a82a5df21412f24b176e26ba5819'}), (e406:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s406)-[edge406:WORKS_AT]->(e406) -; -MATCH (s407:Person {neogen_id: 'adc0d665cef53d4cfa55feca0b239413cd4f8088'}), (e407:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s407)-[edge407:WORKS_AT]->(e407) -; -MATCH (s408:Person {neogen_id: '181d38258aef2258510c5fb2a771727d6f8f9012'}), (e408:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s408)-[edge408:WORKS_AT]->(e408) -; -MATCH (s409:Person {neogen_id: 'fe8bfdc2d3e051eea407e590ecf560803533cf34'}), (e409:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s409)-[edge409:WORKS_AT]->(e409) -; -MATCH (s410:Person {neogen_id: '461624e85265724b0c29c1b7f5db6b8aec952bad'}), (e410:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s410)-[edge410:WORKS_AT]->(e410) -; -MATCH (s411:Person {neogen_id: 'a48d860c8893d52cce843277006237b4e0d30a60'}), (e411:Company { neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}) -MERGE (s411)-[edge411:WORKS_AT]->(e411) -; -MATCH (s412:Person {neogen_id: '6fb8f33141660a336e36503dd8f587a3749657d4'}), (e412:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s412)-[edge412:WORKS_AT]->(e412) -; -MATCH (s413:Person {neogen_id: '34d689504b0514011aa71659760d732c6b039931'}), (e413:Company { neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}) -MERGE (s413)-[edge413:WORKS_AT]->(e413) -; -MATCH (s414:Person {neogen_id: '3360bdf61046cf17073df8c8b7a7359b5130113d'}), (e414:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s414)-[edge414:WORKS_AT]->(e414) -; -MATCH (s415:Person {neogen_id: '46d293be3d94171c7aca62a07af8851ca10e6556'}), (e415:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s415)-[edge415:WORKS_AT]->(e415) -; -MATCH (s416:Person {neogen_id: '34eeec19b07c392389749388544e50445d2d8767'}), (e416:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s416)-[edge416:WORKS_AT]->(e416) -; -MATCH (s417:Person {neogen_id: '5e643ede98b2db4f11645ff534eefcbebd2dc653'}), (e417:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s417)-[edge417:WORKS_AT]->(e417) -; -MATCH (s418:Person {neogen_id: '7a26a4f1fa4e5d46c7fcdfa7aa50e7a0180ebaa4'}), (e418:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s418)-[edge418:WORKS_AT]->(e418) -; -MATCH (s419:Person {neogen_id: '215530bcf5d03d81cd877721a54db9a8e2de4632'}), (e419:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s419)-[edge419:WORKS_AT]->(e419) -; -MATCH (s420:Person {neogen_id: 'f7174c7cc06c575917822e848af98b729baf3518'}), (e420:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s420)-[edge420:WORKS_AT]->(e420) -; -MATCH (s421:Person {neogen_id: 'ef2a86709c93e235b08f9ed17d2cb5e05b75f75a'}), (e421:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s421)-[edge421:WORKS_AT]->(e421) -; -MATCH (s422:Person {neogen_id: '86e1a7cc22985b7e81f1bc890e3236f6fc554ae5'}), (e422:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s422)-[edge422:WORKS_AT]->(e422) -; -MATCH (s423:Person {neogen_id: '85406d84256b54aded1215db30dba05839b45ff5'}), (e423:Company { neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}) -MERGE (s423)-[edge423:WORKS_AT]->(e423) -; -MATCH (s424:Person {neogen_id: '7031abebd5f58e18d29bc89b8944a99d64e86f79'}), (e424:Company { neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}) -MERGE (s424)-[edge424:WORKS_AT]->(e424) -; -MATCH (s425:Person {neogen_id: '424a591459adf6624ae52c1ed91d2b2f88e5af45'}), (e425:Company { neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}) -MERGE (s425)-[edge425:WORKS_AT]->(e425) -; -MATCH (s426:Person {neogen_id: 'deed06ec110f950cca9bf04cf8ba2c9404bee6ba'}), (e426:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s426)-[edge426:WORKS_AT]->(e426) -; -MATCH (s427:Person {neogen_id: 'bdb7d363904c5e8fb0d0006a991add284993d04b'}), (e427:Company { neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}) -MERGE (s427)-[edge427:WORKS_AT]->(e427) -; -MATCH (s428:Person {neogen_id: 'ca3758d2fc91f56e8166d084cc869fc1dabff173'}), (e428:Company { neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}) -MERGE (s428)-[edge428:WORKS_AT]->(e428) -; -MATCH (s429:Person {neogen_id: 'e5d15cf0ac0b6fdc6482227e7fedaba6a5da4671'}), (e429:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s429)-[edge429:WORKS_AT]->(e429) -; -MATCH (s430:Person {neogen_id: '78893fd8ae0a297d50ede3737b8dce4784c343f1'}), (e430:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s430)-[edge430:WORKS_AT]->(e430) -; -MATCH (s431:Person {neogen_id: '90123be9fcf3616b4bf13c642a87cce7a7323fa5'}), (e431:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s431)-[edge431:WORKS_AT]->(e431) -; -MATCH (s432:Person {neogen_id: '1928c7f46dfdc823aa7a574b9dcbcf9aeb3af586'}), (e432:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s432)-[edge432:WORKS_AT]->(e432) -; -MATCH (s433:Person {neogen_id: '94743f633f0e72d795969d6c8d3e697306a6e20c'}), (e433:Company { neogen_id: 'f5017914486a5459729846842847ff40708e7948'}) -MERGE (s433)-[edge433:WORKS_AT]->(e433) -; -MATCH (s434:Person {neogen_id: 'b41085a8fe31065a3b9a063a2a1e79cab816d74c'}), (e434:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s434)-[edge434:WORKS_AT]->(e434) -; -MATCH (s435:Person {neogen_id: '7c149631a99c78b2d277829cce7b9638d58c0d3d'}), (e435:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s435)-[edge435:WORKS_AT]->(e435) -; -MATCH (s436:Person {neogen_id: '2cd34128bc8f45c13aa14b2678030a1ecc5105d2'}), (e436:Company { neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}) -MERGE (s436)-[edge436:WORKS_AT]->(e436) -; -MATCH (s437:Person {neogen_id: '0d0f292a8416024dc33affd15f48691228837fb0'}), (e437:Company { neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}) -MERGE (s437)-[edge437:WORKS_AT]->(e437) -; -MATCH (s438:Person {neogen_id: 'b04e481e49e823867884332b898b6afb79fa21ab'}), (e438:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s438)-[edge438:WORKS_AT]->(e438) -; -MATCH (s439:Person {neogen_id: 'bc7920f2447437dc59251694831410a675d22c69'}), (e439:Company { neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}) -MERGE (s439)-[edge439:WORKS_AT]->(e439) -; -MATCH (s440:Person {neogen_id: '3fd54241fdd97a521b0eca3afea64eb7d3891b67'}), (e440:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s440)-[edge440:WORKS_AT]->(e440) -; -MATCH (s441:Person {neogen_id: '90be776b3a1d2b20e7d7fe51d9a0b620e96d0679'}), (e441:Company { neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}) -MERGE (s441)-[edge441:WORKS_AT]->(e441) -; -MATCH (s442:Person {neogen_id: 'd636c68e10a8fde8b3af4a9f6f951563b6a866d8'}), (e442:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s442)-[edge442:WORKS_AT]->(e442) -; -MATCH (s443:Person {neogen_id: 'efe96dadd4d6d12651ffc04fa21fbd5becb52e3f'}), (e443:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s443)-[edge443:WORKS_AT]->(e443) -; -MATCH (s444:Person {neogen_id: '9646977127602bce49467f9f19e7b6019848b95e'}), (e444:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s444)-[edge444:WORKS_AT]->(e444) -; -MATCH (s445:Person {neogen_id: '737451f7e58a27f85d26e87a1ae2dd45cfa1078a'}), (e445:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s445)-[edge445:WORKS_AT]->(e445) -; -MATCH (s446:Person {neogen_id: '48bd300ef7a0827c9349f3ab0606222b8dfcb3b9'}), (e446:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s446)-[edge446:WORKS_AT]->(e446) -; -MATCH (s447:Person {neogen_id: 'b900010c54fe4ab260b6db355089da641823d604'}), (e447:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s447)-[edge447:WORKS_AT]->(e447) -; -MATCH (s448:Person {neogen_id: '7d1e838db3cb4fc00b25b1dd3923fb74399edc7f'}), (e448:Company { neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}) -MERGE (s448)-[edge448:WORKS_AT]->(e448) -; -MATCH (s449:Person {neogen_id: '88b59c106d06372b6d32f146a17a6c25ec1724e5'}), (e449:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s449)-[edge449:WORKS_AT]->(e449) -; -MATCH (s450:Person {neogen_id: 'a5d4783bf3c1f29cc2542f4ce9c65ba7d46080a8'}), (e450:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s450)-[edge450:WORKS_AT]->(e450) -; -MATCH (s451:Person {neogen_id: '598f8ae22aa784ba771102ebcdf35d972be7a289'}), (e451:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s451)-[edge451:WORKS_AT]->(e451) -; -MATCH (s452:Person {neogen_id: '35338e65a0e2f93fd6fe357409bf36eeee9c5a25'}), (e452:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s452)-[edge452:WORKS_AT]->(e452) -; -MATCH (s453:Person {neogen_id: 'edd6b7779e52f29c0ca768738c08f0c6897560d5'}), (e453:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s453)-[edge453:WORKS_AT]->(e453) -; -MATCH (s454:Person {neogen_id: 'e270b161ab369c0ce328c08b27c0004f4d83170d'}), (e454:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s454)-[edge454:WORKS_AT]->(e454) -; -MATCH (s455:Person {neogen_id: '98d629817a3eff1be85b2311275a6ab0ea8e04db'}), (e455:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s455)-[edge455:WORKS_AT]->(e455) -; -MATCH (s456:Person {neogen_id: '755ff38c2091e35286dc0d0b2d951830769eab99'}), (e456:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s456)-[edge456:WORKS_AT]->(e456) -; -MATCH (s457:Person {neogen_id: '8a6ce3df78cb29f56d68e64e07e8a3bb9561d0c6'}), (e457:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s457)-[edge457:WORKS_AT]->(e457) -; -MATCH (s458:Person {neogen_id: '135678699b50eb1f1a1150e6854b538cfbe66d77'}), (e458:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s458)-[edge458:WORKS_AT]->(e458) -; -MATCH (s459:Person {neogen_id: '66b59cc067f1bce3dbed0bfd0266e4f423edab11'}), (e459:Company { neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}) -MERGE (s459)-[edge459:WORKS_AT]->(e459) -; -MATCH (s460:Person {neogen_id: 'bde16cf828d410de0f1033085b41e5e5c7bee207'}), (e460:Company { neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}) -MERGE (s460)-[edge460:WORKS_AT]->(e460) -; -MATCH (s461:Person {neogen_id: '5d9eaf7f6199e04bb0d69d6484c46fd402520f08'}), (e461:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s461)-[edge461:WORKS_AT]->(e461) -; -MATCH (s462:Person {neogen_id: '289d49441213ebdbcfc86fbae3e358d3c11df6db'}), (e462:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s462)-[edge462:WORKS_AT]->(e462) -; -MATCH (s463:Person {neogen_id: '7293acccafd37e5de3714284be7bf81404ea7162'}), (e463:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s463)-[edge463:WORKS_AT]->(e463) -; -MATCH (s464:Person {neogen_id: 'b4a5ea2f55354c7b745148e9c3b154baa93216ab'}), (e464:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s464)-[edge464:WORKS_AT]->(e464) -; -MATCH (s465:Person {neogen_id: '4aafc48f629d5ce9682792ab6d27898c61d9e978'}), (e465:Company { neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}) -MERGE (s465)-[edge465:WORKS_AT]->(e465) -; -MATCH (s466:Person {neogen_id: '9b227241edd1d7ae65e96e41a9de7d285ef100eb'}), (e466:Company { neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}) -MERGE (s466)-[edge466:WORKS_AT]->(e466) -; -MATCH (s467:Person {neogen_id: 'a38d9cb5250b6e4c2c52dc57e9da3172210140b7'}), (e467:Company { neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}) -MERGE (s467)-[edge467:WORKS_AT]->(e467) -; -MATCH (s468:Person {neogen_id: '38b7b8ff76f693a208708f080c8bc820c023088e'}), (e468:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s468)-[edge468:WORKS_AT]->(e468) -; -MATCH (s469:Person {neogen_id: '462780aa8040e5662090d8dc1bbf4a651ed3d3aa'}), (e469:Company { neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}) -MERGE (s469)-[edge469:WORKS_AT]->(e469) -; -MATCH (s470:Person {neogen_id: '84c8761b30c46bab8d079677235ad7e1e442af16'}), (e470:Company { neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}) -MERGE (s470)-[edge470:WORKS_AT]->(e470) -; -MATCH (s471:Person {neogen_id: 'd059dd6742b4e5bc28fc04c52905efd28531fbdb'}), (e471:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s471)-[edge471:WORKS_AT]->(e471) -; -MATCH (s472:Person {neogen_id: '7c8c3f901283fb0f5d0bb615303c6ccef7380b10'}), (e472:Company { neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}) -MERGE (s472)-[edge472:WORKS_AT]->(e472) -; -MATCH (s473:Person {neogen_id: '621bf910d48350af18f8ffb1d9b76fcbfa092de3'}), (e473:Company { neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}) -MERGE (s473)-[edge473:WORKS_AT]->(e473) -; -MATCH (s474:Person {neogen_id: '2ec276d0de625ed48ce25c6255af7964e2a1a0b9'}), (e474:Company { neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}) -MERGE (s474)-[edge474:WORKS_AT]->(e474) -; -MATCH (s475:Person {neogen_id: '5c4284d430cc6b94ecdb0000e78b0a77435ca129'}), (e475:Company { neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}) -MERGE (s475)-[edge475:WORKS_AT]->(e475) -; -MATCH (s476:Person {neogen_id: '37abdd4b536218ca6a1fd8179df50be93f76599d'}), (e476:Company { neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}) -MERGE (s476)-[edge476:WORKS_AT]->(e476) -; -MATCH (s477:Person {neogen_id: 'eb3fbc364b0e4b46e58a9a1ef294fac8116aef97'}), (e477:Company { neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}) -MERGE (s477)-[edge477:WORKS_AT]->(e477) -; -MATCH (s478:Person {neogen_id: 'd00cf3ed3ab7a11ae281dc60f5a81bf8707e1bfe'}), (e478:Company { neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}) -MERGE (s478)-[edge478:WORKS_AT]->(e478) -; -MATCH (s479:Person {neogen_id: '206d70467d89239e415a4c019ebd2f1f6d9507bc'}), (e479:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s479)-[edge479:WORKS_AT]->(e479) -; -MATCH (s480:Person {neogen_id: '2099c6b5bd32201e018d2740a003a6b61d6c339b'}), (e480:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s480)-[edge480:WORKS_AT]->(e480) -; -MATCH (s481:Person {neogen_id: '044e36625d26f85c9929f770cfba538e104e9cbc'}), (e481:Company { neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}) -MERGE (s481)-[edge481:WORKS_AT]->(e481) -; -MATCH (s482:Person {neogen_id: '45b456af2240ac583a6fc54c77228f7389b42882'}), (e482:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s482)-[edge482:WORKS_AT]->(e482) -; -MATCH (s483:Person {neogen_id: 'b28e31d92e9b0cb2335845b51d0851e7a8211fcf'}), (e483:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s483)-[edge483:WORKS_AT]->(e483) -; -MATCH (s484:Person {neogen_id: '8b98c18173526ee53470c0241d052fbace55d5fa'}), (e484:Company { neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6'}) -MERGE (s484)-[edge484:WORKS_AT]->(e484) -; -MATCH (s485:Person {neogen_id: '51b31360ee9077a3a37c6264e64640778bc6df15'}), (e485:Company { neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}) -MERGE (s485)-[edge485:WORKS_AT]->(e485) -; -MATCH (s486:Person {neogen_id: '81c83e2e25697251b8f46ccd2a01adf65df6928a'}), (e486:Company { neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}) -MERGE (s486)-[edge486:WORKS_AT]->(e486) -; -MATCH (s487:Person {neogen_id: '7f2eb2d3957725a9ae0a74534c462e454c41e67c'}), (e487:Company { neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}) -MERGE (s487)-[edge487:WORKS_AT]->(e487) -; -MATCH (s488:Person {neogen_id: '1085bb5eb0592813930a4c8fd6ef7bab81e986ab'}), (e488:Company { neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}) -MERGE (s488)-[edge488:WORKS_AT]->(e488) -; -MATCH (s489:Person {neogen_id: '13cd52385b6df569996d6dfaa9ade0f38b89b384'}), (e489:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s489)-[edge489:WORKS_AT]->(e489) -; -MATCH (s490:Person {neogen_id: '4468f44f7da8e225fdcee06465c30d790a8370df'}), (e490:Company { neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}) -MERGE (s490)-[edge490:WORKS_AT]->(e490) -; -MATCH (s491:Person {neogen_id: '9fd366c333892819d6e93476adea31ab94666f57'}), (e491:Company { neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}) -MERGE (s491)-[edge491:WORKS_AT]->(e491) -; -MATCH (s492:Person {neogen_id: '924c558afbd1d73882e229349770ecb5fceb5608'}), (e492:Company { neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}) -MERGE (s492)-[edge492:WORKS_AT]->(e492) -; -MATCH (s493:Person {neogen_id: '8d72d8327fa46c27461b755e91ed7dc76c6e7ffd'}), (e493:Company { neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}) -MERGE (s493)-[edge493:WORKS_AT]->(e493) -; -MATCH (s494:Person {neogen_id: '2d77c61853e8db14f66b1d2ef18da3d267b41cd0'}), (e494:Company { neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}) -MERGE (s494)-[edge494:WORKS_AT]->(e494) -; -MATCH (s495:Person {neogen_id: '99174ef47a4808802310dfef5e6f5ad1fd89f60c'}), (e495:Company { neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}) -MERGE (s495)-[edge495:WORKS_AT]->(e495) -; -MATCH (s496:Person {neogen_id: '2ad8503b2e84524c949d260359637dfe6213fe29'}), (e496:Company { neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}) -MERGE (s496)-[edge496:WORKS_AT]->(e496) -; -MATCH (s497:Person {neogen_id: 'e08a313b38bcd75b4cd32a4b1bcc12bd460c70fb'}), (e497:Company { neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}) -MERGE (s497)-[edge497:WORKS_AT]->(e497) -; -MATCH (s498:Person {neogen_id: 'dc7e6bd296183ddb33e2ce04bb9d28616d44e030'}), (e498:Company { neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}) -MERGE (s498)-[edge498:WORKS_AT]->(e498) -; -MATCH (s499:Person {neogen_id: 'baea8be532e935b470ce0710d731ff38b32eb248'}), (e499:Company { neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}) -MERGE (s499)-[edge499:WORKS_AT]->(e499) -; -MATCH (s500:Person {neogen_id: 'be0e2d786c6bbad21bff0c6e800f568c24559d92'}), (e500:Company { neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}) -MERGE (s500)-[edge500:WORKS_AT]->(e500) -; -MATCH (s501:Company {neogen_id: 'ab3a54deef0e36dbb3613ac1437af3d90fac4693'}), (e501:Country { neogen_id: '29a8a7b8607ab37aa89716ab0d87c677375dc179'}) -MERGE (s501)-[edge501:LOCATED_IN]->(e501) -; -MATCH (s502:Company {neogen_id: '7c29ff9d0dff667af540a06237daaf36ebabf513'}), (e502:Country { neogen_id: 'c32a90da46fb5fb902f67306fae10aefb9c031e6'}) -MERGE (s502)-[edge502:LOCATED_IN]->(e502) -; -MATCH (s503:Company {neogen_id: '3a3140135c92a0d5669ad74e5045816126d8724e'}), (e503:Country { neogen_id: 'f550f11cf5cfaa532bfe8acfec8612eba2727a56'}) -MERGE (s503)-[edge503:LOCATED_IN]->(e503) -; -MATCH (s504:Company {neogen_id: '9327b563eebedb00871e0f1db2225caad78c9e5e'}), (e504:Country { neogen_id: '708e9309cac32fd873ede7a2e5e24747575bd5f5'}) -MERGE (s504)-[edge504:LOCATED_IN]->(e504) -; -MATCH (s505:Company {neogen_id: 'b230ed94e0e01a4924c94057ede684b9e67baf97'}), (e505:Country { neogen_id: '8a7ee89f60932fab0973e25704066796b9d8b8fb'}) -MERGE (s505)-[edge505:LOCATED_IN]->(e505) -; -MATCH (s506:Company {neogen_id: 'bf7662b809f7dfb793369f2cf7bea9a0964efbde'}), (e506:Country { neogen_id: '5cf08a7520a6220656dee74d32f3c19b7ed845d6'}) -MERGE (s506)-[edge506:LOCATED_IN]->(e506) -; -MATCH (s507:Company {neogen_id: '13bb846033cf7d656e58cabc22e6d23b7ea994d5'}), (e507:Country { neogen_id: 'a179d48762f45f5208d069e957a07a48ad2f220d'}) -MERGE (s507)-[edge507:LOCATED_IN]->(e507) -; -MATCH (s508:Company {neogen_id: 'c25167ccf3f2da5c7ca8d428cd41dc249ee17ea9'}), (e508:Country { neogen_id: '190cb206f0fcb0ffa8387f38fe6d357f3709d190'}) -MERGE (s508)-[edge508:LOCATED_IN]->(e508) -; -MATCH (s509:Company {neogen_id: '85b28105936f9d2c276a075f1ad73d457cb4e4dd'}), (e509:Country { neogen_id: 'bce8e29bc7bbbb3ac4e782a9b01ed36bd4f626ab'}) -MERGE (s509)-[edge509:LOCATED_IN]->(e509) -; -MATCH (s510:Company {neogen_id: '9be67837a3bd0fd397b6619fce3ec5696f29d245'}), (e510:Country { neogen_id: '4e9522bc477be3cd8ad23edfff7ab8418a74da0c'}) -MERGE (s510)-[edge510:LOCATED_IN]->(e510) -; -MATCH (s511:Company {neogen_id: 'bb3aa36bbb299d83daa94b63cf19c4fff1a87c32'}), (e511:Country { neogen_id: '708e9309cac32fd873ede7a2e5e24747575bd5f5'}) -MERGE (s511)-[edge511:LOCATED_IN]->(e511) -; -MATCH (s512:Company {neogen_id: '79ff4c7d34716a40c3ba126b5ef0bccafa023361'}), (e512:Country { neogen_id: 'da45d7cd85d993ff24978eb4597cad8c23afd22e'}) -MERGE (s512)-[edge512:LOCATED_IN]->(e512) -; -MATCH (s513:Company {neogen_id: '2253ce57c8c736227cb55e423be4b7ebb25dac3c'}), (e513:Country { neogen_id: '13c9fefe5cf91d8f4ec65c28164448ec9bdb5b4b'}) -MERGE (s513)-[edge513:LOCATED_IN]->(e513) -; -MATCH (s514:Company {neogen_id: 'ecefd2fba36348385a581b81c49ab1b12c21af19'}), (e514:Country { neogen_id: 'c562d912be8b79dcd983d3abaacef9291339f093'}) -MERGE (s514)-[edge514:LOCATED_IN]->(e514) -; -MATCH (s515:Company {neogen_id: '607106968b2c12610671e456a7a36d6ef1fd84f1'}), (e515:Country { neogen_id: '27a80bdb0402c1934ade3081d046cf33eb9fc854'}) -MERGE (s515)-[edge515:LOCATED_IN]->(e515) -; -MATCH (s516:Company {neogen_id: '03685b0770dcb68b14654c9e7100892a6b1c61da'}), (e516:Country { neogen_id: '7f1638ed62f9de4ed8c4d86520332e1c82b9e313'}) -MERGE (s516)-[edge516:LOCATED_IN]->(e516) -; -MATCH (s517:Company {neogen_id: '946c9b83d9adae27de88f4917099ca7f926987da'}), (e517:Country { neogen_id: 'e0a793c227fcbe8f915fe1f011dc7b80ea8cca22'}) -MERGE (s517)-[edge517:LOCATED_IN]->(e517) -; -MATCH (s518:Company {neogen_id: 'b4ae3df3358d78ae6cae46d7564d9dc255915357'}), (e518:Country { neogen_id: '6341d5407785e4a94711a5557afddd18f5bd6434'}) -MERGE (s518)-[edge518:LOCATED_IN]->(e518) -; -MATCH (s519:Company {neogen_id: '96b285803de3778cc59dc0913d3b7aa75fc4b751'}), (e519:Country { neogen_id: '38e116584af4ac1c5838b818d9cc81d4498585e2'}) -MERGE (s519)-[edge519:LOCATED_IN]->(e519) -; -MATCH (s520:Company {neogen_id: '8ee36a960cef97e88f029e6abbdfba0c2e024f12'}), (e520:Country { neogen_id: 'f550f11cf5cfaa532bfe8acfec8612eba2727a56'}) -MERGE (s520)-[edge520:LOCATED_IN]->(e520) -; -MATCH (s521:Company {neogen_id: 'f3d5ee22c637a5f72f24b6ed8eb5402aa43f0281'}), (e521:Country { neogen_id: 'b3239e2bc7392746b0d67429e73c4d3348fddb4e'}) -MERGE (s521)-[edge521:LOCATED_IN]->(e521) -; -MATCH (s522:Company {neogen_id: 'f5017914486a5459729846842847ff40708e7948'}), (e522:Country { neogen_id: 'c32a90da46fb5fb902f67306fae10aefb9c031e6'}) -MERGE (s522)-[edge522:LOCATED_IN]->(e522) -; -MATCH (s523:Company {neogen_id: 'c1e9d979200855c2a2297e2aeb8d1169406576cb'}), (e523:Country { neogen_id: '0cbb369343b7e4b46bcb3b8d63189a59398171e4'}) -MERGE (s523)-[edge523:LOCATED_IN]->(e523) -; -MATCH (s524:Company {neogen_id: '67af2346b0ce65d7b44d6592aeacd0467fdd80f3'}), (e524:Country { neogen_id: '459499fec0df957584d3c9d09423038991ee04c3'}) -MERGE (s524)-[edge524:LOCATED_IN]->(e524) -; -MATCH (s525:Company {neogen_id: 'f4fc1a2219358aea3bab05a15bc29f25be992570'}), (e525:Country { neogen_id: 'f26123058c8f9d953cb7416f64b8c4b1cf08d07a'}) -MERGE (s525)-[edge525:LOCATED_IN]->(e525) -; -MATCH (s526:Company {neogen_id: '659ce23acfa8bd130afbde4202194903211b3637'}), (e526:Country { neogen_id: '0ec10ae0d17c83296173d1d48de9cea51c007a18'}) -MERGE (s526)-[edge526:LOCATED_IN]->(e526) -; -MATCH (s527:Company {neogen_id: 'a6662ed2bc8ccdbb6bb39abc7febfa999090094d'}), (e527:Country { neogen_id: '363ef7eae27a8114d98ba24e9ee4dc227f9c08f7'}) -MERGE (s527)-[edge527:LOCATED_IN]->(e527) -; -MATCH (s528:Company {neogen_id: '1a8ce06139aed5fa7c472af2029a39f4e67d064a'}), (e528:Country { neogen_id: 'e10c17be9da0a9d7e99cb394be0e1ce48f5d8dde'}) -MERGE (s528)-[edge528:LOCATED_IN]->(e528) -; -MATCH (s529:Company {neogen_id: '06304fe251f45dd2b9254a1abd539c4a125a11a3'}), (e529:Country { neogen_id: '11c008853928b58f7cb11c767fdde0827a780e61'}) -MERGE (s529)-[edge529:LOCATED_IN]->(e529) -; -MATCH (s530:Company {neogen_id: '13e0ce9f739bfd41ccc7d5f71cf4211fbdd54fd7'}), (e530:Country { neogen_id: '29446fbf4a102341394c092bc5e956b2e8796636'}) -MERGE (s530)-[edge530:LOCATED_IN]->(e530) -; -MATCH (s531:Company {neogen_id: '2145aa26de90e7ce45fa7bc431b27038f474a66f'}), (e531:Country { neogen_id: '28a01485e037ec4a1c8532564597fefd96a683ca'}) -MERGE (s531)-[edge531:LOCATED_IN]->(e531) -; -MATCH (s532:Company {neogen_id: '93ba090475338400970fe0c6bddf914726a4bcbf'}), (e532:Country { neogen_id: '11c008853928b58f7cb11c767fdde0827a780e61'}) -MERGE (s532)-[edge532:LOCATED_IN]->(e532) -; -MATCH (s533:Company {neogen_id: 'f0fd31a2082826ab2970b401f6b5337c56441c36'}), (e533:Country { neogen_id: 'c32a90da46fb5fb902f67306fae10aefb9c031e6'}) -MERGE (s533)-[edge533:LOCATED_IN]->(e533) -; -MATCH (s534:Company {neogen_id: '0ab39b93074c6807d0cfbe3864563210ea693212'}), (e534:Country { neogen_id: 'a179d48762f45f5208d069e957a07a48ad2f220d'}) -MERGE (s534)-[edge534:LOCATED_IN]->(e534) -; -MATCH (s535:Company {neogen_id: '5ee398f4f51ec824175d1abe717b78602e16e7bf'}), (e535:Country { neogen_id: '708e9309cac32fd873ede7a2e5e24747575bd5f5'}) -MERGE (s535)-[edge535:LOCATED_IN]->(e535) -; -MATCH (s536:Company {neogen_id: 'fd9e466db1ac5fe5b5ae7ba83f45273c6152d038'}), (e536:Country { neogen_id: '8feba8ce538c8e0421697cdbab6fd392c9764bc6'}) -MERGE (s536)-[edge536:LOCATED_IN]->(e536) -; -MATCH (s537:Company {neogen_id: 'b45c685b274960d73b697e02b51e9125c18d5f50'}), (e537:Country { neogen_id: 'a4506847aaaeb73a5926717b258fd479653bb975'}) -MERGE (s537)-[edge537:LOCATED_IN]->(e537) -; -MATCH (s538:Company {neogen_id: 'f7587b997c3e2d0886605879b1bb957c4e9341f6'}), (e538:Country { neogen_id: '0ec10ae0d17c83296173d1d48de9cea51c007a18'}) -MERGE (s538)-[edge538:LOCATED_IN]->(e538) -; -MATCH (s539:Company {neogen_id: '4018a1ba83f52846edb1a7fa62c0ab226598ab30'}), (e539:Country { neogen_id: '97ebbd353da17dde16ffd5ac8cb6f720795bfa3f'}) -MERGE (s539)-[edge539:LOCATED_IN]->(e539) -; -MATCH (s540:Company {neogen_id: '7b16ee8ffbd89fa4b65a63c9a5733f41b17ea1e3'}), (e540:Country { neogen_id: '29a8a7b8607ab37aa89716ab0d87c677375dc179'}) -MERGE (s540)-[edge540:LOCATED_IN]->(e540) -; -MATCH (s541:Company {neogen_id: 'bff319d32f49bd20cf5bf792fa13f5ee46aa4dfc'}), (e541:Country { neogen_id: '67f9625f95b0c72e468ff41c58814fc373580309'}) -MERGE (s541)-[edge541:LOCATED_IN]->(e541) -; -MATCH (s542:Company {neogen_id: '6d4dcef491a37358c597e4d9eb880dd2bcac35c4'}), (e542:Country { neogen_id: '97ebbd353da17dde16ffd5ac8cb6f720795bfa3f'}) -MERGE (s542)-[edge542:LOCATED_IN]->(e542) -; -MATCH (s543:Company {neogen_id: 'c3637697be89a63f572934d52fa635ddb4c4503f'}), (e543:Country { neogen_id: '6bb2f5c03b289dd323150b3e6017b37d4a990338'}) -MERGE (s543)-[edge543:LOCATED_IN]->(e543) -; -MATCH (s544:Company {neogen_id: 'f6cb4ea0980ac2931948dbb86f2b42fcbb154388'}), (e544:Country { neogen_id: 'f26123058c8f9d953cb7416f64b8c4b1cf08d07a'}) -MERGE (s544)-[edge544:LOCATED_IN]->(e544) -; -MATCH (s545:Company {neogen_id: '7023957c9dd34f4d2532b7a1c9c1c66e37c0a6f1'}), (e545:Country { neogen_id: '3a1eacab7defdff6135d4a17ac95ae0a27d48085'}) -MERGE (s545)-[edge545:LOCATED_IN]->(e545) -; -MATCH (s546:Company {neogen_id: 'c494dad8a06c95e40672013857d37dd98965d7b7'}), (e546:Country { neogen_id: '34e341e434e30e0d3ae509aa07a5ea9570d5ae66'}) -MERGE (s546)-[edge546:LOCATED_IN]->(e546) -; -MATCH (s547:Company {neogen_id: 'c3ceff8cbe4edd3e22f527ec371ed00d949724ef'}), (e547:Country { neogen_id: '6bb2f5c03b289dd323150b3e6017b37d4a990338'}) -MERGE (s547)-[edge547:LOCATED_IN]->(e547) -; -MATCH (s548:Company {neogen_id: '08204e18c7bfc3f2422edad4e5c7a439f472a791'}), (e548:Country { neogen_id: '393b33eff436bf78c85aa80c0daddcc3bdb7f445'}) -MERGE (s548)-[edge548:LOCATED_IN]->(e548) -; -MATCH (s549:Company {neogen_id: '7f4d6325437fcbfa474ce6445de4ebad1462a9c4'}), (e549:Country { neogen_id: 'b26dda3ea03f2dc2b8d8406f744a78e478f9db67'}) -MERGE (s549)-[edge549:LOCATED_IN]->(e549) -; -MATCH (s550:Company {neogen_id: '46ecd62bf56794310425d6a38c7448c88625ba09'}), (e550:Country { neogen_id: 'f550f11cf5cfaa532bfe8acfec8612eba2727a56'}) -MERGE (s550)-[edge550:LOCATED_IN]->(e550) -; -MATCH (n1:Person) REMOVE n1.neogen_id; -MATCH (n2:Company) REMOVE n2.neogen_id; -MATCH (n3:Country) REMOVE n3.neogen_id; diff --git a/benchmark/results.txt b/benchmark/results.txt deleted file mode 100644 index 6b21f986..00000000 --- a/benchmark/results.txt +++ /dev/null @@ -1,18 +0,0 @@ -Benchmarking client instantation without cache, with result formatter enabled, 1000 runs -Runned in 47.425533056259 seconds, using 8.5 mb memory --------------------------- -Benchmarking client instatation with cache enabled, 1000 runs -Runned in 0.068459987640381 seconds, using 8.5 mb memory --------------------------- -Running 1000 statements with immediate tx commits -Runned in 7.8483679294586 seconds, using 9.25 mb memory --------------------------- -Running 1000 statements in one transaction commit, separate requests using the TransactionManager -Runned in 3.0217499732971 seconds, using 9.5 mb memory --------------------------- -Running 1000 statements in one transaction commit, same request -Runned in 0.26249098777771 seconds, using 10 mb memory --------------------------- -Handling big graph Response format, 1000 nodes with more edges -Runned in 0.09460186958313 seconds, using 10.25 mb memory --------------------------- diff --git a/composer.json b/composer.json index 8360a9bc..b9a30561 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,13 @@ } ], "require": { - "php": ">= 5.5", - "graphaware/neo4j-bolt": "1.0.x-dev", + "php": ">= 5.6", + "graphaware/neo4j-bolt": "1.0.x-dev", "guzzlehttp/guzzle": "^6.0", "monolog/monolog": "~1.1", "symfony/yaml": "^2.7", "symfony/config": "^2.7", - "symfony/dependency-injection": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-response-formatter": "^1.0", "graphaware/neo4j-common": "^1.2" }, "require-dev": { @@ -38,13 +36,12 @@ }, "autoload": { "psr-4": { - "Neoxygen\\NeoClient\\": "src/", "GraphAware\\Neo4j\\": "src/" } }, "autoload-dev": { "psr-4": { - "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" + "GraphAware\\Neo4j\\Tests\\": "tests/" } } } diff --git a/composer.lock b/composer.lock index ec037920..cf6aeeee 100644 --- a/composer.lock +++ b/composer.lock @@ -4,93 +4,26 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "220b1aadc378e0a44d11c32f13da8642", - "content-hash": "bfabb08d6cef541943a1d8d354989e59", + "hash": "75a5cc566fe76ed8e3c3a7f60db2e5a5", + "content-hash": "97d3ac0e3cdba66c8e019bf91e4a3bf5", "packages": [ - { - "name": "doctrine/collections", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2015-04-14 22:21:58" - }, { "name": "graphaware/neo4j-bolt", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "59f5057abc0d804e037bdf2ff2d3184fc7837ad6" + "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/59f5057abc0d804e037bdf2ff2d3184fc7837ad6", - "reference": "59f5057abc0d804e037bdf2ff2d3184fc7837ad6", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", + "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", "shasum": "" }, "require": { - "doctrine/collections": "^1.3", "graphaware/neo4j-common": "^1.7", - "monolog/monolog": "^1.16", + "myclabs/php-enum": "^1.4", "symfony/console": "^2.7", "symfony/event-dispatcher": "^2.7" }, @@ -122,20 +55,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2015-11-06 20:00:55" + "time": "2016-01-05 13:41:25" }, { "name": "graphaware/neo4j-common", - "version": "1.10.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "642f8edafbaf11965f1e23bba8c4481c6266f570" + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/642f8edafbaf11965f1e23bba8c4481c6266f570", - "reference": "642f8edafbaf11965f1e23bba8c4481c6266f570", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b0713ade0458ec9b412a506a24f7aa55153e1b79", + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79", "shasum": "" }, "require": { @@ -168,61 +101,20 @@ "neo4j", "statement" ], - "time": "2015-11-07 02:32:34" - }, - { - "name": "graphaware/neo4j-response-formatter", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/graphaware/neo4j-php-response-formatter.git", - "reference": "a1a1bbbd445163c5dc06e5e47a8fec07b344f903" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-response-formatter/zipball/a1a1bbbd445163c5dc06e5e47a8fec07b344f903", - "reference": "a1a1bbbd445163c5dc06e5e47a8fec07b344f903", - "shasum": "" - }, - "require": { - "psr/http-message": "^1.0" - }, - "require-dev": { - "neoxygen/neoclient": "^3.2", - "phpspec/prophecy": "^1.4", - "phpunit/phpunit": "^4.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "GraphAware\\NeoClient\\Formatter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Willemsen", - "email": "christophe@graphaware.com" - } - ], - "description": "Response Formatter for NeoClient", - "time": "2015-08-06 21:11:14" + "time": "2016-01-05 12:54:41" }, { "name": "guzzlehttp/guzzle", - "version": "6.1.0", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81" + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", "shasum": "" }, "require": { @@ -271,7 +163,7 @@ "rest", "web service" ], - "time": "2015-09-08 17:36:26" + "time": "2015-11-23 00:47:50" }, { "name": "guzzlehttp/promises", @@ -592,32 +484,35 @@ }, { "name": "symfony/config", - "version": "v2.7.6", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "831f88908b51b9ce945f5e6f402931d1ac544423" + "reference": "17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/831f88908b51b9ce945f5e6f402931d1ac544423", - "reference": "831f88908b51b9ce945f5e6f402931d1ac544423", + "url": "https://api.github.com/repos/symfony/config/zipball/17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2", + "reference": "17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/filesystem": "~2.3" + "symfony/filesystem": "~2.3|~3.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -635,29 +530,30 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" + "time": "2015-12-26 13:37:56" }, { "name": "symfony/console", - "version": "v2.7.6", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5efd632294c8320ea52492db22292ff853a43766" + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5efd632294c8320ea52492db22292ff853a43766", - "reference": "5efd632294c8320ea52492db22292ff853a43766", + "url": "https://api.github.com/repos/symfony/console/zipball/2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" }, "suggest": { "psr/log": "For using the console logger", @@ -667,13 +563,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -691,48 +590,49 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-10-20 14:38:46" + "time": "2015-12-22 10:25:57" }, { - "name": "symfony/dependency-injection", - "version": "v2.7.6", + "name": "symfony/event-dispatcher", + "version": "v2.8.1", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "af284e795ec8a08c80d1fc47518fd23004b89847" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/af284e795ec8a08c80d1fc47518fd23004b89847", - "reference": "af284e795ec8a08c80d1fc47518fd23004b89847", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "conflict": { - "symfony/expression-language": "<2.6" - }, "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/yaml": "~2.1" + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" }, "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - } + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -748,48 +648,40 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-10-27 15:38:06" + "time": "2015-10-30 20:15:42" }, { - "name": "symfony/event-dispatcher", - "version": "v2.7.6", + "name": "symfony/filesystem", + "version": "v3.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8" + "url": "https://github.com/symfony/filesystem.git", + "reference": "c2e59d11dccd135dc8f00ee97f34fe1de842e70c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a5db5ea887763fa3a31a5471b512ff1596d9b8", - "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c2e59d11dccd135dc8f00ee97f34fe1de842e70c", + "reference": "c2e59d11dccd135dc8f00ee97f34fe1de842e70c", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -805,37 +697,43 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" + "time": "2015-12-22 10:39:06" }, { - "name": "symfony/filesystem", - "version": "v2.7.6", + "name": "symfony/polyfill-mbstring", + "version": "v1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "56fd6df73be859323ff97418d97edc1d756df6df" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/56fd6df73be859323ff97418d97edc1d756df6df", - "reference": "56fd6df73be859323ff97418d97edc1d756df6df", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25", + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - } + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -843,30 +741,37 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2015-10-18 20:23:18" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-20 09:19:13" }, { "name": "symfony/yaml", - "version": "v2.7.6", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "eca9019c88fbe250164affd107bc8057771f3f4d" + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d", - "reference": "eca9019c88fbe250164affd107bc8057771f3f4d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", "shasum": "" }, "require": { @@ -875,13 +780,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -899,10 +807,76 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" + "time": "2015-12-26 13:37:56" } ], "packages-dev": [ + { + "name": "doctrine/collections", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2015-04-14 22:21:58" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -1308,16 +1282,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.18", + "version": "4.8.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3" + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c", + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c", "shasum": "" }, "require": { @@ -1376,7 +1350,7 @@ "testing", "xunit" ], - "time": "2015-11-11 11:32:49" + "time": "2015-12-12 07:45:58" }, { "name": "phpunit/phpunit-mock-objects", @@ -1500,28 +1474,28 @@ }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1544,24 +1518,24 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "6e7133793a8e5a5714a551a8324337374be209df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df", + "reference": "6e7133793a8e5a5714a551a8324337374be209df", "shasum": "" }, "require": { @@ -1598,7 +1572,7 @@ "environment", "hhvm" ], - "time": "2015-08-03 06:14:51" + "time": "2015-12-02 08:37:27" }, { "name": "sebastian/exporter", @@ -1719,16 +1693,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -1768,7 +1742,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", @@ -1814,7 +1788,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">= 5.5" + "php": ">= 5.6" }, "platform-dev": [] } diff --git a/phpunit.xml b/phpunit.xml index 557d5fe4..c63affb3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,8 +1,7 @@ - - + ./tests @@ -13,10 +12,4 @@ bin - - - - - - diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index f6a2801c..bcdb81e7 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -1,15 +1,17 @@ " NeoClient package. + * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient\Connection; +namespace GraphAware\Neo4j\Connection; + +use GraphAware\Common\Driver\DriverInterface; class Connection { @@ -19,59 +21,19 @@ class Connection private $alias; /** - * @var string The scheme to use for the Connection, could be http|https + * @var \GraphAware\Common\Driver\DriverInterface */ - private $scheme; - - /** - * @var string The connection's host - */ - private $host; - - /** - * @var int The connection's port - */ - private $port; - - /** - * @var bool Whether or not to use Auth headers - */ - private $authMode; - - /** - * @var string The username for the authentication - */ - private $authUser; - - /** - * @var string The user's password for the authentication - */ - private $authPassword; + private $driver; /** + * Connection constructor. * @param $alias - * @param string $scheme - * @param string $host - * @param int $port - * @param string $authUser The user login when using the authentication extension - * @param string $authPassword The user password when using the authentication extension + * @param \GraphAware\Common\Driver\DriverInterface $driver */ - public function __construct( - $alias, - $scheme = 'http', - $host = 'localhost', - $port = 7474, - $authMode = false, - $authUser = null, - $authPassword = null) + public function __construct($alias, DriverInterface $driver) { - $this->alias = $alias; - $this->scheme = $scheme; - $this->host = $host; - $this->port = $port; - $this->authMode = (bool) $authMode; - $this->authUser = $authUser; - $this->authPassword = $authPassword; + $this->alias = (string) $alias; + $this->driver = $driver; } /** @@ -83,82 +45,10 @@ public function getAlias() } /** - * @return string http|https - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * @return string - */ - public function getPort() - { - return $this->port; - } - - /** - * @return string - */ - public function getBaseUrl() - { - return $this->scheme.'://'.$this->host.':'.$this->port; - } - - /** - * @return bool - */ - public function isAuth() - { - return $this->authMode; - } - - /** - * Sets the authentication mode to true. - */ - public function setAuthMode() - { - $this->authMode = true; - } - - /** - * @return string - */ - public function getAuthUser() - { - return $this->authUser; - } - - /** - * @param string $username - */ - public function setAuthUser($username) - { - $this->authUser = $username; - } - - /** - * @return string - */ - public function getAuthPassword() - { - return $this->authPassword; - } - - /** - * @param string $password + * @return \GraphAware\Common\Driver\DriverInterface */ - public function setAuthPassword($password) + public function getDriver() { - $this->authPassword = $password; + return $this->driver; } } diff --git a/tests/Neoxygen/NeoClient/Tests/ClientBuildTest.php b/tests/Neoxygen/NeoClient/Tests/ClientBuildTest.php deleted file mode 100644 index bce44d50..00000000 --- a/tests/Neoxygen/NeoClient/Tests/ClientBuildTest.php +++ /dev/null @@ -1,79 +0,0 @@ -build(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Client', $client); - } - - /** - * @group config - */ - public function testAddConnection() - { - $builder = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'neoclient'); - - $this->assertArrayHasKey('default', $builder->getConfiguration()['connections']); - } - - /** - * @group config - */ - public function testHAMode() - { - $builder = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'neo4j') - ->enableHAMode(); - - $this->assertEquals(true, $builder->getConfiguration()['ha_mode']['enabled']); - $this->assertEquals('enterprise', $builder->getConfiguration()['ha_mode']['type']); - } - - /** - * @group config - */ - public function testWithConfigArrayLoading() - { - $config = array( - 'connections' => array( - 'default' => array( - 'scheme' => 'http', - 'host' => 'localhost', - 'port' => 7474, - 'auth' => true, - 'user' => 'neo4j', - 'password' => 'password' - ) - ), - 'ha_mode' => array( - 'type' => 'enterprise', - 'enabled' => true, - 'master' => 'default' - ) - ); - - $builder = ClientBuilder::create() - ->loadConfiguration($config); - - $this->assertArrayHasKey('default', $builder->getConfiguration()['connections']); - - $client = ClientBuilder::create() - ->loadConfiguration($config) - ->build(); - - $conn = $client->getConnectionManager()->getWriteConnection(); - $this->assertEquals('password', $conn->getAuthPassword()); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Formatting/GAFormattingTest.php b/tests/Neoxygen/NeoClient/Tests/Formatting/GAFormattingTest.php deleted file mode 100644 index 5e366ee7..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Formatting/GAFormattingTest.php +++ /dev/null @@ -1,96 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->enableNewFormattingService() - ->build(); - - $response = $client->sendCypherQuery('MATCH (n) RETURN count(n)'); - $this->assertInstanceOf('GraphAware\NeoClient\Formatter\Response', $response); - } - - /** - * @group formatter - */ - public function testNewFormattingWithLiveTx() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->enableNewFormattingService() - ->build(); - - $tx = $client->createTransaction(); - $tx->pushQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - $result = $tx->pushQuery('MATCH (n) RETURN count(n) as c'); - $tx->commit(); - - $this->assertEquals(0, $result->get('c', true)); - } - - /** - * @group formatter - */ - public function testNewFormattingWithMultipleStmtsInLiveTx() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->enableNewFormattingService() - ->build(); - $sts = []; - $sts[] = ['query' => 'CREATE (n:User) RETURN n']; - $sts[] = ['query' => 'CREATE (n:Book) RETURN n']; - $sts[] = ['query' => 'CREATE (n:Vehicle {name: {name}}) RETURN n', 'params' => ['name' => 'Bentley']]; - $tx = $client->createTransaction(); - $results = $tx->pushMultiple($sts); - $tx->commit(); - - $this->assertCount(3, $results); - $this->assertInstanceOf('GraphAware\NeoClient\Formatter\Graph\Node', $results[0]->get('n', true)); - } - - /** - * @group formatter - */ - public function testLiveTxWithoutNewFormatting() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - - $tx = $client->createTransaction(); - $result = $tx->pushQuery('CREATE (a:Test) RETURN a'); - $tx->commit(); - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result', $result); - } - - /** - * @group formatter - */ - public function testPreparedTxWithoutNewFormatting() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - - $tx = $client->prepareTransaction(); - $tx->pushQuery('CREATE (a:Test) RETURN a'); - $results = $tx->commit(); - $this->assertInstanceOf('Neoxygen\NeoClient\Request\Response', $results); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php deleted file mode 100644 index b552ec85..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ /dev/null @@ -1,125 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->setDefaultTimeout(15) - ->build(); - - $this->client = $client; - } - - public function testGetRoot() - { - $response = $this->client->getRoot(); - $root = $response->getBody(); - - $this->assertArrayHasKey('data', $root); - $this->assertArrayHasKey('management', $root); - } - - public function testGetLabels() - { - $response = $this->client->getLabels(); - $labels = $response->getBody(); - - $this->assertInternalType('array', $labels); - } - - public function testRenameLabel() - { - $q = 'MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'; - $this->client->sendCypherQuery($q); - - $q = 'CREATE (n:OldLabel)'; - $this->client->sendCypherQuery($q); - $response = $this->client->getLabels(); - $labels = $response->getBody(); - $this->assertContains('OldLabel', $labels); - - $this->client->renameLabel('OldLabel', 'NewLabel'); - $labels = $this->client->getLabels()->getBody(); - $this->assertContains('NewLabel', $labels); - } - - public function testCreateAndListIndex() - { - $this->client->createIndex('User', 'email'); - $response = $this->client->listIndex('User'); - $indexes = $response->getBody(); - - $this->assertContains('email', $indexes); - } - - public function testDropIndex() - { - $this->client->createIndex('Drop', 'user'); - $this->assertTrue($this->client->isIndexed('Drop', 'user')); - $this->client->dropIndex('Drop', 'user'); - $this->assertFalse($this->client->isIndexed('Drop', 'user')); - } - - - public function testListIndexes() - { - $this->client->createIndex('List1', 'property'); - $this->client->createIndex('List2', 'property'); - $response = $this->client->listIndexes(); - $indexes = $response->getBody(); - $this->assertArrayHasKey('List1', $indexes); - $this->assertArrayHasKey('List2', $indexes); - } - - public function testCreateUniqueConstraint() - { - $this->client->createUniqueConstraint('Label', 'uniqueProperty'); - $constraints = $this->client->getUniqueConstraints()->getBody(); - - $this->assertArrayHasKey('Label', $constraints); - $this->assertContains('uniqueProperty', $constraints['Label']); - } - - public function testDropUniqueConstraint() - { - $this->client->createUniqueConstraint('ToDrop', 'username'); - $this->assertArrayHasKey('ToDrop', $this->client->getUniqueConstraints()->getBody()); - $this->client->dropUniqueConstraint('ToDrop', 'username'); - $this->assertArrayNotHasKey('ToDrop', $this->client->getUniqueConstraints()->getBody()); - } - - public function testPushMultipleInTransaction() - { - $q = 'MATCH (n:MultiplePersonNode) DELETE n'; - $this->client->sendCypherQuery($q); - $statements = []; - $statement = 'CREATE (n:MultiplePersonNode {id:{myId} })'; - for ($i = 0; $i <= 2000; $i++) { - $statements[] = ['statement' => $statement, 'parameters' => ['myId' => uniqid()]]; - } - $this->client->sendMultiple($statements); - - $q = 'MATCH (n:MultiplePersonNode) RETURN count(n)'; - $r = $this->client->sendCypherQuery($q); - $count = $r->getRows()['count(n)'][0]; - - $this->assertEquals(2001, $count); - } - - -} diff --git a/tests/Neoxygen/NeoClient/Tests/Helper/SchemaContainsIndexConstraint.php b/tests/Neoxygen/NeoClient/Tests/Helper/SchemaContainsIndexConstraint.php deleted file mode 100644 index a6557829..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Helper/SchemaContainsIndexConstraint.php +++ /dev/null @@ -1,47 +0,0 @@ -schemaContainer = $schemaContainer; - } - - public function matches($other) - { - return $this->checkIndexIsPresent($other); - } - - public function toString() - { - return 'Index is present in schema'; - } - - public function checkIndexIsPresent($index) - { - foreach ($this->schemaContainer as $aindex) { - if ($aindex->getLabel() === $index->getLabel() && $aindex->getProperty() === $index->getProperty()) { - return true; - } - } - - return false; - } - - public function failureDescription($other) - { - return sprintf('a schema index with label "%s" and property "%s" is found.', - $other->getLabel(), - $other->getProperty() - ); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Issues/Issue58Test.php b/tests/Neoxygen/NeoClient/Tests/Issues/Issue58Test.php deleted file mode 100644 index a2ddbb84..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Issues/Issue58Test.php +++ /dev/null @@ -1,52 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - //->enableNewFormattingService() - ->build(); - } - - /** - * @group issues - */ - public function testReportedIssue() - { - $this->emptyDatabase(); - $state = 'CREATE (:Property:Item:OtherLabel {id: 1})'; - $this->prepareDatabase($state); - - $q = 'MATCH (n:Property {id:1}) RETURN n as property, labels(n) as labels'; - $result = $this->getConnection()->sendCypherQuery($q)->getResult(); - - $this->assertCount(3, $result->get('labels')); - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Node', $result->get('property')); - } - - private function emptyDatabase() - { - $this->getConnection()->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - } - - private function prepareDatabase($state) - { - $this->emptyDatabase(); - $this->getConnection()->sendCypherQuery($state); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Issues/IssuePropertyWithZeroValueTest.php b/tests/Neoxygen/NeoClient/Tests/Issues/IssuePropertyWithZeroValueTest.php deleted file mode 100644 index cd6d3fdb..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Issues/IssuePropertyWithZeroValueTest.php +++ /dev/null @@ -1,31 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - - $client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - $insert = 'CREATE (n:Node {count: 0})'; - $client->sendCypherQuery($insert); - - $q = 'MATCH (n:Node) RETURN n'; - $result = $client->sendCypherQuery($q)->getResult(); - $v = $result->get('n')->getProperty('count'); - $this->assertTrue(0 === $v); - $this->assertTrue(null === $result->get('n')->getProperty('unk', null)); - $this->setExpectedException('InvalidArgumentException'); - $result->get('n')->getProperty('unk'); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Issues/IssueSOResultDuplicationTest.php b/tests/Neoxygen/NeoClient/Tests/Issues/IssueSOResultDuplicationTest.php deleted file mode 100644 index 94ba4985..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Issues/IssueSOResultDuplicationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->build(); - - // empty db - $this->client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - } - - public function testSubsequentResultsDoNotDuplicateThePreviousOne() - { - // Create user nodes - $this->client->sendCypherQuery('CREATE (:User {id:1}), (:User {id:2})'); - - // Create folder nodes - $this->client->sendCypherQuery('CREATE (:Folder {id: 1}), (:Folder {id:2})'); - - $result1 = $this->client->sendCypherQuery('MATCH (n:User) RETURN n')->getResult(); - - $result2 = $this->client->sendCypherQuery('MATCH (n:Folder) RETURN n')->getResult(); - - $this->assertCount(2, $result1->getNodes()); - $this->assertCount(2, $result2->getNodes()); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/NeoClientTest.php b/tests/Neoxygen/NeoClient/Tests/NeoClientTest.php deleted file mode 100644 index f80d458e..00000000 --- a/tests/Neoxygen/NeoClient/Tests/NeoClientTest.php +++ /dev/null @@ -1,30 +0,0 @@ -build(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Client', $client); - } - - public function testAddConnection() - { - $client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474, true, '', '4287e44985b04c7536c523ca6ea8e67c') - ->build(); - - $this->assertTrue($client->getConnectionManager()->hasConnection('default')); - $this->assertInstanceOf('Neoxygen\NeoClient\Connection\Connection', $client->getConnection('default')); - $conn = $client->getConnection('default'); - $this->assertEquals('http', $conn->getScheme()); - $this->assertEquals('localhost', $conn->getHost()); - $this->assertEquals(7474, $conn->getPort()); - } -} diff --git a/tests/Neoxygen/NeoClient/Tests/Schema/GraphUnitTestCase.php b/tests/Neoxygen/NeoClient/Tests/Schema/GraphUnitTestCase.php deleted file mode 100644 index 851e6ee1..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Schema/GraphUnitTestCase.php +++ /dev/null @@ -1,17 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->enableNewFormattingService() - ->build(); - } -} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Schema/SchemaUnitTest.php b/tests/Neoxygen/NeoClient/Tests/Schema/SchemaUnitTest.php deleted file mode 100644 index 9c6f980e..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Schema/SchemaUnitTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals("User", $index->getLabel()); - $this->assertEquals("id", $index->getProperty()); - } - - /** - * @group schema - */ - public function testSchemaConstraintIsCreatedWithLabelAndName() - { - $constraint = new UniqueConstraint("User", "id"); - $this->assertEquals("User", $constraint->getLabel()); - $this->assertEquals("id", $constraint->getProperty()); - } -} \ No newline at end of file diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php new file mode 100644 index 00000000..ad4039b2 --- /dev/null +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -0,0 +1,23 @@ +assertEquals($driver, $connection->getDriver()); + $this->assertEquals('default', $connection->getAlias()); + } +} \ No newline at end of file diff --git a/tests/Unit/Stub/DummyDriver.php b/tests/Unit/Stub/DummyDriver.php new file mode 100644 index 00000000..13399c51 --- /dev/null +++ b/tests/Unit/Stub/DummyDriver.php @@ -0,0 +1,30 @@ +uri = $uri; + } + + /** + * @return mixed + */ + public function getUri() + { + return $this->uri; + } + + public function session() + { + + } + +} \ No newline at end of file diff --git a/tests/database_settings.yml.dist b/tests/database_settings.yml.dist deleted file mode 100644 index f2f1ce97..00000000 --- a/tests/database_settings.yml.dist +++ /dev/null @@ -1,13 +0,0 @@ -connections: - default: - scheme: http - host: localhost - port: 7474 - auth: true - user: neo4j - password: 4287e44985b04c7536c523ca6ea8e67c - - test: - scheme: http - host: localhost - port: 7473 \ No newline at end of file diff --git a/tests/setNeoToken.sh b/tests/setNeoToken.sh deleted file mode 100755 index 290a2f90..00000000 --- a/tests/setNeoToken.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -curl -v -X POST --user neo4j:neo4j -d '{"password": "veryCoolMax"}' -H 'Content-Type: application/json' -i http://localhost:7474/user/neo4j/password \ No newline at end of file From c03cfc80f6ee64cc84eebf1e9a71fba0f2d778b3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jan 2016 00:32:41 +0100 Subject: [PATCH 042/217] implementation of the standard RecordCursor and RecordView --- composer.json | 3 +- composer.lock | 117 ++++++++- src/Client.php | 15 +- src/Extension/AbstractExtension.php | 4 +- src/Formatter/Node.php | 299 ---------------------- src/Formatter/RecordView.php | 133 ++++++++++ src/Formatter/Relationship.php | 140 ----------- src/Formatter/ResponseFormatter.php | 373 +--------------------------- src/Formatter/Result.php | 335 ++++--------------------- src/Formatter/Type/Node.php | 66 +++++ src/Formatter/Type/Relationship.php | 108 ++++++++ 11 files changed, 484 insertions(+), 1109 deletions(-) delete mode 100644 src/Formatter/Node.php create mode 100644 src/Formatter/RecordView.php delete mode 100644 src/Formatter/Relationship.php create mode 100644 src/Formatter/Type/Node.php create mode 100644 src/Formatter/Type/Relationship.php diff --git a/composer.json b/composer.json index 57b3a232..9ff10eb2 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "symfony/config": "^2.7", "symfony/dependency-injection": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-response-formatter": "^1.0" + "graphaware/neo4j-response-formatter": "^1.0", + "graphaware/neo4j-common": "^1.12" }, "require-dev": { "phpspec/phpspec": "~2.0", diff --git a/composer.lock b/composer.lock index b353dcda..540f9eb0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,55 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e60d2b09a5ccc646058d3081d74f563a", + "hash": "6df8387ad68870177ad6bac7e089194b", + "content-hash": "6aae7d9ec54fc83ee7fd014e706c825a", "packages": [ + { + "name": "graphaware/neo4j-common", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/graphaware/neo4j-php-commons.git", + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b0713ade0458ec9b412a506a24f7aa55153e1b79", + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "GraphAware\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ApacheV2" + ], + "authors": [ + { + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + } + ], + "description": "Common Utilities library for Neo4j", + "keywords": [ + "cypher", + "database", + "graph", + "neo4j", + "statement" + ], + "time": "2016-01-05 12:54:41" + }, { "name": "graphaware/neo4j-response-formatter", "version": "1.1.5", @@ -294,6 +341,50 @@ ], "time": "2015-07-12 13:54:09" }, + { + "name": "myclabs/php-enum", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2015-07-22 16:14:03" + }, { "name": "psr/http-message", "version": "1.0", @@ -386,12 +477,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", + "url": "https://github.com/symfony/config.git", "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", + "url": "https://api.github.com/repos/symfony/config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9", "shasum": "" }, @@ -436,12 +527,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", + "url": "https://github.com/symfony/dependency-injection.git", "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", "shasum": "" }, @@ -496,12 +587,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", + "url": "https://github.com/symfony/event-dispatcher.git", "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", "shasum": "" }, @@ -554,12 +645,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", + "url": "https://github.com/symfony/filesystem.git", "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", "shasum": "" }, @@ -1893,12 +1984,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/ClassLoader.git", + "url": "https://github.com/symfony/class-loader.git", "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", "shasum": "" }, @@ -1943,12 +2034,12 @@ "version": "v2.7.3", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", + "url": "https://github.com/symfony/console.git", "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", + "url": "https://api.github.com/repos/symfony/console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", "shasum": "" }, diff --git a/src/Client.php b/src/Client.php index e9937db8..c35ed52f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,6 +11,8 @@ namespace Neoxygen\NeoClient; +use GraphAware\Common\Result\AbstractRecordCursor; +use GraphAware\Common\Result\RecordCursorInterface; use Neoxygen\NeoClient\Transaction\PreparedTransaction; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -27,7 +29,6 @@ * @method openTransaction($conn = null) * @method \Neoxygen\NeoClient\Transaction\Transaction createTransaction($conn = null) * @method rollbackTransaction($id, $conn = null) - * @method \Neoxygen\NeoClient\Formatter\Response sendCypherQuery($query, array $parameters = array(), $conn = null) * @method sendMultiple(array $statements, $conn = null) * @method sendWriteQuery($query, array $parameters = array()) * @method sendReadQuery($query, array $parameters = array()) @@ -154,11 +155,17 @@ public function getResult() } /** - * @return array|null + * @param $query + * @param array $parameters + * + * @return \Neoxygen\NeoClient\Formatter\Result */ - public function getRows() + public function sendCypherQuery($query, array $parameters = array()) { - return $this->lastResponse->getRows(); + /** @var \Neoxygen\NeoClient\Formatter\Result[] $results */ + $results = $this->call('sendCypherQuery', array($query, $parameters)); + + return $results[0]; } public static function log($level = 'debug', $message, array $context = array()) diff --git a/src/Extension/AbstractExtension.php b/src/Extension/AbstractExtension.php index 232791b1..054ac1ca 100644 --- a/src/Extension/AbstractExtension.php +++ b/src/Extension/AbstractExtension.php @@ -104,8 +104,8 @@ public function handleHttpResponse(Response $response) $this->checkResponseErrors($response->getBody()); if ($this->autoFormatResponse) { $formatted = $this->formatResponse($response->getBody()); - $response->setResult($formatted->getResult()); - $response->setRows($formatted->geRows()); + + return $formatted; } return $response; diff --git a/src/Formatter/Node.php b/src/Formatter/Node.php deleted file mode 100644 index 447550f3..00000000 --- a/src/Formatter/Node.php +++ /dev/null @@ -1,299 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Formatter; - -class Node -{ - /** - * @var int the node internal ID - */ - protected $id; - - /** - * @var array Collection of the node labels - */ - protected $labels; - - /** - * @var array The properties of the node - */ - protected $properties; - - /** - * @var \Neoxygen\NeoClient\Formatter\Relationship[] The collection of inbound relationships - */ - protected $inboundRelationships; - - /** - * @var \Neoxygen\NeoClient\Formatter\Relationship[] The collection of outbound relationships - */ - protected $outboundRelationships; - - /** - * @param $id - * @param array $labels - * @param array $properties - */ - public function __construct($id, array $labels = array(), array $properties = array()) - { - $this->id = (int) $id; - $this->labels = $labels; - $this->properties = $properties; - $this->inboundRelationships = array(); - $this->outboundRelationships = array(); - } - - /** - * Returns the node internal id. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * @return array collection of node's labels - */ - public function getLabels() - { - return $this->labels; - } - - /** - * @param string|null $label The label to check for - * - * @return bool True if the label is matched or if no label is given if the node has minimum 1 label, false otherwise - */ - public function hasLabel($label = null) - { - if (null !== $label) { - foreach ($this->getLabels() as $k => $v) { - if ($v == $label) { - return true; - } - } - } - - if (null === $label && !empty($this->labels)) { - return true; - } - - return false; - } - - /** - * Used when only one label is expected. - * - * @return string|null the label of the node - */ - public function getLabel() - { - if (empty($this->labels)) { - return; - } - reset($this->labels); - - return current($this->labels); - } - - /** - * @param array $props - * - * @return array - */ - public function getProperties(array $props = array()) - { - if (empty($props)) { - return $this->properties; - } - - $properties = []; - foreach ($props as $key) { - $properties[$key] = isset($this->properties[$key]) ? $this->properties[$key] : null; - } - - return $properties; - } - - /** - * @param $name - * - * @return mixed - */ - public function getProperty($name, $default = '') - { - if (isset($this->properties[$name])) { - return $this->properties[$name]; - } - - if ('' !== $default) { - return $default; - } - - throw new \InvalidArgumentException(sprintf('The node does not have a "%s" property', $name)); - } - - /** - * @param $name - * - * @return bool - */ - public function hasProperty($name) - { - return array_key_exists($name, $this->properties); - } - - /** - * @param \Neoxygen\NeoClient\Formatter\Relationship $relationship - */ - public function addInboundRelationship(Relationship $relationship) - { - $this->inboundRelationships[$relationship->getId()] = $relationship; - } - - /** - * @param \Neoxygen\NeoClient\Formatter\Relationship $relationship - */ - public function addOutboundRelationship(Relationship $relationship) - { - $this->outboundRelationships[$relationship->getId()] = $relationship; - } - - /** - * @return \Neoxygen\NeoClient\Formatter\Relationship[] - */ - public function getInboundRelationships() - { - return $this->inboundRelationships; - } - - /** - * @return \Neoxygen\NeoClient\Formatter\Relationship[] - */ - public function getOutboundRelationships() - { - return $this->outboundRelationships; - } - - /** - * @param null $type - * @param null $direction - * - * @return \Neoxygen\NeoClient\Formatter\Relationship[] - */ - public function getRelationships($type = null, $direction = null) - { - if (null === $direction) { - $relationships = array_merge($this->inboundRelationships, $this->outboundRelationships); - } else { - $dir = strtoupper($direction); - if (!in_array($direction, array('IN', 'OUT'))) { - throw new \InvalidArgumentException(sprintf('The direction "%s" is not valid', $direction)); - } - $relationships = ('IN' === $dir) ? $this->getInboundRelationships() : $this->getOutboundRelationships(); - } - - if (null === $type) { - return $relationships; - } - - $collection = array(); - foreach ($relationships as $rel) { - if ($rel->getType() === $type) { - $collection[] = $rel; - } - } - - return $collection; - } - - /** - * @param null $type - * @param null $direction - * - * @return mixed - */ - public function getSingleRelationship($type = null, $direction = null) - { - $relationships = $this->getRelationships($type, $direction); - reset($relationships); - - return current($relationships); - } - - /** - * @return bool - */ - public function hasRelationships() - { - if (!empty($this->inboundRelationships) || !empty($this->outboundRelationships)) { - return true; - } - - return false; - } - - /** - * @return int - */ - public function getRelationshipsCount() - { - return count($this->getRelationships()); - } - - /** - * @return bool - */ - public function hasConnectedNodes() - { - if (!empty($this->inboundRelationships) || !empty($this->outboundRelationships)) { - return true; - } - - return false; - } - - /** - * @param null $direction - * @param null $relationshipTypes - * - * @return \Neoxygen\NeoClient\Formatter\Node[] - */ - public function getConnectedNodes($direction = null, $relationshipTypes = null) - { - $nodes = []; - $relationships = $this->getRelationships($relationshipTypes, $direction); - foreach ($relationships as $rel) { - $nodes[] = $rel->getOtherNode($this); - } - - return $nodes; - } - - /** - * @param null $direction - * @param null $relationshipTypes - * - * @return null|\Neoxygen\NeoClient\Formatter\Node - */ - public function getConnectedNode($direction = null, $relationshipTypes = null) - { - $nodes = $this->getConnectedNodes($direction, $relationshipTypes); - if (count($nodes) < 1) { - return; - } - - return $nodes[0]; - } -} diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php new file mode 100644 index 00000000..aad0424b --- /dev/null +++ b/src/Formatter/RecordView.php @@ -0,0 +1,133 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Neoxygen\NeoClient\Formatter; + +use GraphAware\Common\Result\RecordViewInterface; +use GraphAware\Common\Type\NodeInterface; +use GraphAware\Common\Type\RelationshipInterface; + +class RecordView implements RecordViewInterface +{ + /** + * @var array + */ + protected $keys = []; + + /** + * @var array + */ + protected $values = []; + + /** + * @var array + */ + private $keyToIndexMap = []; + + /** + * @return array + */ + public function keys() + { + return $this->keys; + } + + /** + * RecordView constructor. + * @param array $keys + * @param array $values + */ + public function __construct(array $keys, array $values) + { + $this->keys = $keys; + $this->values = $values; + foreach ($this->keys as $i => $k) { + $this->keyToIndexMap[$k] = $i; + } + } + + /** + * @return bool + */ + public function hasValues() + { + return !empty($this->values); + } + + /** + * @param $key + * @return mixed|\Neoxygen\NeoClient\Formatter\Node|\Neoxygen\NeoClient\Formatter\Relationship + */ + public function value($key) + { + return $this->values[$this->keyToIndexMap[$key]]; + } + + /** + * Returns the Node for value $key. Ease IDE integration + * + * @param $key + * @return \Neoxygen\NeoClient\Formatter\Node + * + * @throws \InvalidArgumentException When the value is not null or instance of Node + */ + public function nodeValue($key) + { + if ($this->values[$key] !== null && !$this->values[$key] instanceof NodeInterface) { + throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'NODE')); + } + + return $this->value($key); + } + + /** + * @param $key + * @return \Neoxygen\NeoClient\Formatter\Relationship + * + * @throws \InvalidArgumentException When the value is not null or instance of Relationship + */ + public function relationshipValue($key) { + if ($this->values[$key] !== null && !$this->values[$key] instanceof RelationshipInterface) { + throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'RELATIONSHIP')); + } + } + + public function pathValue($key) + { + // TODO: Implement pathValue() method. + } + + /** + * @return array + */ + public function values() + { + return $this->values; + } + + /** + * @param $index + * @return mixed + */ + public function valueByIndex($index) + { + return $this->values[$index]; + } + + /** + * @return \Neoxygen\NeoClient\Formatter\RecordView + */ + public function record() + { + return clone($this); + } + +} \ No newline at end of file diff --git a/src/Formatter/Relationship.php b/src/Formatter/Relationship.php deleted file mode 100644 index bc2b9b23..00000000 --- a/src/Formatter/Relationship.php +++ /dev/null @@ -1,140 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Formatter; - -class Relationship -{ - /** - * @var - */ - protected $id; - - /** - * @var string - */ - protected $type; - - /** - * @var Node - */ - protected $startNode; - - /** - * @var Node - */ - protected $endNode; - - /** - * @var array - */ - protected $properties; - - /** - * @param $id - * @param $type - * @param Node $startNode - * @param Node $endNode - * @param array $properties - */ - public function __construct($id, $type, Node $startNode, Node $endNode, array $properties = array()) - { - $this->id = $id; - $this->type = strtoupper($type); - $this->startNode = $startNode; - $this->endNode = $endNode; - $this->properties = $properties; - } - - /** - * @return mixed - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * @return Node - */ - public function getStartNode() - { - return $this->startNode; - } - - /** - * @return Node - */ - public function getEndNode() - { - return $this->endNode; - } - - /** - * @return array - */ - public function getProperties() - { - return $this->properties; - } - - /** - * @param $name - * - * @return mixed - */ - public function getProperty($name) - { - $value = isset($this->properties[$name]) ? $this->properties[$name] : null; - - return $value; - } - - /** - * @param $property - * - * @return bool - */ - public function hasProperty($property) - { - return array_key_exists($property, $this->properties); - } - - /** - * @return bool - */ - public function hasProperties() - { - return !empty($this->properties); - } - - /** - * @param Node $node - * - * @return Node - */ - public function getOtherNode(Node $node) - { - if ($node === $this->getStartNode()) { - return $this->getEndNode(); - } - - return $this->getStartNode(); - } -} diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index bf878ad3..33d67212 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -11,43 +11,10 @@ namespace Neoxygen\NeoClient\Formatter; +use GraphAware\Common\Cypher\Statement; + class ResponseFormatter implements ResponseFormatterInterface { - /** - * @var array - */ - protected $nodesMap = []; - - /** - * @var array - */ - protected $relationshipsMap = []; - - /** - * @var array - */ - protected $errors = []; - - /** - * @var array - */ - protected $nodesByLabel = []; - - /** - * @var array - */ - protected $relsByType = []; - - /** - * @var Result - */ - protected $result; - - /** - * @var bool - */ - protected $isNew = true; - /** * Returns the Neo4j API ResultDataContent to be used during Cypher queries. * @@ -55,25 +22,7 @@ class ResponseFormatter implements ResponseFormatterInterface */ public static function getDefaultResultDataContents() { - return array('row', 'graph', 'rest'); - } - - /** - * Constructor. - */ - public function __construct() - { - $this->result = new Result(); - } - - /** - * Returns whether or not the Neo4j response contains errors. - * - * @return bool - */ - public function hasErrors() - { - return null !== $this->errors; + return array('rest'); } /** @@ -81,320 +30,20 @@ public function hasErrors() * * @param $response * - * @return Response + * @return \Neoxygen\NeoClient\Formatter\Result[] */ public function format($response) { - $this->isNew = false; - $responseObject = new Response(); - $responseObject->setRawResponse($response); - - if ($responseObject->containsResults()) { - $this->extractResults($response); - $this->prepareResultSet(); - $this->prepareNodesByLabels(); - $this->prepareRelationshipsByType(); - $this->processIdentification($response); - } - - if ($responseObject->containsRows()) { - $rows = $this->formatRows($response); - $responseObject->setRows($rows); - - if ($responseObject->containsResults()) { - foreach ($responseObject->geRows() as $k => $v) { - if (!$this->result->hasIdentifier($k)) { - $this->result->addIdentifierValue($k, $v); - } - } - } - } - - if (is_array($responseObject->geRows())) { - $this->processTableFormat($responseObject->geRows()); - } - $responseObject->setResult($this->result); - - $this->reset(); - - return $responseObject; - } - - /** - * Returns the nodes from the Response array. - * - * @return array - */ - public function getNodes() - { - return $this->nodesMap; - } - - /** - * @return array - */ - public function getRelationships() - { - return $this->relationshipsMap; - } - - /** - * @param $type - */ - public function getRelationshipsByType($type) - { - if ($this->relsByType[$type]) { - return $this->relsByType[$type]; - } - - return; - } - - /** - * @param $label - * - * @return mixed - */ - public function getNodesByLabel($label) - { - if ($this->nodesByLabel[$label]) { - return $this->nodesByLabel[$label]; - } - } - - /** - * @return bool - */ - public function hasNodes() - { - return !empty($this->nodesMap); - } - - /** - * @return bool - */ - public function hasRelationships() - { - return !empty($this->relationshipsMap); - } - - /** - * @return array - */ - public function getGraph() - { - return array( - 'nodes' => $this->nodesMap, - 'relationships' => $this->relationshipsMap, - ); - } - - /** - * Extracts the results from the Neo4j Response. - * - * @param $resultSet - */ - private function extractResults($resultSet) - { - foreach ($resultSet['results'] as $result) { - foreach ($result['data'] as $data) { - if (isset($data['graph'])) { - foreach ($data['graph']['nodes'] as $node) { - $this->nodesMap[$node['id']] = $node; - } - foreach ($data['graph']['relationships'] as $rel) { - $this->relationshipsMap[$rel['id']] = $rel; - } - } - } - } - } - - /** - * - */ - private function prepareNodesByLabels() - { - foreach ($this->nodesMap as $node) { - foreach ($node['labels'] as $label) { - $this->nodesByLabel[$label][] = $node; - } - } - } - - /** - * - */ - private function prepareRelationshipsByType() - { - foreach ($this->relationshipsMap as $rel) { - $this->relsByType[$rel['type']][] = $rel; - } - } - - /** - * - */ - private function prepareResultSet() - { - foreach ($this->nodesMap as $node) { - $n = new Node($node['id'], $node['labels'], $node['properties']); - $this->result->addNode($n); - } - - foreach ($this->relationshipsMap as $relationship) { - $startNode = $this->result->getNodeById($relationship['startNode']); - $endNode = $this->result->getNodeById($relationship['endNode']); - $r = new Relationship($relationship['id'], $relationship['type'], $startNode, $endNode, $relationship['properties']); - $this->result->addRelationship($r); - $startNode->addOutboundRelationship($r); - $endNode->addInboundRelationship($r); - } - } - - /** - * @param $response - */ - private function processIdentification($response) - { + $results = []; foreach ($response['results'] as $result) { - $columns = $result['columns']; - foreach ($result['data'] as $dat) { - foreach ($dat['rest'] as $idx => $restx) { - $this->processRestEltType($restx, $columns, $idx); - } - } - } - } - - /** - * @param $elts - * @param $columns - * @param $idx - */ - private function processRestEltType($elts, $columns, $idx) - { - if (isset($elts[0]) && is_array($elts[0])) { - foreach ($elts as $elt) { - $this->processRestEltType($elt, $columns, $idx); - } - } else { - if (is_array($elts)) { - if (array_key_exists('labels', $elts)) { - $this->result->addNodeToIdentifier($elts['metadata']['id'], $columns[$idx]); - } elseif (array_key_exists('type', $elts)) { - $this->result->addRelationshipToIdentifier($elts['metadata']['id'], $columns[$idx]); - } - } else { - $this->result->addRowToIdentifier($elts, $columns[$idx]); - } - } - } - - /** - * @param $response - * - * @return array - */ - private function formatRows($response) - { - $rows = []; - foreach ($response['results'] as $result) { - $columns = $result['columns']; - $tmpColumns = []; - foreach ($result['data'] as $dat) { - $i = 0; - foreach ($dat['row'] as $row) { - $tmpColumns[$i][] = $row; - ++$i; - } - } - $y = 0; - foreach ($columns as $k => $col) { - if (!empty($tmpColumns)) { - $rows[$col] = $tmpColumns[$k]; - if (is_array($tmpColumns[$k])) { - foreach ($tmpColumns[$k] as $i => $el) { - if (is_array($el) && isset($el[0])) { - $el[0] = 'maybe relationship'; - if (isset($response['results'][0]['data'][$k])) { - $maybeRel = $response['results'][0]['data'][$k]['rest'][$y]; - if (isset($maybeRel['start'])) { - $rows[$col][$i] = $this->getOnlyUsefulEdgeInfoFromRestFormat($maybeRel); - } - if (is_array($maybeRel)) { - $areRels = false; - foreach ($maybeRel as $rel) { - if (isset($rel['start'])) { - $areRels = true; - } - } - if ($areRels) { - $rows[$col][$i] = $this->getUsefulRestEdgeInfoFromCollection($maybeRel); - } - } - } - - } - } - } - } - ++$y; - } - } - - return $rows; - } - - private function getOnlyUsefulEdgeInfoFromRestFormat(array $rel) - { - $data = [ - 'id' => $rel['metadata']['id'], - 'type' => $rel['metadata']['type'], - 'properties' => $rel['data'], - ]; - - return $data; - } - - private function getUsefulRestEdgeInfoFromCollection(array $rels) - { - $data = []; - foreach ($rels as $rel) { - $data[] = $this->getOnlyUsefulEdgeInfoFromRestFormat($rel); - } - - return $data; - } - - private function processTableFormat(array $rows = array()) - { - $table = []; - foreach ($rows as $k => $values) { - foreach ($values as $i => $val) { - $table[$i][$k] = $val; + $resultO = new Result(Statement::create("")); + $resultO->setFields($result['columns']); + foreach ($result['data'] as $data) { + $resultO->pushRecord($data['rest']); } + $results[] = $resultO; } - $this->result->setTableFormat($table); - } - - /** - * Resets the results collections for next Result process. - */ - public function reset() - { - $this->isNew = true; - $this->nodesMap = array(); - $this->relationshipsMap = array(); - $this->nodesByLabel = array(); - $this->result = new Result(); - } - /** - * @return bool - */ - public function isNew() - { - return $this->isNew; + return $results; } } diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index b52ceff9..87a28189 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -1,335 +1,94 @@ " NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - namespace Neoxygen\NeoClient\Formatter; -class Result -{ - /** @var Node[] */ - protected $nodes; - - /** @var Relationship[] */ - protected $relationships; - - protected $errors; - - /** @var array */ - protected $identifiers = []; - - /** @var array */ - protected $tableFormat; - - public function __construct() - { - $this->nodes = array(); - $this->relationships = array(); - } - - public function addNode(Node $node) - { - $this->nodes[$node->getId()] = $node; - } - - public function addRelationship(Relationship $relationship) - { - $this->relationships[$relationship->getId()] = $relationship; - } +use GraphAware\Common\Result\AbstractRecordCursor; +use Neoxygen\NeoClient\Formatter\Type\Node; +use Neoxygen\NeoClient\Formatter\Type\Relationship; +class Result extends AbstractRecordCursor +{ /** - * Returns all nodes if called without arguments. Returns all nodes with - * the given labels if called with an array of labels. Otherwise, acts - * identically as {@link Result::getNodesByLabels()}. - * - * @param string|string[]|null $label - * @param bool $labelizedKeys - * - * @return Node[] + * @var \GraphAware\Common\Result\RecordViewInterface[] */ - public function getNodes($label = null, $labelizedKeys = false) - { - if (null !== $label) { - if (is_array($label)) { - $nodes = []; - foreach ($label as $lbl) { - $nodes[$lbl] = $this->getNodesByLabel($lbl); - } - - return $nodes; - } - - return $this->getNodesByLabel($label, $labelizedKeys); - } - - return $this->nodes; - } + protected $records = []; /** - * Returns a single node by its Neo4j node ID number, or null if the node - * is not present in the result. - * - * @param int $id Neo4j node ID. - * - * @return Node|null + * @var string[] */ - public function getNodeById($id) - { - if (!isset($this->nodes[$id])) { - return; - } - - return $this->nodes[$id]; - } + protected $fields = []; - /** - * Returns a single node from the nodes collection - * Use when you do cypher queries returning only one node. - * - * @param string|null $label Return a node for this label only. - * - * @return Node|null - */ - public function getSingleNode($label = null) + public function setFields(array $fields) { - $nodes = (null === $label) ? $this->getNodes() : $this->getNodesByLabel($label); - $single = current($nodes); - - return $single; + $this->fields = $fields; } - /** - * Returns a single node for a given label. - * - * @param string $label The label to match for - * - * @return Node|null The Node or null if not node found matching the label - */ - public function getSingleNodeByLabel($label) + public function pushRecord($data) { - foreach ($this->nodes as $node) { - if ($node->hasLabel($label)) { - return $node; - } - } - - return; + $mapped = $this->array_map_deep($data); + $this->records[] = new RecordView($this->fields, $mapped); } /** - * Returns all nodes with the given label. - * - * @param string $name - * @param bool $labelizedKeys When true, the results are indexed by node - * label. Assumes only one node per label. - * - * @return Node[] + * @return \GraphAware\Common\Result\RecordViewInterface[] */ - public function getNodesByLabel($name, $labelizedKeys = false) + public function getRecords() { - $collection = array(); - foreach ($this->getNodes() as $node) { - if ($node->hasLabel($name)) { - if ($labelizedKeys) { - $collection[$name] = $node; - } else { - $collection[] = $node; - } - } - } - - return $collection; + return $this->records; } /** - * Returns all nodes with the given labels. - * - * @param array $labels - * @param bool $labelizedKeys When true, the results are indexed by node - * label. Assumes one node per label. - * - * @return Node[] + * @return \GraphAware\Common\Result\RecordViewInterface|null */ - public function getNodesByLabels(array $labels = array(), $labelizedKeys = false) + public function getRecord() { - $nodes = []; - foreach ($labels as $label) { - $lnodes = $this->getNodesByLabel($label); - foreach ($lnodes as $node) { - if ($labelizedKeys) { - $nodes[$label] = $node; - } else { - $nodes[] = $node; - } - } - } - - return $nodes; + return !empty($this->records) ? $this->records[0] : null; } - /** - * @return Relationship[] - */ - public function getRelationships() + public function hasRecord() { - return $this->relationships; + return !empty($this->records); } - /** - * Returns the relationship by its Neo4j ID. - * - * @param int $id The id of the relationship. - * - * @return Relationship|null - */ - public function getRelationship($id) + public function position() { - if (!isset($this->relationships[$id])) { - return; - } - - return $this->relationships[$id]; + // TODO: Implement position() method. } - /** - * @return int Number of nodes in the result. - */ - public function getNodesCount() + public function skip() { - return count($this->nodes); + // TODO: Implement skip() method. } - /** - * @return int Number of relationships in the result. - */ - public function getRelationshipsCount() + private function array_map_deep(array $array) { - return count($this->relationships); - } - - public function addNodeToIdentifier($nodeId, $identifier) - { - if (isset($this->identifiers[$identifier])) { - foreach ($this->identifiers[$identifier] as $node) { - if (null === $node || $node->getId() === $nodeId) { - return; + foreach ($array as $k => $v) { + if (is_array($v)) { + if (array_key_exists('metadata', $v) && isset($v['metadata']['labels'])) { + $array[$k] = new Node($v['metadata']['id'], $v['metadata']['labels'], $v['data']); + } elseif (array_key_exists('start', $v) && array_key_exists('type', $v)) { + $array[$k] = new Relationship( + $v['metadata']['id'], + $v['type'], + $this->extractIdFromRestUrl($v['start']), + $this->extractIdFromRestUrl($v['end']), + $v['data'] + ); + } else { + $array[$k] = $this->array_map_deep($v); } } } - $this->identifiers[$identifier][] = $this->getNodeById($nodeId); - } - public function addRelationshipToIdentifier($relationshipId, $identifier) - { - if (isset($this->identifiers[$identifier])) { - foreach ($this->identifiers[$identifier] as $rel) { - if ($rel->getId() === $relationshipId) { - return; - } - } - } - $this->identifiers[$identifier][] = $this->getRelationship($relationshipId); + return $array; } - public function addRowToIdentifier($value, $identifier) + private function extractIdFromRestUrl($url) { - $this->identifiers[$identifier][] = $value; - } + $expl = explode('/', $url); + $v = $expl[count($expl)-1]; - /** - * Returns the item or items bound to the given identifier, or $default - * if no items are bound. - * - * @param string $identifier - * @param mixed $default A value to return if the identifier is not bound. - * @param bool $singleAsArray When true, always returns a single value as - * an array. - * - * @return mixed - */ - public function get($identifier, $default = null, $singleAsArray = false) - { - if (!array_key_exists($identifier, $this->identifiers)) { - return $default; - } - - if (is_array($this->identifiers[$identifier]) && 1 === count($this->identifiers[$identifier]) && $singleAsArray === false) { - return array_values($this->identifiers[$identifier])[0]; - } - - return $this->identifiers[$identifier]; + return (int) $v; } - /** - * Returns a single item bound to the given identifier, or the default if - * the identifier is not bound. - * - * @param string $identifier - * @param mixed $default A value to return if the identifier is not bound. - * - * @return mixed - */ - public function getSingle($identifier, $default = null) - { - $get = $this->get($identifier, $default); - if (is_array($get)) { - return array_values($this->identifiers[$identifier])[0]; - } - - return $get; - } - - /** - * @return string[] - */ - public function getIdentifiers() - { - return array_keys($this->identifiers); - } - - /** - * @return array - */ - public function getAllByIdentifier() - { - return $this->identifiers; - } - - /** - * @param string $i Query identifier to check. - * - * @return bool - */ - public function hasIdentifier($i) - { - return array_key_exists($i, $this->identifiers); - } - - public function addIdentifierValue($k, $v) - { - if (array_key_exists($k, $this->identifiers)) { - return $this->addRowToIdentifier($k, $v); - } - - return $this->identifiers[$k] = $v; - } - - public function setTableFormat(array $table) - { - $this->tableFormat = $table; - } - - /** - * @return array - */ - public function getTableFormat() - { - return $this->tableFormat; - } -} +} \ No newline at end of file diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php new file mode 100644 index 00000000..84c02c05 --- /dev/null +++ b/src/Formatter/Type/Node.php @@ -0,0 +1,66 @@ +id = $id; + $this->labels = $labels; + $this->properties = $properties; + } + + /** + * @return int + */ + public function identity() + { + return $this->id; + } + + /** + * @return string[] + */ + public function labels() + { + return $this->labels; + } + + /** + * @param string $label + * + * @return bool + */ + public function hasLabel($label) + { + return in_array($label, $this->labels); + } + + public function value($key) + { + return $this->properties[$key]; + } + + public function values() + { + return $this->properties; + } +} \ No newline at end of file diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php new file mode 100644 index 00000000..b8899440 --- /dev/null +++ b/src/Formatter/Type/Relationship.php @@ -0,0 +1,108 @@ +id = $id; + $this->type = $type; + $this->startNodeIdentity = $startNodeId; + $this->endNodeIdentity = $endNodeId; + $this->properties = $properties; + } + + /** + * @return mixed + */ + public function identity() + { + return $this->id; + } + + /** + * @return mixed + */ + public function type() + { + return $this->type; + } + + /** + * @param string $type + * @return bool + */ + public function hasType($type) + { + return $type === $this->type; + } + + /** + * @return mixed + */ + public function startNodeIdentity() + { + return $this->startNodeIdentity; + } + + /** + * @return mixed + */ + public function endNodeIdentity() + { + return $this->endNodeIdentity; + } + + /** + * @param $key + * @return mixed + */ + public function value($key) + { + return $this->properties[$key]; + } + + /** + * @return array + */ + public function values() + { + return $this->properties; + } +} \ No newline at end of file From af4ffbdf736b11c95b25d7976a714c5163372737 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jan 2016 00:51:53 +0100 Subject: [PATCH 043/217] hasValue method on Node and Relationship objects --- src/Formatter/Type/Node.php | 13 +++++++++++++ src/Formatter/Type/Relationship.php | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php index 84c02c05..8bd4344d 100644 --- a/src/Formatter/Type/Node.php +++ b/src/Formatter/Type/Node.php @@ -54,11 +54,24 @@ public function hasLabel($label) return in_array($label, $this->labels); } + /** + * @param $key + * @return mixed + */ public function value($key) { return $this->properties[$key]; } + /** + * @param $key + * @return bool + */ + public function hasValue($key) + { + return array_key_exists($key, $this->properties); + } + public function values() { return $this->properties; diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index b8899440..75069364 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -98,6 +98,15 @@ public function value($key) return $this->properties[$key]; } + /** + * @param $key + * @return bool + */ + public function hasValue($key) + { + return array_key_exists($key, $this->properties); + } + /** * @return array */ From 31a2091f467cec5ec7cb26bd6cd405dcb106b12c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jan 2016 21:48:31 +0100 Subject: [PATCH 044/217] dependencies lock --- composer.json | 1 - composer.lock | 1629 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1629 insertions(+), 1 deletion(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 9165685d..9cf9253d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "guzzlehttp/guzzle": "^6.0", "monolog/monolog": "~1.1", "symfony/yaml": "^2.7", - "symfony/config": "^2.7", "symfony/event-dispatcher": "^2.7", "graphaware/neo4j-common": "^1.2" }, diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..9d07cf9e --- /dev/null +++ b/composer.lock @@ -0,0 +1,1629 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "34332ccdc389de21e87577476658d41e", + "content-hash": "cae0b5aec35afadacfa7e9a78de14d9c", + "packages": [ + { + "name": "graphaware/neo4j-bolt", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/graphaware/neo4j-bolt-php.git", + "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", + "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", + "shasum": "" + }, + "require": { + "graphaware/neo4j-common": "^1.7", + "myclabs/php-enum": "^1.4", + "symfony/console": "^2.7", + "symfony/event-dispatcher": "^2.7" + }, + "require-dev": { + "behat/behat": "~3.0.4", + "neoxygen/neoclient": "^3.3", + "phpunit/phpunit": "^4.8", + "symfony/stopwatch": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "GraphAware\\Bolt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + } + ], + "description": "Neo4j Bolt Binary Protocol PHP Driver", + "time": "2016-01-05 13:41:25" + }, + { + "name": "graphaware/neo4j-common", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/graphaware/neo4j-php-commons.git", + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b0713ade0458ec9b412a506a24f7aa55153e1b79", + "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "GraphAware\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ApacheV2" + ], + "authors": [ + { + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + } + ], + "description": "Common Utilities library for Neo4j", + "keywords": [ + "cypher", + "database", + "graph", + "neo4j", + "statement" + ], + "time": "2016-01-05 12:54:41" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.1.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", + "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "~1.0", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.5.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.1-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2015-11-23 00:47:50" + }, + { + "name": "guzzlehttp/promises", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2015-10-15 22:28:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "PSR-7 message implementation", + "keywords": [ + "http", + "message", + "stream", + "uri" + ], + "time": "2015-11-03 01:34:55" + }, + { + "name": "monolog/monolog", + "version": "1.17.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "raven/raven": "^0.13", + "ruflin/elastica": ">=0.90 <3.0", + "swiftmailer/swiftmailer": "~5.3", + "videlalvaro/php-amqplib": "~2.4" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "raven/raven": "Allow sending log messages to a Sentry server", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.16.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2015-10-14 12:51:02" + }, + { + "name": "myclabs/php-enum", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2015-07-22 16:14:03" + }, + { + "name": "psr/http-message", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2015-05-04 20:22:00" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "symfony/console", + "version": "v2.8.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-12-22 10:25:57" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25", + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2015-11-20 09:19:13" + }, + { + "name": "symfony/yaml", + "version": "v2.8.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-12-26 13:37:56" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03 12:10:50" + }, + { + "name": "phpspec/prophecy", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2015-08-13 10:07:40" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06 15:47:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2015-06-21 08:01:12" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-15 10:49:45" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.21", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c", + "reference": "ea76b17bced0500a28098626b84eda12dbcf119c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": ">=1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2015-12-12 07:45:58" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02 06:51:40" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08 07:14:41" + }, + { + "name": "sebastian/environment", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6e7133793a8e5a5714a551a8324337374be209df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df", + "reference": "6e7133793a8e5a5714a551a8324337374be209df", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2015-12-02 08:37:27" + }, + { + "name": "sebastian/exporter", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-06-21 07:55:53" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21 13:59:46" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "graphaware/neo4j-bolt": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">= 5.6" + }, + "platform-dev": [] +} From 726a1166e2b5b304180615fbdf7a55cc29d76064 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jan 2016 22:31:51 +0100 Subject: [PATCH 045/217] improved Neo4j exception handling --- composer.json | 3 +- composer.lock | 4 +- src/Exception/CommandException.php | 16 ------ src/Exception/CypherException.php | 16 ------ src/Exception/HttpException.php | 16 ------ src/Exception/InvalidArgumentException.php | 5 -- src/Exception/InvalidConnectionException.php | 7 --- .../Neo4jClientExceptionInterface.php | 5 -- src/Exception/Neo4jException.php | 50 +++++++++++++++---- src/Exception/NeoClientExceptionInterface.php | 21 ++++++++ 10 files changed, 66 insertions(+), 77 deletions(-) delete mode 100644 src/Exception/CommandException.php delete mode 100644 src/Exception/CypherException.php delete mode 100644 src/Exception/HttpException.php delete mode 100644 src/Exception/InvalidArgumentException.php delete mode 100644 src/Exception/InvalidConnectionException.php delete mode 100644 src/Exception/Neo4jClientExceptionInterface.php create mode 100644 src/Exception/NeoClientExceptionInterface.php diff --git a/composer.json b/composer.json index 9cf9253d..564f2f17 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "monolog/monolog": "~1.1", "symfony/yaml": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-common": "^1.2" + "graphaware/neo4j-common": "^1.2", + "myclabs/php-enum": "^1.4" }, "require-dev": { "phpunit/phpunit": "4.*" diff --git a/composer.lock b/composer.lock index 9d07cf9e..a164034a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "34332ccdc389de21e87577476658d41e", - "content-hash": "cae0b5aec35afadacfa7e9a78de14d9c", + "hash": "a4e564cd567e911f85831bdff88daac1", + "content-hash": "f3b5075a133cc4ffa49a924990351128", "packages": [ { "name": "graphaware/neo4j-bolt", diff --git a/src/Exception/CommandException.php b/src/Exception/CommandException.php deleted file mode 100644 index e311baee..00000000 --- a/src/Exception/CommandException.php +++ /dev/null @@ -1,16 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Exception; - -class CommandException extends \InvalidArgumentException -{ -} diff --git a/src/Exception/CypherException.php b/src/Exception/CypherException.php deleted file mode 100644 index 08953e3c..00000000 --- a/src/Exception/CypherException.php +++ /dev/null @@ -1,16 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Exception; - -class CypherException extends \InvalidArgumentException -{ -} diff --git a/src/Exception/HttpException.php b/src/Exception/HttpException.php deleted file mode 100644 index 38be2746..00000000 --- a/src/Exception/HttpException.php +++ /dev/null @@ -1,16 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Exception; - -class HttpException extends \InvalidArgumentException -{ -} diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php deleted file mode 100644 index bce89d7d..00000000 --- a/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,5 +0,0 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ -class Neo4jException extends \Exception +namespace GraphAware\Neo4j\Client\Exception; + +abstract class Neo4jException extends \Exception implements NeoClientExceptionInterface { - const NEO4J_INDEX_ALREADY_EXIST = 8000; + /** + * @return string + */ + public function effect() + { + $classification = $this->classification(); + + switch ($classification) { + case 'ClientError': + return NeoClientExceptionInterface::EFFECT_ROLLBACK; + case 'ClientNotification': + return NeoClientExceptionInterface::EFFECT_NONE; + case 'DatabaseError': + return NeoClientExceptionInterface::EFFECT_ROLLBACK; + case 'TransientError': + return NeoClientExceptionInterface::EFFECT_ROLLBACK; + default: + throw new \InvalidArgumentException(sprintf('Invalid classification "%s" in "%s"', $classification, $this->getMessage())); + } + } - public static function fromCode($code) + /** + * @return string + */ + public function classification() { - $c = (string) $code; - switch ($c) { - case 'Neo.ClientError.Schema.IndexAlreadyExists': - return self::NEO4J_INDEX_ALREADY_EXIST; + $parts = explode('.', $this->getMessage()); + if (!isset($parts[2])) { + throw new \InvalidArgumentException(sprintf('Could not parse exception message "%"', $this->getMessage())); } + + return $parts[2]; } -} +} \ No newline at end of file diff --git a/src/Exception/NeoClientExceptionInterface.php b/src/Exception/NeoClientExceptionInterface.php new file mode 100644 index 00000000..99fef7df --- /dev/null +++ b/src/Exception/NeoClientExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Exception; + +interface NeoClientExceptionInterface +{ + const EFFECT_NONE = 'NONE'; + + const EFFECT_ROLLBACK = 'ROLLBACK'; + + public function effect(); +} \ No newline at end of file From 10c64c489c9dd5c235d72466fe09d8d4be70038c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jan 2016 23:49:38 +0100 Subject: [PATCH 046/217] new simplified setup --- composer.json | 7 +- composer.lock | 53 +- src/Client.php | 164 +--- src/ClientBuilder.php | 602 +------------ src/Command/AbstractCommand.php | 47 - src/Command/CommandInterface.php | 17 - src/Command/CommandManager.php | 74 -- .../Core/CoreChangePasswordCommand.php | 56 -- .../Core/CoreCommitTransactionCommand.php | 76 -- .../Core/CoreGetConstraintsCommand.php | 26 - .../Core/CoreGetHAAvailableCommand.php | 31 - src/Command/Core/CoreGetHAMasterCommand.php | 31 - src/Command/Core/CoreGetHASlaveCommand.php | 31 - src/Command/Core/CoreGetLabelsCommand.php | 26 - src/Command/Core/CoreGetVersionCommand.php | 26 - src/Command/Core/CoreListIndexCommand.php | 43 - .../Core/CoreOpenTransactionCommand.php | 33 - src/Command/Core/CorePingCommand.php | 26 - .../CorePushMultipleToTransactionCommand.php | 68 -- .../Core/CorePushToTransactionCommand.php | 74 -- .../Core/CoreRollBackTransactionCommand.php | 45 - .../Core/CoreSendCypherQueryCommand.php | 63 -- .../Core/CoreSendMultipleCypherCommand.php | 59 -- src/Command/SimpleCommand.php | 24 - src/Connection/Connection.php | 3 +- src/Connection/ConnectionManager.php | 10 +- .../Compiler/AliasesCompilerPass.php | 24 - .../ConnectionRegistryCompilerPass.php | 70 -- .../Compiler/EventSubscribersCompilerPass.php | 32 - .../NeoClientExtensionsCompilerPass.php | 69 -- src/DependencyInjection/Definition.php | 106 --- .../NeoClientExtension.php | 186 ---- .../HttpRequestEventSubscriber.php | 76 -- src/EventListener/LoggingEventSubscriber.php | 38 - src/Exception/Neo4jException.php | 10 +- src/Exception/Neo4jExceptionInterface.php | 21 + src/Exception/NeoClientExceptionInterface.php | 9 +- src/Extension/AbstractExtension.php | 136 --- src/Extension/ExtensionManager.php | 75 -- src/Extension/NeoClientAuthExtension.php | 22 - src/Extension/NeoClientCoreExtension.php | 851 ------------------ src/Extension/NeoClientExtensionInterface.php | 17 - src/Formatter/ResponseFormatterInterface.php | 18 - src/Formatter/ResponseFormatterManager.php | 18 - src/HighAvailibility/HACommunityManager.php | 117 --- src/HttpClient/GuzzleHttpClient.php | 118 --- src/HttpClient/HttpClientInterface.php | 24 - src/Logger/LoggerManager.php | 113 --- src/Request/Request.php | 287 ------ src/Request/RequestBuilder.php | 46 - src/Request/RequestInterface.php | 25 - src/Request/Response.php | 80 -- src/Resources/config/services.yml | 47 - src/Resources/extensions/core_commands.yml | 52 -- src/Schema/Index.php | 51 -- src/Schema/UniqueConstraint.php | 51 -- .../ClientSetupIntegrationTest.php | 27 + .../Tests/Functional/CoreCommandsTest.php | 125 --- .../IssueTransactionServerRollBackTest.php | 45 - tests/Unit/Connection/ConnectionUnitTest.php | 6 +- tests/Unit/Stub/DummyDriver.php | 3 +- 61 files changed, 148 insertions(+), 4562 deletions(-) delete mode 100644 src/Command/AbstractCommand.php delete mode 100644 src/Command/CommandInterface.php delete mode 100644 src/Command/CommandManager.php delete mode 100644 src/Command/Core/CoreChangePasswordCommand.php delete mode 100644 src/Command/Core/CoreCommitTransactionCommand.php delete mode 100644 src/Command/Core/CoreGetConstraintsCommand.php delete mode 100644 src/Command/Core/CoreGetHAAvailableCommand.php delete mode 100644 src/Command/Core/CoreGetHAMasterCommand.php delete mode 100644 src/Command/Core/CoreGetHASlaveCommand.php delete mode 100644 src/Command/Core/CoreGetLabelsCommand.php delete mode 100644 src/Command/Core/CoreGetVersionCommand.php delete mode 100644 src/Command/Core/CoreListIndexCommand.php delete mode 100644 src/Command/Core/CoreOpenTransactionCommand.php delete mode 100644 src/Command/Core/CorePingCommand.php delete mode 100644 src/Command/Core/CorePushMultipleToTransactionCommand.php delete mode 100644 src/Command/Core/CorePushToTransactionCommand.php delete mode 100644 src/Command/Core/CoreRollBackTransactionCommand.php delete mode 100644 src/Command/Core/CoreSendCypherQueryCommand.php delete mode 100644 src/Command/Core/CoreSendMultipleCypherCommand.php delete mode 100644 src/Command/SimpleCommand.php delete mode 100644 src/DependencyInjection/Compiler/AliasesCompilerPass.php delete mode 100644 src/DependencyInjection/Compiler/ConnectionRegistryCompilerPass.php delete mode 100644 src/DependencyInjection/Compiler/EventSubscribersCompilerPass.php delete mode 100644 src/DependencyInjection/Compiler/NeoClientExtensionsCompilerPass.php delete mode 100644 src/DependencyInjection/Definition.php delete mode 100644 src/DependencyInjection/NeoClientExtension.php delete mode 100644 src/EventListener/HttpRequestEventSubscriber.php delete mode 100644 src/EventListener/LoggingEventSubscriber.php create mode 100644 src/Exception/Neo4jExceptionInterface.php delete mode 100644 src/Extension/AbstractExtension.php delete mode 100644 src/Extension/ExtensionManager.php delete mode 100644 src/Extension/NeoClientAuthExtension.php delete mode 100644 src/Extension/NeoClientCoreExtension.php delete mode 100644 src/Extension/NeoClientExtensionInterface.php delete mode 100644 src/Formatter/ResponseFormatterInterface.php delete mode 100644 src/Formatter/ResponseFormatterManager.php delete mode 100644 src/HighAvailibility/HACommunityManager.php delete mode 100644 src/HttpClient/GuzzleHttpClient.php delete mode 100644 src/HttpClient/HttpClientInterface.php delete mode 100644 src/Logger/LoggerManager.php delete mode 100644 src/Request/Request.php delete mode 100644 src/Request/RequestBuilder.php delete mode 100644 src/Request/RequestInterface.php delete mode 100644 src/Request/Response.php delete mode 100644 src/Resources/config/services.yml delete mode 100644 src/Resources/extensions/core_commands.yml delete mode 100644 src/Schema/Index.php delete mode 100644 src/Schema/UniqueConstraint.php create mode 100644 tests/Integration/ClientSetupIntegrationTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php delete mode 100644 tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php diff --git a/composer.json b/composer.json index 564f2f17..574c369d 100644 --- a/composer.json +++ b/composer.json @@ -31,17 +31,18 @@ "myclabs/php-enum": "^1.4" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "4.*", + "symfony/stopwatch": "^3.0" }, "autoload": { "psr-4": { - "GraphAware\\Neo4j\\": "src/" + "GraphAware\\Neo4j\\Client\\": "src/" } }, "autoload-dev": { "psr-4": { - "GraphAware\\Neo4j\\Tests\\": "tests/" + "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" } } } diff --git a/composer.lock b/composer.lock index a164034a..f6196257 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "a4e564cd567e911f85831bdff88daac1", - "content-hash": "f3b5075a133cc4ffa49a924990351128", + "hash": "3f7cddc8c9546bd3c902573c49d14e46", + "content-hash": "f5794c2bccc4fdf767b779a3874a2da6", "packages": [ { "name": "graphaware/neo4j-bolt", @@ -1613,6 +1613,55 @@ "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", "time": "2015-06-21 13:59:46" + }, + { + "name": "symfony/stopwatch", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "6aeac8907e3e1340a0033b0a9ec075f8e6524800" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6aeac8907e3e1340a0033b0a9ec075f8e6524800", + "reference": "6aeac8907e3e1340a0033b0a9ec075f8e6524800", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 23:35:59" } ], "aliases": [], diff --git a/src/Client.php b/src/Client.php index c35ed52f..368f38de 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,175 +1,35 @@ " NeoClient package. + * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient; +namespace GraphAware\Neo4j\Client; -use GraphAware\Common\Result\AbstractRecordCursor; -use GraphAware\Common\Result\RecordCursorInterface; -use Neoxygen\NeoClient\Transaction\PreparedTransaction; -use Symfony\Component\DependencyInjection\ContainerInterface; +use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use Symfony\Component\EventDispatcher\EventDispatcher; -/** - * @method getRoot($conn = null) - * @method ping($conn = null) - * @method getLabels($conn = null) - * @method \Neoxygen\NeoClient\Schema\UniqueConstraint createSchemaUniqueConstraint($label, $property, $conn = null) - * @method getConstraints($conn = null) - * @method listIndex($label, $conn = null) - * @method listIndexes(array $labels = array(), $conn = null) - * @method isIndexed($label, $propertyKey, $conn = null) - * @method getVersion($conn = null) - * @method openTransaction($conn = null) - * @method \Neoxygen\NeoClient\Transaction\Transaction createTransaction($conn = null) - * @method rollbackTransaction($id, $conn = null) - * @method sendMultiple(array $statements, $conn = null) - * @method sendWriteQuery($query, array $parameters = array()) - * @method sendReadQuery($query, array $parameters = array()) - * @method PreparedTransaction prepareTransaction($conn = null) - * @method bool createIndex($label, $property) - * @method bool createUniqueConstraint($label, $property, $removeIndexIfExist = false) - */ class Client { - const NEOCLIENT_VERSION = '3.2.0'; - - const NEOCLIENT_QUERY_MODE_WRITE = 'WRITE'; - - const NEOCLIENT_QUERY_MODE_READ = 'READ'; - - private static $serviceContainer; - - public static $logger; - - private $lastResponse; - - public function __construct(ContainerInterface $container) - { - self::$serviceContainer = $container; - self::$logger = $container->get('logger'); - } - - public static function getNeoClientVersion() - { - return self::NEOCLIENT_VERSION; - } - - public static function commitPreparedTransaction(PreparedTransaction $transaction) - { - return self::call('sendMultiple', array($transaction->getStatements(), $transaction->getConnection(), $transaction->getQueryMode())); - } + const NEOCLIENT_VERSION = '4.0.0'; - /** - * @param $method - * @param $attributes - * - * @return \Neoxygen\NeoClient\Request\Response - */ - private static function call($method, $attributes) - { - $extManager = self::$serviceContainer->get('neoclient.extension_manager'); + protected $connectionManager; - $response = $extManager->execute($method, $attributes); + protected $eventDispatcher; - return $response; - } - - /** - * Returns the ConnectionManager Service. - * - * @return \Neoxygen\NeoClient\Connection\ConnectionManager - */ - public function getConnectionManager() + public function __construct(ConnectionManager $connectionManager, EventDispatcher $eventDispatcher) { - return self::$serviceContainer->get('neoclient.connection_manager'); + $this->connectionManager = $connectionManager; + $this->eventDispatcher = $eventDispatcher; } - /** - * Returns the connection bound to the alias, or the default connection if no alias is provided. - * - * @param string|null $alias - * - * @return \Neoxygen\NeoClient\Connection\Connection The connection with alias "$alias" - */ - public function getConnection($alias = null) + public static function create() { - return $this->getConnectionManager()->getConnection($alias); - } - /** - * Returns the CommandManager Service. - * - * @return \Neoxygen\NeoClient\Command\CommandManager - */ - public function getCommandManager() - { - return self::$serviceContainer->get('neoclient.command_manager'); - } - - /** - * @return ContainerInterface - */ - public function getServiceContainer() - { - return self::$serviceContainer; - } - - /** - * @param $method - * @param $attributes - * - * @return \Neoxygen\NeoClient\Request\Response - */ - public function __call($method, $attributes) - { - $extManager = $this->getServiceContainer()->get('neoclient.extension_manager'); - - $response = $extManager->execute($method, $attributes); - - $this->lastResponse = $response; - - return $response; - } - - /** - * @return \Neoxygen\NeoClient\Request\Response - */ - public function getResponse() - { - return $this->lastResponse; - } - - /** - * @return \Neoxygen\NeoClient\Formatter\Result - */ - public function getResult() - { - return $this->lastResponse->getResult(); - } - - /** - * @param $query - * @param array $parameters - * - * @return \Neoxygen\NeoClient\Formatter\Result - */ - public function sendCypherQuery($query, array $parameters = array()) - { - /** @var \Neoxygen\NeoClient\Formatter\Result[] $results */ - $results = $this->call('sendCypherQuery', array($query, $parameters)); - - return $results[0]; - } - - public static function log($level = 'debug', $message, array $context = array()) - { - return self::$logger->log($level, $message, $context); } } diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 8723162d..015d17e0 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -1,616 +1,46 @@ " NeoClient package. + * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient; +namespace GraphAware\Neo4j\Client; -use Monolog\Logger; -use Neoxygen\NeoClient\Exception\Neo4jException; -use Psr\Log\NullLogger; -use Psr\Log\LoggerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\Yaml\Yaml; -use Neoxygen\NeoClient\DependencyInjection\NeoClientExtension; -use Neoxygen\NeoClient\DependencyInjection\Compiler\ConnectionRegistryCompilerPass; -use Neoxygen\NeoClient\DependencyInjection\Compiler\NeoClientExtensionsCompilerPass; -use Neoxygen\NeoClient\DependencyInjection\Compiler\AliasesCompilerPass; -use Neoxygen\NeoClient\DependencyInjection\Compiler\EventSubscribersCompilerPass; +use GraphAware\Bolt\GraphDatabase; +use Symfony\Component\EventDispatcher\EventDispatcher; +use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\Connection\Connection; class ClientBuilder { - const CACHE_FILENAME = 'neoclient_container.php'; + protected $config = []; - /** - * @var ContainerBuilder - */ - private $serviceContainer; + protected $connectionManager; - /** - * @var array Configuration array - */ - private $configuration = array(); - - /** - * @var array the Configuration loaded with a config file - */ - private $loadedConfig; - - /** - * @var array The collection of registered listeners - */ - private $listeners = array(); - - /** - * @var array The collection of the registered loggers - */ - private $loggers = array(); - - /** - * @var bool if the check for a Ha Failure file have to be skipped or not - */ - private $skipHaFailureFileCheck = false; - - /** - */ - public static function create() - { - return new static(); - } - - /** - * @param ContainerInterface $serviceContainer - */ - public function __construct(ContainerInterface $serviceContainer = null) - { - if (null === $serviceContainer) { - $this->serviceContainer = new ContainerBuilder(); - } - $this->configuration['cache']['enabled'] = false; - - return $this; - } - - /** - * @return array The current configuration - */ - public function getConfiguration() - { - if (null !== $this->loadedConfig) { - $conf = array_merge($this->configuration, $this->loadedConfig); - - return $conf; - } - - return $this->configuration; - } - - /** - * Load a configuration from an external YAML file. - * - * @param string $file - * - * @return ClientBuilder - */ - public function loadConfigurationFile($file) - { - if (!file_exists($file)) { - throw new \InvalidArgumentException(sprintf('Configuration file "%s" not found', $file)); - } - $this->loadedConfig = Yaml::parse(file_get_contents($file)); - - return $this; - } - - /** - * Load a user defined configuration array - * - * @param array $configuration - * - * @return ClientBuilder - */ - public function loadConfiguration(array $configuration) - { - $this->loadedConfig = $configuration; - - return $this; - } - - /** - * @param string $alias An alias for the connection - * @param string $scheme The scheme of the connection - * @param string $host The host of the connection - * @param int $port The port for the connection - * @param bool $authMode Whether or not the connection use the authentication extension - * @param string|null Authentication login - * @param string|null Authentication password - * - * @return ClientBuilder - */ - public function addConnection($alias, $scheme, $host, $port, $authMode = false, $authUser = null, $authPassword = null) - { - $this->configuration['connections'][$alias] = array( - 'scheme' => $scheme, - 'host' => $host, - 'port' => $port, - 'auth' => $authMode, - 'user' => $authUser, - 'password' => $authPassword, - ); - - return $this; - } - - /** - * Add a default local connection running at http://localhost:7474. - * - * @return ClientBuilder - */ - public function addDefaultLocalConnection() - { - return $this->addConnection('default', 'http', 'localhost', 7474); - } - - public function setMasterConnection($connectionAlias) - { - $this->checkConnection($connectionAlias); - - $this->configuration['ha_mode']['master'] = $connectionAlias; - - return $this; - } - - public function setSlaveConnection($connectionAlias) - { - $this->checkConnection($connectionAlias); - - $this->configuration['ha_mode']['slaves'][] = $connectionAlias; - - return $this; - } - - /** - * Enables the High Availibility Mode. - * - * @return $this - */ - public function enableHAMode() - { - $this->configuration['ha_mode']['enabled'] = true; - $this->configuration['ha_mode']['type'] = 'enterprise'; - - return $this; - } - - public function configureHAQueryModeHeaders($headerKey, $writeModeHeaderValue, $readModeHeaderValue) - { - $this->configuration['ha_mode']['query_mode_header_key'] = $headerKey; - $this->configuration['ha_mode']['write_mode_header_value'] = $writeModeHeaderValue; - $this->configuration['ha_mode']['read_mode_header_value'] = $readModeHeaderValue; - } - - /** - * Defines a fallback connection for a given connection. - * - * @param string $connectionAlias - * @param string $fallbackConnectionAlias - * - * @return $this - */ - public function setFallbackConnection($connectionAlias, $fallbackConnectionAlias) - { - $this->configuration['fallback'][$connectionAlias] = $fallbackConnectionAlias; - - return $this; - } - - /** - * Sets the default timeout for the http connection request. - * - * @param int $seconds - * - * @return $this - */ - public function setDefaultTimeout($seconds) - { - $this->configuration['default_timeout'] = (int) $seconds; - - return $this; - } - - /** - * Sets whether or not the response from the API should be formatted by the ResponseFormatter. - * - * @param bool $auto - * - * @return $this - */ - public function setAutoFormatResponse($auto = false) - { - $this->configuration['auto_format_response'] = $auto; - - return $this; - } - - /** - * Defines the class to use as Response Formatter, should implements \Neoxygen\NeoClient\Formatter\ResponseFormatterInterface. - * - * @param string $class - */ - public function setResponseFormatterClass($class) - { - if (null === $class) { - throw new \InvalidArgumentException('A string should be passed as response formatter class'); - } - - $this->configuration['response_formatter_class'] = $class; - - return $this; - } - - /** - * Enables the new formatting service from GraphAware. - */ - public function enableNewFormattingService() - { - $this->configuration['enable_new_response_format_mode'] = true; - - return $this; - } - - /** - * Adds an event listener to an event. - * - * @param string $event The Event to listen to - * @param string|\Closure $listener The listener, can be a Closure, a callback function or a class - * - * @return $this - */ - public function addEventListener($event, $listener) - { - $this->listeners[] = array($event, $listener); - - return $this; - } - - /** - * @return array - */ - public function getListeners() - { - return $this->listeners; - } - - /** - * Register a user defined logger. - * - * @param string $name Logger channel name - * @param LoggerInterface $logger User logger instance - */ - public function setLogger($name, LoggerInterface $logger) - { - if (!isset($this->loggers[$name])) { - $this->loggers[$name] = $logger; - } - - return $this; - } - - /** - * @return array[$name => LoggerInterface] The registered loggers - */ - public function getLoggers() - { - if (empty($this->loggers)) { - $this->createNullLogger(); - } - - return $this->loggers; - } - - /** - * Returns a registered Logger. - * - * @param string|null $name The name of the Logger - * - * @return LoggerInterface The logger bounded to the specified name - */ - public function getLogger($name = null) - { - if (null === $name && !isset($this->loggers['nullLogger'])) { - $this->createNullLogger(); - $name = 'nullLogger'; - } - - return $this->loggers[$name]; - } - - /** - * Logs a record to the registered loggers. - * - * @param string $level Record logging level - * @param string $message Log record message - * @param array $context Context of message - */ - public function log($level = 'debug', $message, array $context = array()) - { - foreach ($this->getLoggers() as $key => $logger) { - $logger->log($level, $message, $context); - } - } - - /** - * Creates an internal stream logger. - * - * @param string $name Logger channel name - * @param string $path Path to the log file - * @param int|string $level Logging level - * - * @return $this - */ - public function createDefaultStreamLogger($name, $path, $level = Logger::DEBUG) + public function __construct() { - $logger = new Logger($name); - $handler = new \Monolog\Handler\StreamHandler($path, $level); - $logger->pushHandler($handler); - $this->loggers[$name] = $logger; - - return $this; + $this->connectionManager = new ConnectionManager(); } - /** - * Creates an internal chrome php logger. - * - * @param string $name Logger channel name - * @param int|string $level Logging level - * - * @return $this - */ - public function createDefaultChromePHPLogger($name, $level = Logger::DEBUG) - { - $logger = new Logger($name); - $handler = new \Monolog\Handler\ChromePHPHandler($level); - $logger->pushHandler($handler); - $this->loggers[$name] = $logger; - - return $this; - } - - private function createNullLogger() - { - $logger = new NullLogger(); - $this->loggers['nullLogger'] = $logger; - } - - /** - * Register a user custom command. - * - * @param string $alias Command alias - * @param string $class The Command class name - * - * @return $this - */ - public function registerCommand($alias, $class) - { - $this->configuration['custom_commands'][] = array( - 'alias' => $alias, - 'class' => $class, - ); - - return $this; - } - - /** - * Register a user custom extension. - * - * @param string $alias The extension alias - * @param string $class The class name of the extension - * - * @return $this - */ - public function registerExtension($alias, $class) + public static function create() { - $this->configuration['extensions'][$alias] = array('class' => $class); - - return $this; + return new self(); } - /** - * Enables the cache option for the container dumping. - * - * @param string $cachePath The cache path - * - * @return $this - */ - public function enableCache($cachePath) + public function addConnection($alias, $uri) { - $this->configuration['cache']['enabled'] = true; - $this->configuration['cache']['cache_path'] = $cachePath; + $this->connectionManager->registerConnection(new Connection($alias, GraphDatabase::driver($uri))); return $this; } - /** - * @return bool True if the cache is enabled, false otherwise - */ - public function isCacheEnabled() - { - $cf = $this->getConfiguration(); - if ($cf['cache']['enabled'] === true) { - return true; - } - - return false; - } - - /** - * @return null|string The defined cache path, null if cache disabled - */ - public function getCachePath() - { - if (!$this->isCacheEnabled()) { - return; - } - - $path = $this->getConfiguration()['cache']['cache_path']; - if (!preg_match('#/$#', $path)) { - $path = $path.'/'; - } - - return $path; - } - - /** - * Builds the service definitions and processes the configuration. - * - * @return \Neoxygen\NeoClient\Client - */ public function build() { - if ($this->isCacheEnabled()) { - $file = $this->getCachePath().self::CACHE_FILENAME; - if (file_exists($file)) { - include_once $file; - $this->serviceContainer = new \ProjectServiceContainer(); - - return new Client($this->serviceContainer); - } - } - $extension = new NeoClientExtension(); - $this->serviceContainer->registerExtension($extension); - $this->serviceContainer->addCompilerPass(new AliasesCompilerPass()); - $this->serviceContainer->addCompilerPass(new ConnectionRegistryCompilerPass()); - $this->serviceContainer->addCompilerPass(new NeoClientExtensionsCompilerPass()); - $this->serviceContainer->addCompilerPass(new EventSubscribersCompilerPass()); - $this->serviceContainer->loadFromExtension($extension->getAlias(), $this->getConfiguration()); - $this->serviceContainer->compile(); - if ($this->serviceContainer->hasParameter('loggers')) { - foreach ($this->serviceContainer->getParameter('loggers') as $channel => $logger) { - switch ($logger['type']) { - case 'stream': - $this->createDefaultStreamLogger($channel, $logger['path'], $logger['level']); - } - } - } - - foreach ($this->listeners as $event => $callback) { - $this->serviceContainer->get('event_dispatcher')->addListener($event, $callback); - } - - foreach ($this->loggers as $alias => $logger) { - $this->serviceContainer->get('logger')->setLogger($alias, $logger); - } - - if ($this->isCacheEnabled()) { - $dumper = new PhpDumper($this->serviceContainer); - file_put_contents($file, $dumper->dump()); - } - - if (!$this->skipHaFailureFileCheck) { - $this->checkForHaConfig(); - } - - $client = $this->getClient(); - - return $client; - } - - /** - * @return ContainerBuilder - */ - public function getServiceContainer() - { - return $this->serviceContainer; - } - - /** - * @return bool Whether or not the DIC has been compiled - */ - public function isFrozen() - { - return true === $this->getServiceContainer()->isFrozen(); - } - - /** - * Erases the HAFailureFile. - * - * @return $this - */ - public function resetHaFailureFile() - { - $file = sys_get_temp_dir().DIRECTORY_SEPARATOR.'neoclient_ha_config_after_failure'; - if (file_exists($file)) { - unlink($file); - } - - return $this; - } - - /** - * Returns whether or not the check for the failure file should be done. - * - * @return $this - */ - public function skipHaFailureFileCheck() - { - $this->skipHaFailureFileCheck = true; - - return $this; - } - - private function checkConnection($alias) - { - if (!array_key_exists($alias, $this->configuration['connections'])) { - throw new Neo4jException(sprintf('The connection "%s" has not been registered', '%s')); - } - - return true; - } - - private function checkForHaConfig() - { - if ($this->serviceContainer->has('neoclient.ha_manager')) { - $file = sys_get_temp_dir().DIRECTORY_SEPARATOR.'neoclient_ha_config_after_failure'; - if (!file_exists($file)) { - return; - } - $content = file_get_contents($file); - $config = Yaml::parse($content); - $cm = $this->serviceContainer->get('neoclient.connection_manager'); - $all = $cm->getConnectionAliases(); - if (isset($config['new_master'])) { - $newConfig['master'] = $config['new_master']; - unset($all[$config['new_master']]); - } else { - $newConfig['master'] = $cm->getMasterConnectionAlias(); - unset($all[$cm->getMasterConnectionAlias()]); - } - if (isset($config['primary_slave'])) { - $newConfig['slaves'][] = $config['primary_slave']; - unset($all[$config['primary_slave']]); - } - foreach ($all as $slave) { - $newConfig['slaves'][] = $slave; - } - - $cm->setMasterConnection($newConfig['master']); - $cm->setSlaveConnections($newConfig['slaves']); - } - } - - /** - * @return \Neoxygen\NeoClient\Client - */ - private function getClient() - { - return $this->serviceContainer->get('neoclient.client'); + return new Client($this->connectionManager, new EventDispatcher()); } } diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php deleted file mode 100644 index 5e58d098..00000000 --- a/src/Command/AbstractCommand.php +++ /dev/null @@ -1,47 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command; - -use Neoxygen\NeoClient\HttpClient\HttpClientInterface; -use Neoxygen\NeoClient\Request\RequestBuilder; - -abstract class AbstractCommand implements CommandInterface -{ - protected $connection; - - protected $httpClient; - - protected $requestBuilder; - - public function __construct(HttpClientInterface $httpClient, RequestBuilder $requestBuilder) - { - $this->httpClient = $httpClient; - $this->requestBuilder = $requestBuilder; - } - - public function setConnection($connection) - { - $this->connection = $connection; - } - - public function getConnection() - { - return $this->connection; - } - - protected function process($method, $path, $body = null, $conn = null, $queryStrings = null, $queryMode = null, array $headers = array()) - { - $request = $this->requestBuilder->buildRequest($method, $path, $body, $queryStrings, $conn, $queryMode, $headers); - - return $this->httpClient->sendRequest($request); - } -} diff --git a/src/Command/CommandInterface.php b/src/Command/CommandInterface.php deleted file mode 100644 index e07f1e60..00000000 --- a/src/Command/CommandInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command; - -interface CommandInterface -{ - public function execute(); -} diff --git a/src/Command/CommandManager.php b/src/Command/CommandManager.php deleted file mode 100644 index 0101526d..00000000 --- a/src/Command/CommandManager.php +++ /dev/null @@ -1,74 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command; - -use Neoxygen\NeoClient\Exception\CommandException; - -class CommandManager -{ - /** - * @var array - */ - private $commands; - - /** - * - */ - public function __construct() - { - $this->commands = array(); - } - - /** - * @return array - */ - public function getCommands() - { - return $this->commands; - } - - /** - * @param string $commandAlias - * @param \Neoxygen\NeoClient\Command\AbstractCommand $command - */ - public function registerCommand($commandAlias, CommandInterface $command) - { - if (array_key_exists($commandAlias, $this->commands)) { - throw new CommandException(sprintf('The command "%s" is already registered', $commandAlias)); - } - $this->commands[$commandAlias] = $command; - } - - /** - * @param $commandAlias - * - * @return mixed - */ - public function getCommand($commandAlias) - { - if (!array_key_exists($commandAlias, $this->commands)) { - throw new CommandException(sprintf('The command "%s" is not registered', $commandAlias)); - } - - return $this->commands[$commandAlias]; - } - - /** - * @param $commandAlias - * - * @return bool - */ - public function hasCommand($commandAlias) - { - return array_key_exists($commandAlias, $this->commands); - } -} diff --git a/src/Command/Core/CoreChangePasswordCommand.php b/src/Command/Core/CoreChangePasswordCommand.php deleted file mode 100644 index 3b9ab747..00000000 --- a/src/Command/Core/CoreChangePasswordCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreChangePasswordCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/user/'; - - protected $user; - - protected $password; - - protected $newPassword; - - public function setArguments($user, $password) - { - $this->user = (string) $user; - $this->password = (string) $password; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), $this->getBody(), $this->connection); - } - - private function getPath() - { - return self::PATH.$this->user.'/password'; - } - - private function getBody() - { - $b = array( - 'password' => $this->password, - ); - - $body = json_encode($b); - - return $body; - } -} diff --git a/src/Command/Core/CoreCommitTransactionCommand.php b/src/Command/Core/CoreCommitTransactionCommand.php deleted file mode 100644 index 9d5ef62a..00000000 --- a/src/Command/Core/CoreCommitTransactionCommand.php +++ /dev/null @@ -1,76 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreCommitTransactionCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction/'; - - public $query; - - public $parameters; - - public $resultDataContents; - - public $transactionId; - - protected $queryMode; - - public function setArguments($transactionId, $query = null, array $parameters = array(), array $resultDataContents = array(), $queryMode = null) - { - $this->transactionId = (int) $transactionId; - $this->query = $query; - $this->parameters = $parameters; - $this->resultDataContents = $resultDataContents; - $this->queryMode = $queryMode; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), $this->prepareBody(), $this->connection, null, $this->queryMode); - } - - public function prepareBody() - { - if (null === $this->query) { - return; - } - $statement = array(); - $statement['statement'] = $this->query; - if (!empty($this->parameters)) { - $statement['parameters'] = $this->parameters; - } - $body = array( - 'statements' => array( - $statement, - ), - ); - - return json_encode($body); - } - - public function getPath() - { - return self::PATH.$this->getTransactionId().'/commit'; - } - - public function getTransactionId() - { - return $this->transactionId; - } -} diff --git a/src/Command/Core/CoreGetConstraintsCommand.php b/src/Command/Core/CoreGetConstraintsCommand.php deleted file mode 100644 index 832f202a..00000000 --- a/src/Command/Core/CoreGetConstraintsCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreGetConstraintsCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/data/schema/constraint'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } -} diff --git a/src/Command/Core/CoreGetHAAvailableCommand.php b/src/Command/Core/CoreGetHAAvailableCommand.php deleted file mode 100644 index e2869056..00000000 --- a/src/Command/Core/CoreGetHAAvailableCommand.php +++ /dev/null @@ -1,31 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; -use Neoxygen\NeoClient\Exception\HttpException; - -class CoreGetHAAvailableCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/manage/server/ha/available'; - - public function execute() - { - try { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } catch (HttpException $e) { - return false; - } - } -} diff --git a/src/Command/Core/CoreGetHAMasterCommand.php b/src/Command/Core/CoreGetHAMasterCommand.php deleted file mode 100644 index 39db534b..00000000 --- a/src/Command/Core/CoreGetHAMasterCommand.php +++ /dev/null @@ -1,31 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; -use Neoxygen\NeoClient\Exception\HttpException; - -class CoreGetHAMasterCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/manage/server/ha/master'; - - public function execute() - { - try { - return $this->process(self::METHOD, self::PATH, null, $this->connection, array(), 'HA_DETECTION'); - } catch (HttpException $e) { - return false; - } - } -} diff --git a/src/Command/Core/CoreGetHASlaveCommand.php b/src/Command/Core/CoreGetHASlaveCommand.php deleted file mode 100644 index cc186ee8..00000000 --- a/src/Command/Core/CoreGetHASlaveCommand.php +++ /dev/null @@ -1,31 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; -use Neoxygen\NeoClient\Exception\HttpException; - -class CoreGetHASlaveCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/manage/server/ha/slave'; - - public function execute() - { - try { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } catch (HttpException $e) { - return false; - } - } -} diff --git a/src/Command/Core/CoreGetLabelsCommand.php b/src/Command/Core/CoreGetLabelsCommand.php deleted file mode 100644 index 54a35d33..00000000 --- a/src/Command/Core/CoreGetLabelsCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreGetLabelsCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/data/labels'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection, ['in_use' => 0]); - } -} diff --git a/src/Command/Core/CoreGetVersionCommand.php b/src/Command/Core/CoreGetVersionCommand.php deleted file mode 100644 index 568db28c..00000000 --- a/src/Command/Core/CoreGetVersionCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreGetVersionCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/data'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } -} diff --git a/src/Command/Core/CoreListIndexCommand.php b/src/Command/Core/CoreListIndexCommand.php deleted file mode 100644 index a40c81b2..00000000 --- a/src/Command/Core/CoreListIndexCommand.php +++ /dev/null @@ -1,43 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; -use Neoxygen\NeoClient\Exception\CommandException; - -class CoreListIndexCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/db/data/schema/index/'; - - private $label; - - public function setArguments($label) - { - $this->label = $label; - } - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), null, $this->connection); - } - - private function getPath() - { - if (null === $this->label) { - throw new CommandException('A label must be given to find an index on'); - } - - return self::PATH.$this->label; - } -} diff --git a/src/Command/Core/CoreOpenTransactionCommand.php b/src/Command/Core/CoreOpenTransactionCommand.php deleted file mode 100644 index 679f0591..00000000 --- a/src/Command/Core/CoreOpenTransactionCommand.php +++ /dev/null @@ -1,33 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreOpenTransactionCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction'; - - protected $queryMode; - - public function setArguments($queryMode) - { - $this->queryMode = $queryMode; - } - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection, null, $this->queryMode); - } -} diff --git a/src/Command/Core/CorePingCommand.php b/src/Command/Core/CorePingCommand.php deleted file mode 100644 index 51917d03..00000000 --- a/src/Command/Core/CorePingCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CorePingCommand extends AbstractCommand -{ - const METHOD = 'HEAD'; - - const PATH = '/'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } -} diff --git a/src/Command/Core/CorePushMultipleToTransactionCommand.php b/src/Command/Core/CorePushMultipleToTransactionCommand.php deleted file mode 100644 index 2c2f8b57..00000000 --- a/src/Command/Core/CorePushMultipleToTransactionCommand.php +++ /dev/null @@ -1,68 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CorePushMultipleToTransactionCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction/'; - - public $statements; - - public $resultDataContents; - - public $transactionId; - - public function setArguments($transactionId, array $statements, array $resultDataContents = array()) - { - $this->transactionId = (int) $transactionId; - $this->statements = $statements; - $this->resultDataContents = $resultDataContents; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), $this->prepareBody(), $this->connection); - } - - public function prepareBody() - { - $body = []; - foreach ($this->statements as $statement) { - $st = []; - $k = isset($statement['query']) ? 'query' : 'statement'; - $st['statement'] = $statement[$k]; - if (isset($statement['params'])) { - $st['parameters'] = $statement['params']; - } - $st['resultDataContents'] = $this->resultDataContents; - $body['statements'][] = $st; - } - - return json_encode($body); - } - - public function getPath() - { - return self::PATH.$this->getTransactionId(); - } - - public function getTransactionId() - { - return $this->transactionId; - } -} diff --git a/src/Command/Core/CorePushToTransactionCommand.php b/src/Command/Core/CorePushToTransactionCommand.php deleted file mode 100644 index 446a204a..00000000 --- a/src/Command/Core/CorePushToTransactionCommand.php +++ /dev/null @@ -1,74 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CorePushToTransactionCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction/'; - - public $query; - - public $parameters; - - public $resultDataContents; - - public $transactionId; - - protected $queryMode; - - public function setArguments($transactionId, $query, array $parameters = array(), array $resultDataContents = array(), $queryMode) - { - $this->transactionId = (int) $transactionId; - $this->query = $query; - $this->parameters = $parameters; - $this->resultDataContents = $resultDataContents; - $this->queryMode = $queryMode; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), $this->prepareBody(), $this->connection, null, $this->queryMode); - } - - public function prepareBody() - { - $statement = array(); - $statement['statement'] = $this->query; - if (!empty($this->parameters)) { - $statement['parameters'] = $this->parameters; - } - $statement['resultDataContents'] = $this->resultDataContents; - $body = array( - 'statements' => array( - $statement, - ), - ); - - return json_encode($body); - } - - public function getPath() - { - return self::PATH.$this->getTransactionId(); - } - - public function getTransactionId() - { - return $this->transactionId; - } -} diff --git a/src/Command/Core/CoreRollBackTransactionCommand.php b/src/Command/Core/CoreRollBackTransactionCommand.php deleted file mode 100644 index b3358d67..00000000 --- a/src/Command/Core/CoreRollBackTransactionCommand.php +++ /dev/null @@ -1,45 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreRollBackTransactionCommand extends AbstractCommand -{ - const METHOD = 'DELETE'; - - const PATH = '/db/data/transaction/'; - - private $transactionId; - - public function execute() - { - return $this->process(self::METHOD, $this->getPath(), null, $this->connection); - } - - public function getPath() - { - return self::PATH.$this->getTransactionId(); - } - - public function getTransactionId() - { - return $this->transactionId; - } - - public function setTransactionId($id) - { - $this->transactionId = $id; - - return $this; - } -} diff --git a/src/Command/Core/CoreSendCypherQueryCommand.php b/src/Command/Core/CoreSendCypherQueryCommand.php deleted file mode 100644 index 03845d56..00000000 --- a/src/Command/Core/CoreSendCypherQueryCommand.php +++ /dev/null @@ -1,63 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreSendCypherQueryCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction/commit'; - - public $query; - - public $parameters; - - public $resultDataContents; - - public $queryMode; - - public function setArguments($query, array $parameters = array(), array $resultDataContents = array(), $queryMode = null) - { - $this->query = $query; - $this->parameters = $parameters; - $this->resultDataContents = $resultDataContents; - $this->queryMode = $queryMode; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, self::PATH, $this->prepareBody(), $this->connection, null, $this->queryMode); - } - - public function prepareBody() - { - $statement = array(); - $statement['statement'] = $this->query; - if (!empty($this->parameters)) { - $statement['parameters'] = $this->parameters; - } - if (!empty($this->resultDataContents)) { - $statement['resultDataContents'] = $this->resultDataContents; - } - $body = array( - 'statements' => array( - $statement, - ), - ); - - return json_encode($body); - } -} diff --git a/src/Command/Core/CoreSendMultipleCypherCommand.php b/src/Command/Core/CoreSendMultipleCypherCommand.php deleted file mode 100644 index a20ec7f1..00000000 --- a/src/Command/Core/CoreSendMultipleCypherCommand.php +++ /dev/null @@ -1,59 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command\Core; - -use Neoxygen\NeoClient\Command\AbstractCommand; - -class CoreSendMultipleCypherCommand extends AbstractCommand -{ - const METHOD = 'POST'; - - const PATH = '/db/data/transaction/commit'; - - public $statements; - - public $resultDataContents; - - public $queryMode; - - public function setArguments(array $statements, array $resultDataContents = array(), $queryMode = null) - { - $this->statements = $statements; - $this->resultDataContents = $resultDataContents; - $this->queryMode = $queryMode; - - return $this; - } - - public function execute() - { - return $this->process(self::METHOD, self::PATH, $this->prepareBody(), $this->connection, null, $this->queryMode); - } - - public function prepareBody() - { - $sts = []; - foreach ($this->statements as $statement) { - $statement['resultDataContents'] = $this->resultDataContents; - if (empty($statement['parameters'])) { - unset($statement['parameters']); - } - $sts[] = $statement; - } - - $body = array( - 'statements' => $sts, - ); - - return json_encode($body); - } -} diff --git a/src/Command/SimpleCommand.php b/src/Command/SimpleCommand.php deleted file mode 100644 index fcf513e0..00000000 --- a/src/Command/SimpleCommand.php +++ /dev/null @@ -1,24 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Command; - -class SimpleCommand extends AbstractCommand -{ - const METHOD = 'GET'; - - const PATH = '/'; - - public function execute() - { - return $this->process(self::METHOD, self::PATH, null, $this->connection); - } -} diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index bcdb81e7..859d7a85 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Connection; +namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Common\Driver\DriverInterface; @@ -27,6 +27,7 @@ class Connection /** * Connection constructor. + * * @param $alias * @param \GraphAware\Common\Driver\DriverInterface $driver */ diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 26517222..67b91ee3 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -1,15 +1,15 @@ " NeoClient package. + * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient\Connection; +namespace GraphAware\Neo4j\Client\Connection; use Neoxygen\NeoClient\Exception\InvalidConnectionException; use Neoxygen\NeoClient\Exception\HttpException; @@ -59,7 +59,7 @@ public function registerConnection(Connection $connection) /** * @param string|null $alias The connection's alias * - * @return \Neoxygen\NeoClient\Connection\Connection The requested connection + * @return \GraphAware\Neo4j\Connection\Connection The requested connection * * @throws InvalidConnectionException When the connection does not exist */ @@ -84,7 +84,7 @@ public function getConnection($alias = null) } /** - * @return \Neoxygen\NeoClient\Connection\Connection The default Connection if defined, the first connection in the connections array otherwise + * @return \GraphAware\Neo4j\Connection\Connection The default Connection if defined, the first connection in the connections array otherwise * * @throws \Neoxygen\NeoClient\Exception\InvalidConnectionException If no connections are configured */ diff --git a/src/DependencyInjection/Compiler/AliasesCompilerPass.php b/src/DependencyInjection/Compiler/AliasesCompilerPass.php deleted file mode 100644 index 4c2ff629..00000000 --- a/src/DependencyInjection/Compiler/AliasesCompilerPass.php +++ /dev/null @@ -1,24 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AliasesCompilerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $container->setAlias('event_dispatcher', 'neoclient.event_dispatcher'); - $container->setAlias('logger', 'neoclient.logger'); - } -} diff --git a/src/DependencyInjection/Compiler/ConnectionRegistryCompilerPass.php b/src/DependencyInjection/Compiler/ConnectionRegistryCompilerPass.php deleted file mode 100644 index 783a2085..00000000 --- a/src/DependencyInjection/Compiler/ConnectionRegistryCompilerPass.php +++ /dev/null @@ -1,70 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class ConnectionRegistryCompilerPass implements CompilerPassInterface -{ - private $master; - - private $slaves = []; - - public function process(ContainerBuilder $container) - { - $connections = $container->findTaggedServiceIds('neoclient.registered_connection'); - $connectionManager = $container->findDefinition('neoclient.connection_manager'); - $fallbacks = $container->findTaggedServiceIds('neoclient.fallback_connection'); - - foreach ($connections as $id => $params) { - $def = $container->getDefinition($id); - if ($def->hasTag('neoclient.ha_master')) { - if (null !== $this->master) { - throw new \RuntimeException('Having two connections registered as master is not permitted'); - } - $this->master = $def->getArgument(0); - } - if ($def->hasTag('neoclient.ha_slave')) { - $this->slaves[] = $def->getArgument(0); - } - $connectionManager - ->addMethodCall( - 'registerConnection', - array($container->getDefinition($id)) - ); - } - - foreach ($fallbacks as $id => $params) { - $connectionManager - ->addMethodCall( - 'setFallbackConnection', - array($params[0]['fallback_of'], $params[0]['connection_alias']) - ); - } - if (null !== $this->master) { - $connectionManager - ->addMethodCall( - 'setMasterConnection', - array($this->master) - ); - } - - if (!empty($this->slaves)) { - $connectionManager - ->addMethodCall( - 'setSlaveConnections', - array($this->slaves) - ); - } - } -} diff --git a/src/DependencyInjection/Compiler/EventSubscribersCompilerPass.php b/src/DependencyInjection/Compiler/EventSubscribersCompilerPass.php deleted file mode 100644 index fb4e4b60..00000000 --- a/src/DependencyInjection/Compiler/EventSubscribersCompilerPass.php +++ /dev/null @@ -1,32 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class EventSubscribersCompilerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $subscribers = $container->findTaggedServiceIds('neoclient.service_event_subscriber'); - $ev = $container->getDefinition('neoclient.event_dispatcher'); - foreach ($subscribers as $id => $params) { - $definition = $container->getDefinition($id); - $class = $definition->getClass(); - $ev->addMethodCall( - 'addSubscriberService', - array($id, $class) - ); - } - } -} diff --git a/src/DependencyInjection/Compiler/NeoClientExtensionsCompilerPass.php b/src/DependencyInjection/Compiler/NeoClientExtensionsCompilerPass.php deleted file mode 100644 index 1a08ba3e..00000000 --- a/src/DependencyInjection/Compiler/NeoClientExtensionsCompilerPass.php +++ /dev/null @@ -1,69 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class NeoClientExtensionsCompilerPass implements CompilerPassInterface -{ - private $registeredCommands = array(); - - public function process(ContainerBuilder $container) - { - $extensions = $container->findTaggedServiceIds('neoclient.extension_class'); - $commandManager = $container->getDefinition('neoclient.command_manager'); - $httpClient = $container->getDefinition('neoclient.http_client'); - $requestBuilder = $container->getDefinition('neoclient.request_builder'); - $extManager = $container->getDefinition('neoclient.extension_manager'); - - foreach ($extensions as $id => $params) { - $definition = $container->getDefinition($id); - $class = $definition->getClass(); - $commands = $class::getAvailableCommands(); - $extManager->addMethodCall( - 'addExtension', - array($class) - ); - - foreach ($commands as $alias => $props) { - if (array_key_exists($alias, $this->registeredCommands)) { - throw new \InvalidArgumentException(sprintf('The command with alias "%s" already exist', $alias)); - } - - $def = new Definition(); - $def->setClass($props['class']); - $def->addArgument($httpClient); - $def->addArgument($requestBuilder); - $container->setDefinition(sprintf('neoclient.command.%s', $alias), $def); - $commandManager->addMethodCall( - 'registerCommand', - array($alias, $def) - ); - $this->registeredCommands[$alias] = true; - } - } - - $customCommands = $container->findTaggedServiceIds('neoclient.custom_command'); - - foreach ($customCommands as $id => $params) { - $def = $container->getDefinition($id); - $def->addArgument($httpClient); - $class = $def->getClass(); - $commandManager->addMethodCall( - 'registerCommand', - array($params[0][0], $def) - ); - } - } -} diff --git a/src/DependencyInjection/Definition.php b/src/DependencyInjection/Definition.php deleted file mode 100644 index 5a74ba3f..00000000 --- a/src/DependencyInjection/Definition.php +++ /dev/null @@ -1,106 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection; - -use Symfony\Component\Config\Definition\ConfigurationInterface; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; - -class Definition implements ConfigurationInterface -{ - protected $allowedModes = array('rest', 'graph', 'row'); - - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('neoclient'); - - $supportedSchemes = array('http', 'https'); - - $rootNode->children() - ->arrayNode('connections') - ->requiresAtLeastOneElement() - ->prototype('array') - ->children() - ->scalarNode('scheme')->defaultValue('http') - ->validate() - ->ifNotInArray($supportedSchemes) - ->thenInvalid('The scheme %s is not valid, please choose one of '.json_encode($supportedSchemes)) - ->end() - ->end() - ->scalarNode('host')->defaultValue('localhost')->end() - ->integerNode('port')->defaultValue('7474')->end() - ->booleanNode('auth')->defaultValue(false)->end() - ->scalarNode('user')->end() - ->scalarNode('password')->end() - ->end() - ->validate() - ->ifTrue(function ($v) {true === $v['auth'] && empty($v['user']) || empty($v['password']);}) - ->thenInvalid('You must specify a user and a password when using the auth mode') - ->end() - ->end() - ->end() - ->integerNode('default_timeout')->defaultValue(5)->end() - ->arrayNode('extensions') - ->prototype('array') - ->children() - ->scalarNode('class')->canNotBeEmpty()->end() - ->end() - ->end() - ->end() - ->arrayNode('loggers') - ->prototype('array') - ->children() - ->scalarNode('channel')->canNotBeEmpty()->end() - ->scalarNode('type')->canNotBeEmpty()->end() - ->scalarNode('path')->end() - ->scalarNode('level')->canNotBeEmpty()->end() - ->end() - ->end() - ->end() - ->arrayNode('custom_commands') - ->prototype('array') - ->children() - ->scalarNode('alias')->end() - ->scalarNode('class')->end() - ->end() - ->end() - ->end() - ->arrayNode('ha_mode') - ->children() - ->booleanNode('enabled')->CanNotBeEmpty()->end() - ->scalarNode('query_mode_header_key')->defaultValue('Neo4j-Query-Mode')->end() - ->scalarNode('write_mode_header_value')->defaultValue('NEO4J_QUERY_WRITE')->end() - ->scalarNode('read_mode_header_value')->defaultValue('NEO4J_QUERY_READ')->end() - ->scalarNode('type')->canNotBeEmpty()->end() - ->scalarNode('master')->end() - ->arrayNode('slaves') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->arrayNode('cache') - ->canBeUnset() - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('enabled')->defaultValue(false)->end() - ->scalarNode('cache_path')->end() - ->end() - ->end() - ->scalarNode('response_formatter_class')->defaultValue('Neoxygen\NeoClient\Formatter\ResponseFormatter')->end() - ->booleanNode('auto_format_response')->defaultValue(false)->end() - ->booleanNode('enable_new_response_format_mode')->defaultValue(false)->end() - ->end() - ->end(); - - return $treeBuilder; - } -} diff --git a/src/DependencyInjection/NeoClientExtension.php b/src/DependencyInjection/NeoClientExtension.php deleted file mode 100644 index 0ebe2e43..00000000 --- a/src/DependencyInjection/NeoClientExtension.php +++ /dev/null @@ -1,186 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\Config\FileLocator; -use Neoxygen\NeoClient\DependencyInjection\Definition as ConfigDefinition; - -class NeoClientExtension implements ExtensionInterface -{ - protected $container; - - public function load(array $configs, ContainerBuilder $container) - { - $this->container = $container; - $processor = new Processor(); - $configuration = new ConfigDefinition(); - - $config = $processor->processConfiguration($configuration, $configs); - - $loader = new YamlFileLoader( - $container, - new FileLocator(__DIR__.'/../Resources/config') - ); - - $loader->load('services.yml'); - - if ($config['cache']['enabled'] === true) { - $container->setParameter('neoclient.cache_path', $config['cache']['cache_path']); - } - - $this->addConnectionDefinitions($config, $container); - $this->addRegisteredExtensionsDefinitions($config, $container); - $this->addListeners($config); - $this->registerCustomCommands($config); - $container->setParameter('loggers', $config['loggers']); - $container->setParameter('default_timeout', $config['default_timeout']); - - $formatterClass = $config['response_formatter_class']; - $container->setParameter('response_formatter_class', $formatterClass); - $resultDataContent = $formatterClass::getDefaultResultDataContents(); - $container->setParameter('neoclient.response_format', $resultDataContent); - $container->setParameter('neoclient.auto_format_response', $config['auto_format_response']); - $container->setParameter('neoclient.result_data_content', $resultDataContent); - $container->setParameter('neoclient.new_format_mode_enabled', $config['enable_new_response_format_mode']); - - if (isset($config['ha_mode'])) { - $connectionManager = $container->getDefinition('neoclient.connection_manager'); - $commandManager = $container->getDefinition('neoclient.command_manager'); - $httpClient = $container->getDefinition('neoclient.http_client'); - $type = $config['ha_mode']['type']; - switch ($type) { - case 'enterprise': - $definition = new Definition(); - $definition - ->setClass('Neoxygen\NeoClient\HighAvailibility\HAEnterpriseManager') - ->addArgument($connectionManager) - ->addArgument($commandManager) - ->addArgument($httpClient) - ->addArgument($config['ha_mode']['query_mode_header_key']) - ->addArgument($config['ha_mode']['write_mode_header_value']) - ->addArgument($config['ha_mode']['read_mode_header_value']) - ->addTag('neoclient.service_event_subscriber'); - $container->setDefinition('neoclient.ha_manager', $definition); - break; - case 'community': - $definition = new Definition(); - $definition - ->setClass('Neoxygen\NeoClient\HighAvailibility\HACommunityManager') - ->addArgument($connectionManager) - ->addArgument($httpClient) - ->addTag('neoclient.service_event_subscriber'); - $container->setDefinition('neoclient.ha_manager', $definition); - break; - } - } - } - - private function addConnectionDefinitions($config, $container) - { - foreach ($config['connections'] as $connectionAlias => $settings) { - if ($container->hasDefinition(sprintf('neoclient.connection.%s', $connectionAlias))) { - throw new \InvalidArgumentException(sprintf('The connection %s can only be declared once, check your config file', $connectionAlias)); - } - - $definition = new Definition(); - $definition - ->setClass('Neoxygen\NeoClient\Connection\Connection') - ->addArgument($connectionAlias) - ->addArgument($settings['scheme']) - ->addArgument($settings['host']) - ->addArgument($settings['port']) - ->addTag('neoclient.registered_connection') - ->setLazy(true); - if (isset($settings['auth']) && true === $settings['auth']) { - $definition->addArgument(true) - ->addArgument($settings['user']) - ->addArgument($settings['password']); - } - if ($fallbackOf = $this->isFallbackConnection($config, $connectionAlias)) { - $definition->addTag('neoclient.fallback_connection', array('fallback_of' => $fallbackOf, 'connection_alias' => $connectionAlias)); - } - if (isset($config['ha_mode']['master']) && $config['ha_mode']['master'] == $connectionAlias) { - $definition->addTag('neoclient.ha_master'); - } - if (isset($config['ha_mode']['slaves']) && in_array($connectionAlias, $config['ha_mode']['slaves'])) { - $definition->addTag('neoclient.ha_slave'); - } - $container->setDefinition(sprintf('neoclient.connection.%s', $connectionAlias), $definition); - } - } - - private function addRegisteredExtensionsDefinitions($config, $container) - { - foreach ($config['extensions'] as $alias => $props) { - $this->registerCoreExtension($alias, $props); - } - - // Registering Core Commands - $this->registerCoreExtension('neoclient_core', array('class' => 'Neoxygen\NeoClient\Extension\NeoClientCoreExtension')); - //$this->registerCoreExtension('neoclient_auth', array('class' => 'Neoxygen\NeoClient\Extension\NeoClientAuthExtension')); - } - - private function registerCoreExtension($alias, $props) - { - $definition = new Definition(); - $definition->setClass($props['class']) - ->addTag('neoclient.extension_class'); - $this->container->setDefinition(sprintf('neoclient.extension_%s', $alias), $definition); - } - - private function registerCustomCommands(array $config) - { - foreach ($config['custom_commands'] as $command) { - $definition = new Definition(); - $definition->setClass($command['class']); - $definition->addTag('neoclient.custom_command', array($command['alias'])); - $this->container->setDefinition(sprintf('neoclient.custom_command.%s', $command['alias']), $definition); - } - } - - private function isFallbackConnection(array $config, $alias) - { - if (isset($config['fallback'])) { - foreach ($config['fallback'] as $con => $fallback) { - if ($alias === $fallback) { - return $con; - } - } - } - - return false; - } - - private function addListeners(array $config) - { - } - - public function getAlias() - { - return 'neoclient'; - } - - public function getXsdValidationBasePath() - { - return false; - } - - public function getNamespace() - { - return false; - } -} diff --git a/src/EventListener/HttpRequestEventSubscriber.php b/src/EventListener/HttpRequestEventSubscriber.php deleted file mode 100644 index 00e334b9..00000000 --- a/src/EventListener/HttpRequestEventSubscriber.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'onPreHttpRequestSend', 10, - ), - NeoClientEvents::NEO_POST_REQUEST_SEND => array( - 'onPostRequestSend', - ), - NeoClientEvents::NEO_HTTP_EXCEPTION => array( - 'onHttpException', 10, - ), - ); - } - - /** - * @param \Psr\Log\LoggerInterface $logger - */ - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * @param \Neoxygen\NeoClient\Event\HttpClientPreSendRequestEvent $event - */ - public function onPreHttpRequestSend(HttpClientPreSendRequestEvent $event) - { - $conn = $event->getRequest()->getConnection(); - $request = $event->getRequest(); - $mode = $request->hasQueryMode() ? $request->getQueryMode() : 'ASSUMED WRITE'; - $this->logger->log('debug', sprintf('Sending "%s" request to the "%s" connection', $mode, $conn)); - } - - /** - * @param \Neoxygen\NeoClient\Event\PostRequestSendEvent $event - */ - public function onPostRequestSend(PostRequestSendEvent $event) - { - } - - /** - * @param \Neoxygen\NeoClient\Event\HttpExceptionEvent $event - */ - public function onHttpException(HttpExceptionEvent $event) - { - $request = $event->getRequest(); - $exception = $event->getException(); - $message = $exception->getMessage(); - Client::log('emergency', sprintf('Error on connection "%s" - %s', $request->getConnection(), $message)); - throw new HttpException(sprintf('Error on Connection "%s" with message "%s"', $request->getConnection(), $message)); - } -} diff --git a/src/EventListener/LoggingEventSubscriber.php b/src/EventListener/LoggingEventSubscriber.php deleted file mode 100644 index 82a61f92..00000000 --- a/src/EventListener/LoggingEventSubscriber.php +++ /dev/null @@ -1,38 +0,0 @@ - array( - 'writeLogMessage', - ), - ); - } - - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - public function writeLogMessage(LoggingEvent $event) - { - $level = strtoupper($event->getLevel()); - $message = (string) $event->getMessage(); - $context = $event->getContext(); - if (!is_array($context)) { - $context = array(); - } - $this->logger->log($level, $message, $context); - } -} diff --git a/src/Exception/Neo4jException.php b/src/Exception/Neo4jException.php index 91bedb2d..9c7e1a31 100644 --- a/src/Exception/Neo4jException.php +++ b/src/Exception/Neo4jException.php @@ -11,7 +11,7 @@ namespace GraphAware\Neo4j\Client\Exception; -abstract class Neo4jException extends \Exception implements NeoClientExceptionInterface +abstract class Neo4jException extends \Exception implements Neo4jExceptionInterface { /** * @return string @@ -22,13 +22,13 @@ public function effect() switch ($classification) { case 'ClientError': - return NeoClientExceptionInterface::EFFECT_ROLLBACK; + return Neo4jExceptionInterface::EFFECT_ROLLBACK; case 'ClientNotification': - return NeoClientExceptionInterface::EFFECT_NONE; + return Neo4jExceptionInterface::EFFECT_NONE; case 'DatabaseError': - return NeoClientExceptionInterface::EFFECT_ROLLBACK; + return Neo4jExceptionInterface::EFFECT_ROLLBACK; case 'TransientError': - return NeoClientExceptionInterface::EFFECT_ROLLBACK; + return Neo4jExceptionInterface::EFFECT_ROLLBACK; default: throw new \InvalidArgumentException(sprintf('Invalid classification "%s" in "%s"', $classification, $this->getMessage())); } diff --git a/src/Exception/Neo4jExceptionInterface.php b/src/Exception/Neo4jExceptionInterface.php new file mode 100644 index 00000000..7f6434e1 --- /dev/null +++ b/src/Exception/Neo4jExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Exception; + +interface Neo4jExceptionInterface extends NeoClientExceptionInterface +{ + const EFFECT_NONE = 'NONE'; + + const EFFECT_ROLLBACK = 'ROLLBACK'; + + public function effect(); +} \ No newline at end of file diff --git a/src/Exception/NeoClientExceptionInterface.php b/src/Exception/NeoClientExceptionInterface.php index 99fef7df..04a70c48 100644 --- a/src/Exception/NeoClientExceptionInterface.php +++ b/src/Exception/NeoClientExceptionInterface.php @@ -11,11 +11,4 @@ namespace GraphAware\Neo4j\Client\Exception; -interface NeoClientExceptionInterface -{ - const EFFECT_NONE = 'NONE'; - - const EFFECT_ROLLBACK = 'ROLLBACK'; - - public function effect(); -} \ No newline at end of file +interface NeoClientExceptionInterface {} \ No newline at end of file diff --git a/src/Extension/AbstractExtension.php b/src/Extension/AbstractExtension.php deleted file mode 100644 index 054ac1ca..00000000 --- a/src/Extension/AbstractExtension.php +++ /dev/null @@ -1,136 +0,0 @@ -commandManager = $commandManager; - $this->connectionManager = $connectionManager; - $this->responseFormatter = $responseFormatter->getResponseFormatter(); - $this->autoFormatResponse = $autoFormatResponse; - $this->resultDataContent = $resultDataContent; - $this->newFormatModeEnabled = $newFormatModeEnabled; - if ($this->newFormatModeEnabled) { - $this->newFormattingService = new ResponseFormattingService(); - } - } - - /** - * @param string $commandAlias - * @param null|string $connectionAlias - * - * @return \Neoxygen\NeoClient\Command\AbstractCommand - */ - public function invoke($commandAlias, $connectionAlias = null) - { - $command = $this->commandManager->getCommand($commandAlias); - $command->setConnection($connectionAlias); - - return $command; - } - - /** - * @param mixed $response - * - * @return \Neoxygen\NeoClient\Formatter\Response - */ - public function formatResponse($response) - { - $formatted = $this->responseFormatter->format($response); - - return $formatted; - } - - /** - * @param Response $response - * - * @return string|array|\Neoxygen\NeoClient\Formatter\Response - * - * @throws Neo4jException - */ - public function handleHttpResponse(Response $response) - { - if ($this->newFormatModeEnabled) { - $newResponse = $this->newFormattingService->formatResponse($response->getRaw()); - - if ($newResponse->hasError()) { - $error = $newResponse->getError(); - throw new Neo4jException(sprintf( - $error->getCode(), - $error->getMessage(), - Neo4jException::fromCode($error->getCode()) - )); - } - - return $newResponse; - } - - $this->checkResponseErrors($response->getBody()); - if ($this->autoFormatResponse) { - $formatted = $this->formatResponse($response->getBody()); - - return $formatted; - } - - return $response; - } - - public function checkResponseErrors($response) - { - if (isset($response['errors']) && !empty($response['errors'])) { - throw new Neo4jException( - sprintf( - 'Neo4j Exception with code "%s" and message "%s"', - $response['errors'][0]['code'], - $response['errors'][0]['message']), - Neo4jException::fromCode($response['errors'][0]['code']) - ); - } - } - - protected function getWriteConnection() - { - return $this->connectionManager->getWriteConnection(); - } - - protected function getReadConnection() - { - return $this->connectionManager->getReadConnection(); - } -} diff --git a/src/Extension/ExtensionManager.php b/src/Extension/ExtensionManager.php deleted file mode 100644 index 74bf490c..00000000 --- a/src/Extension/ExtensionManager.php +++ /dev/null @@ -1,75 +0,0 @@ -commandManager = $commandManager; - $this->connectionManager = $connectionManager; - $this->responseFormatter = $responseFormatter; - $this->autoFormatResponse = $autoFormatResponse; - $this->resultDataContent = $resultDataContent; - $this->newFormatModeEnabled = $newFormatModeEnabled; - } - - public function addExtension($extension) - { - array_unshift( - $this->extensions, - new $extension( - $this->commandManager, - $this->connectionManager, - $this->responseFormatter, - $this->autoFormatResponse, - $this->resultDataContent, - $this->newFormatModeEnabled) - ); - } - - public function execute($method, $attributes = array()) - { - return call_user_func_array($this->getExecution($method), $attributes); - } - - public function getExecution($method) - { - if (isset($this->execs[$method], $this->execs)) { - return $this->execs[$method]; - } - foreach ($this->extensions as $extension) { - if (method_exists($extension, $method)) { - $this->execs[$method] = array($extension, $method); - - return $this->execs[$method]; - } - } - throw new \InvalidArgumentException(sprintf('The method "%s" does not exist', $method)); - } - - public function getRegisteredExtensions() - { - return $this->extensions; - } -} diff --git a/src/Extension/NeoClientAuthExtension.php b/src/Extension/NeoClientAuthExtension.php deleted file mode 100644 index 1c15ca2f..00000000 --- a/src/Extension/NeoClientAuthExtension.php +++ /dev/null @@ -1,22 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Extension; - -use Symfony\Component\Yaml\Yaml; - -class NeoClientAuthExtension implements NeoClientExtensionInterface -{ - public static function getAvailableCommands() - { - return Yaml::parse(file_get_contents(__DIR__.'/../Resources/extensions/auth_commands.yml')); - } -} diff --git a/src/Extension/NeoClientCoreExtension.php b/src/Extension/NeoClientCoreExtension.php deleted file mode 100644 index 6ab4393c..00000000 --- a/src/Extension/NeoClientCoreExtension.php +++ /dev/null @@ -1,851 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Extension; - -use Neoxygen\NeoClient\Exception\Neo4jException; -use Neoxygen\NeoClient\Exception\CypherException; -use Neoxygen\NeoClient\Schema\Index; -use Neoxygen\NeoClient\Schema\UniqueConstraint; -use Neoxygen\NeoClient\Transaction\PreparedTransaction; -use Symfony\Component\Yaml\Yaml; -use Neoxygen\NeoClient\Transaction\Transaction; -use Neoxygen\NeoClient\Request\Response; -use Neoxygen\NeoClient\Client; -use GuzzleHttp\Psr7\Response as PsrResponse; - -class NeoClientCoreExtension extends AbstractExtension -{ - public static function getAvailableCommands() - { - return Yaml::parse(file_get_contents(__DIR__.'/../Resources/extensions/core_commands.yml')); - } - - /** - * Convenience method that returns the root of the Neo4j Api. - * - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function getRoot($conn = null) - { - $command = $this->invoke('simple_command', $conn); - $httpResponse = $command->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - /** - * Convenience method that invoke the GetVersionCommand. - * - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function getNeo4jVersion($conn = null) - { - $command = $this->invoke('neo.get_neo4j_version', $conn); - $httpResponse = $command->execute(); - - $response = $this->handleHttpResponse($httpResponse); - - return $response->getBody()['neo4j_version']; - } - - /** - * Convenience method for pinging the Connection. - * - * @param string|null $conn The alias of the connection to use - */ - public function ping($conn = null) - { - $command = $this->invoke('neo.ping_command', $conn); - $httpResponse = $command->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - /** - * Convenience method that invoke the sendCypherQueryCommand - * and passes given query and parameters arguments. - * - * @param string $query The query to send - * @param array $parameters Map of query parameters - * @param string|null $conn The alias of the connection to use - * @param string|null $queryMode The mode of the query, could be WRITE or READ - * - * @return mixed - */ - public function sendCypherQuery($query, array $parameters = array(), $conn = null, $queryMode = null) - { - $command = $this->invoke('neo.send_cypher_query', $conn); - if (!is_string($query)) { - throw new CypherException('You need to send a Cypher query as a string. Usage: "$neoclient->sendCypherQuery(string $query, array $params);"'); - } - - $httpResponse = $command->setArguments($query, $parameters, $this->resultDataContent, $queryMode) - ->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - /** - * @param array $statements - * @param null $conn - * - * @return \Neoxygen\NeoClient\Formatter\Response - */ - public function sendMultiple(array $statements, $conn = null, $queryMode = null) - { - $command = $this->invoke('neo.send_cypher_multiple', $conn); - $command->setArguments($statements, $this->resultDataContent, $queryMode); - $httpResponse = $command->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - /** - * @param null|string $conn Connection alias - * - * @return PreparedTransaction - */ - public function prepareTransaction($conn = null) - { - return new PreparedTransaction($conn); - } - - /** - * Convenience method that invoke the GetLabelsCommand. - * - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function getLabels($conn = null) - { - $command = $this->invoke('neo.get_labels_command', $conn); - $httpResponse = $command->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - public function renameLabel($oldLabel, $newLabel, $conn = null) - { - $q = 'MATCH (old:'.$oldLabel.') - REMOVE old:'.$oldLabel.' - SET old :'.$newLabel.';'; - - return $this->sendCypherQuery($q); - } - - /** - * Creates a Schema Index based on label and property. - * - * @param string $label - * @param string $property - * - * @return \Neoxygen\NeoClient\Schema\Index - */ - public function createSchemaIndex($label, $property, $conn = null) - { - $statement = 'CREATE INDEX ON :'.$label.'('.$property.')'; - $this->sendCypherQuery($statement, array(), $conn = null, self::WRITE_QUERY); - - return new Index($label, $property); - } - - /** - * Removes a Schema Index. - * - * @param \Neoxygen\NeoClient\Schema\Index $index - * @param string|null $conn - */ - public function dropSchemaIndex(Index $index, $conn = null) - { - $statement = 'DROP INDEX ON :'.$index->getLabel().'('.$index->getProperty().')'; - $this->sendCypherQuery($statement, array(), $conn, self::WRITE_QUERY); - } - - /** - * Creates an index on a label. - * - * @param string $label - * @param string|array $property - * - * @return bool - * - * @deprecated will be removed in 4.0 - */ - public function createIndex($label, $property) - { - $statements = []; - if (is_array($property)) { - foreach ($property as $prop) { - $statements[] = 'CREATE INDEX ON :'.$label.'('.$prop.')'; - } - } else { - $statements[] = 'CREATE INDEX ON :'.$label.'('.$property.')'; - } - foreach ($statements as $statement) { - $this->sendCypherQuery($statement); - } - - return true; - } - - /** - * Returns the list of indexed properties for a given Label. - * - * @param string $label - * @param string|null $conn - * - * @return array - */ - public function listIndex($label, $conn = null) - { - $command = $this->invoke('neo.list_index_command', $conn); - $command->setArguments($label); - $httpResponse = $command->execute(); - - $response = $this->handleHttpResponse($httpResponse); - $propertiesIndexed = []; - foreach ($response->getBody() as $index) { - foreach ($index['property_keys'] as $key) { - $propertiesIndexed[] = $key; - } - } - if ($response instanceof \GraphAware\NeoClient\Formatter\Response) { - return new \GraphAware\NeoClient\Formatter\Response(new PsrResponse(200, array(), json_encode($propertiesIndexed))); - } - $response->setBody($propertiesIndexed); - - return $response; - } - - /** - * Drops an index on a label. - * - * @param string $label - * @param string $property - * - * @return bool - */ - public function dropIndex($label, $property) - { - $statements = []; - if (is_array($property)) { - foreach ($property as $prop) { - $statements[] = 'DROP INDEX ON :'.$label.'('.$prop.')'; - } - } else { - $statements[] = 'DROP INDEX ON :'.$label.'('.$property.')'; - } - foreach ($statements as $statement) { - $this->sendCypherQuery($statement); - } - - return true; - } - - /** - * @param array $labels - * @param string|null $conn - * - * @return Response - * @deprecetad Will be removed in 4.0 - */ - public function listIndexes(array $labels = array(), $conn = null) - { - if (empty($labels)) { - $labels = $this->getLabels($conn)->getBody(); - } - $indexes = []; - foreach ($labels as $label) { - $res = $this->listIndex($label, $conn); - $indexs = $res->getBody(); - $indexes[$label] = $indexs; - } - - if (!isset($res)){ - if ($this->newFormatModeEnabled) { - $res = new \GraphAware\NeoClient\Formatter\Response(new PsrResponse(200)); - } else { - $res = new Response(new PsrResponse(200)); - } - } - - if ($res instanceof \GraphAware\NeoClient\Formatter\Response) { - return new \GraphAware\NeoClient\Formatter\Response(new PsrResponse(200, [], json_encode($indexes))); - } - - $response = new Response($res->getRaw()); - $response->setBody($indexes); - - return $response; - } - - /** - * Returns the schema indexes live in the database. - * - * @param null $conn - * - * @return \Neoxygen\NeoClient\Schema\Index[] - */ - public function getSchemaIndexes($conn = null) - { - $indx = []; - $labels = $this->getLabels($conn)->getBody(); - foreach ($labels as $label) { - $indexes = $this->listIndex($label, $conn)->getBody(); - foreach ($indexes as $property) { - $indx[] = new Index($label, $property); - } - } - - return $indx; - } - - /** - * Checks if a property is indexed for a given label. - * - * @param string $label - * @param string $propertyKey - * @param string|null $conn - * - * @return bool - */ - public function isIndexed($label, $propertyKey, $conn = null) - { - $indexes = $this->listIndex($label, $conn)->getBody(); - if (in_array($propertyKey, $indexes)) { - return true; - } - - return false; - } - - /** - * Returns the registered constraints. - * - * @param string|null $conn - * - * @return mixed - */ - public function getUniqueConstraints($conn = null) - { - $command = $this->invoke('neo.get_constraints_command', $conn); - $httpResponse = $command->execute(); - - $responseO = $this->handleHttpResponse($httpResponse); - $response = $responseO->getBody(); - $constraints = []; - foreach ($response as $constraint) { - foreach ($constraint['property_keys'] as $key) { - $constraints[$constraint['label']][] = $key; - } - } - if ($responseO instanceof \GraphAware\NeoClient\Formatter\Response) { - $msg = new PsrResponse(200, array(), json_encode($constraints)); - return new \GraphAware\NeoClient\Formatter\Response($msg); - } - - $responseO->setBody($constraints); - - return $responseO; - } - - /** - * Create a unique constraint on a label. - * - * @param string $label - * @param string|array $property - * - * @return bool - */ - public function createUniqueConstraint($label, $property, $removeIndexIfExist = false) - { - $statements = []; - $identifier = strtolower($label); - if (is_array($property)) { - foreach ($property as $prop) { - $statements[] = 'CREATE CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$prop.' IS UNIQUE'; - } - } else { - $statements[] = 'CREATE CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$property.' IS UNIQUE'; - } - foreach ($statements as $statement) { - try { - $this->sendCypherQuery($statement); - } catch (Neo4jException $e) { - if (true === $removeIndexIfExist && 8000 === $e->getCode() && !is_array($property)) { - $this->dropIndex($label, $property); - - return $this->createUniqueConstraint($label, $property); - } - throw($e); - } - } - - return true; - } - - /** - * @param $label - * @param $property - * @param bool $transformIndexInConstraint - * @param null $conn - * - * @return \Neoxygen\NeoClient\Schema\UniqueConstraint - * - * @throws \Neoxygen\NeoClient\Exception\Neo4jException - */ - public function createSchemaUniqueConstraint($label, $property, $transformIndexInConstraint = false, $conn = null) - { - $q = 'CREATE CONSTRAINT ON (n:'.$label.') ASSERT n.'.$property.' IS UNIQUE'; - try { - $this->sendCypherQuery($q); - - return new UniqueConstraint($label, $property); - } catch (Neo4jException $e) { - if (true === $transformIndexInConstraint && 8000 === $e->getCode()) { - // do remove constraint - } - - throw $e; - } - } - - /** - * Drops a Uniqueness constraint from the Schema. - * - * @param \Neoxygen\NeoClient\Schema\UniqueConstraint $constraint - * @param null $conn - */ - public function dropSchemaUniqueConstraint(UniqueConstraint $constraint, $conn = null) - { - $q = 'DROP CONSTRAINT ON (n:'.$constraint->getLabel().') ASSERT n.'.$constraint->getProperty().' IS UNIQUE'; - $this->sendCypherQuery($q); - } - - /** - * Returns a collection of Uniqueness constraints live in the schema. - * - * @param null $conn - * - * @return \Neoxygen\NeoClient\Schema\UniqueConstraint[] - */ - public function getSchemaUniqueConstraints($conn = null) - { - $command = $this->invoke('neo.get_constraints_command', $conn); - $httpResponse = $command->execute(); - - $responseO = $this->handleHttpResponse($httpResponse); - $response = $responseO->getBody(); - $constraints = []; - foreach ($response as $constraint) { - foreach ($constraint['property_keys'] as $key) { - $constraints[] = new UniqueConstraint($constraint['label'], $key); - } - } - - return $constraints; - } - - /** - * Drops a unique constraint on a label. - * - * @param string $label - * @param string|array $property - * - * @return bool - */ - public function dropUniqueConstraint($label, $property) - { - $statements = []; - $identifier = strtolower($label); - if (is_array($property)) { - foreach ($property as $prop) { - $statements[] = 'DROP CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$prop.' IS UNIQUE'; - } - } else { - $statements[] = 'DROP CONSTRAINT ON ('.$identifier.':'.$label.') ASSERT '.$identifier.'.'.$property.' IS UNIQUE'; - } - foreach ($statements as $statement) { - $this->sendCypherQuery($statement); - } - - return true; - } - - /** - * Creates a new Transaction Handler. - * - * @param string|null $conn The connection alias - * - * @return Transaction - */ - public function createTransaction($conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE) - { - $transaction = new Transaction($conn, $this, $queryMode); - - return $transaction; - } - - /** - * Convenience method that invoke the OpenTransactionCommand. - * - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function openTransaction($conn = null, $queryMode = self::WRITE_QUERY) - { - $command = $this->invoke('neo.open_transaction', $conn); - $command->setArguments($queryMode); - $httpResponse = $command->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - /** - * Convenience method that invoke the RollBackTransactionCommand. - * - * @param int $id The id of the transaction - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function rollBackTransaction($id, $conn = null) - { - $response = $this->invoke('neo.rollback_transaction', $conn) - ->setTransactionId($id) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * Convenience method that invoke the PushToTransactionCommand - * and passes the query and parameters as arguments. - * - * @param int $transactionId The transaction id - * @param string $query The query to send - * @param array $parameters Parameters map of the query - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function pushToTransaction($transactionId, $query, array $parameters = array(), $conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE) - { - $httpResponse = $this->invoke('neo.push_to_transaction', $conn) - ->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $queryMode) - ->execute(); - - return $this->handleHttpResponse($httpResponse); - } - - public function pushMultipleToTransaction($transactionId, array $statements, $conn = null) - { - $response = $this->invoke('neo.push_multiple_to_transaction', $conn) - ->setArguments($transactionId, $statements, $this->resultDataContent) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * Convenience method that commit the transaction - * and passes the optional query and parameters as arguments. - * - * @param int $transactionId The transaction id - * @param string|null $query The query to send - * @param array $parameters Parameters map of the query - * @param string|null $conn The alias of the connection to use - * - * @return mixed - */ - public function commitTransaction($transactionId, $query = null, array $parameters = array(), $conn = null, $queryMode = self::WRITE_QUERY) - { - $response = $this->invoke('neo.commit_transaction', $conn) - ->setArguments($transactionId, $query, $parameters, $this->resultDataContent, $queryMode) - ->execute(); - - return $this->handleHttpResponse($response); - } - - public function changePassword($user, $newPassword, $conn = null) - { - $response = $this->invoke('neo.core_change_password', $conn) - ->setArguments($user, $newPassword) - ->execute(); - - return $response; - } - - /** - * @param string|null $connectionAlias - * - * @return mixed - */ - public function listUsers($connectionAlias = null) - { - $response = $this->invoke('neo.list_users', $connectionAlias) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * @param string $user - * @param string $password - * @param bool $readOnly - * @param string|null $connectionAlias - * - * @return mixed - */ - public function addUser($user, $password, $readOnly = false, $connectionAlias = null) - { - $response = $this->invoke('neo.add_user', $connectionAlias) - ->setReadOnly($readOnly) - ->setUser($user) - ->setPassword($password) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * @param string $user - * @param string $password - * @param string|null $connectionAlias - * - * @return mixed - */ - public function removeUser($user, $password, $connectionAlias = null) - { - $response = $this->invoke('neo.remove_user', $connectionAlias) - ->setUser($user) - ->setPassword($password) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * Convenience method for working with replication - * Sends a read only query. - * - * @param string $query - * @param array $parameters - * - * @return mixed - */ - public function sendReadQuery($query, array $parameters = array()) - { - return $this->sendCypherQuery($query, $parameters, $this->getReadConnection()->getAlias(), self::READ_QUERY); - } - - /** - * Convenience method for working with replication. - * - * @param string $query - * @param array $parameters - * - * @return mixed - */ - public function sendWriteQuery($query, array $parameters = array()) - { - return $this->sendCypherQuery($query, $parameters, $this->getWriteConnection()->getAlias(), self::WRITE_QUERY); - } - - /** - * Get the connection alias of the Master Connection. - * - * @return string - */ - public function getWriteConnectionAlias() - { - return $this->getWriteConnection()->getAlias(); - } - - /** - * Get the connection alias of the first Slave connection. - * - * @return string - */ - public function getReadConnectionAlias() - { - return $this->getReadConnection()->getAlias(); - } - - /** - * @param string|null $conn - * - * @return mixed - */ - public function checkHAMaster($conn = null) - { - $response = $this->invoke('neo.core_get_ha_master', $conn) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * @param string|null $conn - * - * @return mixed - */ - public function checkHASlave($conn = null) - { - $response = $this->invoke('neo.core_get_ha_slave', $conn) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * @param string|null $conn - * - * @return mixed - */ - public function checkHAAvailable($conn = null) - { - $response = $this->invoke('neo.core_get_ha_available', $conn) - ->execute(); - - return $this->handleHttpResponse($response); - } - - /** - * Retrieve paths between two nodes. - * - * @param array $startNodeProperties - * @param array $endNodeProperties - * @param int|null $depth - * @param string|null $direction - * @param string|null $conn - * - * @return mixed - */ - public function getPathBetween(array $startNodeProperties, array $endNodeProperties, $direction = null, $depth = null, $conn = null) - { - $this->checkPathNode($startNodeProperties); - $this->checkPathNode($endNodeProperties); - $parameters = []; - $startNPattern = '(start'; - if (isset($startNodeProperties['label']) && !empty($startNodeProperties['label'])) { - if (is_array($startNodeProperties['label'])) { - $label = implode(':', $startNodeProperties['label']); - } else { - $label = ':'.$startNodeProperties['label']; - } - $startNPattern .= $label; - } - if (isset($startNodeProperties['properties']) && !empty($startNodeProperties['properties'])) { - $startNPattern .= ' {'; - $propsCount = count($startNodeProperties['properties']); - $i = 0; - foreach ($startNodeProperties['properties'] as $key => $value) { - $startNPattern .= $key.': {start_'.$key.'}'; - if ($value instanceof \DateTime) { - $value = $value->format('Ymdhis'); - } - $parameters['start_'.$key] = $value; - if ($i < $propsCount - 1) { - $startNPattern .= ', '; - } - ++$i; - } - $startNPattern .= '}'; - } - $startNPattern .= ')'; - - $endNPattern = '(end'; - if (isset($endNodeProperties['label']) && !empty($endNodeProperties['label'])) { - if (is_array($endNodeProperties['label'])) { - $label = implode(':', $endNodeProperties['label']); - } else { - $label = ':'.$endNodeProperties['label']; - } - $endNPattern .= $label; - } - if (isset($endNodeProperties['properties']) && !empty($endNodeProperties['properties'])) { - $endNPattern .= ' {'; - $propsCount = count($endNodeProperties['properties']); - $i = 0; - foreach ($endNodeProperties['properties'] as $key => $value) { - $endNPattern .= $key.': {end_'.$key.'}'; - if ($value instanceof \DateTime) { - $value = $value->format('Ymdhis'); - } - $parameters['end_'.$key] = $value; - if ($i < $propsCount - 1) { - $endNPattern .= ', '; - } - ++$i; - } - $endNPattern .= '}'; - } - $endNPattern .= ')'; - if (null === $depth) { - $rel = '[*]'; - } else { - $d = (int) $depth; - $rel = '[*1..'.$d.']'; - } - switch ($direction) { - case null: - $in = '-'; - $out = '-'; - break; - case 'IN': - $in = '<-'; - $out = '-'; - break; - case 'OUT': - $in = '-'; - $out = '->'; - break; - default: - throw new \InvalidArgumentException('The direction must be IN, OUT or ALL'); - } - $q = 'MATCH p='.$startNPattern.$in.$rel.$out.$endNPattern; - if (isset($startNodeProperties['id'])) { - $q .= ' WHERE id(start) = {startNodeId}'; - $parameters['startNodeId'] = $startNodeProperties['id']; - } - - if (isset($endNodeProperties['id'])) { - if (isset($startNodeProperties['id'])) { - $q .= ' AND '; - } - $q .= ' WHERE id(end) = {endNodeId}'; - $parameters['endNodeId'] = $endNodeProperties['id']; - } - - $q .= ' RETURN p'; - - $response = $this->sendCypherQuery($q, $parameters, $conn, array('graph', 'row')); - - return $this->handleHttpResponse($response); - } - - private function checkPathNode(array $node) - { - if ((!isset($node['label']) || empty($node['label'])) - && (!isset($node['properties']) || empty($node['properties'])) - && (!isset($node['id']) || empty($node['id']))) { - throw new \InvalidArgumentException('The node must contain a label or properties'); - } - } -} diff --git a/src/Extension/NeoClientExtensionInterface.php b/src/Extension/NeoClientExtensionInterface.php deleted file mode 100644 index 4d931487..00000000 --- a/src/Extension/NeoClientExtensionInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Extension; - -interface NeoClientExtensionInterface -{ - public static function getAvailableCommands(); -} diff --git a/src/Formatter/ResponseFormatterInterface.php b/src/Formatter/ResponseFormatterInterface.php deleted file mode 100644 index 54fa5afa..00000000 --- a/src/Formatter/ResponseFormatterInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Formatter; - -interface ResponseFormatterInterface -{ - public static function getDefaultResultDataContents(); - public function format($response); -} diff --git a/src/Formatter/ResponseFormatterManager.php b/src/Formatter/ResponseFormatterManager.php deleted file mode 100644 index f5ddd137..00000000 --- a/src/Formatter/ResponseFormatterManager.php +++ /dev/null @@ -1,18 +0,0 @@ -responseFormatter = new $responseFormatter(); - } - - public function getResponseFormatter() - { - return $this->responseFormatter; - } -} diff --git a/src/HighAvailibility/HACommunityManager.php b/src/HighAvailibility/HACommunityManager.php deleted file mode 100644 index cef5b5a9..00000000 --- a/src/HighAvailibility/HACommunityManager.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'onRequestException', 50, - ), - NeoClientEvents::NEO_POST_REQUEST_SEND => array( - 'onSuccessfulRequest', 50, - ), - NeoClientEvents::NEO_PRE_REQUEST_SEND => array( - 'onPreSend', 50, - ), - ); - } - - public function __construct(ConnectionManager $connectionManager, GuzzleHttpClient $httpClient) - { - $this->connectionManager = $connectionManager; - $this->httpClient = $httpClient; - } - - public function onRequestException(HttpExceptionEvent $event) - { - $request = $event->getRequest(); - $this->fails[$request->getConnection()] = !isset($this->fails[$request->getConnection()]) ? 1 : $this->fails[$request->getConnection()] + 1; - if ($request->hasQueryMode()) { - if ($request->getQueryMode() == 'READ') { - $this->slavesUsed[] = $request->getConnection(); - if ($this->connectionManager->hasNextSlave($this->slavesUsed)) { - $next = $this->connectionManager->getNextSlave($this->slavesUsed); - Client::log('warning', sprintf('Connection "%s" unreacheable, using "%s"', $request->getConnection(), $next)); - $request->setInfoFromConnection($this->connectionManager->getConnection($next)); - $event->stopPropagation(); - } elseif (null === $this->masterUsed) { - $master = $this->connectionManager->getMasterConnection(); - Client::log('warning', sprintf('Connection "%s" unreacheable, using "%s"', $request->getConnection(), $master->getAlias())); - $this->masterUsed = true; - $request->setInfoFromConnection($master); - $event->stopPropagation(); - } - } - } - } - - public function onSuccessfulRequest(PostRequestSendEvent $event) - { - $request = $event->getRequest(); - $this->fails[$request->getConnection()] = null; - $this->slavesUsed = []; - $this->masterUsed = null; - if ($request->hasQueryMode()) { - if ($request->getQueryMode() === 'WRITE') { - $master = $this->connectionManager->getMasterConnection()->getAlias(); - if ($request->getConnection() === $master) { - $slaves = $this->connectionManager->getSlaves(); - $slave = current($slaves); - $this->writeReplicationUsed[] = $slave; - Client::log('debug', sprintf('Performing write replication on connection "%s"', $slave)); - $request->setInfoFromConnection($this->connectionManager->getConnection($slave)); - $event->stopPropagation(); - } elseif ($this->connectionManager->hasNextSlave($this->writeReplicationUsed)) { - $next = $this->connectionManager->getNextSlave($this->writeReplicationUsed); - $nc = $this->connectionManager->getConnection($next); - Client::log('debug', sprintf('Performing write replication on connection "%s"', $next)); - $request->setInfoFromConnection($nc); - $event->stopPropagation(); - } elseif (null !== $this->masterUsed && !$this->connectionManager->hasNextSlave($this->masterUsed) && $request->getConnection() !== $master) { - $this->masterUsed = []; - Client::log('debug', 'Replication terminated'); - } - } - } - } - - public function onPreSend(HttpClientPreSendRequestEvent $event) - { - $request = $event->getRequest(); - $conn = $request->getConnection(); - if (isset($this->fails[$conn]) && $this->fails[$conn] >= 5) { - if ($request->hasQueryMode()) { - if ($request->getQueryMode() === 'READ') { - if ($this->connectionManager->hasNextSlave([$conn])) { - $next = $this->connectionManager->getNextSlave([$conn]); - $request->setInfoFromConnection($this->connectionManager->getConnection($next)); - } - } - } - } - } -} diff --git a/src/HttpClient/GuzzleHttpClient.php b/src/HttpClient/GuzzleHttpClient.php deleted file mode 100644 index 60c40f37..00000000 --- a/src/HttpClient/GuzzleHttpClient.php +++ /dev/null @@ -1,118 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\HttpClient; - -use GuzzleHttp\Client; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Psr7\Response as HttpResponse; -use Neoxygen\NeoClient\Request\Request; -use Neoxygen\NeoClient\Request\Response; -use Neoxygen\NeoClient\NeoClientEvents; -use Neoxygen\NeoClient\Event\HttpClientPreSendRequestEvent; -use Neoxygen\NeoClient\Event\PostRequestSendEvent; -use Neoxygen\NeoClient\Event\HttpExceptionEvent; -use Neoxygen\NeoClient\Client as BaseClient; -use Psr\Http\Message\ResponseInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -class GuzzleHttpClient implements HttpClientInterface -{ - protected $client; - - protected $eventDispatcher; - - protected $defaultTimeout; - - public function __construct($defaultTimeOut, EventDispatcherInterface $eventDispatcher) - { - $this->client = new Client(); - $this->eventDispatcher = $eventDispatcher; - $this->defaultTimeout = (int) $defaultTimeOut; - } - - public function sendRequest(Request $request) - { - $this->dispatchPreSend($request); - $options = []; - if ($request->hasBody()) { - $options['body'] = $request->getBody(); - } - if ($request->hasQueryStrings()) { - $options['query'] = $request->getQueryStrings(); - } - if ($request->isSecured()) { - $options['auth'] = [$request->getUser(), $request->getPassword()]; - } - $options['timeout'] = null !== $request->getTimeout() ? $request->getTimeout() : $this->defaultTimeout; - - $options['headers'] = [ - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - 'User-Agent' => $this->getUserAgent(), - ]; - foreach ($request->getHeaders() as $header => $value) { - $options['headers'][$header] = $value; - } - - $url = $request->getUrl(); - - try { - $response = $this->client->request($request->getMethod(), $url, $options); - $this->dispatchPostRequestSend($request, $response); - if ($request->getUrl() !== $url) { - return $this->sendRequest($request); - } - - return $this->getResponse($response); - } catch (RequestException $e) { - return $this->dispatchHttpException($request, $e); - } - } - - private function getResponse(ResponseInterface $httpResponse) - { - $response = new Response($httpResponse); - - if ($httpResponse->getBody()) { - $resp = (string) $httpResponse->getBody(); - $decoded = json_decode($resp, true); - $response->setBody($decoded); - } - - return $response; - } - - private function dispatchPreSend(Request $request) - { - $event = new HttpClientPreSendRequestEvent($request); - $this->eventDispatcher->dispatch(NeoClientEvents::NEO_PRE_REQUEST_SEND, $event); - } - - private function dispatchPostRequestSend(Request $request, HttpResponse $response) - { - $event = new PostRequestSendEvent($request, $response); - $this->eventDispatcher->dispatch(NeoClientEvents::NEO_POST_REQUEST_SEND, $event); - } - - private function dispatchHttpException(Request $request, RequestException $exception) - { - $event = new HttpExceptionEvent($request, $exception); - $this->eventDispatcher->dispatch(NeoClientEvents::NEO_HTTP_EXCEPTION, $event); - - return $this->sendRequest($request); - } - - private function getUserAgent() - { - return 'NeoClient-PHP/v-'.BaseClient::getNeoClientVersion(); - } -} diff --git a/src/HttpClient/HttpClientInterface.php b/src/HttpClient/HttpClientInterface.php deleted file mode 100644 index 001f9c1d..00000000 --- a/src/HttpClient/HttpClientInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\HttpClient; - -use Neoxygen\NeoClient\Request\Request; - -interface HttpClientInterface -{ - /** - * @param \Neoxygen\NeoClient\Request\Request $request - * - * @return \Neoxygen\NeoClient\Request\Response - */ - public function sendRequest(Request $request); -} diff --git a/src/Logger/LoggerManager.php b/src/Logger/LoggerManager.php deleted file mode 100644 index 919b8b7c..00000000 --- a/src/Logger/LoggerManager.php +++ /dev/null @@ -1,113 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Logger; - -use Psr\Log\NullLogger; -use Psr\Log\LoggerInterface; -use Monolog\Logger; -use Monolog\Handler\StreamHandler; - -class LoggerManager implements LoggerInterface -{ - protected $loggers; - - public function setLogger($name, LoggerInterface $logger) - { - if (!isset($this->loggers[$name])) { - $this->loggers[$name] = $logger; - } - - return $this; - } - - public function getLogger($name = 'defaultLogger') - { - if (!isset($this->loggers[$name])) { - if ('defaultLogger' === $name) { - $this->loggers[$name] = new NullLogger(); - } - } - - return $this->loggers[$name]; - } - - public function createLogger($name, $config) - { - if (!isset($this->loggers[$name])) { - $logger = new Logger($name); - switch ($config['type']) { - case 'stream': - $handler = new StreamHandler( - $config['path'], - isset($config['level']) ? $config['level'] : null - ); - $logger->pushHandler($handler); - $this->loggers[$name] = $logger; - break; - } - } - - return $this->loggers[$name]; - } - - public function log($level = 'debug', $message, array $context = array()) - { - if (empty($this->loggers)) { - $this->loggers['defaultLogger'] = new NullLogger(); - } - foreach ($this->loggers as $logger) { - $logger->log($level, $message, $context); - } - - return true; - } - - public function emergency($message, array $context = array()) - { - return $this->log('emergency', $message, $context); - } - - public function alert($message, array $context = array()) - { - return $this->log('alert', $message, $context); - } - - public function critical($message, array $context = array()) - { - return $this->log('critical', $message, $context); - } - - public function error($message, array $context = array()) - { - return $this->log('error', $message, $context); - } - - public function warning($message, array $context = array()) - { - return $this->log('warning', $message, $context); - } - - public function notice($message, array $context = array()) - { - return $this->log('notice', $message, $context); - } - - public function info($message, array $context = array()) - { - return $this->log('info', $message, $context); - } - - public function debug($message, array $context = array()) - { - return $this->log('debug', $message, $context); - } -} diff --git a/src/Request/Request.php b/src/Request/Request.php deleted file mode 100644 index 28b68258..00000000 --- a/src/Request/Request.php +++ /dev/null @@ -1,287 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Request; - -use Neoxygen\NeoClient\Connection\Connection; - -class Request implements RequestInterface -{ - private $method; - - private $path; - - private $url; - - private $body; - - private $queryStrings; - - private $headers = []; - - private $options; - - private $connection; - - private $timeout; - - private $authMode; - - private $user; - - private $password; - - private $stream; - - private $queryMode; - - /** - * @return mixed - */ - public function getQueryMode() - { - return $this->queryMode; - } - - /** - * @param mixed $queryMode - */ - public function setQueryMode($queryMode) - { - $this->queryMode = $queryMode; - } - - public function hasQueryMode() - { - return null !== $this->queryMode; - } - - /** - * @return mixed - */ - public function getPath() - { - return $this->path; - } - - /** - * @param mixed $path - */ - public function setPath($path) - { - $this->path = $path; - } - - /** - * @return mixed - */ - public function getConnection() - { - return $this->connection; - } - - /** - * @param mixed $connection - */ - public function setConnection($connection) - { - $this->connection = $connection; - } - - /** - * @return mixed - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * @param mixed $timeout - */ - public function setTimeout($timeout) - { - $this->timeout = $timeout; - } - - /** - * @return mixed - */ - public function getAuthMode() - { - return $this->authMode; - } - - /** - * @param mixed $authMode - */ - public function setAuthMode($authMode) - { - $this->authMode = $authMode; - } - - /** - * @return mixed - */ - public function getUser() - { - return $this->user; - } - - /** - * @param mixed $user - */ - public function setUser($user) - { - $this->user = $user; - } - - /** - * @return mixed - */ - public function getPassword() - { - return $this->password; - } - - /** - * @param mixed $password - */ - public function setPassword($password) - { - $this->password = $password; - } - - /** - * @return mixed - */ - public function getStream() - { - return $this->stream; - } - - /** - * @param mixed $stream - */ - public function setStream($stream) - { - $this->stream = $stream; - } - - public function getMethod() - { - return $this->method; - } - - public function setMethod($method) - { - $this->method = $method; - } - - public function getUrl() - { - return $this->url; - } - - public function setUrl($url) - { - $this->url = $url; - } - - public function getBody() - { - return $this->body; - } - - public function setBody($body) - { - $this->body = $body; - } - - public function getHeaders() - { - return $this->headers; - } - - public function setHeaders(array $headers) - { - $this->headers = $headers; - } - - public function setHeader($name, $value) - { - $this->headers[$name] = $value; - } - - public function getOptions() - { - return $this->options; - } - - public function setOptions(array $options) - { - $this->options = $options; - } - - public function setOption($key, $value) - { - $this->options[$key] = $value; - } - - /** - * @return mixed - */ - public function getQueryStrings() - { - return $this->queryStrings; - } - - /** - * @param mixed $queryStrings - */ - public function setQueryStrings($queryStrings) - { - $this->queryStrings = $queryStrings; - } - - public function hasBody() - { - return null !== $this->body; - } - - public function isStream() - { - return null !== $this->stream; - } - - public function hasQueryStrings() - { - return null !== $this->queryStrings; - } - - public function isSecured() - { - return null !== $this->authMode; - } - - public function setInfoFromConnection(Connection $connection) - { - $this->connection = $connection->getAlias(); - if ($connection->isAuth()) { - $this->authMode = true; - $this->user = $connection->getAuthUser(); - $this->password = $connection->getAuthPassword(); - } - $this->url = $connection->getBaseUrl().$this->path; - - return $this; - } -} diff --git a/src/Request/RequestBuilder.php b/src/Request/RequestBuilder.php deleted file mode 100644 index 0349ebbc..00000000 --- a/src/Request/RequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -connectionManager = $connectionManager; - } - - /** - * @param $method - * @param $path - * @param null $body - * @param null $queryStrings - * @param null $conn - * - * @return Request - */ - public function buildRequest($method, $path, $body = null, $queryStrings = null, $conn = null, $queryMode = null, array $headers = array()) - { - $request = new Request(); - $connection = $this->connectionManager->getConnection($conn); - $request->setMethod(strtoupper($method)); - $request->setPath($path); - $request->setBody($body); - $request->setQueryStrings($queryStrings); - $request->setConnection($connection->getAlias()); - $request->setQueryMode($queryMode); - $request->setHeaders($headers); - if ($connection->isAuth()) { - $request->setAuthMode(true); - $request->setUser($connection->getAuthUser()); - $request->setPassword($connection->getAuthPassword()); - } - $url = $connection->getBaseUrl().$path; - $request->setUrl($url); - - return $request; - } -} diff --git a/src/Request/RequestInterface.php b/src/Request/RequestInterface.php deleted file mode 100644 index 4bc38d37..00000000 --- a/src/Request/RequestInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Request; - -interface RequestInterface -{ - public function getMethod(); - - public function getUrl(); - - public function getBody(); - - public function getHeaders(); - - public function getOptions(); -} diff --git a/src/Request/Response.php b/src/Request/Response.php deleted file mode 100644 index 675d7387..00000000 --- a/src/Request/Response.php +++ /dev/null @@ -1,80 +0,0 @@ -raw = $responseInterface; - } - - public function setBody($body) - { - $this->body = $body; - } - - public function getBody() - { - return $this->body; - } - - public function hasBody() - { - return null !== $this->body; - } - - /** - * @return mixed - */ - public function getRows() - { - return $this->rows; - } - - /** - * @param mixed $rows - */ - public function setRows($rows = null) - { - $this->rows = $rows; - } - - /** - * @return Result - */ - public function getResult() - { - return $this->result; - } - - /** - * @param mixed $result - */ - public function setResult(Result $result = null) - { - $this->result = $result; - } - - /** - * @return \Psr\Http\Message\ResponseInterface - */ - public function getRaw() - { - return $this->raw; - } -} diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml deleted file mode 100644 index 62675adb..00000000 --- a/src/Resources/config/services.yml +++ /dev/null @@ -1,47 +0,0 @@ -services: - neoclient.connection_manager: - class: "Neoxygen\\NeoClient\\Connection\\ConnectionManager" - arguments: ["@?logger","@?event_dispatcher"] - - neoclient.command_manager: - class: "Neoxygen\\NeoClient\\Command\\CommandManager" - arguments: ["@?logger","@?event_dispatcher"] - - neoclient.http_client: - class: "Neoxygen\\NeoClient\\HttpClient\\GuzzleHttpClient" - arguments: ["%default_timeout%","@event_dispatcher", "?@neoclient.ha_manager"] - - neoclient.logger: - class: "Neoxygen\\NeoClient\\Logger\\LoggerManager" - - neoclient.extension_manager: - class: "Neoxygen\\NeoClient\\Extension\\ExtensionManager" - arguments: ["@neoclient.command_manager","@neoclient.connection_manager","@neoclient.response_formatter", "%neoclient.auto_format_response%", "%neoclient.result_data_content%", "%neoclient.new_format_mode_enabled%"] - - neoclient.response_formatter: - class: "Neoxygen\\NeoClient\\Formatter\\ResponseFormatterManager" - arguments: ["%response_formatter_class%"] - - neoclient.event_dispatcher: - class: "Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher" - arguments: ["@service_container"] - - neoclient.client: - class: "Neoxygen\\NeoClient\\Client" - arguments: ["@service_container"] - - neoclient.logging_event_subscriber: - class: "Neoxygen\\NeoClient\\EventListener\\LoggingEventSubscriber" - arguments: ["@logger"] - tags: - - { name: neoclient.service_event_subscriber } - - neoclient.http_event_subscriber: - class: "Neoxygen\\NeoClient\\EventListener\\HttpRequestEventSubscriber" - arguments: ["@logger"] - tags: - - { name: neoclient.service_event_subscriber } - - neoclient.request_builder: - class: "Neoxygen\\NeoClient\\Request\\RequestBuilder" - arguments: ["@neoclient.connection_manager"] diff --git a/src/Resources/extensions/core_commands.yml b/src/Resources/extensions/core_commands.yml deleted file mode 100644 index 831b7291..00000000 --- a/src/Resources/extensions/core_commands.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Core Commands - -simple_command: - class: "Neoxygen\\NeoClient\\Command\\SimpleCommand" - -neo.ping_command: - class: "Neoxygen\\NeoClient\\Command\\Core\\CorePingCommand" - -neo.get_labels_command: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetLabelsCommand" - -neo.get_constraints_command: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetConstraintsCommand" - -neo.list_index_command: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreListIndexCommand" - -neo.get_neo4j_version: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetVersionCommand" - -neo.send_cypher_query: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreSendCypherQueryCommand" - -neo.send_cypher_multiple: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreSendMultipleCypherCommand" - -neo.open_transaction: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreOpenTransactionCommand" - -neo.rollback_transaction: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreRollBackTransactionCommand" - -neo.push_to_transaction: - class: "Neoxygen\\NeoClient\\Command\\Core\\CorePushToTransactionCommand" - -neo.commit_transaction: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreCommitTransactionCommand" - -neo.push_multiple_to_transaction: - class: "Neoxygen\\NeoClient\\Command\\Core\\CorePushMultipleToTransactionCommand" - -neo.core_get_ha_master: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetHAMasterCommand" - -neo.core_get_ha_slave: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetHASlaveCommand" - -neo.core_get_ha_available: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreGetHAAvailableCommand" - -neo.core_change_password: - class: "Neoxygen\\NeoClient\\Command\\Core\\CoreChangePasswordCommand" diff --git a/src/Schema/Index.php b/src/Schema/Index.php deleted file mode 100644 index 92ecd57f..00000000 --- a/src/Schema/Index.php +++ /dev/null @@ -1,51 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Schema; - -class Index -{ - /** - * @var string - */ - protected $label; - - /** - * @var string - */ - protected $property; - - /** - * @param string $label - * @param string $property - */ - public function __construct($label, $property) - { - $this->label = (string) $label; - $this->property = (string) $property; - } - - /** - * @return string - */ - public function getLabel() - { - return $this->label; - } - - /** - * @return string - */ - public function getProperty() - { - return $this->property; - } -} diff --git a/src/Schema/UniqueConstraint.php b/src/Schema/UniqueConstraint.php deleted file mode 100644 index d3e204b4..00000000 --- a/src/Schema/UniqueConstraint.php +++ /dev/null @@ -1,51 +0,0 @@ -" NeoClient package. - * - * (c) Neoxygen.io - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Schema; - -class UniqueConstraint -{ - /** - * @var string - */ - protected $label; - - /** - * @var string - */ - protected $property; - - /** - * @param string $label - * @param string $property - */ - public function __construct($label, $property) - { - $this->label = (string) $label; - $this->property = (string) $property; - } - - /** - * @return string - */ - public function getLabel() - { - return $this->label; - } - - /** - * @return string - */ - public function getProperty() - { - return $this->property; - } -} diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php new file mode 100644 index 00000000..2e9a9b4c --- /dev/null +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Tests\Integration; + +use GraphAware\Neo4j\Client\Client; +use GraphAware\Neo4j\Client\ClientBuilder; + +class ClientSetupIntegrationTest extends \PHPUnit_Framework_TestCase +{ + public function testClientSetupWithOneConnection() + { + $client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->build(); + + $this->assertInstanceOf(Client::class, $client); + } +} \ No newline at end of file diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php deleted file mode 100644 index b552ec85..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Functional/CoreCommandsTest.php +++ /dev/null @@ -1,125 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - ->setDefaultTimeout(15) - ->build(); - - $this->client = $client; - } - - public function testGetRoot() - { - $response = $this->client->getRoot(); - $root = $response->getBody(); - - $this->assertArrayHasKey('data', $root); - $this->assertArrayHasKey('management', $root); - } - - public function testGetLabels() - { - $response = $this->client->getLabels(); - $labels = $response->getBody(); - - $this->assertInternalType('array', $labels); - } - - public function testRenameLabel() - { - $q = 'MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'; - $this->client->sendCypherQuery($q); - - $q = 'CREATE (n:OldLabel)'; - $this->client->sendCypherQuery($q); - $response = $this->client->getLabels(); - $labels = $response->getBody(); - $this->assertContains('OldLabel', $labels); - - $this->client->renameLabel('OldLabel', 'NewLabel'); - $labels = $this->client->getLabels()->getBody(); - $this->assertContains('NewLabel', $labels); - } - - public function testCreateAndListIndex() - { - $this->client->createIndex('User', 'email'); - $response = $this->client->listIndex('User'); - $indexes = $response->getBody(); - - $this->assertContains('email', $indexes); - } - - public function testDropIndex() - { - $this->client->createIndex('Drop', 'user'); - $this->assertTrue($this->client->isIndexed('Drop', 'user')); - $this->client->dropIndex('Drop', 'user'); - $this->assertFalse($this->client->isIndexed('Drop', 'user')); - } - - - public function testListIndexes() - { - $this->client->createIndex('List1', 'property'); - $this->client->createIndex('List2', 'property'); - $response = $this->client->listIndexes(); - $indexes = $response->getBody(); - $this->assertArrayHasKey('List1', $indexes); - $this->assertArrayHasKey('List2', $indexes); - } - - public function testCreateUniqueConstraint() - { - $this->client->createUniqueConstraint('Label', 'uniqueProperty'); - $constraints = $this->client->getUniqueConstraints()->getBody(); - - $this->assertArrayHasKey('Label', $constraints); - $this->assertContains('uniqueProperty', $constraints['Label']); - } - - public function testDropUniqueConstraint() - { - $this->client->createUniqueConstraint('ToDrop', 'username'); - $this->assertArrayHasKey('ToDrop', $this->client->getUniqueConstraints()->getBody()); - $this->client->dropUniqueConstraint('ToDrop', 'username'); - $this->assertArrayNotHasKey('ToDrop', $this->client->getUniqueConstraints()->getBody()); - } - - public function testPushMultipleInTransaction() - { - $q = 'MATCH (n:MultiplePersonNode) DELETE n'; - $this->client->sendCypherQuery($q); - $statements = []; - $statement = 'CREATE (n:MultiplePersonNode {id:{myId} })'; - for ($i = 0; $i <= 2000; $i++) { - $statements[] = ['statement' => $statement, 'parameters' => ['myId' => uniqid()]]; - } - $this->client->sendMultiple($statements); - - $q = 'MATCH (n:MultiplePersonNode) RETURN count(n)'; - $r = $this->client->sendCypherQuery($q); - $count = $r->getRows()['count(n)'][0]; - - $this->assertEquals(2001, $count); - } - - -} diff --git a/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php b/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php deleted file mode 100644 index ce8fdc4a..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Issues/IssueTransactionServerRollBackTest.php +++ /dev/null @@ -1,45 +0,0 @@ -addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'veryCoolMax') - ->setAutoFormatResponse(true) - //->enableNewFormattingService() - ->build(); - } - - public function testIssueDescription() - { - $conn = $this->getConnection(); - $conn->createSchemaUniqueConstraint('User', 'name'); - $conn->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - $conn->sendCypherQuery('CREATE (n:User {name:"Chris"})'); - - $tx = $conn->createTransaction(); - try { - $tx->pushQuery('CREATE (n:User {name:"Chris"})'); - } catch (Neo4jException $e) { - // - } - - $this->assertFalse($tx->isActive()); - - } -} \ No newline at end of file diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index ad4039b2..916def65 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -1,10 +1,10 @@ Date: Sun, 10 Jan 2016 23:55:32 +0100 Subject: [PATCH 047/217] removed old stuff from README --- README.md | 863 ++---------------------------------------------------- 1 file changed, 17 insertions(+), 846 deletions(-) diff --git a/README.md b/README.md index 1cfef87a..7006bc6d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,11 @@ -# Neo4j-PHP-Client +# GraphAware Neo4j PHP Client ## An Enterprise Grade Client for Neo4j [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) [![Latest Stable Version](https://poser.pugx.org/graphaware/neo4j-php-client/v/stable.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) -[![Latest Unstable Version](https://poser.pugx.org/neoxygen/neoclient/v/unstable.svg)](https://packagist.org/packages/neoxygen/neoclient) -[![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/neoxygen/neoclient) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/bac840f0-7b30-4206-a0e0-c6f4ca320077/big.png)](https://insight.sensiolabs.com/projects/bac840f0-7b30-4206-a0e0-c6f4ca320077) - +[![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) ## Introduction @@ -28,8 +25,8 @@ Neo4j is a transactional, open-source graph database. A graph database manages d | **Version** | **Tested** | |-------------|-------------| -| <= 2.1.5 | No | -| >= 2.1.6 | Yes | +| <= 2.2.6 | No | +| >= 2.2.6 | Yes | | 2.2 | Yes | | 2.3 | Yes | @@ -37,26 +34,25 @@ Neo4j is a transactional, open-source graph database. A graph database manages d | **Feature** | **Supported?** | |----------------------|----------------| -| Auth | Yes | -| Remote Cypher | Yes | -| Transactions | Yes | -| High Availability | Yes | -| Embedded JVM support | No | -| Binary Protocol | In progress | +| Auth | Yes | +| Remote Cypher | Yes | +| Transactions | Yes | +| High Availability | Yes | +| Embedded JVM support | No | +| Binary Protocol | Yes | ### Requirements -* PHP 5.5+ -* A Neo4j database (minimum version 2.1.6) +* PHP 5.6+ +* A Neo4j database (minimum version 2.2.6) ### Getting Help You can: * Check out an [example application built with NeoClient](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) - * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=neo4j-neoclient-php,php,neo4j) - * Chat with us on Gitter: [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/neoxygen/neo4j-neoclient?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - * For bugs, please feel free to create a [new issue on GitHub](https://github.com/neoxygen/neo4j-neoclient/issues/new) + * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=graphaware,php,neo4j) + * For bugs, please feel free to create a [new issue on GitHub](https://github.com/graphaware/neo4j-php-client/issues/new) ## Installation and basic usage @@ -75,847 +71,22 @@ Require the composer autoloader, configure your connection by providing a connec require_once 'vendor/autoload.php'; -use Neoxygen\NeoClient\ClientBuilder; +use GraphAware\Neo4j\Client\ClientBuilder; $client = ClientBuilder::create() - ->addConnection('default','http','localhost',7474) + ->addConnection('default', 'http://neo4j:password@localhost') ->build(); ``` You're now ready to connect to your database. -If you use default database settings in a local environment (meaning _http://localhost:7474_), you can use the handy `addDefaultLocalConnection` method : - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->build(); -``` - -The build method will process configuration settings and return you a `Client` instance. - -#### Configuring the connection timeout - -You can configure the default timeout during the build process : - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->setDefaultTimeout(20) // <-- Timeout of 20 seconds for http requests - ->build(); -``` - -### Usage - -You have now full access to the database. - - -#### getRoot | Returns the root endpoint - -```php -$root = $client->getRoot(); -``` - -```php -Array - ( - [management] => http://localhost:7474/db/manage/ - [data] => http://localhost:7474/db/data/ - ) -``` - -Note: As the library provide full support for working with multiple databases, each method explained in the documentation can take -a `$conn` parameter which you can use to define on which connection you want to execute the method. The default connection will be used when -the parameter is not set. - -For more information on how to set up multiple connections, read the `Multiple connections` section of the documentation. - - -#### getNeo4jVersion | Returns the Neo4j version of the current connection - -```php -$version = $client->getNeo4jVersion(); - -// Returns (string) 2.2.1 -``` - -## Sending Cypher Queries - -In order to send a Cypher Query, you need to pass the query as a string, and an optional array of paramaters as arguments : - -```php - -$q = 'MATCH (n) RETURN count(n)'; -$response = $client->sendCypherQuery($q); -``` - -````php -Array -( - [results] => Array - ( - [0] => Array - ( - [columns] => Array - ( - [0] => count(n) - ) - - [data] => Array - ( - [0] => Array - ( - [row] => Array - ( - [0] => 1 - ) -...... -``` - -Handling such response format is not really practical and boring. You can ask the client to format the response in a pretty way and have -this format available to you : - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->setAutoFormatResponse(true) - ->build(); -``` - -To get the pretty format : - -```php - -$q = 'MATCH (n:Actor) RETURN n.name'; -$client->sendCypherQuery($q); - -$result = $client->getRows(); -``` - -``` -Array -( - [n.name] => Array - ( - [0] => Keanu Reeves - [1] => Laurence Fishburne - [2] => Carrie-Anne Moss - ) - -) - -``` -## Labels, Indexes and Constraints Management - -### Managing labels - -The library provide handy methods for managing your labels : - - -#### getLabels | Returns the labels indexed in the database - -```php -$labels = $client->getLabels(); -``` - -```php -[ "UriahHeep", "MyLabel", "Version", "Customer", "TestLabel" ] -``` - -#### renameLabel | Fetch all nodes for that label and rename the label of the nodes - -Note that depending on the amount of nodes for the given label, this can take some time. - -Call the `renameLabel` method and pass the old label name and the new label name as arguments : - -```php -$client->renameLabel('Person', 'User'); -``` - -### Managing Indexes and Constraints - -Indexes and Constraints management is also an easy task - -#### createIndex | Creates an index for a label/property pair - -```php -$client->createIndex('Person', 'email'); -``` - -#### listIndex | List indexed properties for a given label - -```php -$client->listIndex('Person'); -``` - -Returns you an array of indexed properties for the given label - -#### listIndexes | List indexed properties for given labels or all labels - -```php -$personAndUserIndexes = $client->listIndexes(['Person','User']); - -$allIndexes = $client->listIndexes(); -``` - -Returns you an array of indexed properties by the form `['Label' => ['prop1','prop2']]`. - -#### dropIndex | Drop an index for a given label/property pair - -```php -$client->dropIndex('Person','email'); -``` - -#### isIndexed | Checks whether or not a given label/property pair is indexed - -```php -$client->isIndexed('User','username'); -``` - -Returns true or false - -#### createUniqueConstraint | Create a uniqueness constraint for a given label/property pair - -```php -$client->createUniqueConstraint('User','username'); -``` - -If an index already exist on the combination `Label, property` you can ask the client to drop the index and create the -constraint instead of throwing an exception, just pass `true` as a third parameter. - -```php -$client->createUniqueConstraint('User','username',true); -``` - -#### dropUniqueConstraint | Drop a uniqueness constraint for a given label/property pair - -```php -$client->dropUniqueConstraint('User','username'); -``` - -#### getUniqueConstraints | Returns all the uniqueness constraints by label - -```php -$constraints = $client->getUniqueConstraints(); -``` - -Returns `['User' => ['username','email'], 'Movie' => ['imdb_id']]` - - -## Handling Graph Results - -The Response Formatter will format graph results in a pretty format of nodes and relationships objects. - -If you've setup the `autoFormatResponse` configuration value, when a graph result is available, a graph representation -is available for you : - -```php -$query = 'MATCH (a:Actor)-[r]-(m:Movie) RETURN *'; -$client->sendCypherQuery($query); - -// Getting the graph Result -$result = $client->getResult(); - -// The raw response is still available : -$response = $client->getResponse(); - -// Getting all nodes - -$nodes = $result->getNodes(); - -// Getting all movie nodes from the result -$movies = $result->getNodes('Movie'); - -// Getting all movie and Actor nodes from the result - -$moviesAndActors = $result->getNodes(['Movie','Actor']); -// Returns you a collection of nodes objects - -// If you want to group the nodes by labels, you can pass true as second argument to the getNodes method - -$moviesAndActors = $result->getNodes(['Movie','Actor'], true); -// Returns an array with labels as keys ['Movie' => ['NodeObject1', 'NodeObject2']] - - -// Getting only one movie (returns in fact the first element of an array, but is handy when you expect only one node -$movie = $result->getSingleNode('Movie'); - -// Working with the relationships - -$movie = $result->getSingleNode('Movie'); -$actors = $movie->getRelationships('ACTS_IN'); -// Or you may want to specify direction -$actors = $movie->getRelationships('ACTS_IN', 'IN'); - -// If you need only one relationship : -$actor = $movie->getSingleRelationship('ACTS_IN'); - -// Getting node/relationships properties - -// Getting one property -$actor = $result->getSingleNode('Actor'); -$name = $actor->getProperty('name'); - -// Getting all properties -$props = $actor->getProperties(); - -// Getting a set of properties -$props = $actor->getProperties(['name', 'date_of_birh']); - -// Getting the node internal Id (Id of the Neo4j database) - -$id = $actor->getId(); - -// Getting a node by id in the Result set - -$node = $result->getNodeById(34); - -// Counting Nodes And Relationships - -$nbNodes = $result->getNodesCount(); -$nbRels = $result->getRelationshipsCount(); - - -// Since 2.2 -// getConnectedNodes and getConnectedNode -// Shortcut bypassing the relationship and returning the connected nodes - -$node->getConnectedNodes(); -$node->getConnectedNodes('IN', 'KNOWS'); -$node->getconnectedNodes('OUT', ['KNOWS','FOLLOWS']); -//Same arguments signature for getConnectedNode -$node->getConnectedNode(); // returns only one node - -``` - -### Using `get` - -Commonly, you'll use identifiers in your return statements, you can access them in an easy way : - -```php -$q = 'MATCH (n:User)<-[:FOLLOWS]-(followers) RETURN n, collect(followers) as flwers'; -$r = $client->sendCypherQuery($q)->getResult(); - -print_r($r->get('flwers')); // Returns an array of node objects -``` - -### Results in table format - -Sometimes you will deal with results in table format, there is a dedicated method `getTableFormat` -that will format the results for you : - -``` -$q = 'MATCH (c:Country) - MATCH (c)<-[:LIVES_IN]->(p) - RETURN c.name, count(*) as people - ORDER BY people DESC'; -$result = $client->sendCypherQuery($q)->getResult(); - -print_r($result->getTableFormat()); - ---- -Array -( - [0] => Array - ( - [c.name] => Barbados - [people] => 3 - ) - - [1] => Array - ( - [c.name] => Vietnam - [people] => 2 - ) - - [2] => Array - ( - [c.name] => Liberia - [people] => 2 - ) - - [3] => Array - ( - [c.name] => Rwanda - [people] => 2 - ) - - [4] => Array - ( - [c.name] => Canada - [people] => 1 - ) -) ---- -``` - - -## Sending multiple statements in one transaction - -There are 2 ways for sending multiple statements in one and only transaction. - -1. Using an open transaction throughout the process (see the next section "Transaction Management") -2. Using a `PreparedTransaction` instance - - -### PreparedTransaction - -Handy if you want to keep a `PreparedTransaction` instance throughout your code : - -```php -$tx = $client->prepareTransaction() - ->pushQuery($q, $p) - ->pushQuery($q2) - ->pushQuery($q3) - ->commit(); -``` - - -## Transaction Management - -The library comes with a Transaction Manager removing you the burden of parsing commit urls and transaction ids. - -Usage is straightforward : - -```php -$transaction = $client->createTransaction(); -$transaction->pushQuery('MERGE (n:User {id: 123}) RETURN n'); -$transaction->pushQuery('MATCH (n) RETURN count(n)'); -$transaction->commit(); - -// Other methods : -$transaction->rollback(); -$transaction->getLastResult // Returns the result of the last transaction statements -$transaction->getResults() // Returns the results of all the statements -``` - -Note that a commited or a rolled back transaction will not accept pushQuery calls anymore. - -## Working with multiple connections - -### Define multiple connections - -You can work with as many connections you want : - -```php -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'localhost', 7474) - ->addConnection('testserver1', 'http', 'testserver.local', 7474) - ->addConnection('testserver2', 'http', 'testserver2.local',7474) - ->build(); -``` - -When calling commands, you can specify to which connection the command has to be executed by passing the connection alias as argument : - -```php -$client->getRoot('default'); -$client->sendCypherQuery('MATCH (n) RETURN count(n) as total', array(), 'testserver1'); -``` - -## HA (High-Availibilty) - -### HA Mode for Neo4j Enterprise - -NB: There are ongoing changes for improving the HA Mode of the Enterprise Edition, stay tuned ;-) - -The library provide a powerful system for handling the HA Mode of Neo4j available in Neo4j Enterprise. - -The convention is to send write queries to the master, and read queries to slaves. - -To enable the HA Mode and defining which connections are master or slave, you need to add some method call during the build process of the -client : - -```php - -$client = ClientBuilder::create() - ->addConnection('server1', 'http', '193.147.213.3', 7474) - ->addConnection('server2', 'http', '193.147.213.4', 7474) - ->addConnection('server3', 'http', '193.147.213.7', 7474) - ->setMasterConnection('server1') // Define the Master Connection by providing the connection alias - ->setSlaveConnection('server2') // Idem for slave connections - ->setSlaveConnection('server3') - ->enableHAMode() - ->build(); -``` - -Your configuration is now set. The client has convenience methods for HA usage, respectively `sendReadQuery` and `sendWriteQuery`. - -Automatically, write queries will be executed against the `master` connection, while `read` queries against slave connections. - -If a slave is no more reachable, it will automatically check if other slaves are configured. If yes it will attempt to send the query again -to the other slave connections. - -If you have loggers settled up, an `alert` entry will be logged to inform you of slave connection failure. - -```php - -$client->sendWriteQuery('MERGE (n:User {firstname: "Chris"})'); // Will be sent to the "server1" connection - -$client->sendReadQuery('MATCH (n:User) RETURN n'); // Will be sent to the "server2" connection -``` - -NB: The above methods do not take the `$conn` argument as the choice of the connection is done in the library internals. - -Note: You can always retrieve the Master and the first Slave connection alias from the client if you want to specify them when using other commands : - -```php - -$client->getRoot($client->getWriteConnectionAlias()); // Will be run against the master connection - -$client->listLabels($client->getReadConnectionAlias()); // Will be run agains the first found slave connection -``` - -Please also note, that when using the *Transaction Manager*, all queries will be run against the same connection. *Transaction* instances -are bounded to one and only connection. - -### Checking your Master/Slave Configuration - -You can check that your defined master and slaves connections are running and setup correctly : - -```php -$client->checkHAMaster('server1'); // Returns true|false -$client->checkHASlave('server2'); // Returns true|false -$client->checkHAAvailable('serverxxx'); // Returns master|slave|false -``` - - -### Query Mode Headers - -When the High Availibity Mode is enabled, an additional header will be set to the http request. This header defines the query mode of -the transaction : `READ` or `WRITE`. - -By default, all queries, live transactions and prepared transactions are assumed `WRITE`. - -You can define it your self by using the Client's constants `Client::NEOCLIENT_QUERY_MODE_WRITE` and `Client::NEOCLIENT_QUERY_MODE_READ` -or by simply passing a string with those values to the following methods: - -```php -$client->sendCypherQuery($query, $params, $conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_READ); - -$client->createTransaction($conn = null, Client::NEOCLIENT_QUERY_MODE_WRITE); - -$client->prepareTransaction($conn = null, Client::NEOCLIENT_QUERY_MODE_WRITE); -``` - -The default headers are the following : - -* The header key is `Neo4j-Query-Mode` -* The write transactions will have a header value of : `NEO4J_QUERY_WRITE` -* The read transactions will have a header value of : `NEO4J_QUERY_READ` - -You can define your own headers definition via the configuration : - -##### yaml - -```yaml -neoclient: - ha_mode: - enabled: true - query_mode_header_key: MY_HEADER - read_mode_header_value: QUERY_READ - write_mode_header_value: QUERY_WRITE -``` - -##### php - -```php -$client = ClientBuilder::create() - // .. other settings - ->enableHAMode() - ->configureHAQueryModeHeaders($headerKey, $writeModeHeaderValue, $readModeHeaderValue) - ->build(); -``` - -## Secured connections - -### Authenticated connection - -#### For Neo4j 2.2 - -Provide the user and the password when building the connection : - -```php -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'myserver.dev', 7474, true, 'username', 'password') - ->build(); -``` - -#### changing the password - -The client has a built-in method for changing the password : - -```php -$client->changePassword('user', 'newPassword'); -``` - -#### Before Neo4j 2.2 using the Auth Extension - -If you are using the `authenticated-extension` or using [GrapheneDB](http://graphenedb.com) instance, you can specify to use the authMode for the connection and provide your username -and password : - -```php -$client = ClientBuilder::create() - ->addConnection('default', 'http', 'myserver.dev', 7474, true, 'username', 'password') - ->build(); -``` - -Your password will automatically be encoded in base64 for the Authorization. - -### Convenience methods for the `Authentication extension` - -#### listUsers | List the users registered in the connection authentication extension - -```php -$client->listUsers(); -``` - -```json -{"john"} -``` +NB: The build method will process configuration settings and return you a `Client` instance. -#### addUser | Adds a user to the extensions - -```php -$client->addUser('John', 'password'); -``` - -```json -OK -``` - -The third argument of the `addUser` method is the `readOnly` parameter, default to false - -``` -$client->addUser('john', 'password', true); -``` - -```json -OK -{"john"} -``` - -#### removeUser | Removes a user from the extension - -```php -$client->removeUser('user', 'password'); -``` - -```json -OK -``` - -## Events & Logging - -### Event Listeners - -You can add listeners to hook into the built-in event system, for all list of all available events, look inside the -`NeoEvents.php` file. - -A listener can be a \Closure instance, an object implementing an __invoke method, -a string representing a function, or an array representing an object method or a class method. - -Event listeners are currently not configurable with the yaml file, it will come soon... - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->addEventListener('foo.action', function (Event $event)) - ->build(); -``` - -### Logging - -You can add your logging system or ask the library to use the default built-in logging mechanism (currently only stream and ChromePHP -are supported). - -If you integrate your own logging, he must be compatible with the PSR-3 standard. - -```php -// Adding your own logging -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->setLogger('app', MyLogger) // My Logger must implement Psr\Log\LoggerInterface - ->build(); -``` - -The library is shipped with two default Monolog handlers that you can use : Stream and ChromePHP. Registering them is straightforward : - -```php - -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->createDefaultStreamLogger('name', '/path/to/your/log/file.log', 'debug') - ->createDefaultChromePHPLogger('app', 'debug'); - ->build(); -``` - -## Extending NeoClient - - -### Creating your own commands - -You can extend the library by creating your own commands. - -Create your `Command` class, this class must extend `Neoxygen\NeoClient\Command\AbstractCommand` and must implement -the `execute` method. - -By extending the AbstractCommand class, you have access to the http client, and also the connection alias that is used -when invoking the command. - -The best way to execute a command is by calling the `send` request of the HttpClient and passing the `method`, `path`, -`body` and `connectionAlias` arguments : - -```php -httpClient->send($method, $path, null, $this->connection); - } -} -``` - -Then you have to register your command when building the client by passing an alias for your command and the class FQDN : - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->registerCommand('my_super_command', 'My\Command\Class\Namespace') - ->build(); -``` - -Then to use your command, just use the invoke method of the client : - -```php -$command = $client->invoke('custom_get_extensions'); -$extensions = $command->execute(); -print_r($extensions); -``` - -### Creating an Extension - -When you have a lot of commands, it may be good to create a command extension. Creating a command extension is quite simple : - -You need to create a class that extends the `Neoxygen\NeoClient\Extension\AbsractExtension`, and you have to -implement the `getAvailableCommands` method that return an array of command aliases bounded to command classes : - -```php - -use Neoxygen\NeoClient\Extension\NeoClientExtensionInterface; - -class MyExtension implements NeoClientExtensionInterface -{ - public static function getAvailableCommands() - { - return array( - 'custom_get_extensions' => 'My\Command\Class', - 'custom_other_exec' => 'My\Other\Class' - ); - } -} -``` - -And then register your extension when building the client by giving an alias and the class FQDN of your extension : - -```php -$client = ClientBuilder::create() - ->addDefaultLocalConnection() - ->registerExtension('my_extension_alias', 'My\Extension\Class\Namespace') - ->build(); -``` - -## Production settings - -The library uses a Dependency Injenction Container and service files definitions, while this provide full flexibility and -robust code, this comes at a price. - -By providing a cache path where the container and all the configuration can be dumped, you'll have the best of both worlds. - -```yaml -connections: - default: - scheme: http - host: localhost - port: 7474 - testdb: - scheme: http - host: testserver.dev - port: 7475 - -cache: - enable: true - cache_path: /dev/project/cache/ -``` - -Don't forget to add full permissions to the cache path : `chmod -R 777 your/cache/path` and also to empty the cache dir when -you do changes to your configuration. - -### Configuration Reference - -### YAML - -```yaml -connections: - default: - scheme: http - host: localhost - port: 7474 - testdb: - scheme: http - host: testserver.dev - port: 7475 - auth: true - user: user - password: password - -ha_mode: - enabled: true - type: community|enterprise - master: default - slaves: - - testdb - -auto_format_response: true - -cache: - enabled: true - cache_path: /dev/project/cache - -custom_commands: - my_command: - class: My\Command\Class - -extensions: - my_extension: - class: My\Extension\Class -``` ### License The library is released under the MIT License, refer to the LICENSE file. -### Tests - -To run the test suite, you need to copy the `tests/database_settings.yml.dist` to `tests/database_settings.yml`, as it will -create nodes to a real database. - -Run `vendor/bin/phpunit` - From 8232bd3f55f54cd36e5506afdca3e7e1ab728fb4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 00:28:05 +0100 Subject: [PATCH 048/217] simple tests and first new implementation --- README.md | 39 ++++++++++++++++++++++++++++ composer.lock | 8 +++--- src/Client.php | 15 ++++++++++- src/Connection/ConnectionManager.php | 2 +- tests/Example/ExampleTestCase.php | 34 ++++++++++++++++++++++++ tests/Example/ReadmeExampleTest.php | 34 ++++++++++++++++++++++++ 6 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 tests/Example/ExampleTestCase.php create mode 100644 tests/Example/ReadmeExampleTest.php diff --git a/README.md b/README.md index 7006bc6d..1018b470 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,45 @@ You're now ready to connect to your database. NB: The build method will process configuration settings and return you a `Client` instance. +### Basic Usage + +#### Sending a Cypher Query + +```php +$client->run("CREATE (n:Person)"); +``` + +#### Sending a Cypher Query with parameters + +```php +$client->run("CREATE (n:Person) SET n += {infos}", ['infos' => ['name' => 'Ales', 'age' => 34]]); +``` + +#### Reading a Result + +```php +$result = $client->run("MATCH (n:Person) RETURN n"; +// a result contains always a collection (array) of Record objects + +// get all records +$records = $result->getRecords(); + +// get the first or (if expected only one) the only record + +$record = $result->getRecord(); +``` + +A `Record` object contains the values of one record from your Cypher query : + +```php +$query = "MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name, collect(friend) as friends"; +$result = $client->run($query); + +foreach ($result->getRecords() as $record) { + echo sprintf('Person name is : %s and has %d number of friends', $record->value('name'), count($record->value('friends')); +} +``` + ### License diff --git a/composer.lock b/composer.lock index f6196257..fb3922ee 100644 --- a/composer.lock +++ b/composer.lock @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61" + "reference": "5a1ed78a297695f1e30ae0ada1b3183b5e2107fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", - "reference": "77ad20fdbcfa29b66b19b8b9d86aa3f98b905b61", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/5a1ed78a297695f1e30ae0ada1b3183b5e2107fd", + "reference": "5a1ed78a297695f1e30ae0ada1b3183b5e2107fd", "shasum": "" }, "require": { @@ -55,7 +55,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-05 13:41:25" + "time": "2016-01-10 23:26:20" }, { "name": "graphaware/neo4j-common", diff --git a/src/Client.php b/src/Client.php index 368f38de..bedc2823 100644 --- a/src/Client.php +++ b/src/Client.php @@ -28,8 +28,21 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche $this->eventDispatcher = $eventDispatcher; } - public static function create() + /** + * @param $query + * @param null $parameters + * @param null $tag + * @param null $connectionAlias + * + * @return \GraphAware\Bolt\Result\Result + */ + public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { + $connection = $this->connectionManager->getConnection($connectionAlias); + $session = $connection->getDriver()->session(); + $params = is_array($parameters) ? $parameters : array(); + + return $session->run($query, $params); } } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 67b91ee3..ac944b9d 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -59,7 +59,7 @@ public function registerConnection(Connection $connection) /** * @param string|null $alias The connection's alias * - * @return \GraphAware\Neo4j\Connection\Connection The requested connection + * @return \GraphAware\Neo4j\Client\Connection\Connection The requested connection * * @throws InvalidConnectionException When the connection does not exist */ diff --git a/tests/Example/ExampleTestCase.php b/tests/Example/ExampleTestCase.php new file mode 100644 index 00000000..055cd6e7 --- /dev/null +++ b/tests/Example/ExampleTestCase.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Tests\Example; + +use GraphAware\Neo4j\Client\ClientBuilder; + +abstract class ExampleTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * @var \GraphAware\Neo4j\Client\Client + */ + protected $client; + + public function setUp() + { + $this->client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->build(); + } + + public function emptyDB() + { + $this->client->run("MATCH (n) DETACH DELETE n"); + } +} \ No newline at end of file diff --git a/tests/Example/ReadmeExampleTest.php b/tests/Example/ReadmeExampleTest.php new file mode 100644 index 00000000..deab72ff --- /dev/null +++ b/tests/Example/ReadmeExampleTest.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Tests\Example; + +class ReadmeExamleTest extends ExampleTestCase +{ + public function testReadingAResult() + { + $this->emptyDB(); + $this->client->run("CREATE (n:Person {name: {name} }) + CREATE (n2:Person {name: {friend_name} }) + CREATE (n)-[:FOLLOWS]->(n2)", [ + 'name' => 'Chris', + 'friend_name' => 'Ales' + ]); + + $result = $this->client->run("MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name as name, collect(friend) as friends"); + $this->assertCount(1, $result->getRecords()); + + $record = $result->getRecord(); + $this->assertEquals('Chris', $record->value('name')); + $this->assertCount(1, $record->value('friends')); + $this->assertEquals('Ales', $record->value('friends')[0]->value('name')); + } +} \ No newline at end of file From 9536957f0134d75743a00eb0517df013ca45eebd Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 00:33:19 +0100 Subject: [PATCH 049/217] build config for travis --- .travis.yml | 21 ++++++++------------- build/install-jdk8.sh | 11 +++++++++++ build/install-neo.sh | 11 +++++++++++ 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100755 build/install-jdk8.sh create mode 100755 build/install-neo.sh diff --git a/.travis.yml b/.travis.yml index 5d825b1f..17573cf6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,23 +4,18 @@ php: - 5.6 - 7.0 -env: - - NEO_VERSION="2.3.0" - - NEO_VERSION="3.0.0-M02" - before_install: - - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - - neo4j-enterprise-$NEO_VERSION/bin/neo4j start > null - - composer self-update - -before_script: + - sudo apt-get update > /dev/null + # install Oracle JDK8 + - sh -c ./build/install-jdk8.sh + # install and launch neo4j + - sh -c ./build/install-neo.sh - composer install --prefer-source --no-interaction - - mv tests/database_settings.yml.dist tests/database_settings.yml + - composer self-update script: - - ./tests/setNeoToken.sh - - vendor/bin/phpunit + - vendor/bin/phpunit --exclude-group fail + - vendor/bin/behat notifications: email: "christophe@graphaware.com" diff --git a/build/install-jdk8.sh b/build/install-jdk8.sh new file mode 100755 index 00000000..8b08600d --- /dev/null +++ b/build/install-jdk8.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Get dependencies (for adding repos) +sudo apt-get install -y python-software-properties +sudo add-apt-repository -y ppa:webupd8team/java +sudo apt-get update + +# install oracle jdk 8 +sudo apt-get install -y oracle-java8-installer +sudo update-alternatives --auto java +sudo update-alternatives --auto javac \ No newline at end of file diff --git a/build/install-neo.sh b/build/install-neo.sh new file mode 100755 index 00000000..8958b8e3 --- /dev/null +++ b/build/install-neo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +export JAVA_HOME=/usr/lib/jvm/java-8-oracle +export JRE_HOME=/usr/lib/jvm/java-8-oracle + +wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-M02-unix.tar.gz > null +mkdir neo +tar xzf neo4j-enterprise-3.0.0-M02-unix.tar.gz -C neo --strip-components=1 > null +sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j-server.properties +neo/bin/neo4j start > null & +#mv neo/conf/ssl/snakeoil.cert neo/conf/ssl/snakeoil.pem \ No newline at end of file From 9f5f256400fb9e0edbe2c2153a0643dd61c28d78 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 00:34:54 +0100 Subject: [PATCH 050/217] removed sudo false --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 17573cf6..b68e783a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: php -sudo: false php: - 5.6 - 7.0 From fa81017d3f42a472f106347cccee99289fe46422 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 00:44:40 +0100 Subject: [PATCH 051/217] behat is not yet used in the test suite --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b68e783a..ff965f62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: script: - vendor/bin/phpunit --exclude-group fail - - vendor/bin/behat + # - vendor/bin/behat notifications: email: "christophe@graphaware.com" From 0e898eaf953acab3d282d389dcd27eb5f23ddf0f Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 03:07:32 +0100 Subject: [PATCH 052/217] multi-protocol first step --- composer.lock | 8 +- src/Client.php | 15 +++- src/ClientBuilder.php | 10 ++- src/Exception/Neo4jException.php | 23 +++-- src/Formatter/RecordView.php | 10 +-- src/Formatter/Response.php | 11 ++- src/Formatter/ResponseFormatter.php | 4 +- src/Formatter/Result.php | 6 +- src/Formatter/Type/Node.php | 11 ++- src/Formatter/Type/Relationship.php | 11 ++- src/HttpDriver/Driver.php | 35 ++++++++ src/HttpDriver/GraphDatabase.php | 24 +++++ src/HttpDriver/Session.php | 89 +++++++++++++++++++ .../ClientGetExceptionIntegrationTest.php | 27 ++++++ 14 files changed, 259 insertions(+), 25 deletions(-) create mode 100644 src/HttpDriver/Driver.php create mode 100644 src/HttpDriver/GraphDatabase.php create mode 100644 src/HttpDriver/Session.php create mode 100644 tests/Integration/ClientGetExceptionIntegrationTest.php diff --git a/composer.lock b/composer.lock index fb3922ee..35482dc9 100644 --- a/composer.lock +++ b/composer.lock @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "5a1ed78a297695f1e30ae0ada1b3183b5e2107fd" + "reference": "7fc4be8286ffe41a33fbfea92bdadc35698ab969" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/5a1ed78a297695f1e30ae0ada1b3183b5e2107fd", - "reference": "5a1ed78a297695f1e30ae0ada1b3183b5e2107fd", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/7fc4be8286ffe41a33fbfea92bdadc35698ab969", + "reference": "7fc4be8286ffe41a33fbfea92bdadc35698ab969", "shasum": "" }, "require": { @@ -55,7 +55,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-10 23:26:20" + "time": "2016-01-11 01:04:12" }, { "name": "graphaware/neo4j-common", diff --git a/src/Client.php b/src/Client.php index bedc2823..6f2ff67a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,7 +11,9 @@ namespace GraphAware\Neo4j\Client; +use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\Exception\Neo4jException; use Symfony\Component\EventDispatcher\EventDispatcher; class Client @@ -43,6 +45,17 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = $session = $connection->getDriver()->session(); $params = is_array($parameters) ? $parameters : array(); - return $session->run($query, $params); + try { + return $session->run($query, $params); + } catch (\Exception $e) { + if ($e instanceof MessageFailureException) { + $exc = new Neo4jException($e->getMessage()); + $exc->setNeo4jStatusCode($e->getStatusCode()); + + throw $exc; + } else { + throw $e; + } + } } } diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 015d17e0..aaf712f7 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -11,7 +11,8 @@ namespace GraphAware\Neo4j\Client; -use GraphAware\Bolt\GraphDatabase; +use GraphAware\Bolt\GraphDatabase as BoltDatabase; +use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpDatabase; use Symfony\Component\EventDispatcher\EventDispatcher; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\Connection\Connection; @@ -34,7 +35,12 @@ public static function create() public function addConnection($alias, $uri) { - $this->connectionManager->registerConnection(new Connection($alias, GraphDatabase::driver($uri))); + if (preg_match('/http/', $uri)) { + $driver = HttpDatabase::driver($uri); + } else { + $driver = BoltDatabase::driver($uri); + } + $this->connectionManager->registerConnection(new Connection($alias, $driver)); return $this; } diff --git a/src/Exception/Neo4jException.php b/src/Exception/Neo4jException.php index 9c7e1a31..621179db 100644 --- a/src/Exception/Neo4jException.php +++ b/src/Exception/Neo4jException.php @@ -11,8 +11,21 @@ namespace GraphAware\Neo4j\Client\Exception; -abstract class Neo4jException extends \Exception implements Neo4jExceptionInterface +class Neo4jException extends \Exception implements Neo4jExceptionInterface { + /** + * @var string + */ + protected $statusCode; + + /** + * @param string $code + */ + public function setNeo4jStatusCode($code) + { + $this->statusCode = $code; + } + /** * @return string */ @@ -39,11 +52,11 @@ public function effect() */ public function classification() { - $parts = explode('.', $this->getMessage()); - if (!isset($parts[2])) { - throw new \InvalidArgumentException(sprintf('Could not parse exception message "%"', $this->getMessage())); + $parts = explode('.', $this->statusCode); + if (!isset($parts[1])) { + throw new \InvalidArgumentException(sprintf('Could not parse exception classification "%"', $this->statusCode)); } - return $parts[2]; + return $parts[1]; } } \ No newline at end of file diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index aad0424b..39ee7e8e 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient\Formatter; +namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Result\RecordViewInterface; use GraphAware\Common\Type\NodeInterface; @@ -64,7 +64,7 @@ public function hasValues() /** * @param $key - * @return mixed|\Neoxygen\NeoClient\Formatter\Node|\Neoxygen\NeoClient\Formatter\Relationship + * @return mixed|\GraphAware\Neo4j\Client\Formatter\Node|\GraphAware\Neo4j\Client\Formatter\Relationship */ public function value($key) { @@ -75,7 +75,7 @@ public function value($key) * Returns the Node for value $key. Ease IDE integration * * @param $key - * @return \Neoxygen\NeoClient\Formatter\Node + * @return \GraphAware\Neo4j\Client\Formatter\Node * * @throws \InvalidArgumentException When the value is not null or instance of Node */ @@ -90,7 +90,7 @@ public function nodeValue($key) /** * @param $key - * @return \Neoxygen\NeoClient\Formatter\Relationship + * @return \GraphAware\Neo4j\Client\Formatter\Relationship * * @throws \InvalidArgumentException When the value is not null or instance of Relationship */ @@ -123,7 +123,7 @@ public function valueByIndex($index) } /** - * @return \Neoxygen\NeoClient\Formatter\RecordView + * @return \GraphAware\Neo4j\Client\Formatter\RecordView */ public function record() { diff --git a/src/Formatter/Response.php b/src/Formatter/Response.php index af9e3090..fee5bfd2 100644 --- a/src/Formatter/Response.php +++ b/src/Formatter/Response.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Formatter; class Response { diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 33d67212..a225ca7e 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Neoxygen\NeoClient\Formatter; +namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Cypher\Statement; -class ResponseFormatter implements ResponseFormatterInterface +class ResponseFormatter { /** * Returns the Neo4j API ResultDataContent to be used during Cypher queries. diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 87a28189..12bda255 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -1,10 +1,10 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\NodeInterface; diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index 75069364..b9b69ae9 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\RelationshipInterface; diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php new file mode 100644 index 00000000..e85b290f --- /dev/null +++ b/src/HttpDriver/Driver.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver; + +use GraphAware\Common\Driver\DriverInterface; +use GuzzleHttp\Client; + +class Driver implements DriverInterface +{ + protected $uri; + + public function __construct($uri) + { + $this->uri = $uri; + } + + function session() + { + return new Session($this->uri, new Client()); + } + + function getUri() + { + return $this->uri; + } +} \ No newline at end of file diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php new file mode 100644 index 00000000..71a6ba26 --- /dev/null +++ b/src/HttpDriver/GraphDatabase.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver; + +use GraphAware\Common\Driver\ConfigInterface; +use GraphAware\Common\GraphDatabaseInterface; + +class GraphDatabase implements GraphDatabaseInterface +{ + static function driver($uri, ConfigInterface $config = null) + { + return new Driver($uri); + } + +} \ No newline at end of file diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php new file mode 100644 index 00000000..60299ba9 --- /dev/null +++ b/src/HttpDriver/Session.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver; + +use GraphAware\Common\Driver\SessionInterface; +use GraphAware\Neo4j\Client\Connection\Connection; +use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; +use GuzzleHttp\Client; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\Request; + +class Session implements SessionInterface +{ + protected $uri; + + protected $httpClient; + + protected $responseFormatter; + + public function __construct($uri, Client $httpClient) + { + $this->uri = $uri; + $this->httpClient = $httpClient; + $this->responseFormatter = new ResponseFormatter(); + } + + public function run($statement, $parameters, $tag = null) + { + $request = $this->prepareRequest($statement, $parameters); + + try { + $response = $this->httpClient->send($request); + + echo (string) $response->getBody(); + + return $this->responseFormatter->format(json_decode($response->getBody(), true)); + } catch (RequestException $e) { + throw $e; + } + } + + public function close() + { + // + } + + public function prepareRequest($statement, $parameters) + { + $info = parse_url($this->uri); + $host = sprintf('%s://%s:%d/db/data/transaction/commit', $info['scheme'], $info['host'], $info['port']); + $statements = [ + 'statements' => [] + ]; + $st = [ + 'statement' => $statement, + 'resultDataContents' => ['REST'], + 'includeStats' => true + ]; + + if (is_array($parameters) && !empty($parameters)) { + $st['parameters'] = $parameters; + } + + $statements['statements'][] = $st; + + $headers = [ + [ + 'X-Stream' => true, + 'Content-Type' => 'application/json' + ] + ]; + + $request = new Request("POST", $host, $headers, json_encode($statements)); + + echo (string) $request->getBody(); + + return $request; + } + +} \ No newline at end of file diff --git a/tests/Integration/ClientGetExceptionIntegrationTest.php b/tests/Integration/ClientGetExceptionIntegrationTest.php new file mode 100644 index 00000000..7cf5f1a9 --- /dev/null +++ b/tests/Integration/ClientGetExceptionIntegrationTest.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Tests\Integration; + +use GraphAware\Neo4j\Client\ClientBuilder; + +class ClientGetExceptionIntegrationTest extends \PHPUnit_Framework_TestCase +{ + public function testExceptionHandling() + { + $client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->build(); + + $result = $client->run("CREATE (n:Cool"); + + } +} \ No newline at end of file From de84be014c9d3984114c85886db358a4d561ead6 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 03:09:26 +0100 Subject: [PATCH 053/217] added expected exception to test --- tests/Integration/ClientGetExceptionIntegrationTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Integration/ClientGetExceptionIntegrationTest.php b/tests/Integration/ClientGetExceptionIntegrationTest.php index 7cf5f1a9..9dee502c 100644 --- a/tests/Integration/ClientGetExceptionIntegrationTest.php +++ b/tests/Integration/ClientGetExceptionIntegrationTest.php @@ -12,6 +12,7 @@ namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; +use GraphAware\Neo4j\Client\Exception\Neo4jException; class ClientGetExceptionIntegrationTest extends \PHPUnit_Framework_TestCase { @@ -21,7 +22,7 @@ public function testExceptionHandling() ->addConnection('default', 'bolt://localhost') ->build(); + $this->setExpectedException(Neo4jException::class); $result = $client->run("CREATE (n:Cool"); - } } \ No newline at end of file From c49cb4c9f392637b9507b8ff12c24c404a72c013 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 03:36:28 +0100 Subject: [PATCH 054/217] updateStatistics in HttpDriver --- src/Formatter/ResponseFormatter.php | 24 +- src/Formatter/Result.php | 16 ++ src/HttpDriver/Result/ResultSummary.php | 48 ++++ src/HttpDriver/Result/StatementStatistics.php | 206 ++++++++++++++++++ src/HttpDriver/Session.php | 7 +- 5 files changed, 283 insertions(+), 18 deletions(-) create mode 100644 src/HttpDriver/Result/ResultSummary.php create mode 100644 src/HttpDriver/Result/StatementStatistics.php diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index a225ca7e..f448865c 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -15,32 +15,26 @@ class ResponseFormatter { - /** - * Returns the Neo4j API ResultDataContent to be used during Cypher queries. - * - * @return array - */ - public static function getDefaultResultDataContents() - { - return array('rest'); - } - /** * Formats the Neo4j Response. * - * @param $response + * @param array $response + * @param \GraphAware\Common\Cypher\Statement[] $statements * - * @return \Neoxygen\NeoClient\Formatter\Result[] + * @return \GraphAware\Neo4j\Client\Formatter\Result[] */ - public function format($response) + public function format(array $response, array $statements) { $results = []; - foreach ($response['results'] as $result) { - $resultO = new Result(Statement::create("")); + foreach ($response['results'] as $k => $result) { + $resultO = new Result($statements[$k]); $resultO->setFields($result['columns']); foreach ($result['data'] as $data) { $resultO->pushRecord($data['rest']); } + if (array_key_exists('stats', $result)) { + $resultO->setStats($result['stats']); + } $results[] = $resultO; } diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 12bda255..d76b55e3 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -5,6 +5,9 @@ use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Neo4j\Client\Formatter\Type\Node; use GraphAware\Neo4j\Client\Formatter\Type\Relationship; +use GraphAware\Common\Cypher\StatementInterface; +use GraphAware\Neo4j\Client\HttpDriver\Result\ResultSummary; +use GraphAware\Neo4j\Client\HttpDriver\Result\StatementStatistics; class Result extends AbstractRecordCursor { @@ -18,6 +21,14 @@ class Result extends AbstractRecordCursor */ protected $fields = []; + protected $resultSummary; + + public function __construct(StatementInterface $statement) + { + $this->resultSummary = new ResultSummary($statement); + parent::__construct($statement); + } + public function setFields(array $fields) { $this->fields = $fields; @@ -29,6 +40,11 @@ public function pushRecord($data) $this->records[] = new RecordView($this->fields, $mapped); } + public function setStats(array $stats) + { + $this->resultSummary->setStatistics(new StatementStatistics($stats)); + } + /** * @return \GraphAware\Common\Result\RecordViewInterface[] */ diff --git a/src/HttpDriver/Result/ResultSummary.php b/src/HttpDriver/Result/ResultSummary.php new file mode 100644 index 00000000..3a03c59e --- /dev/null +++ b/src/HttpDriver/Result/ResultSummary.php @@ -0,0 +1,48 @@ +statement = $statement; + } + + public function statement() + { + return $this->statement; + } + + public function updateStatistics() + { + return $this->updateStatistics; + } + + public function notifications() + { + return $this->notifications; + } + + public function statementType() + { + return $this->type; + } + + public function setStatistics(StatementStatistics $statistics) + { + $this->updateStatistics = $statistics; + } + +} \ No newline at end of file diff --git a/src/HttpDriver/Result/StatementStatistics.php b/src/HttpDriver/Result/StatementStatistics.php new file mode 100644 index 00000000..d2c9bb7f --- /dev/null +++ b/src/HttpDriver/Result/StatementStatistics.php @@ -0,0 +1,206 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver\Result; + +use GraphAware\Common\Result\StatementStatisticsInterface; + +class StatementStatistics implements StatementStatisticsInterface +{ + /** + * @var int + */ + protected $nodesCreated = 0; + + /** + * @var int + */ + protected $nodesDeleted = 0; + + /** + * @var int + */ + protected $relationshipsCreated = 0; + + /** + * @var int + */ + protected $relationshipsDeleted = 0; + + /** + * @var int + */ + protected $propertiesSet = 0; + + /** + * @var int + */ + protected $labelsAdded = 0; + + /** + * @var int + */ + protected $labelsRemoved = 0; + + /** + * @var int + */ + protected $indexesAdded = 0; + + /** + * @var int + */ + protected $indexesRemoved = 0; + + /** + * @var int + */ + protected $constraintsAdded = 0; + + /** + * @var int + */ + protected $constraintsRemoved = 0; + + /** + * @var bool + */ + protected $containsUpdates = false; + + /** + * @param array $statistics + */ + public function __construct(array $statistics = array()) + { + $keys = [ + 'contains_updates', 'nodes_created', 'nodes_deleted', 'properties_set', 'labels_added', 'labels_removed', + 'indexes_added', 'indexes_removed', 'constraints_added', 'constraints_removed', 'relationship_deleted', + 'relationships_created' + ]; + + foreach ($statistics as $key => $value) { + if (!in_array($key, $keys)) { + throw new \InvalidArgumentException(sprintf('Key %s is invalid in statement statistics', $key)); + } + $k = $this->toCamelCase($key); + $this->$k = $value; + } + } + + /** + * @return bool + */ + public function containsUpdates() + { + return (bool) $this->containsUpdates; + } + + /** + * @return int + */ + public function nodesCreated() + { + return $this->nodesCreated; + } + + /** + * @return int + */ + public function nodesDeleted() + { + return $this->nodesDeleted; + } + + /** + * @return int + */ + public function relationshipsCreated() + { + return $this->relationshipsCreated; + } + + /** + * @return int + */ + public function relationshipsDeleted() + { + return $this->relationshipsDeleted; + } + + /** + * @return int + */ + public function propertiesSet() + { + return $this->propertiesSet; + } + + /** + * @return int + */ + public function labelsAdded() + { + return $this->labelsAdded; + } + + /** + * @return int + */ + public function labelsRemoved() + { + return $this->labelsRemoved; + } + + /** + * @return int + */ + public function indexesAdded() + { + return $this->indexesAdded; + } + + /** + * @return int + */ + public function indexesRemoved() + { + return $this->labelsRemoved; + } + + /** + * @return int + */ + public function constraintsAdded() + { + return $this->constraintsAdded; + } + + /** + * @return int + */ + public function constraintsRemoved() + { + return $this->constraintsRemoved; + } + + /** + * @param $key + * @return string + */ + private function toCamelCase($key) + { + list($start, $end) = explode('_', $key); + $str = strtolower($start) . ucfirst($end); + + return $str; + } + +} \ No newline at end of file diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 60299ba9..5242a275 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Driver\SessionInterface; use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; @@ -35,14 +36,14 @@ public function __construct($uri, Client $httpClient) public function run($statement, $parameters, $tag = null) { + $st = Statement::create($statement, $parameters, $tag); $request = $this->prepareRequest($statement, $parameters); try { $response = $this->httpClient->send($request); + $results = $this->responseFormatter->format(json_decode($response->getBody(), true), array($st)); - echo (string) $response->getBody(); - - return $this->responseFormatter->format(json_decode($response->getBody(), true)); + return $results[0]; } catch (RequestException $e) { throw $e; } From f30d2ac00d445306a95171f6c90290ad11a577d8 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 11 Jan 2016 22:50:01 +0100 Subject: [PATCH 055/217] removed unused use statement --- src/HttpDriver/Session.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 5242a275..2029ce0b 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -13,7 +13,6 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Driver\SessionInterface; -use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; From 9ae42d9116a2720b9152eb36ef19a20b4b7624fd Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 00:31:13 +0100 Subject: [PATCH 056/217] connection manager progress --- src/Client.php | 50 +++---- src/ClientBuilder.php | 26 ++-- src/Config.php | 38 +++++ src/Connection/Connection.php | 50 +++++-- src/Connection/ConnectionManager.php | 212 +-------------------------- src/HttpDriver/Session.php | 24 ++- 6 files changed, 145 insertions(+), 255 deletions(-) create mode 100644 src/Config.php diff --git a/src/Client.php b/src/Client.php index 6f2ff67a..64f98155 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,30 +11,27 @@ namespace GraphAware\Neo4j\Client; -use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\Connection\ConnectionManager; -use GraphAware\Neo4j\Client\Exception\Neo4jException; -use Symfony\Component\EventDispatcher\EventDispatcher; class Client { const NEOCLIENT_VERSION = '4.0.0'; + /** + * @var \GraphAware\Neo4j\Client\Connection\ConnectionManager + */ protected $connectionManager; - protected $eventDispatcher; - - public function __construct(ConnectionManager $connectionManager, EventDispatcher $eventDispatcher) + public function __construct(ConnectionManager $connectionManager) { $this->connectionManager = $connectionManager; - $this->eventDispatcher = $eventDispatcher; } /** * @param $query - * @param null $parameters - * @param null $tag - * @param null $connectionAlias + * @param null|array $parameters + * @param null|string $tag + * @param null|string $connectionAlias * * @return \GraphAware\Bolt\Result\Result */ @@ -42,20 +39,23 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = { $connection = $this->connectionManager->getConnection($connectionAlias); - $session = $connection->getDriver()->session(); - $params = is_array($parameters) ? $parameters : array(); - - try { - return $session->run($query, $params); - } catch (\Exception $e) { - if ($e instanceof MessageFailureException) { - $exc = new Neo4jException($e->getMessage()); - $exc->setNeo4jStatusCode($e->getStatusCode()); - - throw $exc; - } else { - throw $e; - } - } + return $connection->run($query, $parameters, $tag); + } + + /** + * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. + * + * @param $query + * @param null|array $parameters + * @param null|string $tag + * @param null|string $connectionAlias + * + * @return \GraphAware\Bolt\Result\Result + */ + public function sendCypherQuery($query, $parameters = null, $tag = null, $connectionAlias = null) + { + $connection = $this->connectionManager->getConnection($connectionAlias); + + return $connection->run($query, $parameters, $tag); } } diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index aaf712f7..3d774aef 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -11,21 +11,19 @@ namespace GraphAware\Neo4j\Client; -use GraphAware\Bolt\GraphDatabase as BoltDatabase; -use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpDatabase; -use Symfony\Component\EventDispatcher\EventDispatcher; use GraphAware\Neo4j\Client\Connection\ConnectionManager; -use GraphAware\Neo4j\Client\Connection\Connection; class ClientBuilder { + const PREFLIGHT_ENV_DEFAULT = 'NEO4J_DB_VERSION'; + protected $config = []; protected $connectionManager; public function __construct() { - $this->connectionManager = new ConnectionManager(); + $this->config['connection_manager']['preflight_env'] = self::PREFLIGHT_ENV_DEFAULT; } public static function create() @@ -35,18 +33,22 @@ public static function create() public function addConnection($alias, $uri) { - if (preg_match('/http/', $uri)) { - $driver = HttpDatabase::driver($uri); - } else { - $driver = BoltDatabase::driver($uri); - } - $this->connectionManager->registerConnection(new Connection($alias, $driver)); + $this->config['connections'][$alias]['uri'] = $uri; return $this; } + public function preflightEnv($variable) + { + $this->config['connection_manager']['preflight_env'] = $variable; + } + public function build() { - return new Client($this->connectionManager, new EventDispatcher()); + $this->connectionManager = new ConnectionManager(); + foreach ($this->config['connections'] as $alias => $conn) { + $this->connectionManager->registerConnection($alias, $conn['uri']); + } + return new Client($this->connectionManager); } } diff --git a/src/Config.php b/src/Config.php new file mode 100644 index 00000000..2973b46c --- /dev/null +++ b/src/Config.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client; + +class Config +{ + protected $defaultHttpPort = 7474; + + protected $defaultTcpPort = 8687; + + public static function create() + { + return new self(); + } + + public function withDefaultHttpPort($port) + { + $this->defaultHttpPort = (int) $port; + + return $this; + } + + public function withDefaultTcpPort($port) + { + $this->defaultTcpPort = (int) $port; + + return $this; + } +} \ No newline at end of file diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 859d7a85..1bf82826 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -11,7 +11,10 @@ namespace GraphAware\Neo4j\Client\Connection; -use GraphAware\Common\Driver\DriverInterface; +use GraphAware\Bolt\GraphDatabase as BoltGraphDB; +use GraphAware\Neo4j\Client\Exception\Neo4jException; +use GraphAware\Bolt\Exception\MessageFailureException; +use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; class Connection { @@ -21,20 +24,26 @@ class Connection private $alias; /** - * @var \GraphAware\Common\Driver\DriverInterface + * @var string + */ + private $uri; + + /** + * @var \GraphAware\Common\Driver\DriverInterface The configured driver */ private $driver; /** * Connection constructor. * - * @param $alias - * @param \GraphAware\Common\Driver\DriverInterface $driver + * @param string $alias + * @param string $uri */ - public function __construct($alias, DriverInterface $driver) + public function __construct($alias, $uri) { $this->alias = (string) $alias; - $this->driver = $driver; + $this->uri = (string) $uri; + $this->buildDriver(); } /** @@ -45,11 +54,30 @@ public function getAlias() return $this->alias; } - /** - * @return \GraphAware\Common\Driver\DriverInterface - */ - public function getDriver() + public function buildDriver() { - return $this->driver; + if (preg_match('/bolt/', $this->uri)) { + $this->driver = BoltGraphDB::driver($this->uri); + } elseif (preg_match('/http/', $this->uri)) { + $this->driver = HttpGraphDB::driver($this->uri); + } else { + throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); + } + } + + public function run($statement, $parameters, $tag) + { + $parameters = is_array($parameters) ? $parameters : array(); + $session = $this->driver->session(); + try { + $results = $session->run($statement, $parameters, $tag); + + return $results; + } catch (MessageFailureException $e) { + $exception = new Neo4jException($e->getMessage()); + $exception->setNeo4jStatusCode($e->getStatusCode()); + + throw $e; + } } } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index ac944b9d..855a159e 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -19,222 +19,24 @@ class ConnectionManager /** * @var array Array of all registered connections */ - private $connections; + private $connections = []; - /** - * @var string The alias of the default connection - */ - private $defaultConnection; - - private $master; - - private $slaves = []; - - /** - * Initialize connections array. - */ - public function __construct() - { - $this->connections = array(); - } - - /** - * @return array An array of the registered connections with the form 'alias' => Connection Object - */ - public function getConnections() - { - return $this->connections; - } - - /** - * Register a new Collection. - * - * @param Connection $connection - */ - public function registerConnection(Connection $connection) + public function registerConnection($alias, $uri, $config = null) { - $this->connections[$connection->getAlias()] = $connection; + $this->connections[$alias] = new Connection($alias, $uri, $config); } - /** - * @param string|null $alias The connection's alias - * - * @return \GraphAware\Neo4j\Client\Connection\Connection The requested connection - * - * @throws InvalidConnectionException When the connection does not exist - */ public function getConnection($alias = null) { - $message = null; - - if (null === $alias && empty($this->connections)) { - $message = sprintf('There is no connection configured'); - } elseif (null !== $alias && !array_key_exists($alias, $this->connections)) { - $message = sprintf('The connection with alias "%s" is not configured', $alias); - } - if ($message) { - throw new InvalidConnectionException($message); - } - if (null === $alias) { - return $this->getDefaultConnection(); + list($a) = array_keys($this->connections); + return $this->connections[$a]; } - return $this->connections[$alias]; - } - - /** - * @return \GraphAware\Neo4j\Connection\Connection The default Connection if defined, the first connection in the connections array otherwise - * - * @throws \Neoxygen\NeoClient\Exception\InvalidConnectionException If no connections are configured - */ - public function getDefaultConnection() - { - if (!$this->defaultConnection && empty($this->connections)) { - throw new InvalidConnectionException('There are no connections configured'); - } - - if (!$this->defaultConnection) { - reset($this->connections); - - return current($this->connections); - } - - return $this->getConnection($this->defaultConnection); - } - - /** - * @param string $alias The alias of the connection to be set as default - */ - public function setDefaultConnection($alias) - { if (!array_key_exists($alias, $this->connections)) { - throw new InvalidConnectionException(sprintf('The connection "%s" is not configured', $alias)); - } - - $this->defaultConnection = $alias; - } - - /** - * Returns whether or not a connection exist for a given alias. - * - * @param string $alias The connection's alias to verify the existence - * - * @return bool - */ - public function hasConnection($alias) - { - return array_key_exists($alias, $this->connections); - } - - public function setMasterConnection($connectionAlias) - { - if (!array_key_exists($connectionAlias, $this->connections)) { - throw new InvalidConnectionException(sprintf('The connection "%s" is not configured', $alias)); - } - - $this->master = $connectionAlias; - } - - public function setSlaveConnections(array $slaves) - { - foreach ($slaves as $connectionAlias) { - if (!array_key_exists($connectionAlias, $this->connections)) { - throw new InvalidConnectionException(sprintf('The connection "%s" is not configured', $alias)); - } - $this->slaves[] = $connectionAlias; - } - } - - public function getWriteConnection() - { - if (null !== $this->master) { - return $this->getMasterConnection(); - } - - return $this->getConnection(); - } - - public function getReadConnection() - { - if (null !== $this->master && !empty($this->slaves)) { - return $this->getConnection(current($this->slaves)); - } - - return $this->getConnection(); - } - - public function getMasterConnection() - { - if (null !== $this->master) { - return $this->getConnection($this->master); + throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', $alias)); } - return; - } - - public function isHA() - { - if (null !== $this->master && !empty($this->slaves)) { - return true; - } - - return false; - } - - public function hasNextSlave(array $usedSlaves) - { - if (count($this->slaves) > count($usedSlaves)) { - return true; - } - - return false; - } - - public function getNextSlave(array $usedSlaves) - { - foreach ($this->slaves as $slave) { - if (!in_array($slave, $usedSlaves)) { - return $slave; - } - } - - throw new HttpException('There are no more slaves to process'); - } - - public function getSlaves() - { - return $this->slaves; - } - - public function getHAConfig() - { - if (null !== $this->master && !empty($this->slaves)) { - return array( - 'master' => $this->master, - 'slaves' => $this->slaves, - ); - } - - return; - } - - public function getConnectionAliases() - { - $aliases = []; - foreach ($this->connections as $k => $c) { - $aliases[$k] = $k; - } - - return $aliases; - } - - public function getMasterConnectionAlias() - { - if ($this->isHA()) { - return $this->getMasterConnection()->getAlias(); - } - - return; + return $this->connections[$alias]; } } diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 2029ce0b..0da832f8 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -13,6 +13,7 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Driver\SessionInterface; +use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; @@ -44,6 +45,18 @@ public function run($statement, $parameters, $tag = null) return $results[0]; } catch (RequestException $e) { + if ($e->hasResponse()) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; + } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); + + throw $exception; + } + throw $e; } } @@ -72,14 +85,21 @@ public function prepareRequest($statement, $parameters) $statements['statements'][] = $st; - $headers = [ + $options = []; + $options['headers'] = [ [ 'X-Stream' => true, 'Content-Type' => 'application/json' ] ]; - $request = new Request("POST", $host, $headers, json_encode($statements)); + if (isset($info['user']) && isset($info['pass'])) { + $options['auth'] = [$info['user'], $info['pass']]; + } + + $options['json'] = $st; + + $request = new Request("POST", sprintf('%s/db/data/transaction/commit', $this->uri), $options['headers'], json_encode($statements)); echo (string) $request->getBody(); From 2b2016541ea0e8474eabe9ea0c438bff979630e9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 00:56:38 +0100 Subject: [PATCH 057/217] adapted tests --- src/Connection/Connection.php | 10 +++++++++- tests/Unit/Connection/ConnectionUnitTest.php | 8 +++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 1bf82826..c6ec40ce 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -65,6 +65,14 @@ public function buildDriver() } } + /** + * @return \GraphAware\Common\Driver\DriverInterface + */ + public function getDriver() + { + return $this->driver; + } + public function run($statement, $parameters, $tag) { $parameters = is_array($parameters) ? $parameters : array(); @@ -77,7 +85,7 @@ public function run($statement, $parameters, $tag) $exception = new Neo4jException($e->getMessage()); $exception->setNeo4jStatusCode($e->getStatusCode()); - throw $e; + throw $exception; } } } diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index 916def65..b13fe9fb 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -5,6 +5,7 @@ use GraphAware\Common\Driver\Protocol; use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\Tests\Unit\Stub\DummyDriver; +use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; /** * @group unit @@ -14,10 +15,7 @@ class ConnectionUnitTest extends \PHPUnit_Framework_TestCase { public function testConnectionInstantiation() { - $driver = new DummyDriver('localhost', Protocol::HTTPS); - $connection = new Connection('default', $driver); - - $this->assertEquals($driver, $connection->getDriver()); - $this->assertEquals('default', $connection->getAlias()); + $connection = new Connection('default', 'http://localhost:7474'); + $this->assertInstanceOf(HttpDriver::class, $connection->getDriver()); } } \ No newline at end of file From 504191479aa0cec1ef79544738a2f84b15841e7b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 01:32:03 +0100 Subject: [PATCH 058/217] removed unused imports in test --- tests/Unit/Connection/ConnectionUnitTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index b13fe9fb..3475a8c6 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -2,9 +2,7 @@ namespace GraphAware\Neo4j\Client\Tests\Unit\Connection; -use GraphAware\Common\Driver\Protocol; use GraphAware\Neo4j\Client\Connection\Connection; -use GraphAware\Neo4j\Client\Tests\Unit\Stub\DummyDriver; use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; /** From 8182c6df6570e599f2cc82d68d210afca7d01a51 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 15:14:24 +0100 Subject: [PATCH 059/217] CypherStack and Tagging --- README.md | 34 +++++++++++ composer.lock | 18 +++--- src/Client.php | 38 ++++++++++++ src/Connection/Connection.php | 10 +++- src/Formatter/ResponseFormatter.php | 7 ++- src/HttpDriver/Pipeline.php | 49 +++++++++++++++ src/HttpDriver/Session.php | 80 +++++++++++++++---------- src/Stack.php | 92 +++++++++++++++++++++++++++++ 8 files changed, 284 insertions(+), 44 deletions(-) create mode 100644 src/HttpDriver/Pipeline.php create mode 100644 src/Stack.php diff --git a/README.md b/README.md index 1018b470..c373a263 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,40 @@ foreach ($result->getRecords() as $record) { } ``` +### Cypher statements and Stacks + +Ideally, you would stack your statements and issue them all at once in order to improve performance. + +You can create Cypher statement stacks that act as a Bag and run this stack with the client, example : + +```php + +$stack = $client->stack(); + +$stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); +$stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[:FOLLOWS]->(n2)', ['uuid1' => '123-fff', 'uuid2' => '456-ddd']); + +$results = $client->runStack($stack); +``` + +### Tagging your Cypher statements + +Sometimes, you may want to retrieve a specific result from a Stack, an easy way to do this is to tag your Cypher statements. + +The tag is passed via the 3rd argument of the `run` or `push` methods : + +```php +$stack = $client->stack(); + +$stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff'], 'user_create'); +$stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[r:FOLLOWS]->(n2) RETURN id(r) as relId', ['uuid1' => '123-fff', 'uuid2' => '456-ddd'], 'user_follows'); + +$results = $client->runStack($stack); + +$followResult = $results->get('user_follows'); +$followRelationshipId = $followResult->getRecord()->value('relId'); +``` + ### License diff --git a/composer.lock b/composer.lock index 35482dc9..d855fd1b 100644 --- a/composer.lock +++ b/composer.lock @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "7fc4be8286ffe41a33fbfea92bdadc35698ab969" + "reference": "705ef4b14f1a66eb6089fb72a55dba5d201fa6ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/7fc4be8286ffe41a33fbfea92bdadc35698ab969", - "reference": "7fc4be8286ffe41a33fbfea92bdadc35698ab969", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/705ef4b14f1a66eb6089fb72a55dba5d201fa6ee", + "reference": "705ef4b14f1a66eb6089fb72a55dba5d201fa6ee", "shasum": "" }, "require": { @@ -55,20 +55,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-11 01:04:12" + "time": "2016-01-12 12:18:35" }, { "name": "graphaware/neo4j-common", - "version": "1.12.1", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79" + "reference": "683aa323386a511409ab43ebe20fc9f8f3ad6e00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/b0713ade0458ec9b412a506a24f7aa55153e1b79", - "reference": "b0713ade0458ec9b412a506a24f7aa55153e1b79", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/683aa323386a511409ab43ebe20fc9f8f3ad6e00", + "reference": "683aa323386a511409ab43ebe20fc9f8f3ad6e00", "shasum": "" }, "require": { @@ -101,7 +101,7 @@ "neo4j", "statement" ], - "time": "2016-01-05 12:54:41" + "time": "2016-01-12 12:15:56" }, { "name": "guzzlehttp/guzzle", diff --git a/src/Client.php b/src/Client.php index 64f98155..d5a7239f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -42,6 +42,44 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = return $connection->run($query, $parameters, $tag); } + /** + * @param string|null $tag + * @return \GraphAware\Neo4j\Client\Stack + */ + public function stack($tag = null, $connectionAlias = null) + { + return Stack::create($tag, $connectionAlias); + } + + /** + * @param \GraphAware\Neo4j\Client\Stack $stack + * + * @return \GraphAware\Common\Result\ResultCollection + */ + public function runStack(Stack $stack) + { + $pipeline = $this->pipeline($stack->getConnectionAlias()); + foreach ($stack->statements() as $statement) { + $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); + } + + return $pipeline->run(); + } + + /** + * @param null $query + * @param null $parameters + * @param null $tag + * @param null $connectionAlias + * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline + */ + private function pipeline($query = null, $parameters = null, $tag = null, $connectionAlias = null) + { + $connection = $this->connectionManager->getConnection($connectionAlias); + + return $connection->createPipeline($query, $parameters, $tag); + } + /** * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. * diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index c6ec40ce..ae5ed3d3 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -54,7 +54,7 @@ public function getAlias() return $this->alias; } - public function buildDriver() + private function buildDriver() { if (preg_match('/bolt/', $this->uri)) { $this->driver = BoltGraphDB::driver($this->uri); @@ -73,6 +73,14 @@ public function getDriver() return $this->driver; } + public function createPipeline($query, $parameters, $tag) + { + $session = $this->driver->session(); + $parameters = is_array($parameters) ? $parameters : array(); + + return $session->createPipeline($query, $parameters, $tag); + } + public function run($statement, $parameters, $tag) { $parameters = is_array($parameters) ? $parameters : array(); diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index f448865c..ee24de57 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -12,6 +12,7 @@ namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Cypher\Statement; +use GraphAware\Common\Result\ResultCollection; class ResponseFormatter { @@ -21,11 +22,11 @@ class ResponseFormatter * @param array $response * @param \GraphAware\Common\Cypher\Statement[] $statements * - * @return \GraphAware\Neo4j\Client\Formatter\Result[] + * @return \GraphAware\Common\Result\ResultCollection */ public function format(array $response, array $statements) { - $results = []; + $results = new ResultCollection(); foreach ($response['results'] as $k => $result) { $resultO = new Result($statements[$k]); $resultO->setFields($result['columns']); @@ -35,7 +36,7 @@ public function format(array $response, array $statements) if (array_key_exists('stats', $result)) { $resultO->setStats($result['stats']); } - $results[] = $resultO; + $results->add($resultO); } return $results; diff --git a/src/HttpDriver/Pipeline.php b/src/HttpDriver/Pipeline.php new file mode 100644 index 00000000..beb1c6e5 --- /dev/null +++ b/src/HttpDriver/Pipeline.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver; + +use GraphAware\Common\Cypher\Statement; + +class Pipeline +{ + protected $session; + + /** + * @var \GraphAware\Common\Cypher\Statement[] + */ + protected $statements = []; + + public function __construct(Session $session) + { + $this->session = $session; + } + + public function push($query, array $parameters = array(), $tag = null) + { + $this->statements[] = Statement::create($query, $parameters, $tag); + } + + public function run() + { + return $this->session->flush($this); + } + + public function statements() + { + return $this->statements; + } + + public function size() + { + return count($this->statements); + } +} \ No newline at end of file diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 0da832f8..85b226d9 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -36,14 +36,42 @@ public function __construct($uri, Client $httpClient) public function run($statement, $parameters, $tag = null) { - $st = Statement::create($statement, $parameters, $tag); - $request = $this->prepareRequest($statement, $parameters); + $pipeline = $this->createPipeline($statement, $parameters, $tag); + $response = $pipeline->run(); + return $response->results()[0]; + } + + /** + * @param string|null $query + * @param array $parameters + * @param string|null $tag + * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline + */ + public function createPipeline($query = null, array $parameters = array(), $tag = null) + { + $pipeline = new Pipeline($this); + if (null !== $query) { + $pipeline->push($query, $parameters, $tag); + } + + return $pipeline; + } + + /** + * @param \GraphAware\Neo4j\Client\HttpDriver\Pipeline $pipeline + * @return \GraphAware\Common\Result\ResultCollection + * + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + */ + public function flush(Pipeline $pipeline) + { + $request = $this->prepareRequest($pipeline); try { $response = $this->httpClient->send($request); - $results = $this->responseFormatter->format(json_decode($response->getBody(), true), array($st)); + $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $pipeline->statements()); - return $results[0]; + return $results; } catch (RequestException $e) { if ($e->hasResponse()) { $body = json_decode($e->getResponse()->getBody(), true); @@ -66,42 +94,32 @@ public function close() // } - public function prepareRequest($statement, $parameters) + public function prepareRequest(Pipeline $pipeline) { - $info = parse_url($this->uri); - $host = sprintf('%s://%s:%d/db/data/transaction/commit', $info['scheme'], $info['host'], $info['port']); - $statements = [ - 'statements' => [] - ]; - $st = [ - 'statement' => $statement, - 'resultDataContents' => ['REST'], - 'includeStats' => true - ]; - - if (is_array($parameters) && !empty($parameters)) { - $st['parameters'] = $parameters; + $statements = []; + foreach ($pipeline->statements() as $statement) { + $st = [ + 'statement' => $statement->text(), + 'resultDataContents' => ["REST"], + 'includeStats' => true + ]; + if (!empty($statement->parameters())) { + $st['parameters'] = $statement->parameters(); + } + $statements[] = $st; } - $statements['statements'][] = $st; - - $options = []; - $options['headers'] = [ + $body = json_encode([ + 'statements' => $statements + ]); + $headers = [ [ 'X-Stream' => true, 'Content-Type' => 'application/json' ] ]; - if (isset($info['user']) && isset($info['pass'])) { - $options['auth'] = [$info['user'], $info['pass']]; - } - - $options['json'] = $st; - - $request = new Request("POST", sprintf('%s/db/data/transaction/commit', $this->uri), $options['headers'], json_encode($statements)); - - echo (string) $request->getBody(); + $request = new Request("POST", sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); return $request; } diff --git a/src/Stack.php b/src/Stack.php new file mode 100644 index 00000000..4d93b803 --- /dev/null +++ b/src/Stack.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client; + +use GraphAware\Common\Cypher\Statement; + +class Stack +{ + /** + * @var null|string + */ + protected $tag; + + /** + * @var string + */ + protected $connectionAlias; + + /** + * @var \GraphAware\Common\Cypher\Statement[] + */ + protected $statements = []; + + /** + * Stack constructor. + * @param null $tag + */ + public function __construct($tag = null, $connectionAlias = null) + { + $this->tag = null !== $tag ? (string) $tag : null; + $this->connectionAlias = $connectionAlias; + } + + /** + * @param string|null $tag + * @return \GraphAware\Neo4j\Client\Stack + */ + public static function create($tag = null, $connectionAlias = null) + { + return new self($tag, $connectionAlias); + } + + /** + * @param $query + * @param array $parameters + */ + public function push($query, array $parameters = array(), $tag = null) + { + $this->statements[] = Statement::create($query, $parameters, $tag); + } + + /** + * @return int + */ + public function size() + { + return count($this->statements); + } + + /** + * @return \GraphAware\Common\Cypher\Statement[] + */ + public function statements() + { + return $this->statements; + } + + /** + * @return null|string + */ + public function getTag() + { + return $this->tag; + } + + /** + * @return null|string + */ + public function getConnectionAlias() + { + return $this->connectionAlias; + } +} From 70991182156a5a66019a508d7b2ec883087a7ac5 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 15:37:23 +0100 Subject: [PATCH 060/217] added docs about Result handling --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index c373a263..ab377569 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,32 @@ $followResult = $results->get('user_follows'); $followRelationshipId = $followResult->getRecord()->value('relId'); ``` +### Working with Result sets + +The `run` method returns you a single `Result` object. Other methods where you can expect multiple results returns a `ResultCollection` object which is Traversable. + +The `Result` object contains the `records` and the `summary` of the statement, the following methods are available in the API : + +```php + +$result->getRecord(); // Returns one record + +$result->records(); // Returns all recrods + +$result->summarize(); // Returns the ResultSummary +``` + +The `ResultSummary` contains the `Statement`, the Statistics and the QueryPlan if available : + +```php +$summary = $result->summarize(); + +$stats = $summary->updateStatistics(); + +$nodesUpdated = $stats->nodesUpdated(); +$propertiesSet = $stats->propertiesSet(); +``` + ### License From a4f2c725bd3ca7555f0c38f1a328d91e0262772d Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 15:39:26 +0100 Subject: [PATCH 061/217] summary docs --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab377569..2288c8e7 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ The `Result` object contains the `records` and the `summary` of the statement, t $result->getRecord(); // Returns one record -$result->records(); // Returns all recrods +$result->records(); // Returns all records $result->summarize(); // Returns the ResultSummary ``` @@ -175,10 +175,15 @@ The `ResultSummary` contains the `Statement`, the Statistics and the QueryPlan i ```php $summary = $result->summarize(); +$query = $summary->statement()->text(); + $stats = $summary->updateStatistics(); $nodesUpdated = $stats->nodesUpdated(); $propertiesSet = $stats->propertiesSet(); + +// Does the statement affected the graph ? +$affected = $stats->containsUpdates(); ``` From 76a3c9f9b02d454d1ff2441f14677e8b55ec427c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 15:47:40 +0100 Subject: [PATCH 062/217] hydration docs --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 2288c8e7..4c1be6ce 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,9 @@ $followRelationshipId = $followResult->getRecord()->value('relId'); ### Working with Result sets + +#### Basics + The `run` method returns you a single `Result` object. Other methods where you can expect multiple results returns a `ResultCollection` object which is Traversable. The `Result` object contains the `records` and the `summary` of the statement, the following methods are available in the API : @@ -170,6 +173,8 @@ $result->records(); // Returns all records $result->summarize(); // Returns the ResultSummary ``` +#### Summary + The `ResultSummary` contains the `Statement`, the Statistics and the QueryPlan if available : ```php @@ -186,6 +191,40 @@ $propertiesSet = $stats->propertiesSet(); $affected = $stats->containsUpdates(); ``` +#### Record Values + +Each record contains one row of values returned by the Cypher query : + +``` + +$query = "MATCH (n:Person) n, n.name as name, n.age as age"; +$result = $client->run($query); + +foreach ($result->records() as $record) { + print_r($record->value('n'); // nodes returned are automatically hydrated to Node objects + echo $record->value('name') . PHP_EOL; + echo $record->value('age') . PHP_EOL; +} + +The client takes care of the hydration of Graph objects to PHP Objects, so it is for Node, Relationship and Path : + +##### Node + +* `labels()` : returns an array of labels (string) +* `identity()` : returns the internal ID of the node +* `values()` : returns the properties of the node (array) +* `value($key)` : returns the value for the given property key +* `hasLabel($label)` : returns whether or not the node has the given label (boolean) +* `startNodeIdentity` : returns the start node id +* `endNodeIdentity` : returns the end node id + + +##### Relationship + +* `type()` : returns the relationship type +* `identity()` : returns the internal ID of the relationship +* `values()` : returns the properties of the relationship (array) +* `value($key)` : returns the value for the given property key ### License From ef3921ad0e0708601bf5c7e77fa959c26ca75f67 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 15:48:11 +0100 Subject: [PATCH 063/217] fix docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c1be6ce..b56587c7 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ foreach ($result->records() as $record) { echo $record->value('name') . PHP_EOL; echo $record->value('age') . PHP_EOL; } +``` The client takes care of the hydration of Graph objects to PHP Objects, so it is for Node, Relationship and Path : From 0276bf12aa6fad27b27f594f6ba5bcaa3cbabdbd Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 22:48:47 +0100 Subject: [PATCH 064/217] TransactionAware objects --- composer.json | 2 +- composer.lock | 23 +- src/Client.php | 8 + src/Connection/Connection.php | 51 +++- src/Event/HttpClientPreSendRequestEvent.php | 32 -- src/Event/HttpExceptionEvent.php | 35 --- src/Event/LoggingEvent.php | 36 --- src/Event/PostRequestSendEvent.php | 61 ---- src/Formatter/ResponseFormatter.php | 7 + src/HighAvailibility/HAEnterpriseManager.php | 305 ------------------- src/HttpDriver/Session.php | 133 +++++++- src/HttpDriver/Transaction.php | 151 +++++++++ src/Result/ResultCollection.php | 20 ++ src/Transaction/Transaction.php | 229 ++++---------- 14 files changed, 426 insertions(+), 667 deletions(-) delete mode 100644 src/Event/HttpClientPreSendRequestEvent.php delete mode 100644 src/Event/HttpExceptionEvent.php delete mode 100644 src/Event/LoggingEvent.php delete mode 100644 src/Event/PostRequestSendEvent.php delete mode 100644 src/HighAvailibility/HAEnterpriseManager.php create mode 100644 src/HttpDriver/Transaction.php create mode 100644 src/Result/ResultCollection.php diff --git a/composer.json b/composer.json index 574c369d..370dba0a 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": ">= 5.6", - "graphaware/neo4j-bolt": "1.0.x-dev", + "graphaware/neo4j-bolt": "^1.0", "guzzlehttp/guzzle": "^6.0", "monolog/monolog": "~1.1", "symfony/yaml": "^2.7", diff --git a/composer.lock b/composer.lock index d855fd1b..8075d074 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "3f7cddc8c9546bd3c902573c49d14e46", - "content-hash": "f5794c2bccc4fdf767b779a3874a2da6", + "hash": "6599051306dad19a2f1c29e45ab482b8", + "content-hash": "1823bb1cc76af2635c87ca2523283791", "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "dev-master", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "705ef4b14f1a66eb6089fb72a55dba5d201fa6ee" + "reference": "b00e0cc340ccd7ae17aab1c44f3df4737570f8ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/705ef4b14f1a66eb6089fb72a55dba5d201fa6ee", - "reference": "705ef4b14f1a66eb6089fb72a55dba5d201fa6ee", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/b00e0cc340ccd7ae17aab1c44f3df4737570f8ef", + "reference": "b00e0cc340ccd7ae17aab1c44f3df4737570f8ef", "shasum": "" }, "require": { @@ -34,11 +34,6 @@ "symfony/stopwatch": "^2.7" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "GraphAware\\Bolt\\": "src/" @@ -55,7 +50,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-12 12:18:35" + "time": "2016-01-12 20:55:41" }, { "name": "graphaware/neo4j-common", @@ -1666,9 +1661,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "graphaware/neo4j-bolt": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Client.php b/src/Client.php index d5a7239f..9153d263 100644 --- a/src/Client.php +++ b/src/Client.php @@ -12,6 +12,7 @@ namespace GraphAware\Neo4j\Client; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\Transaction\Transaction; class Client { @@ -66,6 +67,13 @@ public function runStack(Stack $stack) return $pipeline->run(); } + public function transaction($connectionAlias = null) + { + $connection = $this->connectionManager->getConnection($connectionAlias); + + return $connection->getTransaction(); + } + /** * @param null $query * @param null $parameters diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index ae5ed3d3..44d16ce6 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -12,9 +12,11 @@ namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; +use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; +use GraphAware\Neo4j\Client\Stack; class Connection { @@ -33,6 +35,11 @@ class Connection */ private $driver; + /** + * @var \GraphAware\Common\Driver\SessionInterface + */ + private $session; + /** * Connection constructor. * @@ -44,6 +51,7 @@ public function __construct($alias, $uri) $this->alias = (string) $alias; $this->uri = (string) $uri; $this->buildDriver(); + $this->session = $this->driver->session(); } /** @@ -73,20 +81,24 @@ public function getDriver() return $this->driver; } - public function createPipeline($query, $parameters, $tag) + /** + * @param null $query + * @param array $parameters + * @param null $tag + * @return \GraphAware\Bolt\Protocol\Pipeline|\GraphAware\Neo4j\Client\HttpDriver\Pipeline + */ + public function createPipeline($query = null, $parameters = array(), $tag = null) { - $session = $this->driver->session(); $parameters = is_array($parameters) ? $parameters : array(); - return $session->createPipeline($query, $parameters, $tag); + return $this->session->createPipeline($query, $parameters, $tag); } public function run($statement, $parameters, $tag) { $parameters = is_array($parameters) ? $parameters : array(); - $session = $this->driver->session(); try { - $results = $session->run($statement, $parameters, $tag); + $results = $this->session->run($statement, $parameters, $tag); return $results; } catch (MessageFailureException $e) { @@ -96,4 +108,33 @@ public function run($statement, $parameters, $tag) throw $exception; } } + + public function runMixed(array $queue) + { + $pipeline = $this->createPipeline(); + foreach ($queue as $element) { + if ($element instanceof Stack) { + foreach ($element->statements() as $statement) { + $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); + } + } elseif ($element instanceof Statement) { + $pipeline->push($element->text(), $element->parameters(), $element->getTag()); + } + } + + return $pipeline->run(); + } + + public function getTransaction() + { + return $this->session->transaction(); + } + + /** + * @return \GraphAware\Common\Driver\SessionInterface + */ + public function getSession() + { + return $this->session; + } } diff --git a/src/Event/HttpClientPreSendRequestEvent.php b/src/Event/HttpClientPreSendRequestEvent.php deleted file mode 100644 index d1bc6e4e..00000000 --- a/src/Event/HttpClientPreSendRequestEvent.php +++ /dev/null @@ -1,32 +0,0 @@ -request = $request; - } - - /** - * @return \Neoxygen\NeoClient\Request\Request - */ - public function getRequest() - { - return $this->request; - } - - public function setRequest(RequestInterface $request) - { - $this->request = $request; - } -} diff --git a/src/Event/HttpExceptionEvent.php b/src/Event/HttpExceptionEvent.php deleted file mode 100644 index 3e551b10..00000000 --- a/src/Event/HttpExceptionEvent.php +++ /dev/null @@ -1,35 +0,0 @@ -request = $request; - $this->exception = $exception; - } - - public function getRequest() - { - return $this->request; - } - - public function setRequest(RequestInterface $request) - { - $this->request = $request; - } - - public function getException() - { - return $this->exception; - } -} diff --git a/src/Event/LoggingEvent.php b/src/Event/LoggingEvent.php deleted file mode 100644 index f1ef6e89..00000000 --- a/src/Event/LoggingEvent.php +++ /dev/null @@ -1,36 +0,0 @@ -level = $level; - $this->message = $message; - $this->context = $context; - } - - public function getLevel() - { - return $this->level; - } - - public function getMessage() - { - return $this->message; - } - - public function getContext() - { - return $this->context; - } -} diff --git a/src/Event/PostRequestSendEvent.php b/src/Event/PostRequestSendEvent.php deleted file mode 100644 index 0bf625e9..00000000 --- a/src/Event/PostRequestSendEvent.php +++ /dev/null @@ -1,61 +0,0 @@ -request = $request; - } - - /** - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * @param RequestInterface $request - */ - public function setRequest(RequestInterface $request) - { - $this->request = $request; - } - - /** - * @param Response $response - */ - public function setResponse(Response $response) - { - $this->response = $response; - } - - /** - * @return mixed - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index ee24de57..a7849035 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -13,6 +13,7 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Result\ResultCollection; +use GraphAware\Neo4j\Client\Exception\Neo4jException; class ResponseFormatter { @@ -26,6 +27,12 @@ class ResponseFormatter */ public function format(array $response, array $statements) { + if (isset($response['errors'][0])) { + $e = new Neo4jException($response['errors'][0]['message']); + $e->setNeo4jStatusCode($response['errors'][0]['code']); + + throw $e; + } $results = new ResultCollection(); foreach ($response['results'] as $k => $result) { $resultO = new Result($statements[$k]); diff --git a/src/HighAvailibility/HAEnterpriseManager.php b/src/HighAvailibility/HAEnterpriseManager.php deleted file mode 100644 index 98fa7642..00000000 --- a/src/HighAvailibility/HAEnterpriseManager.php +++ /dev/null @@ -1,305 +0,0 @@ - array( - 'onRequestException', 50, - ), - NeoClientEvents::NEO_PRE_REQUEST_SEND => array( - 'onPreSend', 50, - ), - NeoClientEvents::NEO_PRE_REQUEST_SEND => array( - 'onPreSendHAHeaders', 10, - ), - NeoClientEvents::NEO_POST_REQUEST_SEND => array( - 'onSuccessfulRequest', 30, - ), - ); - } - - /** - * @param \Neoxygen\NeoClient\Connection\ConnectionManager $connectionManager - * @param \Neoxygen\NeoClient\Command\CommandManager $commandManager - * @param \Neoxygen\NeoClient\HttpClient\GuzzleHttpClient $httpClient - */ - public function __construct(ConnectionManager $connectionManager, CommandManager $commandManager, GuzzleHttpClient $httpClient, $queryModeKey, $writeQueryKeyValue, $readQueryKeyValue) - { - $this->connectionManager = $connectionManager; - $this->commandManager = $commandManager; - $this->httpClient = $httpClient; - $this->queryModeHeaderName = $queryModeKey; - $this->queryModeWriteQueryHeaderValue = $writeQueryKeyValue; - $this->queryModeReadQueryHeaderValue = $readQueryKeyValue; - } - - /** - * @param \Neoxygen\NeoClient\Event\HttpExceptionEvent $event - */ - public function onRequestException(HttpExceptionEvent $event) - { - $request = $event->getRequest(); - $this->fails[$request->getConnection()] = !isset($this->fails[$request->getConnection()]) ? 1 : $this->fails[$request->getConnection()] + 1; - if ($request->hasQueryMode()) { - if ($request->getQueryMode() == 'READ') { - $this->slavesUsed[] = $request->getConnection(); - if ($this->connectionManager->hasNextSlave($this->slavesUsed)) { - $next = $this->connectionManager->getNextSlave($this->slavesUsed); - Client::log('warning', sprintf('Connection "%s" unreacheable, using "%s"', $request->getConnection(), $next)); - $request->setInfoFromConnection($this->connectionManager->getConnection($next)); - $request->setQueryMode('READ'); - $event->stopPropagation(); - } elseif (null === $this->masterUsed) { - $master = $this->connectionManager->getMasterConnection(); - if (isset($master)) { - Client::log('warning', sprintf('Connection "%s" unreacheable, using "%s"', $request->getConnection(), $master->getAlias())); - $this->masterUsed = true; - $request->setInfoFromConnection($master); - $request->setQueryMode('READ'); - $event->stopPropagation(); - } else { - Client::log('warning', sprintf('Connection "%s" unreacheable, even after trying the master', $request->getConnection())); - } - } - } elseif ($request->getQueryMode() == 'WRITE') { - Client::log('emergency', sprintf('The master connection "%s" is unreachable', $request->getConnection())); - $newMaster = $this->detectReelectedMaster(); - if (null !== $newMaster) { - $conn = $this->connectionManager->getConnection($newMaster); - $this->masterWriteFails = $this->masterWriteFails + 1; - $this->newMasterDetected = $newMaster; - $request->setInfoFromConnection($conn); - $request->setQueryMode('WRITE'); - $event->stopPropagation(); - } - } - } - } - - /** - * @param \Neoxygen\NeoClient\Event\HttpClientPreSendRequestEvent $event - */ - public function onPreSend(HttpClientPreSendRequestEvent $event) - { - $request = $event->getRequest(); - $conn = $request->getConnection(); - if (isset($this->fails[$conn]) && $this->fails[$conn] >= 5) { - if ($request->hasQueryMode()) { - if ($request->getQueryMode() === 'READ') { - if ($this->connectionManager->hasNextSlave([$conn])) { - $next = $this->connectionManager->getNextSlave([$conn]); - $this->setHaPrimarySlave($next); - $request->setInfoFromConnection($this->connectionManager->getConnection($next)); - } - } - } - } - - if (null !== $this->masterWriteFails && $request->getQueryMode() == 'WRITE' && $this->masterWriteFails >= 5) { - if (null !== $this->newMasterDetected) { - $this->setHaNewMaster($this->newMasterDetected); - $conn = $this->connectionManager->getConnection($this->newMasterDetected); - Client::log('debug', sprintf('Automatic Write connection change after 5 write failures on Master. Changing to the "%s" connection', $this->newMasterDetected)); - $request->setInfoFromConnection($conn); - } - } - } - - /** - * Add specific headers to the Request object for helping HA proxies to determine if it is a read or write query. - * - * @param \Neoxygen\NeoClient\Event\HttpClientPreSendRequestEvent $event - */ - public function onPreSendHAHeaders(HttpClientPreSendRequestEvent $event) - { - if ($event->getRequest()->getQueryMode() == 'WRITE') { - $event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeWriteQueryHeaderValue); - } elseif ($event->getRequest()->getQueryMode() == 'READ') { - $event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeReadQueryHeaderValue); - } - } - - /** - * @param \Neoxygen\NeoClient\Event\PostRequestSendEvent $event - */ - public function onSuccessfulRequest(PostRequestSendEvent $event) - { - $request = $event->getRequest(); - $this->fails[$request->getConnection()] = null; - $this->slavesUsed = []; - $this->masterUsed = null; - } - - /** - * - */ - private function detectReelectedMaster() - { - $slaves = $this->connectionManager->getSlaves(); - foreach ($slaves as $slave) { - if ($this->isMaster($slave)) { - Client::log('debug', sprintf('Master Reelection detected, new Master is "%s".', $slave)); - - return $slave; - } - } - - return; - } - - /** - * @param $connAlias - * - * @return bool - */ - private function isMaster($connAlias) - { - $command = $this->commandManager->getCommand('neo.core_get_ha_master'); - $command->setConnection($connAlias); - try { - $response = $command->execute(); - if ($response instanceof Response && true === $response->getBody()) { - return true; - } - } catch (HttpException $e) { - return false; - } - - return false; - } - - /** - * @param array $config - */ - private function setHAConfigAfterFailure(array $config) - { - $dump = Yaml::dump($config, 4, 2); - $file = $this->getHAFailureFile(); - file_put_contents($file, $dump); - } - - /** - * @return array - */ - private function getHAConfigAfterFailure() - { - if (!file_exists($this->getHAFailureFile())) { - return array(); - } - $content = file_get_contents($this->getHAFailureFile()); - $config = Yaml::parse($content); - - return $config; - } - - /** - * Retrieve the new HAconfig after a failure. - */ - private function getHAFailureFile() - { - $dir = sys_get_temp_dir(); - $file = $dir.DIRECTORY_SEPARATOR.'neoclient_ha_config_after_failure'; - - return $file; - } - - /** - * @param $slaveAlias - */ - private function setHaPrimarySlave($slaveAlias) - { - $config = $this->getHAConfigAfterFailure(); - $config['primary_slave'] = $slaveAlias; - $this->setHAConfigAfterFailure($config); - } - - /** - * @param $masterAlias - */ - private function setHaNewMaster($masterAlias) - { - $config = $this->getHAConfigAfterFailure(); - $config['new_master'] = $masterAlias; - $this->setHAConfigAfterFailure($config); - } -} diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 85b226d9..1504c142 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -27,6 +27,8 @@ class Session implements SessionInterface protected $responseFormatter; + public $transaction; + public function __construct($uri, Client $httpClient) { $this->uri = $uri; @@ -34,8 +36,9 @@ public function __construct($uri, Client $httpClient) $this->responseFormatter = new ResponseFormatter(); } - public function run($statement, $parameters, $tag = null) + public function run($statement, $parameters = array(), $tag = null) { + $parameters = is_array($parameters) ? $parameters : array(); $pipeline = $this->createPipeline($statement, $parameters, $tag); $response = $pipeline->run(); @@ -124,4 +127,132 @@ public function prepareRequest(Pipeline $pipeline) return $request; } + public function transaction() + { + if ($this->transaction instanceof Transaction) { + throw new \RuntimeException('A transaction is already bound to this session'); + } + + return new Transaction($this); + } + + /** + * @return mixed|\Psr\Http\Message\ResponseInterface + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + */ + public function begin() + { + $request = new Request("POST", sprintf('%s/db/data/transaction', $this->uri)); + try { + $response = $this->httpClient->send($request); + + return $response; + } catch (RequestException $e) { + if ($e->hasResponse()) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; + } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); + + throw $exception; + } + + throw $e; + } + } + + public function pushToTransaction($transactionId, array $statementsStack) + { + $statements = []; + foreach ($statementsStack as $statement) { + $st = [ + 'statement' => $statement->text(), + 'resultDataContents' => ["REST"], + 'includeStats' => true + ]; + if (!empty($statement->parameters())) { + $st['parameters'] = $statement->parameters(); + } + $statements[] = $st; + } + + $headers = [ + [ + 'X-Stream' => true, + 'Content-Type' => 'application/json' + ] + ]; + + $body = json_encode([ + 'statements' => $statements + ]); + $request = new Request("POST", sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId), $headers, $body); + try { + $response = $this->httpClient->send($request); + $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); + + return $results; + } catch (RequestException $e) { + if ($e->hasResponse()) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; + } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); + + throw $exception; + } + + throw $e; + } + } + + public function commitTransaction($transactionId) + { + $request = new Request("POST", sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); + try { + $this->httpClient->send($request); + } catch (RequestException $e) { + if ($e->hasResponse()) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; + } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); + + throw $exception; + } + + throw $e; + } + } + + public function rollbackTransaction($transactionId) + { + $request = new Request("DELETE", sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId)); + try { + $this->httpClient->send($request); + } catch (RequestException $e) { + if ($e->hasResponse()) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; + } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); + + throw $exception; + } + + throw $e; + } + } } \ No newline at end of file diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php new file mode 100644 index 00000000..5d70e6ad --- /dev/null +++ b/src/HttpDriver/Transaction.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\HttpDriver; + +use GraphAware\Common\Transaction\TransactionInterface; +use GraphAware\Neo4j\Client\Exception\Neo4jException; +use GraphAware\Neo4j\Client\HttpDriver\Session; +use GraphAware\Common\Cypher\Statement; + +class Transaction implements TransactionInterface +{ + const OPENED = 'OPEN'; + + const COMMITED = 'COMMITED'; + + const ROLLED_BACK = 'ROLLED_BACK'; + + protected $state; + + protected $session; + + protected $closed = false; + + protected $transactionId; + + protected $expires; + + public function __construct(Session $session) + { + $this->session = $session; + $this->session->transaction = $this; + } + + public function isOpen() + { + return $this->state === self::OPENED; + } + + public function isCommited() + { + return $this->state === self::COMMITED; + } + + public function isRolledBack() + { + return $this->state === self::ROLLED_BACK; + } + + public function getStatus() + { + return $this->state; + } + + public function begin() + { + $this->assertNotStarted(); + $response = $this->session->begin(); + $body = json_decode($response->getBody(), true); + $parts = explode('/', $body['commit']); + $this->transactionId = (int) $parts[count($parts)-2]; + $this->state = self::OPENED; + $this->session->transaction = $this; + } + + public function run(Statement $statement) + { + $this->assertStarted(); + try { + return $this->session->pushToTransaction($this->transactionId, array($statement)); + } catch (Neo4jException $e) { + if ($e->effect() === Neo4jException::EFFECT_ROLLBACK) { + $this->closed = true; + $this->state = self::ROLLED_BACK; + } + + throw $e; + } + } + + public function success() + { + $this->assertNotClosed(); + $this->assertStarted(); + $this->session->commitTransaction($this->transactionId); + $this->state = self::COMMITED; + $this->closed = true; + $this->session->transaction = null; + } + + public function rollback() + { + $this->assertNotClosed(); + $this->assertStarted(); + $this->session->rollbackTransaction($this->transactionId); + $this->closed = true; + $this->state = self::ROLLED_BACK; + $this->session->transaction = null; + } + + private function assertStarted() + { + if ($this->state !== self::OPENED) { + throw new \RuntimeException('This transaction has not been started'); + } + } + + private function assertNotStarted() + { + if (null !== $this->state) { + throw new \RuntimeException(sprintf('Can not begin transaction, Transaction State is "%s"', $this->state)); + } + } + + private function assertNotClosed() + { + if (false !== $this->closed) { + throw new \RuntimeException('This Transaction is closed'); + } + } + + public function status() + { + return $this->state; + } + + public function commit() + { + $this->success(); + } + + public function push($query, array $parameters = array(), $tag = null) + { + // + } + + public function getSession() + { + return $this->session; + } + + +} \ No newline at end of file diff --git a/src/Result/ResultCollection.php b/src/Result/ResultCollection.php new file mode 100644 index 00000000..8685740d --- /dev/null +++ b/src/Result/ResultCollection.php @@ -0,0 +1,20 @@ +tag = $tag; + } + + public function getTag() + { + return $this->tag; + } +} \ No newline at end of file diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index 5dc7185c..cfcf4bf7 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -1,229 +1,106 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Transaction; + +use GraphAware\Common\Cypher\Statement; +use GraphAware\Common\Transaction\TransactionInterface; +use GraphAware\Neo4j\Client\Connection\Connection; +use GraphAware\Neo4j\Client\Stack; + +class Transaction implements TransactionInterface { - /** - * @var \Neoxygen\NeoClient\Extension\NeoClientCoreExtension|\Neoxygen\NeoClient\Extension\AbstractExtension - */ - private $client; + const OPENED = 'OPEN'; - /** - * @var bool - */ - private $active; + const COMMITTED = 'COMMITED'; - /** - * @var string|null - */ - private $conn; + const ROLLED_BACK = 'ROLLED_BACK'; /** - * @var string + * @var \GraphAware\Neo4j\Client\Connection\Connection */ - private $commitUrl; + protected $connection; /** - * @var int + * @var null|string */ - private $transactionId; + protected $state; /** - * @var string + * @var array() */ - private $queryMode; + protected $queue = []; /** - * @var \Neoxygen\NeoClient\Formatter\Result[] + * @var array */ - private $results = []; - - private $version; + protected $results = []; /** - * @param null $conn - * @param \Neoxygen\NeoClient\Extension\NeoClientCoreExtension $extension + * @var array */ - public function __construct($conn = null, NeoClientCoreExtension $extension, $queryMode) - { - $this->conn = $conn; - $this->queryMode = $queryMode; - $this->client = $extension; - $response = $this->handleResponse($this->client->openTransaction($this->conn, $this->queryMode)); - $this->commitUrl = $response->getBody()['commit']; - $this->parseTransactionId(); - $this->active = true; - - return $this; - } + protected $taggedResults = []; /** - * @param $query - * @param array $parameters - * - * @return \Neoxygen\NeoClient\Formatter\Result - * - * @throws \Neoxygen\NeoClient\Exception\Neo4jException + * @param \GraphAware\Neo4j\Client\Connection\Connection $connection */ - public function pushQuery($query, array $parameters = array()) + public function __construct(Connection $connection) { - $this->checkIfOpened(); - try { - $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn)); - } catch (Neo4jException $e) { - $this->version = $this->client->getNeo4jVersion(); - $this->rollback(); - throw $e; - } catch (HttpException $e) { - $this->rollback(); - throw $e; - } - - $result = $response->getResult(); - $this->results[] = $result; - - return $result; + $this->connection = $connection; } - /** - * @param array $statements - * - * @return \Neoxygen\NeoClient\Formatter\Result|\GraphAware\NeoClient\Formatter\Results[] - * - * @throws \Neoxygen\NeoClient\Exception\Neo4jException - */ - public function pushMultiple(array $statements) + public function push($statement, array $parameters = array(), $tag = null) { - $this->checkIfOpened(); - $httpResponse = $this->client->pushMultipleToTransaction($this->transactionId, $statements); - - $response = $this->handleResponse($httpResponse); - - if ($this->client->newFormattingService) { - return $response->getResults(); - } - - return $response->getResult(); + $this->queue[] = Statement::create($statement, $parameters, $tag); } - /** - * @return array|\Neoxygen\NeoClient\Formatter\Response|string - * - * @throws \Neoxygen\NeoClient\Exception\Neo4jException - */ - public function commit() + public function pushStack(Stack $stack) { - $this->checkIfOpened(); - $response = $this->handleResponse($this->client->commitTransaction($this->transactionId, null, array(), $this->conn, $this->queryMode)); - $this->active = false; - - return $response; + $this->queue[] = $stack; } - /** - * @return array|\Neoxygen\NeoClient\Formatter\Response|string - * - * @throws \Neoxygen\NeoClient\Exception\Neo4jException - */ - public function rollback() + public function begin() { - $this->checkIfOpened(); - if ($this->isAbove225Version()) { - $this->active = false; - return true; - } - try { - $response = $this->handleResponse($this->client->rollBackTransaction($this->transactionId)); - } catch (HttpException $e) { - + if ($this->state === self::ROLLED_BACK || $this->state === self::COMMITTED) { + throw new \RuntimeException(sprintf('Cannot begin a transaction when state is "%s"', $this->state)); // @todo change to TransactionException } - $this->active = false; - - return $response; } - /** - * @return \Neoxygen\NeoClient\Formatter\Result[] - */ - public function getResults() + public function isOpen() { - return $this->results; + return self::OPENED === $this->state; } - /** - * @return mixed - */ - public function getLastResult() + public function isCommited() { - $last = end($this->results); - reset($this->results); - - return $last; + return self::COMMITTED === $this->state; } - /** - * @return bool - */ - public function isActive() + public function isRolledBack() { - return $this->active; + return self::ROLLED_BACK === $this->state; } - /** - * @return mixed - */ - public function getTransactionId() - { - return $this->transactionId; - } - - /** - * - */ - private function parseTransactionId() + public function status() { - $expl = explode('/', $this->commitUrl); - $this->transactionId = (int) $expl[6]; + return $this->state; } - /** - * @throws \Neoxygen\NeoClient\Exception\Neo4jException - */ - private function checkIfOpened() - { - if (!$this->isActive()) { - throw new Neo4jException('The transaction has not been opened or is closed'); - } - } - - /** - * @param $httpResponse - * - * @return array|\Neoxygen\NeoClient\Formatter\Response|string|\GraphAware\NeoClient\Formatter\Response - */ - private function handleResponse($response) + public function commit() { - if ($this->client->newFormatModeEnabled === true) { - return $response; - } - - return $this->client->handleHttpResponse($response); + return $this->connection->runMixed($this->queue); } - private function isAbove225Version() + public function rollback() { - if (null !== $this->version) { - $v = (int) str_replace('.', '', trim($this->version)); - if ($v > 225) { - return true; - } - } - - return false; + // TODO: Implement rollback() method. } -} +} \ No newline at end of file From 8569003ce76930315d2148fdb2d9ac11ac9ebd86 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 23:20:27 +0100 Subject: [PATCH 065/217] Client Transaction embeds DriverTransaction --- src/Client.php | 3 +- src/HttpDriver/Transaction.php | 14 ++++++ src/Transaction/Transaction.php | 85 +++++++++++++++++++-------------- 3 files changed, 64 insertions(+), 38 deletions(-) diff --git a/src/Client.php b/src/Client.php index 9153d263..439aab55 100644 --- a/src/Client.php +++ b/src/Client.php @@ -70,8 +70,9 @@ public function runStack(Stack $stack) public function transaction($connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); + $driverTransaction = $connection->getTransaction(); - return $connection->getTransaction(); + return new Transaction($driverTransaction); } /** diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php index 5d70e6ad..9033bfe3 100644 --- a/src/HttpDriver/Transaction.php +++ b/src/HttpDriver/Transaction.php @@ -86,6 +86,20 @@ public function run(Statement $statement) } } + public function runMultiple(array $statements) + { + try { + return $this->session->pushToTransaction($this->transactionId, $statements); + } catch (Neo4jException $e) { + if ($e->effect() === Neo4jException::EFFECT_ROLLBACK) { + $this->closed = true; + $this->state = self::ROLLED_BACK; + + throw $e; + } + } + } + public function success() { $this->assertNotClosed(); diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index cfcf4bf7..459f2b41 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -13,26 +13,15 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Transaction\TransactionInterface; -use GraphAware\Neo4j\Client\Connection\Connection; +use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Stack; -class Transaction implements TransactionInterface +class Transaction { - const OPENED = 'OPEN'; - - const COMMITTED = 'COMMITED'; - - const ROLLED_BACK = 'ROLLED_BACK'; - - /** - * @var \GraphAware\Neo4j\Client\Connection\Connection - */ - protected $connection; - /** - * @var null|string + * @var \GraphAware\Common\Transaction\TransactionInterface */ - protected $state; + private $driverTransaction; /** * @var array() @@ -40,28 +29,31 @@ class Transaction implements TransactionInterface protected $queue = []; /** - * @var array + * Transaction constructor. + * @param \GraphAware\Common\Transaction\TransactionInterface $driverTransaction */ - protected $results = []; - - /** - * @var array - */ - protected $taggedResults = []; - - /** - * @param \GraphAware\Neo4j\Client\Connection\Connection $connection - */ - public function __construct(Connection $connection) + public function __construct(TransactionInterface $driverTransaction) { - $this->connection = $connection; + $this->driverTransaction = $driverTransaction; } + /** + * Push a statement to the queue, without actually sending it + * + * @param string $statement + * @param array $parameters + * @param string|null $tag + */ public function push($statement, array $parameters = array(), $tag = null) { $this->queue[] = Statement::create($statement, $parameters, $tag); } + /** + * Push a statements Stack to the queue, without actually sending it + * + * @param \GraphAware\Neo4j\Client\Stack $stack + */ public function pushStack(Stack $stack) { $this->queue[] = $stack; @@ -69,38 +61,57 @@ public function pushStack(Stack $stack) public function begin() { - if ($this->state === self::ROLLED_BACK || $this->state === self::COMMITTED) { - throw new \RuntimeException(sprintf('Cannot begin a transaction when state is "%s"', $this->state)); // @todo change to TransactionException - } + $this->driverTransaction->begin(); } public function isOpen() { - return self::OPENED === $this->state; + return $this->driverTransaction->isOpen(); } public function isCommited() { - return self::COMMITTED === $this->state; + return $this->driverTransaction->isCommited(); } public function isRolledBack() { - return self::ROLLED_BACK === $this->state; + return $this->driverTransaction->isRolledBack(); } public function status() { - return $this->state; + return $this->driverTransaction->status(); } public function commit() { - return $this->connection->runMixed($this->queue); + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + $this->driverTransaction->begin(); + } + if (!empty($this->queue)) { + $stack = []; + foreach ($this->queue as $element) { + if ($element instanceof Stack) { + foreach ($element->statements() as $statement) { + $stack[] = $statement; + } + } else { + $stack[] = $element; + } + } + + $result = $this->driverTransaction->runMultiple($stack); + $this->driverTransaction->commit(); + $this->queue = []; + return $result; + } else { + return $this->driverTransaction->commit(); + } } public function rollback() { - // TODO: Implement rollback() method. + return $this->driverTransaction->rollback(); } } \ No newline at end of file From e6430438135f6c2a7281c842344bc407e92a6346 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 23:31:37 +0100 Subject: [PATCH 066/217] runStack --- src/Transaction/Transaction.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index 459f2b41..544ea881 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -59,6 +59,19 @@ public function pushStack(Stack $stack) $this->queue[] = $stack; } + public function runStack(Stack $stack) + { + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + $this->driverTransaction->begin(); + } + $sts = []; + foreach ($stack->statements() as $statement) { + $sts[] = $statement; + } + + return $this->driverTransaction->runMultiple($sts); + } + public function begin() { $this->driverTransaction->begin(); From 4a7014aeef3e6c73d40921cc21e4facd7ad790f1 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jan 2016 23:52:55 +0100 Subject: [PATCH 067/217] Transaction docs --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/README.md b/README.md index b56587c7..29bf3b49 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,73 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `values()` : returns the properties of the relationship (array) * `value($key)` : returns the value for the given property key +### Working with Transactions + +The Client provides a Transaction object that ease how you would work with transactions. + +#### Creating a Transaction + +```php + +$tx = $client->transaction(); +``` + +At this stage, nothing has been sent to the server yet (the statement BEGIN has not been sent), this permits to stack queries or Stack objects before commiting them. + +#### Stack a query + +``` +$tx->push("CREATE (n:Person) RETURN id(n)"); +``` + +Again, until now nothing has been sent. + +#### Run a query in a Transaction + +Sometimes you want to get an immediate result of a statement inside the transaction, this can be done with the `run` method : + +```php + +$result = $tx->run("CREATE (n:Person) SET n.name = {name} RETURN id(n)", ['name' => 'Michal']); + +echo $result->getRecord()->value("id(n)"); +``` + +If the transaction has not yet begun, the BEGIN of the transaction will be done automatically. +``` + +#### You can also push or run Stacks + +```php + +$stack = $client->stack(); +$stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); +$stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[:FOLLOWS]->(n2)', ['uuid1' => '123-fff', 'uuid2' => '456-ddd']); + +$tx->pushStack($stack); +// or +$results = $tx->runStack($stack); +``` + +### Commit and Rollback + +if you have queued statements in your transaction (those added with the `push` methods) and you have finish your job, you can commit the transaction and receive +the results : + +```php +$stack = $client->stack(); +$stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); +$stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[:FOLLOWS]->(n2)', ['uuid1' => '123-fff', 'uuid2' => '456-ddd']); + +$tx->pushStack($stack); +$tx->pushQuery("MATCH (n) RETURN count(n)"); + +$results = $tx->commit(); +``` + +After a commit, you will not be able to `push` or `run` statements in this transaction. + + ### License The library is released under the MIT License, refer to the LICENSE file. From abb6a2fc24a5d9f38f61bfc2ae8f055fce9dd961 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 13 Jan 2016 14:19:32 +0100 Subject: [PATCH 068/217] updated deps --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 8075d074..ae63cd90 100644 --- a/composer.lock +++ b/composer.lock @@ -54,16 +54,16 @@ }, { "name": "graphaware/neo4j-common", - "version": "1.13.1", + "version": "1.13.2", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "683aa323386a511409ab43ebe20fc9f8f3ad6e00" + "reference": "4a1ebb39c51e49286cf2e391ced2f9121de876f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/683aa323386a511409ab43ebe20fc9f8f3ad6e00", - "reference": "683aa323386a511409ab43ebe20fc9f8f3ad6e00", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4a1ebb39c51e49286cf2e391ced2f9121de876f5", + "reference": "4a1ebb39c51e49286cf2e391ced2f9121de876f5", "shasum": "" }, "require": { @@ -96,7 +96,7 @@ "neo4j", "statement" ], - "time": "2016-01-12 12:15:56" + "time": "2016-01-13 13:18:10" }, { "name": "guzzlehttp/guzzle", From 6f55dd372d1b66d7491d4a3c5dd2cec3cee3e9ad Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 18 Jan 2016 01:34:28 +0100 Subject: [PATCH 069/217] updated deps and hasValue method --- composer.lock | 10 +++++----- src/Formatter/RecordView.php | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index ae63cd90..c777ca60 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "b00e0cc340ccd7ae17aab1c44f3df4737570f8ef" + "reference": "2829e32bb40aa1b74c7f22918af074afaa5aecfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/b00e0cc340ccd7ae17aab1c44f3df4737570f8ef", - "reference": "b00e0cc340ccd7ae17aab1c44f3df4737570f8ef", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/2829e32bb40aa1b74c7f22918af074afaa5aecfe", + "reference": "2829e32bb40aa1b74c7f22918af074afaa5aecfe", "shasum": "" }, "require": { @@ -50,7 +50,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-12 20:55:41" + "time": "2016-01-18 00:31:33" }, { "name": "graphaware/neo4j-common", diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index 39ee7e8e..d1eb3b2a 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -113,6 +113,11 @@ public function values() return $this->values; } + public function hasValue($key) + { + return array_key_exists($key, $this->keyToIndexMap); + } + /** * @param $index * @return mixed From 33b4f2353da96591dcc8952dce631c758e2ee5ba Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Jan 2016 14:09:33 +0100 Subject: [PATCH 070/217] updated deps --- composer.lock | 161 +++++++------------------------------------------- 1 file changed, 20 insertions(+), 141 deletions(-) diff --git a/composer.lock b/composer.lock index c777ca60..8f85d4a3 100644 --- a/composer.lock +++ b/composer.lock @@ -9,27 +9,25 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.0.3", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "2829e32bb40aa1b74c7f22918af074afaa5aecfe" + "reference": "296c352c4c21c71633b3577d2aaf7a4aff915ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/2829e32bb40aa1b74c7f22918af074afaa5aecfe", - "reference": "2829e32bb40aa1b74c7f22918af074afaa5aecfe", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/296c352c4c21c71633b3577d2aaf7a4aff915ad3", + "reference": "296c352c4c21c71633b3577d2aaf7a4aff915ad3", "shasum": "" }, "require": { "graphaware/neo4j-common": "^1.7", "myclabs/php-enum": "^1.4", - "symfony/console": "^2.7", "symfony/event-dispatcher": "^2.7" }, "require-dev": { "behat/behat": "~3.0.4", - "neoxygen/neoclient": "^3.3", "phpunit/phpunit": "^4.8", "symfony/stopwatch": "^2.7" }, @@ -50,20 +48,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-18 00:31:33" + "time": "2016-01-21 13:03:39" }, { "name": "graphaware/neo4j-common", - "version": "1.13.2", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "4a1ebb39c51e49286cf2e391ced2f9121de876f5" + "reference": "ddda42b2d8bd5767323ab4430e99b29a7614f909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4a1ebb39c51e49286cf2e391ced2f9121de876f5", - "reference": "4a1ebb39c51e49286cf2e391ced2f9121de876f5", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ddda42b2d8bd5767323ab4430e99b29a7614f909", + "reference": "ddda42b2d8bd5767323ab4430e99b29a7614f909", "shasum": "" }, "require": { @@ -96,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-01-13 13:18:10" + "time": "2016-01-13 22:44:18" }, { "name": "guzzlehttp/guzzle", @@ -477,78 +475,18 @@ ], "time": "2012-12-21 11:40:51" }, - { - "name": "symfony/console", - "version": "v2.8.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", - "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-12-22 10:25:57" - }, { "name": "symfony/event-dispatcher", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" + "reference": "ee278f7c851533e58ca307f66305ccb9188aceda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc", - "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ee278f7c851533e58ca307f66305ccb9188aceda", + "reference": "ee278f7c851533e58ca307f66305ccb9188aceda", "shasum": "" }, "require": { @@ -595,79 +533,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-10-30 20:15:42" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25", - "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2015-11-20 09:19:13" + "time": "2016-01-13 10:28:07" }, { "name": "symfony/yaml", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966" + "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", - "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", + "url": "https://api.github.com/repos/symfony/yaml/zipball/34c8a4b51e751e7ea869b8262f883d008a2b81b8", + "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8", "shasum": "" }, "require": { @@ -703,7 +582,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-12-26 13:37:56" + "time": "2016-01-13 10:28:07" } ], "packages-dev": [ From 62a9cb868bb3695d368e4435b89e8e63e17b49a2 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Jan 2016 17:06:22 +0100 Subject: [PATCH 071/217] updated bolt dep --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 8f85d4a3..7a1faa91 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "296c352c4c21c71633b3577d2aaf7a4aff915ad3" + "reference": "1ace96f292cb15f1cf9f0e28dd17b5cba250226c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/296c352c4c21c71633b3577d2aaf7a4aff915ad3", - "reference": "296c352c4c21c71633b3577d2aaf7a4aff915ad3", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/1ace96f292cb15f1cf9f0e28dd17b5cba250226c", + "reference": "1ace96f292cb15f1cf9f0e28dd17b5cba250226c", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-21 13:03:39" + "time": "2016-01-21 16:01:15" }, { "name": "graphaware/neo4j-common", From 7c574fe89c8f62013c8589c675983e95be8ee3ec Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Jan 2016 17:34:39 +0100 Subject: [PATCH 072/217] updated dep --- composer.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 7a1faa91..a86d4253 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "1ace96f292cb15f1cf9f0e28dd17b5cba250226c" + "reference": "dc4eccb09440cb16cbd71df745a786002eb5b8a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/1ace96f292cb15f1cf9f0e28dd17b5cba250226c", - "reference": "1ace96f292cb15f1cf9f0e28dd17b5cba250226c", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/dc4eccb09440cb16cbd71df745a786002eb5b8a4", + "reference": "dc4eccb09440cb16cbd71df745a786002eb5b8a4", "shasum": "" }, "require": { @@ -48,20 +48,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-21 16:01:15" + "time": "2016-01-21 16:26:43" }, { "name": "graphaware/neo4j-common", - "version": "1.13.3", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "ddda42b2d8bd5767323ab4430e99b29a7614f909" + "reference": "d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ddda42b2d8bd5767323ab4430e99b29a7614f909", - "reference": "ddda42b2d8bd5767323ab4430e99b29a7614f909", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a", + "reference": "d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-01-13 22:44:18" + "time": "2016-01-21 16:31:06" }, { "name": "guzzlehttp/guzzle", From 674225652faebe6b842f9dd71e5f612d81c37d40 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Jan 2016 17:38:43 +0100 Subject: [PATCH 073/217] adapted to last result collection --- src/Formatter/ResponseFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index a7849035..f6757965 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -35,7 +35,7 @@ public function format(array $response, array $statements) } $results = new ResultCollection(); foreach ($response['results'] as $k => $result) { - $resultO = new Result($statements[$k]); + $resultO = new Result($statements[$k], $statements[$k]->getTag()); $resultO->setFields($result['columns']); foreach ($result['data'] as $data) { $resultO->pushRecord($data['rest']); From ae2ebd5de5fa7f0120dd5252544435c2974a4956 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Jan 2016 17:44:16 +0100 Subject: [PATCH 074/217] fix last commit --- src/Formatter/ResponseFormatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index f6757965..a17ce781 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -35,7 +35,7 @@ public function format(array $response, array $statements) } $results = new ResultCollection(); foreach ($response['results'] as $k => $result) { - $resultO = new Result($statements[$k], $statements[$k]->getTag()); + $resultO = new Result($statements[$k]); $resultO->setFields($result['columns']); foreach ($result['data'] as $data) { $resultO->pushRecord($data['rest']); @@ -43,7 +43,7 @@ public function format(array $response, array $statements) if (array_key_exists('stats', $result)) { $resultO->setStats($result['stats']); } - $results->add($resultO); + $results->add($resultO, $statements[$k]->getTag()); } return $results; From 44c84341582426d44b79c75f582696ab05a3be66 Mon Sep 17 00:00:00 2001 From: Aaron Scherer Date: Thu, 21 Jan 2016 14:32:46 -0800 Subject: [PATCH 075/217] Small updates --- .gitignore | 5 +- .travis.yml | 3 +- LICENSE | 2 +- README.md | 2 +- composer.json | 45 +- composer.lock | 2167 ------------------------------------------------- 6 files changed, 26 insertions(+), 2198 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 8efe547d..f094bd95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,7 @@ vendor/ test.php -bin/behat -bin/phpspec -bin/phpunit +bin/* tests/_reports tests/database_settings.yml cache/ neoclient.yml -.idea diff --git a/.travis.yml b/.travis.yml index ecb6986c..5e14c3b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: - NEO_VERSION="2.3.0" - NEO_VERSION="2.3.1" - before_install: - wget dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null - tar -xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null @@ -19,7 +18,7 @@ before_install: - composer self-update before_script: - - composer install --prefer-source --no-interaction + - travis_retry composer install --prefer-source --no-interaction - mv tests/database_settings.yml.dist tests/database_settings.yml script: diff --git a/LICENSE b/LICENSE index 50e9b0db..78449037 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 Christophe Willemsen +Copyright (c) 2014-2016 Christophe Willemsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 035b41ae..f966294b 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Neo4j is a transactional, open-source graph database. A graph database manages d ### Requirements -* PHP 5.5+ +* PHP >= 5.5, < 8.0 * A Neo4j database (minimum version 2.1.6) ### Getting Help diff --git a/composer.json b/composer.json index 57b3a232..fa553378 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "graphaware/neo4j-php-client", - "type": "library", - "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", - "keywords": [ + "name": "graphaware/neo4j-php-client", + "type": "library", + "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", + "keywords": [ "graph", "neo4j", "cluster", @@ -11,32 +11,31 @@ "bolt", "binary" ], - "homepage": "http://graphaware.com", - "license": "MIT", - "authors": [ + "homepage": "http://graphaware.com", + "license": "MIT", + "authors": [ { - "name": "Christophe Willemsen", + "name": "Christophe Willemsen", "email": "christophe@graphaware.com" } ], - "require": { - "php": ">= 5.5", - "guzzlehttp/guzzle": "^6.0", - "monolog/monolog": "~1.1", - "symfony/yaml": "^2.7", - "symfony/config": "^2.7", - "symfony/dependency-injection": "^2.7", - "symfony/event-dispatcher": "^2.7", + "require": { + "php": "^5.5|^7.0", + "guzzlehttp/guzzle": "^6.0", + "monolog/monolog": "^1.1", + "symfony/yaml": "^2.7", + "symfony/config": "^2.7", + "symfony/dependency-injection": "^2.7", + "symfony/event-dispatcher": "^2.7", "graphaware/neo4j-response-formatter": "^1.0" }, - "require-dev": { - "phpspec/phpspec": "~2.0", - "phpunit/phpunit": "4.*", + "require-dev": { + "phpspec/phpspec": "~2.0", + "phpunit/phpunit": "4.*", "bossa/phpspec2-expect": "*", - "behat/behat": "~3.0" - + "behat/behat": "~3.0" }, - "autoload": { + "autoload": { "psr-4": { "Neoxygen\\NeoClient\\": "src/" } @@ -46,7 +45,7 @@ "Neoxygen\\NeoClient\\Tests\\": "tests/Neoxygen/NeoClient/Tests" } }, - "extra": { + "extra": { "branch-alias": { "dev-master": "3.1-dev" } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index b353dcda..00000000 --- a/composer.lock +++ /dev/null @@ -1,2167 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "e60d2b09a5ccc646058d3081d74f563a", - "packages": [ - { - "name": "graphaware/neo4j-response-formatter", - "version": "1.1.5", - "source": { - "type": "git", - "url": "https://github.com/graphaware/neo4j-php-response-formatter.git", - "reference": "1cc1ac1bc1f573aeb231ee424c55fae137beea47" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-response-formatter/zipball/1cc1ac1bc1f573aeb231ee424c55fae137beea47", - "reference": "1cc1ac1bc1f573aeb231ee424c55fae137beea47", - "shasum": "" - }, - "require": { - "psr/http-message": "^1.0" - }, - "require-dev": { - "neoxygen/neoclient": "^3.2", - "phpspec/prophecy": "^1.4", - "phpunit/phpunit": "^4.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "GraphAware\\NeoClient\\Formatter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Willemsen", - "email": "christophe@graphaware.com" - } - ], - "description": "Response Formatter for NeoClient", - "time": "2015-08-04 22:19:01" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.0.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a8dfeff00eb84616a17fea7a4d72af35e750410f", - "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.0-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-07-04 20:09:24" - }, - { - "name": "guzzlehttp/promises", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7", - "reference": "2ee5bc7f1a92efecc90da7f6711a53a7be26b5b7", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2015-06-24 16:16:25" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/af0e1758de355eb113917ad79c3c0e3604bce4bd", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2015-06-24 19:55:15" - }, - { - "name": "monolog/monolog", - "version": "1.15.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/dc5150cc608f2334c72c3b6a553ec9668a4156b0", - "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.8", - "ruflin/elastica": ">=0.90 <3.0", - "swiftmailer/swiftmailer": "~5.3", - "videlalvaro/php-amqplib": "~2.4" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.15.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2015-07-12 13:54:09" - }, - { - "name": "psr/http-message", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "symfony/config", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", - "reference": "851e3ffe8a366b1590bdaf3df2c1395f2d27d8a6", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-06-18 19:21:56" - }, - { - "name": "symfony/filesystem", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/yaml", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" - } - ], - "packages-dev": [ - { - "name": "behat/behat", - "version": "v3.0.15", - "source": { - "type": "git", - "url": "https://github.com/Behat/Behat.git", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", - "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", - "shasum": "" - }, - "require": { - "behat/gherkin": "~4.3", - "behat/transliterator": "~1.0", - "ext-mbstring": "*", - "php": ">=5.3.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.3", - "symfony/console": "~2.1", - "symfony/dependency-injection": "~2.1", - "symfony/event-dispatcher": "~2.1", - "symfony/translation": "~2.3", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.0", - "symfony/process": "~2.1" - }, - "suggest": { - "behat/mink-extension": "for integration with Mink testing framework", - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework" - }, - "bin": [ - "bin/behat" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Behat": "src/", - "Behat\\Testwork": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Agile", - "BDD", - "ScenarioBDD", - "Scrum", - "StoryBDD", - "User story", - "business", - "development", - "documentation", - "examples", - "symfony", - "testing" - ], - "time": "2015-02-22 14:10:33" - }, - { - "name": "behat/gherkin", - "version": "v4.3.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/43777c51058b77bcd84a8775b7a6ad05e986b5db", - "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "time": "2014-06-06 01:24:32" - }, - { - "name": "behat/transliterator", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/Behat/Transliterator.git", - "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", - "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Transliterator": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Artistic-1.0" - ], - "description": "String transliterator", - "keywords": [ - "i18n", - "slug", - "transliterator" - ], - "time": "2014-05-15 22:08:22" - }, - { - "name": "bossa/phpspec2-expect", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/BossaConsulting/phpspec2-expect.git", - "reference": "f3a80b7fa743b8a1078a7e320bd3e8b8b6283780" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/BossaConsulting/phpspec2-expect/zipball/f3a80b7fa743b8a1078a7e320bd3e8b8b6283780", - "reference": "f3a80b7fa743b8a1078a7e320bd3e8b8b6283780", - "shasum": "" - }, - "require": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "autoload": { - "files": [ - "expect.php" - ], - "psr-0": { - "Bossa\\PhpSpec\\Expect\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Helper that decorates any SUS with a phpspec lazy object wrapper", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification" - ], - "time": "2014-09-12 09:25:51" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/php-diff", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton", - "role": "Original developer" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2013-11-01 13:02:21" - }, - { - "name": "phpspec/phpspec", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec.git", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/e9a40577323e67f1de2e214abf32976a0352d8f8", - "reference": "e9a40577323e67f1de2e214abf32976a0352d8f8", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.1", - "php": ">=5.3.3", - "phpspec/php-diff": "~1.0.0", - "phpspec/prophecy": "~1.4", - "sebastian/exporter": "~1.0", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "behat/behat": "^3.0.11", - "bossa/phpspec2-expect": "~1.0", - "phpunit/phpunit": "~4.4", - "symfony/filesystem": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" - }, - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "PhpSpec": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.3+", - "homepage": "http://phpspec.net/", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification", - "testing", - "tests" - ], - "time": "2015-05-30 15:21:40" - }, - { - "name": "phpspec/prophecy", - "version": "v1.4.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2015-04-27 22:15:08" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-08-04 03:42:39" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-06-21 13:08:43" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-06-19 03:43:16" - }, - { - "name": "phpunit/phpunit", - "version": "4.7.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2015-07-13 11:28:34" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-07-10 06:54:24" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/environment", - "version": "1.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-08-03 06:14:51" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2014-10-06 09:23:50" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/class-loader", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/ClassLoader.git", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", - "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "time": "2015-06-25 12:52:11" - }, - { - "name": "symfony/console", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-07-28 15:18:12" - }, - { - "name": "symfony/finder", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/process", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 11:25:50" - }, - { - "name": "symfony/translation", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">= 5.5" - }, - "platform-dev": [] -} From 3ce6b5687bc30fc5087faecca16baa26c51c75b3 Mon Sep 17 00:00:00 2001 From: Aaron Scherer Date: Thu, 21 Jan 2016 15:25:26 -0800 Subject: [PATCH 076/217] Fixing style --- composer.json | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index fa553378..47d0c7df 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "graphaware/neo4j-php-client", - "type": "library", - "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", - "keywords": [ + "name": "graphaware/neo4j-php-client", + "type": "library", + "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", + "keywords": [ "graph", "neo4j", "cluster", @@ -11,31 +11,32 @@ "bolt", "binary" ], - "homepage": "http://graphaware.com", - "license": "MIT", - "authors": [ + "homepage": "http://graphaware.com", + "license": "MIT", + "authors": [ { - "name": "Christophe Willemsen", + "name": "Christophe Willemsen", "email": "christophe@graphaware.com" } ], - "require": { - "php": "^5.5|^7.0", - "guzzlehttp/guzzle": "^6.0", - "monolog/monolog": "^1.1", - "symfony/yaml": "^2.7", - "symfony/config": "^2.7", - "symfony/dependency-injection": "^2.7", - "symfony/event-dispatcher": "^2.7", + "require": { + "php": "^5.5|^7.0", + "guzzlehttp/guzzle": "^6.0", + "monolog/monolog": "^1.1", + "symfony/yaml": "^2.7", + "symfony/config": "^2.7", + "symfony/dependency-injection": "^2.7", + "symfony/event-dispatcher": "^2.7", "graphaware/neo4j-response-formatter": "^1.0" }, - "require-dev": { - "phpspec/phpspec": "~2.0", - "phpunit/phpunit": "4.*", + "require-dev": { + "phpspec/phpspec": "~2.0", + "phpunit/phpunit": "4.*", "bossa/phpspec2-expect": "*", - "behat/behat": "~3.0" + "behat/behat": "~3.0" + }, - "autoload": { + "autoload": { "psr-4": { "Neoxygen\\NeoClient\\": "src/" } @@ -45,7 +46,7 @@ "Neoxygen\\NeoClient\\Tests\\": "tests/Neoxygen/NeoClient/Tests" } }, - "extra": { + "extra": { "branch-alias": { "dev-master": "3.1-dev" } From 5d178713a3f8e1a47660ac7db007a123ea1b2bc0 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 23 Jan 2016 10:14:02 +0100 Subject: [PATCH 077/217] adapted example for setting up a connection with http --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 29bf3b49..f7627e3a 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Neo4j is a transactional, open-source graph database. A graph database manages d ### Key features * Supports multiple connections +* Support for Bolt binary protocol * Built-in and automatic support for *Neo4j Enterprise HA Master-Slave Mode* with auto slaves fallback -* Fully extensible (You can create your own extensions) #### Neo4j Version Support @@ -74,7 +74,7 @@ require_once 'vendor/autoload.php'; use GraphAware\Neo4j\Client\ClientBuilder; $client = ClientBuilder::create() - ->addConnection('default', 'http://neo4j:password@localhost') + ->addConnection('default', 'http://neo4j:password@localhost:7474') ->build(); ``` From 447d851ec51d1d1cfa55364c12928a92f9df9124 Mon Sep 17 00:00:00 2001 From: Aaron Scherer Date: Sat, 23 Jan 2016 17:17:30 -0800 Subject: [PATCH 078/217] Updating spacing --- composer.json | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index f6b846e3..f16f7594 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "graphaware/neo4j-php-client", - "type": "library", - "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", - "keywords": [ + "name": "graphaware/neo4j-php-client", + "type": "library", + "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", + "keywords": [ "graph", "database", "neo4j", @@ -12,29 +12,30 @@ "http", "high-availibility" ], - "homepage": "http://graphaware.com", - "license": "MIT", - "authors": [ + "homepage": "http://graphaware.com", + "license": "MIT", + "authors": [ { - "name": "Christophe Willemsen", + "name": "Christophe Willemsen", "email": "christophe@graphaware.com" } ], - "require": { - "php": "^5.6|^7.0", - "graphaware/neo4j-bolt": "^1.0", - "guzzlehttp/guzzle": "^6.0", - "monolog/monolog": "^1.1", - "symfony/yaml": "^2.7", + "require": { + "php": "^5.6|^7.0", + "graphaware/neo4j-bolt": "^1.0", + "guzzlehttp/guzzle": "^6.0", + "monolog/monolog": "^1.1", + "symfony/yaml": "^2.7", "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-common": "^1.2", - "myclabs/php-enum": "^1.4" + "graphaware/neo4j-common": "^1.2", + "myclabs/php-enum": "^1.4" }, - "require-dev": { - "phpunit/phpunit": "4.*", + "require-dev": { + "phpunit/phpunit": "4.*", "symfony/stopwatch": "^3.0" + }, - "autoload": { + "autoload": { "psr-4": { "GraphAware\\Neo4j\\Client\\": "src/" } @@ -44,4 +45,4 @@ "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" } } -} +} \ No newline at end of file From 2852fe40de10fe90d105ef6703b280346c520126 Mon Sep 17 00:00:00 2001 From: Aaron Scherer Date: Sat, 23 Jan 2016 17:28:05 -0800 Subject: [PATCH 079/217] Updating spacing --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f16f7594..d902cb02 100644 --- a/composer.json +++ b/composer.json @@ -45,4 +45,4 @@ "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" } } -} \ No newline at end of file +} From 92c406c059adc079507c4a4f3ffa2748b803d401 Mon Sep 17 00:00:00 2001 From: k4zuk0 Date: Thu, 28 Jan 2016 10:13:29 +0100 Subject: [PATCH 080/217] replace deprecated call to `CanNotBeEmpty` in the DI definition --- src/DependencyInjection/Definition.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/Definition.php b/src/DependencyInjection/Definition.php index 5a74ba3f..1e5c5a74 100644 --- a/src/DependencyInjection/Definition.php +++ b/src/DependencyInjection/Definition.php @@ -76,7 +76,7 @@ public function getConfigTreeBuilder() ->end() ->arrayNode('ha_mode') ->children() - ->booleanNode('enabled')->CanNotBeEmpty()->end() + ->booleanNode('enabled')->defaultValue(false)->end() ->scalarNode('query_mode_header_key')->defaultValue('Neo4j-Query-Mode')->end() ->scalarNode('write_mode_header_value')->defaultValue('NEO4J_QUERY_WRITE')->end() ->scalarNode('read_mode_header_value')->defaultValue('NEO4J_QUERY_READ')->end() From 05c06ee1f1a6853a17dc65570d4466c047ce84dd Mon Sep 17 00:00:00 2001 From: k4zuk0 Date: Thu, 28 Jan 2016 10:14:30 +0100 Subject: [PATCH 081/217] allow dependencies to Symfony 3 packages --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 57b3a232..89242e3a 100644 --- a/composer.json +++ b/composer.json @@ -23,11 +23,11 @@ "php": ">= 5.5", "guzzlehttp/guzzle": "^6.0", "monolog/monolog": "~1.1", - "symfony/yaml": "^2.7", - "symfony/config": "^2.7", - "symfony/dependency-injection": "^2.7", - "symfony/event-dispatcher": "^2.7", - "graphaware/neo4j-response-formatter": "^1.0" + "symfony/yaml": "^2.7|~3.0", + "symfony/config": "^2.7|~3.0", + "symfony/dependency-injection": "^2.7|~3.0", + "symfony/event-dispatcher": "^2.7|~3.0", + "graphaware/neo4j-response-formatter": "^1.0" }, "require-dev": { "phpspec/phpspec": "~2.0", From eaa0026d7c0ea4c553f54f0e0991213e7ddeaf8a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 29 Jan 2016 22:11:26 +0100 Subject: [PATCH 082/217] up deps --- composer.json | 4 +- composer.lock | 227 +++++++++++++------------------------------------- 2 files changed, 57 insertions(+), 174 deletions(-) diff --git a/composer.json b/composer.json index 370dba0a..1808530d 100644 --- a/composer.json +++ b/composer.json @@ -24,9 +24,7 @@ "php": ">= 5.6", "graphaware/neo4j-bolt": "^1.0", "guzzlehttp/guzzle": "^6.0", - "monolog/monolog": "~1.1", - "symfony/yaml": "^2.7", - "symfony/event-dispatcher": "^2.7", + "symfony/event-dispatcher": "^2.7|^3.0", "graphaware/neo4j-common": "^1.2", "myclabs/php-enum": "^1.4" }, diff --git a/composer.lock b/composer.lock index a86d4253..937f3d0b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6599051306dad19a2f1c29e45ab482b8", - "content-hash": "1823bb1cc76af2635c87ca2523283791", + "hash": "92e185bf81c987185c43e7395d38bd3b", + "content-hash": "65e4b739c6e51d424c6a87b2724902cb", "packages": [ { "name": "graphaware/neo4j-bolt", @@ -211,16 +211,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" + "reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5d04bdd2881ac89abde1fb78cc234bce24327bb", + "reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb", "shasum": "" }, "require": { @@ -265,84 +265,7 @@ "stream", "uri" ], - "time": "2015-11-03 01:34:55" - }, - { - "name": "monolog/monolog", - "version": "1.17.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", - "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "^0.13", - "ruflin/elastica": ">=0.90 <3.0", - "swiftmailer/swiftmailer": "~5.3", - "videlalvaro/php-amqplib": "~2.4" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.16.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2015-10-14 12:51:02" + "time": "2016-01-23 01:23:02" }, { "name": "myclabs/php-enum", @@ -437,44 +360,6 @@ ], "time": "2015-05-04 20:22:00" }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, { "name": "symfony/event-dispatcher", "version": "v2.8.2", @@ -534,55 +419,6 @@ "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", "time": "2016-01-13 10:28:07" - }, - { - "name": "symfony/yaml", - "version": "v2.8.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/34c8a4b51e751e7ea869b8262f883d008a2b81b8", - "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2016-01-13 10:28:07" } ], "packages-dev": [ @@ -1536,6 +1372,55 @@ "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", "time": "2015-10-30 23:35:59" + }, + { + "name": "symfony/yaml", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "3df409958a646dad2bc5046c3fb671ee24a1a691" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3df409958a646dad2bc5046c3fb671ee24a1a691", + "reference": "3df409958a646dad2bc5046c3fb671ee24a1a691", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-12-26 13:39:53" } ], "aliases": [], From aa68ca82c95eb4f9242ec8f7cf78097f9f4fdfa5 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 30 Jan 2016 01:29:58 +0100 Subject: [PATCH 083/217] added note to install alpha version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44d87677..f85a5bb2 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ You can: Add the library to your composer dependencies : ```bash -composer require graphaware/neo4j-php-client +omposer require graphaware/neo4j-php-client:^4.0@alpha ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : From 0eda3da997b2f04e289ed3ec659d7fb9b056b727 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 4 Feb 2016 13:37:27 +0000 Subject: [PATCH 084/217] applied fix for issue #10 --- src/Formatter/ResponseFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index bf878ad3..ea0f9922 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -279,7 +279,7 @@ private function processRestEltType($elts, $columns, $idx) $this->processRestEltType($elt, $columns, $idx); } } else { - if (is_array($elts)) { + if (is_array($elts) && isset($elts['metadata'])) { if (array_key_exists('labels', $elts)) { $this->result->addNodeToIdentifier($elts['metadata']['id'], $columns[$idx]); } elseif (array_key_exists('type', $elts)) { From a6085a4f047f736242b243dc8e37333a477992a3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 4 Mar 2016 20:36:24 +0100 Subject: [PATCH 085/217] fix issue#12 + new path object --- src/Formatter/Path.php | 52 +++++++++++++++++++++++++++++ src/Formatter/ResponseFormatter.php | 20 ++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/Formatter/Path.php diff --git a/src/Formatter/Path.php b/src/Formatter/Path.php new file mode 100644 index 00000000..13221e83 --- /dev/null +++ b/src/Formatter/Path.php @@ -0,0 +1,52 @@ +" NeoClient package. + * + * (c) Neoxygen.io + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Neoxygen\NeoClient\Formatter; + +class Path +{ + /** + * @var int + */ + protected $length; + + /** + * @var \Neoxygen\NeoClient\Formatter\Relationship[] + */ + protected $relationships = []; + + /** + * Path constructor. + * @param int $length + * @param \Neoxygen\NeoClient\Formatter\Relationship[] $relationships + */ + public function __construct($length, array $relationships) + { + $this->length = $length; + $this->relationships = $relationships; + } + + /** + * @return int + */ + public function getLength() + { + return $this->length; + } + + /** + * @return Relationship[] + */ + public function getRelationships() + { + return $this->relationships; + } +} \ No newline at end of file diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index ea0f9922..dd26e3e7 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -319,7 +319,7 @@ private function formatRows($response) $el[0] = 'maybe relationship'; if (isset($response['results'][0]['data'][$k])) { $maybeRel = $response['results'][0]['data'][$k]['rest'][$y]; - if (isset($maybeRel['start'])) { + if (isset($maybeRel['start']) && !isset($maybeRel['directions'])) { $rows[$col][$i] = $this->getOnlyUsefulEdgeInfoFromRestFormat($maybeRel); } if (is_array($maybeRel)) { @@ -333,6 +333,9 @@ private function formatRows($response) $rows[$col][$i] = $this->getUsefulRestEdgeInfoFromCollection($maybeRel); } } + if (isset($maybeRel['directions'])) { // then it's a path + $rows[$col][$i] = $this->parsePath($maybeRel); + } } } @@ -346,8 +349,23 @@ private function formatRows($response) return $rows; } + public function parsePath($data) { + $relationships = []; + foreach ($data['relationships'] as $rel) { + // get rel id + $expl = explode('/', $rel); + $relId = (int) $expl[count($expl) -1]; + $relationships[] = $this->result->getRelationship($relId); + } + + return new Path($data['length'], $relationships); + } + private function getOnlyUsefulEdgeInfoFromRestFormat(array $rel) { + if (!isset($rel['metadata'])) { + print_r($rel); + } $data = [ 'id' => $rel['metadata']['id'], 'type' => $rel['metadata']['type'], From ee2f3f4dccd841be4d832c696804ddf675600551 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 4 Mar 2016 21:05:09 +0100 Subject: [PATCH 086/217] fix collection of paths --- src/Formatter/ResponseFormatter.php | 32 ++++++++++++++++++++++++----- src/Formatter/Result.php | 2 +- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index dd26e3e7..4dc7f706 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -103,7 +103,7 @@ public function format($response) if ($responseObject->containsResults()) { foreach ($responseObject->geRows() as $k => $v) { - if (!$this->result->hasIdentifier($k)) { + if (!$this->result->hasIdentifier($k) || $this->isPaths($v)) { $this->result->addIdentifierValue($k, $v); } } @@ -120,6 +120,19 @@ public function format($response) return $responseObject; } + public function isPaths($v) + { + if ($v instanceof Path) { + return true; + } + + if (is_array($v) && ($v[0] instanceof Path || $v[0][0] instanceof Path)) { + return true; + } + + return false; + } + /** * Returns the nodes from the Response array. * @@ -324,14 +337,26 @@ private function formatRows($response) } if (is_array($maybeRel)) { $areRels = false; + $arePaths = false; foreach ($maybeRel as $rel) { - if (isset($rel['start'])) { + if (isset($rel['start']) && !isset($rel['directions'])) { $areRels = true; } + if (isset($rel['directions'])) { + $arePaths = true; + } } if ($areRels) { $rows[$col][$i] = $this->getUsefulRestEdgeInfoFromCollection($maybeRel); } + + if ($arePaths) { + $paths = []; + foreach ($maybeRel as $p) { + $paths[] = $this->parsePath($p); + } + $rows[$col][$i] = $paths; + } } if (isset($maybeRel['directions'])) { // then it's a path $rows[$col][$i] = $this->parsePath($maybeRel); @@ -363,9 +388,6 @@ public function parsePath($data) { private function getOnlyUsefulEdgeInfoFromRestFormat(array $rel) { - if (!isset($rel['metadata'])) { - print_r($rel); - } $data = [ 'id' => $rel['metadata']['id'], 'type' => $rel['metadata']['type'], diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index b52ceff9..6ade6498 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -314,7 +314,7 @@ public function hasIdentifier($i) public function addIdentifierValue($k, $v) { if (array_key_exists($k, $this->identifiers)) { - return $this->addRowToIdentifier($k, $v); + $this->addRowToIdentifier($v, $k); } return $this->identifiers[$k] = $v; From dd7d0fe7ac3ec8e7a559f19d37427ba6a7d70505 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 4 Mar 2016 21:21:39 +0100 Subject: [PATCH 087/217] fix tests --- src/Formatter/ResponseFormatter.php | 2 +- .../NeoClient/Tests/Functional/{UseCaseTest.php => UseCase.php} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/Neoxygen/NeoClient/Tests/Functional/{UseCaseTest.php => UseCase.php} (100%) diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 4dc7f706..1021adb6 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -126,7 +126,7 @@ public function isPaths($v) return true; } - if (is_array($v) && ($v[0] instanceof Path || $v[0][0] instanceof Path)) { + if (is_array($v) && ($v[0] instanceof Path || (isset($v[0][0]) && $v[0][0] instanceof Path))) { return true; } diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php b/tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php similarity index 100% rename from tests/Neoxygen/NeoClient/Tests/Functional/UseCaseTest.php rename to tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php From a20b78e09d9702b2930c51c9e66742aaf5c889b0 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 13:14:18 +0100 Subject: [PATCH 088/217] fix empty coll undefined key --- src/Formatter/Result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 6ade6498..057b3aee 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -217,7 +217,7 @@ public function addNodeToIdentifier($nodeId, $identifier) { if (isset($this->identifiers[$identifier])) { foreach ($this->identifiers[$identifier] as $node) { - if (null === $node || $node->getId() === $nodeId) { + if (null === $node || ( !is_array($node) && $node->getId() === $nodeId)) { return; } } From a4360e893b00bce9d1a9564e00013482a69884d9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 21:32:31 +0100 Subject: [PATCH 089/217] fixed call to null for relationship --- src/Formatter/Result.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 057b3aee..32a5370d 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -239,6 +239,9 @@ public function addRelationshipToIdentifier($relationshipId, $identifier) public function addRowToIdentifier($value, $identifier) { + if (null === $value) { + return; + } $this->identifiers[$identifier][] = $value; } From 600c9865dfd7e3580cdc0a33ba767e067e1e6d81 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 21:36:12 +0100 Subject: [PATCH 090/217] added note for 4.0 --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 035b41ae..99ea4544 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Neo4j-PHP-Client +## NOTE TO USERS + +Branch 4.0 is due to be merged into master soon, while still in beta the branch is working and waiting the official +beta release of Neo4j's Bolt binary protocol which is supported already. + +Branch link here : https://github.com/graphaware/neo4j-php-client/tree/4.0 + ## An Enterprise Grade Client for Neo4j [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) From 12cf8a36f475e599defcfbf61c0d6dd59fa9449c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 23:11:02 +0100 Subject: [PATCH 091/217] doc fixes --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f85a5bb2..97ce5d7c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) +NB: This is the master development branch for 4.x (currently in Alpha), for previous versions refer to the 3.4 branch. + ## Introduction Neo4j-PHP-Client is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. @@ -43,7 +45,7 @@ Neo4j is a transactional, open-source graph database. A graph database manages d ### Requirements -* PHP >= 5.6, < 8.0 +* PHP >= 5.6 * A Neo4j database (minimum version 2.2.6) ### Getting Help @@ -296,7 +298,7 @@ After a commit, you will not be able to `push` or `run` statements in this trans ### License -The library is released under the MIT License, refer to the LICENSE file. +The library is released under the MIT License, refer to the LICENSE file bundled with this package. From 2c80fdc3e8a0bcc9d63332dc5a97c51a4d92236a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 23:20:40 +0100 Subject: [PATCH 092/217] fix readme conflict --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 9e3b99be..97ce5d7c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,5 @@ # GraphAware Neo4j PHP Client -## NOTE TO USERS - -Branch 4.0 is due to be merged into master soon, while still in beta the branch is working and waiting the official -beta release of Neo4j's Bolt binary protocol which is supported already. - -Branch link here : https://github.com/graphaware/neo4j-php-client/tree/4.0 - ## An Enterprise Grade Client for Neo4j [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) From e9ad13556fabd6cb23460037d19d0d8e4f8d5130 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 23:23:59 +0100 Subject: [PATCH 093/217] fix license for GA --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 78449037..eac75ae3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Christophe Willemsen +Copyright (c) 2015-2016 GraphAware Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From fd7ee41a1387fcc5a95fc6fa715a14f57b974410 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 14 Mar 2016 23:30:16 +0100 Subject: [PATCH 094/217] some readme fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97ce5d7c..41b77885 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Neo4j is a transactional, open-source graph database. A graph database manages d You can: - * Check out an [example application built with NeoClient](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) + * Check out an [example application built with GraphAware Neo4j Client](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=graphaware,php,neo4j) * For bugs, please feel free to create a [new issue on GitHub](https://github.com/graphaware/neo4j-php-client/issues/new) @@ -63,7 +63,7 @@ You can: Add the library to your composer dependencies : ```bash -omposer require graphaware/neo4j-php-client:^4.0@alpha +composer require graphaware/neo4j-php-client:^4.0@alpha ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : From 8cd6f21034dbc807b380b761a983f11b866430f0 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 15 Mar 2016 00:29:34 +0100 Subject: [PATCH 095/217] doc annotations fixes --- src/Client.php | 17 +++++++++++----- src/ClientBuilder.php | 29 +++++++++++++++++++++++----- src/Connection/ConnectionManager.php | 4 ++++ 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/Client.php b/src/Client.php index 439aab55..faadb477 100644 --- a/src/Client.php +++ b/src/Client.php @@ -34,7 +34,7 @@ public function __construct(ConnectionManager $connectionManager) * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Bolt\Result\Result + * @return \GraphAware\Common\Result\Result */ public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { @@ -45,6 +45,7 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = /** * @param string|null $tag + * * @return \GraphAware\Neo4j\Client\Stack */ public function stack($tag = null, $connectionAlias = null) @@ -67,6 +68,11 @@ public function runStack(Stack $stack) return $pipeline->run(); } + /** + * @param null $connectionAlias + * + * @return \GraphAware\Neo4j\Client\Transaction\Transaction + */ public function transaction($connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); @@ -76,10 +82,11 @@ public function transaction($connectionAlias = null) } /** - * @param null $query - * @param null $parameters - * @param null $tag - * @param null $connectionAlias + * @param null|string $query + * @param null|array $parameters + * @param null|string $tag + * @param null|string $connectionAlias + * * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline */ private function pipeline($query = null, $parameters = null, $tag = null, $connectionAlias = null) diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 3d774aef..7707d988 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -17,20 +17,34 @@ class ClientBuilder { const PREFLIGHT_ENV_DEFAULT = 'NEO4J_DB_VERSION'; + /** + * @var array + */ protected $config = []; - protected $connectionManager; - public function __construct() { $this->config['connection_manager']['preflight_env'] = self::PREFLIGHT_ENV_DEFAULT; } + /** + * Creates a new Client factory + * + * @return \GraphAware\Neo4j\Client\ClientBuilder + */ public static function create() { return new self(); } + /** + * Add a connection to the handled connections + * + * @param string $alias + * @param string $uri + * + * @return $this + */ public function addConnection($alias, $uri) { $this->config['connections'][$alias]['uri'] = $uri; @@ -43,12 +57,17 @@ public function preflightEnv($variable) $this->config['connection_manager']['preflight_env'] = $variable; } + /** + * Builds a Client based on the connections given + * + * @return \GraphAware\Neo4j\Client\Client + */ public function build() { - $this->connectionManager = new ConnectionManager(); + $connectionManager = new ConnectionManager(); foreach ($this->config['connections'] as $alias => $conn) { - $this->connectionManager->registerConnection($alias, $conn['uri']); + $connectionManager->registerConnection($alias, $conn['uri']); } - return new Client($this->connectionManager); + return new Client($connectionManager); } } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 855a159e..74a10f0a 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -26,6 +26,10 @@ public function registerConnection($alias, $uri, $config = null) $this->connections[$alias] = new Connection($alias, $uri, $config); } + /** + * @param null $alias + * @return \GraphAware\Neo4j\Client\Connection\Connection + */ public function getConnection($alias = null) { if (null === $alias) { From 4269902f88695f4358d777281e1daa412f16f8b5 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 16 Mar 2016 15:10:25 +0100 Subject: [PATCH 096/217] updated to common 2.0 --- composer.json | 2 +- composer.lock | 26 ++-- src/Formatter/Path.php | 4 +- src/Formatter/RecordView.php | 23 ++- src/Formatter/ResponseFormatter.php | 2 +- src/Formatter/Result.php | 9 ++ src/Formatter/Type/Node.php | 37 +++++ src/HttpDriver/Result/ResultSummary.php | 9 ++ src/HttpDriver/Result/StatementStatistics.php | 2 +- src/NeoClientEvents.php | 14 -- src/Result/ResultCollection.php | 9 ++ src/Transaction/PreparedTransaction.php | 133 ------------------ 12 files changed, 104 insertions(+), 166 deletions(-) delete mode 100644 src/NeoClientEvents.php delete mode 100644 src/Transaction/PreparedTransaction.php diff --git a/composer.json b/composer.json index b4e52df2..7f5fbe6c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "graphaware/neo4j-bolt": "^1.0", "guzzlehttp/guzzle": "^6.0", "symfony/event-dispatcher": "^2.7|^3.0", - "graphaware/neo4j-common": "^1.14", + "graphaware/neo4j-common": "^2.0", "myclabs/php-enum": "^1.4" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 45a78514..a1b77347 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e7986e12974a9397135193737a43f348", - "content-hash": "7e7823f2a3d7b7d4f6761c2e89bcf473", + "hash": "f40b80384469305986ad8d9c5166b979", + "content-hash": "acf95e9978f6cb6522e82dbd4c7405a6", "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "fb67e50d00632f29592c759736b034e780eeb857" + "reference": "0b51bfc291d0e3efe386a56e5d641301170a983a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/fb67e50d00632f29592c759736b034e780eeb857", - "reference": "fb67e50d00632f29592c759736b034e780eeb857", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/0b51bfc291d0e3efe386a56e5d641301170a983a", + "reference": "0b51bfc291d0e3efe386a56e5d641301170a983a", "shasum": "" }, "require": { - "graphaware/neo4j-common": "^1.7", + "graphaware/neo4j-common": "^2.0", "myclabs/php-enum": "^1.4", "symfony/event-dispatcher": "^2.7|^3.0" }, @@ -48,20 +48,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-01-29 21:17:14" + "time": "2016-03-16 13:41:39" }, { "name": "graphaware/neo4j-common", - "version": "1.14.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a" + "reference": "3c496cda35ef3366ccacc6259316c48328960f50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a", - "reference": "d24eaeaaacb7cb6538ae2a144be5d54ee24fc07a", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/3c496cda35ef3366ccacc6259316c48328960f50", + "reference": "3c496cda35ef3366ccacc6259316c48328960f50", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-01-21 16:31:06" + "time": "2016-03-14 23:19:34" }, { "name": "guzzlehttp/guzzle", diff --git a/src/Formatter/Path.php b/src/Formatter/Path.php index 13221e83..34be016d 100644 --- a/src/Formatter/Path.php +++ b/src/Formatter/Path.php @@ -1,9 +1,9 @@ " NeoClient package. + * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index d1eb3b2a..e5e44d27 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -1,7 +1,7 @@ * @@ -135,4 +135,25 @@ public function record() return clone($this); } + /** + * @param string $key + * + * @return \GraphAware\Neo4j\Client\Formatter\Node|\GraphAware\Neo4j\Client\Formatter\Relationship|mixed + */ + public function get($key) + { + return $this->value($key); + } + + /** + * @param int $index + * + * @return mixed + */ + public function getByIndex($index) + { + return $this->valueByIndex($index); + } + + } \ No newline at end of file diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 4f57c511..6230b280 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -3,7 +3,7 @@ /** * This file is part of the GraphAware Neo4j Client package. * - * (c) Neoxygen.io + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 58185ceb..fbe1ef3d 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Result\AbstractRecordCursor; diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php index 976db63f..fa363457 100644 --- a/src/Formatter/Type/Node.php +++ b/src/Formatter/Type/Node.php @@ -81,8 +81,45 @@ public function hasValue($key) return array_key_exists($key, $this->properties); } + /** + * @return array + */ public function values() { return $this->properties; } + + /** + * @return array + */ + public function keys() + { + return array_keys($this->properties); + } + + /** + * @param string $key + * @return bool + */ + public function containsKey($key) + { + return array_key_exists($key, $this->properties); + } + + /** + * @param $key + * + * @return mixed + */ + public function get($key) + { + return $this->value($key); + } + + public function asArray() + { + return $this->properties; + } + + } \ No newline at end of file diff --git a/src/HttpDriver/Result/ResultSummary.php b/src/HttpDriver/Result/ResultSummary.php index 3a03c59e..1a97fd34 100644 --- a/src/HttpDriver/Result/ResultSummary.php +++ b/src/HttpDriver/Result/ResultSummary.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\HttpDriver\Result; use GraphAware\Common\Cypher\StatementInterface; diff --git a/src/HttpDriver/Result/StatementStatistics.php b/src/HttpDriver/Result/StatementStatistics.php index d2c9bb7f..217e382b 100644 --- a/src/HttpDriver/Result/StatementStatistics.php +++ b/src/HttpDriver/Result/StatementStatistics.php @@ -1,7 +1,7 @@ * diff --git a/src/NeoClientEvents.php b/src/NeoClientEvents.php deleted file mode 100644 index fe97aa65..00000000 --- a/src/NeoClientEvents.php +++ /dev/null @@ -1,14 +0,0 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\Result; use GraphAware\Common\Result\ResultCollection as BaseResultCollection; diff --git a/src/Transaction/PreparedTransaction.php b/src/Transaction/PreparedTransaction.php deleted file mode 100644 index aa1f1a68..00000000 --- a/src/Transaction/PreparedTransaction.php +++ /dev/null @@ -1,133 +0,0 @@ -connection = (string) $connection; - } - - if ($queryMode !== Client::NEOCLIENT_QUERY_MODE_WRITE && $queryMode !== Client::NEOCLIENT_QUERY_MODE_READ) { - throw new \InvalidArgumentExceptiont(sprintf( - 'The query mode %s for the PreparedTransaction is not valid', - $queryMode - )); - } - $this->queryMode = $queryMode; - $this->committed = false; - - return $this; - } - - /** - * @param $q - * @param null|array $p - * - * @return $this - */ - public function pushQuery($q, $p = array()) - { - if (!is_array($p)) { - throw new CommandException('Cypher query parameters should be of type array or null'); - } - $this->statements[] = array( - 'statement' => $q, - 'parameters' => $p, - ); - - return $this; - } - - /** - * @return bool - */ - public function hasStatements() - { - if (!empty($this->statements)) { - return true; - } - - return false; - } - - /** - * @return array - */ - public function getStatements() - { - return $this->statements; - } - - /** - * @return mixed - */ - public function getConnection() - { - return $this->connection; - } - - /** - * @return string - */ - public function getQueryMode() - { - return $this->queryMode; - } - - /** - * Commit the prepared transaction. - * - * @return mixed - * - * @throws \Neoxygen\NeoClient\Exception\CommandException if the transaction was already committed - */ - public function commit() - { - if ($this->committed) { - throw new CommandException('The prepared transaction has already been commited'); - } - - $response = Client::commitPreparedTransaction($this); - $this->committed = true; - - return $response; - } -} From a8728fec85697ee5afed208282e4385a93b131d5 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 17 Mar 2016 11:14:04 +0100 Subject: [PATCH 097/217] fix nodeValue method --- src/Formatter/RecordView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index e5e44d27..5419581e 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -81,7 +81,7 @@ public function value($key) */ public function nodeValue($key) { - if ($this->values[$key] !== null && !$this->values[$key] instanceof NodeInterface) { + if (!$this->hasValue('n') || !$this->get($key) instanceof NodeInterface) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'NODE')); } From 2e39071b8c70011d318d0ebb10b8a5a9c1eaa885 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 17 Mar 2016 11:16:23 +0100 Subject: [PATCH 098/217] fixed missing relationship implemented methods --- src/Formatter/Type/Relationship.php | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index b9b69ae9..1135b60f 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -123,4 +123,38 @@ public function values() { return $this->properties; } + + /** + * @return array + */ + public function keys() + { + return array_keys($this->properties); + } + + /** + * @param string $key + * + * @return bool + */ + public function containsKey($key) + { + return array_key_exists($key, $this->properties); + } + + /** + * @param string $key + * @return mixed + */ + public function get($key) + { + return $this->value($key); + } + + public function asArray() + { + return $this->properties; + } + + } \ No newline at end of file From 5348cd696df14fb67493442693c2b48719a9a5d8 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 18 Mar 2016 22:28:16 +0100 Subject: [PATCH 099/217] updated to common 2.0.2 --- composer.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index a1b77347..f6ee941c 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "0b51bfc291d0e3efe386a56e5d641301170a983a" + "reference": "cce966a5f3f402a9ad2c0db5b20407ee46d88157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/0b51bfc291d0e3efe386a56e5d641301170a983a", - "reference": "0b51bfc291d0e3efe386a56e5d641301170a983a", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/cce966a5f3f402a9ad2c0db5b20407ee46d88157", + "reference": "cce966a5f3f402a9ad2c0db5b20407ee46d88157", "shasum": "" }, "require": { @@ -48,20 +48,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-03-16 13:41:39" + "time": "2016-03-18 21:18:04" }, { "name": "graphaware/neo4j-common", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "3c496cda35ef3366ccacc6259316c48328960f50" + "reference": "4ddbf8b029dadd7048897299ca3dc0ef50f0881e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/3c496cda35ef3366ccacc6259316c48328960f50", - "reference": "3c496cda35ef3366ccacc6259316c48328960f50", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4ddbf8b029dadd7048897299ca3dc0ef50f0881e", + "reference": "4ddbf8b029dadd7048897299ca3dc0ef50f0881e", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-03-14 23:19:34" + "time": "2016-03-18 21:14:19" }, { "name": "guzzlehttp/guzzle", From 1606595808e07d490c778bf3faee671644bfe6f5 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 18 Mar 2016 23:58:21 +0100 Subject: [PATCH 100/217] fixed http driver for common 2.0.2 --- src/Formatter/Result.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index fbe1ef3d..97d0a6fa 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -114,4 +114,20 @@ private function extractIdFromRestUrl($url) return (int) $v; } + + public function size() + { + return count($this->records); + } + + public function firstRecord() + { + if (!empty($this->records)) { + return $this->records[0]; + } + + return null; + } + + } From 2debb658cd7cec699a5b03426bf3806c9e6d8bf1 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 19 Mar 2016 21:15:52 +0100 Subject: [PATCH 101/217] some tests and Path Object --- src/Client.php | 8 ++ src/Formatter/Path.php | 52 -------- src/Formatter/ResponseFormatter.php | 3 +- src/Formatter/Result.php | 96 ++++++++++++--- src/Formatter/Type/Path.php | 111 ++++++++++++++++++ src/HttpDriver/Session.php | 4 +- tests/Example/ReadmeExampleTest.php | 6 +- .../ClientSetupIntegrationTest.php | 33 ++++++ tests/Integration/CypherIntegrationTest.php | 51 ++++++++ tests/Integration/IntegrationTestCase.php | 32 +++++ 10 files changed, 323 insertions(+), 73 deletions(-) delete mode 100644 src/Formatter/Path.php create mode 100644 src/Formatter/Type/Path.php create mode 100644 tests/Integration/CypherIntegrationTest.php create mode 100644 tests/Integration/IntegrationTestCase.php diff --git a/src/Client.php b/src/Client.php index faadb477..7a2aaa39 100644 --- a/src/Client.php +++ b/src/Client.php @@ -112,4 +112,12 @@ public function sendCypherQuery($query, $parameters = null, $tag = null, $connec return $connection->run($query, $parameters, $tag); } + + /** + * @return \GraphAware\Neo4j\Client\Connection\ConnectionManager + */ + public function getConnectionManager() + { + return $this->connectionManager; + } } diff --git a/src/Formatter/Path.php b/src/Formatter/Path.php deleted file mode 100644 index 34be016d..00000000 --- a/src/Formatter/Path.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Neoxygen\NeoClient\Formatter; - -class Path -{ - /** - * @var int - */ - protected $length; - - /** - * @var \Neoxygen\NeoClient\Formatter\Relationship[] - */ - protected $relationships = []; - - /** - * Path constructor. - * @param int $length - * @param \Neoxygen\NeoClient\Formatter\Relationship[] $relationships - */ - public function __construct($length, array $relationships) - { - $this->length = $length; - $this->relationships = $relationships; - } - - /** - * @return int - */ - public function getLength() - { - return $this->length; - } - - /** - * @return Relationship[] - */ - public function getRelationships() - { - return $this->relationships; - } -} \ No newline at end of file diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 6230b280..e54f9e5c 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -27,6 +27,7 @@ class ResponseFormatter */ public function format(array $response, array $statements) { + //print_r($response); if (isset($response['errors'][0])) { $e = new Neo4jException($response['errors'][0]['message']); $e->setNeo4jStatusCode($response['errors'][0]['code']); @@ -38,7 +39,7 @@ public function format(array $response, array $statements) $resultO = new Result($statements[$k]); $resultO->setFields($result['columns']); foreach ($result['data'] as $data) { - $resultO->pushRecord($data['rest']); + $resultO->pushRecord($data['rest'], $data['graph']); } if (array_key_exists('stats', $result)) { $resultO->setStats($result['stats']); diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 97d0a6fa..80f9e251 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -13,6 +13,7 @@ use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Neo4j\Client\Formatter\Type\Node; +use GraphAware\Neo4j\Client\Formatter\Type\Path; use GraphAware\Neo4j\Client\Formatter\Type\Relationship; use GraphAware\Common\Cypher\StatementInterface; use GraphAware\Neo4j\Client\HttpDriver\Result\ResultSummary; @@ -30,22 +31,41 @@ class Result extends AbstractRecordCursor */ protected $fields = []; + /** + * @var \GraphAware\Neo4j\Client\HttpDriver\Result\ResultSummary + */ protected $resultSummary; + /** + * @var array + */ + private $graph; + public function __construct(StatementInterface $statement) { $this->resultSummary = new ResultSummary($statement); parent::__construct($statement); } + /** + * @param array $fields + */ public function setFields(array $fields) { $this->fields = $fields; } - public function pushRecord($data) + /** + * @param array $graph + */ + public function setGraph(array $graph) { - $mapped = $this->array_map_deep($data); + $this->graph = $graph; + } + + public function pushRecord($data, $graph) + { + $mapped = $this->array_map_deep($data, $graph); $this->records[] = new RecordView($this->fields, $mapped); } @@ -70,21 +90,35 @@ public function getRecord() return !empty($this->records) ? $this->records[0] : null; } + /** + * @return bool + */ public function hasRecord() { return !empty($this->records); } - public function position() + /** + * @return int + */ + public function size() { - // TODO: Implement position() method. + return count($this->records); } - public function skip() + /** + * @return \GraphAware\Common\Result\RecordViewInterface|null + */ + public function firstRecord() { + if (!empty($this->records)) { + return $this->records[0]; + } + + return null; } - private function array_map_deep(array $array) + private function array_map_deep(array $array, array $graph) { foreach ($array as $k => $v) { if (is_array($v)) { @@ -98,8 +132,13 @@ private function array_map_deep(array $array) $this->extractIdFromRestUrl($v['end']), $v['data'] ); + } elseif(array_key_exists('length', $v) && array_key_exists('relationships', $v) && array_key_exists('nodes', $v)) { + $array[$k] = new Path( + $this->getNodesFromPathMetadata($v, $graph), + $this->getRelationshipsFromPathMetadata($v, $graph) + ); } else { - $array[$k] = $this->array_map_deep($v); + $array[$k] = $this->array_map_deep($v, $graph); } } } @@ -115,19 +154,46 @@ private function extractIdFromRestUrl($url) return (int) $v; } - public function size() + private function getRelationshipsFromPathMetadata(array $metadata, array $graph) { - return count($this->records); + $rels = []; + + foreach ($metadata['relationships'] as $relationship) { + $relId = $this->extractIdFromRestUrl($relationship); + foreach ($graph['relationships'] as $grel) { + $grid = (int) $grel['id']; + if ($grid === $relId) { + $rels[$grid] = new Relationship( + $grel['id'], + $grel['type'], + $grel['startNode'], + $grel['endNode'], + $grel['properties'] + ); + } + } + } + + return array_values($rels); } - public function firstRecord() + private function getNodesFromPathMetadata(array $metadata, array $graph) { - if (!empty($this->records)) { - return $this->records[0]; + $nodes = []; + foreach ($metadata['nodes'] as $node) { + $nodeId = $this->extractIdFromRestUrl($node); + foreach ($graph['nodes'] as $gn) { + $gnid = (int) $gn['id']; + if ($gnid === $nodeId) { + $nodes[$nodeId] = new Node( + $gn['id'], + $gn['labels'], + $gn['properties'] + ); + } + } } - return null; + return array_values($nodes); } - - } diff --git a/src/Formatter/Type/Path.php b/src/Formatter/Type/Path.php new file mode 100644 index 00000000..14421f63 --- /dev/null +++ b/src/Formatter/Type/Path.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Formatter\Type; + +use GraphAware\Common\Type\NodeInterface; +use GraphAware\Common\Type\PathInterface; +use GraphAware\Common\Type\RelationshipInterface; + +class Path implements PathInterface +{ + /** + * @var \GraphAware\Neo4j\Client\Formatter\Type\Node[] + */ + protected $nodes; + + /** + * @var \GraphAware\Neo4j\Client\Formatter\Type\Relationship[] + */ + protected $relationships; + + /** + * Path constructor. + * @param array $nodes + * @param array $relationships + */ + public function __construct(array $nodes, array $relationships) + { + $this->nodes = $nodes; + $this->relationships = $relationships; + } + + /** + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node + */ + function start() + { + return $this->nodes[0]; + } + + /** + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node + */ + function end() + { + return $this->nodes[count($this->nodes)-1]; + } + + /** + * @return int + */ + function length() + { + return count($this->relationships); + } + + /** + * @param \GraphAware\Common\Type\NodeInterface $node + * @return bool + */ + function containsNode(NodeInterface $node) + { + foreach ($this->nodes as $n) { + if ($n->identity() === $node->identity()) { + return true; + } + } + + return false; + } + + /** + * @param \GraphAware\Common\Type\RelationshipInterface $relationship + * @return bool + */ + function containsRelationship(RelationshipInterface $relationship) + { + foreach ($this->relationships as $rel) { + if ($rel->identity() === $relationship->identity()) { + return true; + } + } + + return false; + } + + /** + * @return array|\GraphAware\Neo4j\Client\Formatter\Type\Node[] + */ + function nodes() + { + return $this->nodes; + } + + /** + * @return array|\GraphAware\Neo4j\Client\Formatter\Type\Relationship[] + */ + function relationships() + { + return $this->relationships; + } + +} \ No newline at end of file diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 1504c142..ed916779 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -103,7 +103,7 @@ public function prepareRequest(Pipeline $pipeline) foreach ($pipeline->statements() as $statement) { $st = [ 'statement' => $statement->text(), - 'resultDataContents' => ["REST"], + 'resultDataContents' => ["REST", "GRAPH"], 'includeStats' => true ]; if (!empty($statement->parameters())) { @@ -170,7 +170,7 @@ public function pushToTransaction($transactionId, array $statementsStack) foreach ($statementsStack as $statement) { $st = [ 'statement' => $statement->text(), - 'resultDataContents' => ["REST"], + 'resultDataContents' => ["REST", "GRAPH"], 'includeStats' => true ]; if (!empty($statement->parameters())) { diff --git a/tests/Example/ReadmeExampleTest.php b/tests/Example/ReadmeExampleTest.php index deab72ff..c7e7bb00 100644 --- a/tests/Example/ReadmeExampleTest.php +++ b/tests/Example/ReadmeExampleTest.php @@ -24,11 +24,11 @@ public function testReadingAResult() ]); $result = $this->client->run("MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name as name, collect(friend) as friends"); - $this->assertCount(1, $result->getRecords()); + $this->assertCount(1, $result->records()); - $record = $result->getRecord(); + $record = $result->firstRecord(); $this->assertEquals('Chris', $record->value('name')); $this->assertCount(1, $record->value('friends')); - $this->assertEquals('Ales', $record->value('friends')[0]->value('name')); + $this->assertEquals('Ales', $record->get('friends')[0]->get('name')); } } \ No newline at end of file diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index 2e9a9b4c..a0e2d830 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -13,6 +13,8 @@ use GraphAware\Neo4j\Client\Client; use GraphAware\Neo4j\Client\ClientBuilder; +use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; +use GraphAware\Bolt\Driver as BoltDriver; class ClientSetupIntegrationTest extends \PHPUnit_Framework_TestCase { @@ -24,4 +26,35 @@ public function testClientSetupWithOneConnection() $this->assertInstanceOf(Client::class, $client); } + + public function testHttpDriverIsUsedForConnection() + { + $client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->build(); + + $connection = $client->getConnectionManager()->getConnection('default'); + $this->assertInstanceOf(HttpDriver::class, $connection->getDriver()); + } + + public function testBoltDriverIsUsedForConnection() + { + $client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->build(); + + $connection = $client->getConnectionManager()->getConnection('default'); + $this->assertInstanceOf(BoltDriver::class, $connection->getDriver()); + } + + public function testTwoConnectionCanBeUsed() + { + $client = ClientBuilder::create() + ->addConnection('http', 'http://localhost:7474') + ->addConnection('bolt', 'bolt://localhost') + ->build(); + + $this->assertInstanceOf(HttpDriver::class, $client->getConnectionManager()->getConnection('http')->getDriver()); + $this->assertInstanceOf(BoltDriver::class, $client->getConnectionManager()->getConnection('bolt')->getDriver()); + } } \ No newline at end of file diff --git a/tests/Integration/CypherIntegrationTest.php b/tests/Integration/CypherIntegrationTest.php new file mode 100644 index 00000000..e21a0045 --- /dev/null +++ b/tests/Integration/CypherIntegrationTest.php @@ -0,0 +1,51 @@ +emptyDb(); + } + + public function testNodeIsReturned() + { + $query = 'CREATE (n:Node) RETURN n'; + $record1 = $this->client->run($query, [], null, 'http')->firstRecord(); + $this->assertInstanceOf(Node::class, $record1->get('n')); + $this->assertInstanceOf(HttpNode::class, $record1->get('n')); + $record2 = $this->client->run($query, [], null, 'bolt')->firstRecord(); + $this->assertInstanceOf(Node::class, $record2->get('n')); + $this->assertInstanceOf(BoltNode::class, $record2->get('n')); + } + + public function testRelationshipIsReturned() + { + $query = 'CREATE (a)-[r:RELATES]->(b) RETURN a, r, b'; + $record1 = $this->client->run($query, [], null, 'http')->firstRecord(); + $record2 = $this->client->run($query, [], null, 'bolt')->firstRecord(); + $this->assertInstanceOf(HttpRelationship::class, $record1->get('r')); + $this->assertInstanceOf(BoltRelationship::class, $record2->get('r')); + } + + /** + * @group path + */ + public function testPathIsReturned() + { + $query = 'CREATE p=(a:Cool)-[:RELATES]->(b:NotSoCool) RETURN p'; + $record1 = $this->client->run($query, [], null, 'http')->firstRecord(); + $record2 = $this->client->run($query, [], null, 'bolt')->firstRecord(); + $this->assertInstanceOf(PathInterface::class, $record1->get('p')); + $this->assertInstanceOf(PathInterface::class, $record2->get('p')); + } +} \ No newline at end of file diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php new file mode 100644 index 00000000..5fe7f5c5 --- /dev/null +++ b/tests/Integration/IntegrationTestCase.php @@ -0,0 +1,32 @@ +client = ClientBuilder::create() + ->addConnection('http', 'http://localhost:7474') + ->addConnection('bolt', 'bolt://localhost') + ->build(); + } + + /** + * Empties the graph database + * + * @void + */ + public function emptyDb() + { + $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); + } +} \ No newline at end of file From 5986efbddb1628a6a7fc0d34b7db8636d00ece99 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 19 Mar 2016 21:21:37 +0100 Subject: [PATCH 102/217] removed old tests --- .../NeoClient/Tests/Functional/UseCase.php | 228 ------------------ 1 file changed, 228 deletions(-) delete mode 100644 tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php diff --git a/tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php b/tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php deleted file mode 100644 index 2bdbe0fb..00000000 --- a/tests/Neoxygen/NeoClient/Tests/Functional/UseCase.php +++ /dev/null @@ -1,228 +0,0 @@ -getClient(); - - $client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - } - - public function testConnectivity() - { - $client = $this->getClient(); - $root = $client->getRoot()->getBody(); - - $this->assertArrayHasKey('data', $root); - $this->assertArrayHasKey('management', $root); - } - - public function testCreatingElement() - { - $client = $this->getClient(); - $q = 'CREATE (u:`User` {name: {name}, email: {email}}) RETURN u'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com']; - $response = $client->sendCypherQuery($q, $params); - $result = $response->getResult(); - - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result',$result); - // The user is getting created successfully but never returned afterwards. - $this->assertArrayHasKey('User', $result->getNodesByLabel('User', true)); - } - - public function testCreatingElementsAndRelations() - { - $client = $this->getClient(); - $q = 'CREATE (u:`User` {name: {name}, email: {email}})-[:LIKES]->(p:`Post` {title: {title}}) RETURN u, p'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'title' => 'Sss']; - $response = $client->sendCypherQuery($q, $params); - $result = $response->getResult(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result',$result); - - $nodes = $result->getNodes(['User', 'Post'], true); - - $this->assertArrayHasKey('User', $nodes); - $this->assertArrayHasKey('Post', $nodes); - - $nodes_too = $result->getNodesByLabels(['User', 'Post'], true); - $this->assertArrayHasKey('User', $nodes_too); - $this->assertArrayHasKey('Post', $nodes_too); - } - - public function testFetchingElementByAttribute() - { - $client = $this->getClient(); - // You need to recreate the user here because you delete the db on each test run with the query in the setUp() method - $q = 'CREATE (u:`User` {name: {name}, email: {email}})-[:LIKES]->(p:`Post` {title: {title}}) RETURN u, p'; - $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'title' => 'Sss']; - $client->sendCypherQuery($q, $params); - - $q = 'MATCH (u:`User`) WHERE u.email = {email} RETURN u'; - - $response = $client->sendCypherQuery($q, ['email' => 'halawi.abed@gmail.com']); - $result = $response->getResult(); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result', $result); - $this->assertGreaterThan(0, $result->getNodesCount()); - - $node = current($result->getNodesByLabel('User')); - - $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Node', $node); - $props = $node->getProperties(['name']); - $this->assertEquals(['name' => 'Abed Halawi'], $props); - } - - public function testGettingAndRenamingLabels() - { - $client = $this->getClient(); - - $result = $client->sendCypherQuery('CREATE (n:Order) RETURN n')->getResult(); - $this->assertTrue(in_array('Order', $client->getLabels()->getBody())); - - $client->renameLabel('Order', 'Product'); - - $updated_labels = $client->getLabels()->getBody(); - $this->assertTrue(in_array('Product', $updated_labels)); - } - - public function testIndexing() - { - $client = $this->getClient(); - - $this->assertTrue($client->createIndex('Person', 'email', 'name')); - } - - public function testRelationshipProperty() - { - $client = $this->getClient(); - $q = 'CREATE (n:RelationshipTest)-[r:SOME_REL {time:1234} ]->(x:RelTest) RETURN r'; - $r = $client->sendCypherQuery($q)->getResult(); - $rel = $r->get('r'); - $this->assertEquals(1234, $rel->getProperty('time')); - $this->assertNull($rel->getProperty('nonExist')); - } - - public function testFormatterIsResetBetweenQueries() - { - $client = $this->getClient(); - $q1 = "CREATE (n:FormatterTest {name:'User1'})"; - $q2 = "CREATE (n:FormatterTest {name:'User2'})"; - $client->sendCypherQuery($q1); - $client->sendCypherQuery($q2); - $match1 = "MATCH (n:FormatterTest {name:'User1'}) RETURN n"; - $match2 = "MATCH (n:FormatterTest {name:'User2'}) RETURN n"; - $r1 = $client->sendCypherQuery($match1)->getResult(); - $this->assertCount(1, $r1->getNodes()); - $r2 = $client->sendCypherQuery($match2)->getResult(); - $this->assertCount(1, $r2->getNodes()); - $this->assertCount(1, $r1->getnodes()); - - } - - public function testCreateTransaction() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery($q); - $query = 'MATCH (n:`Person`) RETURN n LIMIT 25'; - - $tx = $client->createTransaction(); - $tx->pushQuery($query); - $tx->commit(); - $this->assertCount(1, $tx->getResults()); - $this->assertCount(25, $tx->getResults()[0]->getNodes()); - - } - - public function testReuseNodeIdForOtherQuery() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery($q); - $q2 = 'MATCH (n:Person) RETURN n LIMIT 1'; - $r = $client->sendCypherQuery($q2)->getResult(); - $node = $r->get('n'); - $r2 = $client->sendCypherQuery(' - MATCH (a:Person) - WHERE id(a) = {id} - RETURN a -', array( - 'id' => $node->getId() - ))->getResult(); - - $this->assertEquals($node->getId(), $r2->get('a')->getId()); - } - - public function testGetReturnsArray() - { - $client = $this->getClient(); - $q = 'FOREACH (i in range(0,24)| CREATE (n:Person {id: i} ))'; - $client->sendCypherQuery('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); - $client->sendCypherQuery($q); - $result = $client->sendCypherQuery('MATCH (n:Person) RETURN n.id as pId')->getResult(); - $this->assertCount(25, $result->get('pId')); - - } - - public function testGetConnectedNodes() - { - $client = $this->getClient(); - $q = 'CREATE (a:Connected {id:1}), (b:Connected {id:2}), (c:Connected {id:3}) - MERGE (a)-[:LINKS_TO]->(b) - MERGE (b)-[:LINKS_TO]->(c) - MERGE (c)-[:LINKS_TO]->(a)'; - $client->sendCypherQuery($q); - $q = 'MATCH (a:Connected {id:1}) OPTIONAL MATCH (a)-[r]-(b) RETURN a,r,b'; - $result = $client->sendCypherQuery($q)->getResult(); - $a = $result->get('a'); - $this->assertTrue($a->hasConnectedNodes()); - $b = $a->getConnectedNode('OUT'); - $this->assertEquals(2, $b->getProperty('id')); - $this->assertTrue($b->hasConnectedNodes()); - } - - public function testIdentifierWithDotIsHandled() - { - $client = $this->getClient(); - $result = $client->sendCypherQuery(' - CREATE (a:TEST {foo: {bar}}) - RETURN a.foo -', array( - 'bar' => array(1, 2, 3) - ))->getResult(); - - $this->assertNotEmpty($result->get('a.foo')); - $this->assertInternalType('array', $result->get('a.foo')); - } - - public function testItCanAddAConstraintIfIndexAlreadyExist() - { - $client = $this->getClient(); - try { - $client->createIndex('Tag', 'name'); - } catch (Neo4jException $e) { - - } - $this->assertTrue($client->createUniqueConstraint('Tag', 'name', true)); - } - - /** - * @return \Neoxygen\NeoClient\Client - */ - protected function getClient() - { - return $this->getConnection(); - } -} From 3774c7b81800662b1aadfb52bff3df3db6b6161c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 2 Apr 2016 23:14:21 +0200 Subject: [PATCH 103/217] credentials for bolt and updated to M05 for tests --- build/install-neo.sh | 8 +++++--- composer.lock | 10 +++++----- src/Connection/Connection.php | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index 8958b8e3..b0b6d5eb 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,9 +3,11 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-M02-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-M05-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-3.0.0-M02-unix.tar.gz -C neo --strip-components=1 > null -sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j-server.properties +tar xzf neo4j-enterprise-3.0.0-M05-unix.tar.gz -C neo --strip-components=1 > null +sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j.conf +#sed -i.bak 's/^\(dbms\.bolt\.tls\.enabled=\).*/\1true/' ./neo/conf/neo4j-server.properties neo/bin/neo4j start > null & +#sleep 10 #mv neo/conf/ssl/snakeoil.cert neo/conf/ssl/snakeoil.pem \ No newline at end of file diff --git a/composer.lock b/composer.lock index f6ee941c..2a0f7e21 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.2.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "cce966a5f3f402a9ad2c0db5b20407ee46d88157" + "reference": "824cca4350722c7ae353beb5f4e1affe757233e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/cce966a5f3f402a9ad2c0db5b20407ee46d88157", - "reference": "cce966a5f3f402a9ad2c0db5b20407ee46d88157", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/824cca4350722c7ae353beb5f4e1affe757233e5", + "reference": "824cca4350722c7ae353beb5f4e1affe757233e5", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-03-18 21:18:04" + "time": "2016-04-02 21:05:17" }, { "name": "graphaware/neo4j-common", diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 44d16ce6..aaa24776 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\Connection; +use GraphAware\Bolt\Configuration; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -64,10 +65,19 @@ public function getAlias() private function buildDriver() { + $params = parse_url($this->uri); if (preg_match('/bolt/', $this->uri)) { - $this->driver = BoltGraphDB::driver($this->uri); + $port = isset($params['port']) ? (int) $params['port'] : 7687; + $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); + $config = null; + if (isset($params['user']) && isset($params['pass'])) { + $config = Configuration::withCredentials($params['user'], $params['pass']); + } + $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { - $this->driver = HttpGraphDB::driver($this->uri); + $port = isset($params['port']) ? (int) $params['port'] : 7474; + $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); + $this->driver = HttpGraphDB::driver($uri); } else { throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); } From 6c5b26620ab14bca9f7859395eb2583bd8d658c9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 2 Apr 2016 23:17:55 +0200 Subject: [PATCH 104/217] readme infos for connection --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41b77885..9967bcec 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,8 @@ require_once 'vendor/autoload.php'; use GraphAware\Neo4j\Client\ClientBuilder; $client = ClientBuilder::create() - ->addConnection('default', 'http://neo4j:password@localhost:7474') + ->addConnection('default', 'http://neo4j:password@localhost:7474') // Example for HTTP connection configuration (port is optional) + ->addConnection('bolt', 'bolt://neo4j:password@localhost:7687') // Example for BOLT connection configuration (port is optional) ->build(); ``` From 4ecf1f1b87ed49ba35e02cb26de36c574e2ae5be Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 3 Apr 2016 00:44:50 +0200 Subject: [PATCH 105/217] documentation fix --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9967bcec..44413b6b 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ The `Result` object contains the `records` and the `summary` of the statement, t ```php -$result->getRecord(); // Returns one record +$result->firstRecord(); // Returns the first record of the Statement Result $result->records(); // Returns all records @@ -204,7 +204,8 @@ $query = "MATCH (n:Person) n, n.name as name, n.age as age"; $result = $client->run($query); foreach ($result->records() as $record) { - print_r($record->value('n'); // nodes returned are automatically hydrated to Node objects + print_r($record->get('n'); // nodes returned are automatically hydrated to Node objects + echo $record->value('name') . PHP_EOL; echo $record->value('age') . PHP_EOL; } @@ -219,8 +220,6 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `values()` : returns the properties of the node (array) * `value($key)` : returns the value for the given property key * `hasLabel($label)` : returns whether or not the node has the given label (boolean) -* `startNodeIdentity` : returns the start node id -* `endNodeIdentity` : returns the end node id ##### Relationship @@ -229,6 +228,8 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `identity()` : returns the internal ID of the relationship * `values()` : returns the properties of the relationship (array) * `value($key)` : returns the value for the given property key +* `startNodeIdentity` : returns the start node id +* `endNodeIdentity` : returns the end node id ### Working with Transactions From 1319af41fb04f8ca183a4ed79d1760bce3200cba Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 3 Apr 2016 03:05:37 +0200 Subject: [PATCH 106/217] backport sendWriteQuery --- .travis.yml | 1 - README.md | 2 +- src/Client.php | 35 ++++++++++ src/ClientBuilder.php | 21 ++++++ src/Connection/ConnectionManager.php | 15 ++++ .../ClientSetupIntegrationTest.php | 68 +++++++++++++++++++ 6 files changed, 140 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8672584a..58d43e8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ before_install: script: - vendor/bin/phpunit --exclude-group fail - # - vendor/bin/behat notifications: email: "christophe@graphaware.com" diff --git a/README.md b/README.md index 44413b6b..395ba7de 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ $result = $client->run($query); foreach ($result->records() as $record) { print_r($record->get('n'); // nodes returned are automatically hydrated to Node objects - + echo $record->value('name') . PHP_EOL; echo $record->value('age') . PHP_EOL; } diff --git a/src/Client.php b/src/Client.php index 7a2aaa39..f5a6a610 100644 --- a/src/Client.php +++ b/src/Client.php @@ -29,6 +29,8 @@ public function __construct(ConnectionManager $connectionManager) } /** + * Run a Cypher statement against the default database or the database specified + * * @param $query * @param null|array $parameters * @param null|string $tag @@ -43,6 +45,39 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = return $connection->run($query, $parameters, $tag); } + /** + * @param string $query + * @param null|array $parameters + * @param null|string $tag + * + * @return mixed + * + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + */ + public function runWrite($query, $parameters = null, $tag = null) + { + $connection = $this->connectionManager->getMasterConnection(); + + return $connection->run($query, $parameters, $tag); + } + + /** + * + * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead. + * + * @param string $query + * @param null|array $parameters + * @param null|string $tag + * + * @return mixed + * + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + */ + public function sendWriteQuery($query, $parameters = null, $tag = null) + { + return $this->runWrite($query, $parameters, $tag); + } + /** * @param string|null $tag * diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 7707d988..98c862b1 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -57,6 +57,24 @@ public function preflightEnv($variable) $this->config['connection_manager']['preflight_env'] = $variable; } + public function setMaster($connectionAlias) + { + if (!isset($this->config['connections']) || !array_key_exists($connectionAlias, $this->config['connections'])) { + throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); + } + + if (isset($this->config['connections'])) { + foreach ($this->config['connections'] as $k => $conn) { + $conn['is_master'] = false; + $this->config['connections'][$k] = $conn; + } + } + + $this->config['connections'][$connectionAlias]['is_master'] = true; + + return $this; + } + /** * Builds a Client based on the connections given * @@ -67,6 +85,9 @@ public function build() $connectionManager = new ConnectionManager(); foreach ($this->config['connections'] as $alias => $conn) { $connectionManager->registerConnection($alias, $conn['uri']); + if (isset($conn['is_master']) && $conn['is_master'] === true) { + $connectionManager->setMaster($alias); + } } return new Client($connectionManager); } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 74a10f0a..1fec846b 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -21,6 +21,8 @@ class ConnectionManager */ private $connections = []; + private $master; + public function registerConnection($alias, $uri, $config = null) { $this->connections[$alias] = new Connection($alias, $uri, $config); @@ -43,4 +45,17 @@ public function getConnection($alias = null) return $this->connections[$alias]; } + + public function setMaster($alias) + { + $this->master = $this->connections[$alias]; + } + + /** + * @return null|\GraphAware\Neo4j\Client\Connection\Connection + */ + public function getMasterConnection() + { + return $this->master; + } } diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index a0e2d830..70beb5e7 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -13,9 +13,19 @@ use GraphAware\Neo4j\Client\Client; use GraphAware\Neo4j\Client\ClientBuilder; +use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; use GraphAware\Bolt\Driver as BoltDriver; +use \InvalidArgumentException; +use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use Prophecy\Prophet; +/** + * Class ClientSetupIntegrationTest + * @package GraphAware\Neo4j\Client\Tests\Integration + * + * @group setup + */ class ClientSetupIntegrationTest extends \PHPUnit_Framework_TestCase { public function testClientSetupWithOneConnection() @@ -57,4 +67,62 @@ public function testTwoConnectionCanBeUsed() $this->assertInstanceOf(HttpDriver::class, $client->getConnectionManager()->getConnection('http')->getDriver()); $this->assertInstanceOf(BoltDriver::class, $client->getConnectionManager()->getConnection('bolt')->getDriver()); } + + public function testNullIseReturnedForMasterWhenNoMasterIsDefined() + { + $client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->addConnection('conn2', 'http://localhost:7575') + ->addConnection('conn3', 'http://localhost:7676') + ->build(); + + $this->assertNull($client->getConnectionManager()->getMasterConnection()); + } + + public function testICanDefineConnectionAsWriteOrRead() + { + $client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->addConnection('conn2', 'http://localhost:7575') + ->addConnection('conn3', 'http://localhost:7676') + ->setMaster('conn2') + ->build(); + + $this->assertEquals('conn2', $client->getConnectionManager()->getMasterConnection()->getAlias()); + } + + public function testSecondIsMasterCallOverridesPreviousOne() + { + $client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->addConnection('conn2', 'http://localhost:7575') + ->addConnection('conn3', 'http://localhost:7676') + ->setMaster('conn2') + ->setMaster('default') + ->build(); + + $this->assertEquals('default', $client->getConnectionManager()->getMasterConnection()->getAlias()); + } + + public function testExceptionIsThrownWhenMasterAliasDoesntExist() + { + $this->setExpectedException(InvalidArgumentException::class); + $client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->addConnection('conn2', 'http://localhost:7575') + ->addConnection('conn3', 'http://localhost:7676') + ->setMaster('conn5') + ->build(); + } + + public function testSendWriteUseMasterIfAvailable() + { + $connectionManager = $this->prophesize(ConnectionManager::class); + $conn = new Connection('default', 'http://localhost:7474'); + $connectionManager->getMasterConnection()->willReturn($conn); + $connectionManager->getMasterConnection()->shouldBeCalled(); + + $client = new Client($connectionManager->reveal()); + $client->runWrite('MATCH (n) RETURN count(n)'); + } } \ No newline at end of file From 846b14dd90470271895486673738ad7119f400a4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 5 Apr 2016 09:35:48 +0200 Subject: [PATCH 107/217] temp fix for http credentials --- src/Connection/Connection.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index aaa24776..62579fab 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -75,8 +75,7 @@ private function buildDriver() } $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { - $port = isset($params['port']) ? (int) $params['port'] : 7474; - $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); + $uri = $this->uri; $this->driver = HttpGraphDB::driver($uri); } else { throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); From 6c699db6613a8966ffebc7d644672792f87042f2 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 6 Apr 2016 01:19:46 +0200 Subject: [PATCH 108/217] run method in transaction --- src/HttpDriver/Transaction.php | 4 +++- src/Transaction/Transaction.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php index 9033bfe3..090ffe97 100644 --- a/src/HttpDriver/Transaction.php +++ b/src/HttpDriver/Transaction.php @@ -75,7 +75,9 @@ public function run(Statement $statement) { $this->assertStarted(); try { - return $this->session->pushToTransaction($this->transactionId, array($statement)); + $results = $this->session->pushToTransaction($this->transactionId, array($statement)); + + return $results->results()[0]; } catch (Neo4jException $e) { if ($e->effect() === Neo4jException::EFFECT_ROLLBACK) { $this->closed = true; diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index 544ea881..5a24d895 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -49,6 +49,23 @@ public function push($statement, array $parameters = array(), $tag = null) $this->queue[] = Statement::create($statement, $parameters, $tag); } + /** + * @param $statement + * @param array $parameters + * @param null $tag + * + * @return \GraphAware\Common\Result\Result + */ + public function run($statement, array $parameters = array(), $tag = null) + { + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + $this->driverTransaction->begin(); + } + $result = $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); + + return $result; + } + /** * Push a statements Stack to the queue, without actually sending it * From 33394ab6026bb086080afd40976cdfab5120ebad Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 6 Apr 2016 17:18:13 +0200 Subject: [PATCH 109/217] Transaction Integration test --- composer.lock | 52 ++++++------- src/Connection/Connection.php | 13 +++- src/Connection/ConnectionManager.php | 2 - tests/Integration/IntegrationTestCase.php | 2 +- .../TransactionIntegrationTest.php | 77 +++++++++++++++++++ 5 files changed, 116 insertions(+), 30 deletions(-) create mode 100644 tests/Integration/TransactionIntegrationTest.php diff --git a/composer.lock b/composer.lock index 2a0f7e21..088e11bb 100644 --- a/composer.lock +++ b/composer.lock @@ -52,16 +52,16 @@ }, { "name": "graphaware/neo4j-common", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "4ddbf8b029dadd7048897299ca3dc0ef50f0881e" + "reference": "e72c533eff9564f7317807e85adb114c3c440d0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4ddbf8b029dadd7048897299ca3dc0ef50f0881e", - "reference": "4ddbf8b029dadd7048897299ca3dc0ef50f0881e", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/e72c533eff9564f7317807e85adb114c3c440d0a", + "reference": "e72c533eff9564f7317807e85adb114c3c440d0a", "shasum": "" }, "require": { @@ -94,20 +94,20 @@ "neo4j", "statement" ], - "time": "2016-03-18 21:14:19" + "time": "2016-04-06 14:31:05" }, { "name": "guzzlehttp/guzzle", - "version": "6.1.1", + "version": "6.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" + "reference": "d094e337976dff9d8e2424e8485872194e768662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", + "reference": "d094e337976dff9d8e2424e8485872194e768662", "shasum": "" }, "require": { @@ -123,7 +123,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "6.2-dev" } }, "autoload": { @@ -156,7 +156,7 @@ "rest", "web service" ], - "time": "2015-11-23 00:47:50" + "time": "2016-03-21 20:02:09" }, { "name": "guzzlehttp/promises", @@ -362,16 +362,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa" + "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa", - "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9002dcf018d884d294b1ef20a6f968efc1128f39", + "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39", "shasum": "" }, "require": { @@ -418,7 +418,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-01-27 05:14:46" + "time": "2016-03-10 10:34:12" } ], "packages-dev": [ @@ -1328,16 +1328,16 @@ }, { "name": "symfony/stopwatch", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "4a204804952ff267ace88cf499e0b4bb302a475e" + "reference": "6015187088421e9499d8f8316bdb396f8b806c06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4a204804952ff267ace88cf499e0b4bb302a475e", - "reference": "4a204804952ff267ace88cf499e0b4bb302a475e", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6015187088421e9499d8f8316bdb396f8b806c06", + "reference": "6015187088421e9499d8f8316bdb396f8b806c06", "shasum": "" }, "require": { @@ -1373,20 +1373,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-01-03 15:35:16" + "time": "2016-03-04 07:55:57" }, { "name": "symfony/yaml", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c" + "reference": "0047c8366744a16de7516622c5b7355336afae96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c", - "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", + "reference": "0047c8366744a16de7516622c5b7355336afae96", "shasum": "" }, "require": { @@ -1422,7 +1422,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-02-23 15:16:06" + "time": "2016-03-04 07:55:57" } ], "aliases": [], diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 62579fab..8a7799e3 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -52,7 +52,6 @@ public function __construct($alias, $uri) $this->alias = (string) $alias; $this->uri = (string) $uri; $this->buildDriver(); - $this->session = $this->driver->session(); } /** @@ -98,6 +97,7 @@ public function getDriver() */ public function createPipeline($query = null, $parameters = array(), $tag = null) { + $this->checkSession(); $parameters = is_array($parameters) ? $parameters : array(); return $this->session->createPipeline($query, $parameters, $tag); @@ -105,6 +105,7 @@ public function createPipeline($query = null, $parameters = array(), $tag = null public function run($statement, $parameters, $tag) { + $this->checkSession(); $parameters = is_array($parameters) ? $parameters : array(); try { $results = $this->session->run($statement, $parameters, $tag); @@ -120,6 +121,7 @@ public function run($statement, $parameters, $tag) public function runMixed(array $queue) { + $this->checkSession(); $pipeline = $this->createPipeline(); foreach ($queue as $element) { if ($element instanceof Stack) { @@ -136,6 +138,7 @@ public function runMixed(array $queue) public function getTransaction() { + $this->checkSession(); return $this->session->transaction(); } @@ -144,6 +147,14 @@ public function getTransaction() */ public function getSession() { + $this->checkSession(); return $this->session; } + + private function checkSession() + { + if (null === $this->session) { + $this->session = $this->driver->session(); + } + } } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 1fec846b..75f06828 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -11,8 +11,6 @@ namespace GraphAware\Neo4j\Client\Connection; -use Neoxygen\NeoClient\Exception\InvalidConnectionException; -use Neoxygen\NeoClient\Exception\HttpException; class ConnectionManager { diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index 5fe7f5c5..8db48858 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -27,6 +27,6 @@ public function setUp() */ public function emptyDb() { - $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n'); + $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n', null, null, 'http'); } } \ No newline at end of file diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php new file mode 100644 index 00000000..5778c57d --- /dev/null +++ b/tests/Integration/TransactionIntegrationTest.php @@ -0,0 +1,77 @@ +emptyDb(); + $tx = $this->client->transaction('http'); + $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); + $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); + $this->assertEquals(Transaction::OPENED, $tx->status()); + $tx->commit(); + $this->assertEquals(Transaction::COMMITED, $tx->status()); + $this->assertXNodesWithLabelExist('Test'); + } + + public function testTransactionIsRolledBackWithHttp() + { + $this->emptyDb(); + $tx = $this->client->transaction('http'); + $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); + $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); + $this->assertEquals(Transaction::OPENED, $tx->status()); + $tx->rollback(); + $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + $this->assertXNodesWithLabelExist('Test', 0); + } + + public function testTransactionIsRolledBackInCaseOfException() + { + $this->emptyDb(); + $tx = $this->client->transaction('http'); + try { + $result = $tx->run('CREATE (n:Test) RETURN x'); + $this->assertEquals(1, 2); // If we reached here then there is a bug + } catch (Neo4jException $e) { + $this->assertEquals(Neo4jExceptionInterface::EFFECT_ROLLBACK, $e->effect()); + } + $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + $this->assertXNodesWithLabelExist('Test', 0); + } + + public function testPushShouldStackUntilCommit() + { + $this->emptyDb(); + $tx = $this->client->transaction(); + $tx->push('CREATE (n:Test)'); + $this->assertNotContains($tx->status(), [Transaction::COMMITED, Transaction::ROLLED_BACK, Transaction::OPENED]); + $this->assertXNodesWithLabelExist('Test', 0); + $tx->push('CREATE (n:Test)'); + $this->assertXNodesWithLabelExist('Test', 0); + $tx->commit(); + $this->assertXNodesWithLabelExist('Test', 2); + $this->assertEquals(Transaction::COMMITED, $tx->status()); + } + + private function assertXNodesWithLabelExist($label, $number = 1) + { + $query = 'MATCH (n:' . $label . ') RETURN count(n) as c'; + $result = $this->client->run($query, null, null, 'http'); + + $this->assertNotNull($result->firstRecord()); + $this->assertEquals($number, $result->firstRecord()->get('c')); + } +} \ No newline at end of file From 27e02f25e0cd5943c99c1587ac7f9ad74a63a699 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 6 Apr 2016 17:41:03 +0200 Subject: [PATCH 110/217] bolt wrapped tx test --- .../TransactionIntegrationTest.php | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php index 5778c57d..f7963c1d 100644 --- a/tests/Integration/TransactionIntegrationTest.php +++ b/tests/Integration/TransactionIntegrationTest.php @@ -55,7 +55,59 @@ public function testTransactionIsRolledBackInCaseOfException() public function testPushShouldStackUntilCommit() { $this->emptyDb(); - $tx = $this->client->transaction(); + $tx = $this->client->transaction('http'); + $tx->push('CREATE (n:Test)'); + $this->assertNotContains($tx->status(), [Transaction::COMMITED, Transaction::ROLLED_BACK, Transaction::OPENED]); + $this->assertXNodesWithLabelExist('Test', 0); + $tx->push('CREATE (n:Test)'); + $this->assertXNodesWithLabelExist('Test', 0); + $tx->commit(); + $this->assertXNodesWithLabelExist('Test', 2); + $this->assertEquals(Transaction::COMMITED, $tx->status()); + } + + public function testTransactionIsCommittedWithBolt() + { + $this->emptyDb(); + $tx = $this->client->transaction('bolt'); + $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); + $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); + $this->assertEquals(Transaction::OPENED, $tx->status()); + $tx->commit(); + $this->assertEquals(Transaction::COMMITED, $tx->status()); + $this->assertXNodesWithLabelExist('Test'); + } + + public function testTransactionIsRolledBackWithBolt() + { + $this->emptyDb(); + $tx = $this->client->transaction('bolt'); + $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); + $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); + $this->assertEquals(Transaction::OPENED, $tx->status()); + $tx->rollback(); + $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + $this->assertXNodesWithLabelExist('Test', 0); + } + + public function testTransactionIsRolledBackInCaseOfExceptionWithBolt() + { + $this->emptyDb(); + $tx = $this->client->transaction('bolt'); + try { + $result = $tx->run('CREATE (n:Test) RETURN x'); + $this->assertEquals(1, 2); // If we reached here then there is a bug + } catch (Neo4jException $e) { + $this->assertEquals(Neo4jExceptionInterface::EFFECT_ROLLBACK, $e->effect()); + } + $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + $this->assertXNodesWithLabelExist('Test', 0); + } + + public function testPushShouldStackUntilCommitWithBolt() + { + $this->emptyDb(); + $tx = $this->client->transaction('bolt'); $tx->push('CREATE (n:Test)'); $this->assertNotContains($tx->status(), [Transaction::COMMITED, Transaction::ROLLED_BACK, Transaction::OPENED]); $this->assertXNodesWithLabelExist('Test', 0); From 17fd5d51496fd303799431418754a024ca109684 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 6 Apr 2016 22:07:40 +0200 Subject: [PATCH 111/217] bolt tx wrapper tests --- composer.lock | 10 +++++----- .../Integration/TransactionIntegrationTest.php | 17 +++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 088e11bb..f245c496 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "824cca4350722c7ae353beb5f4e1affe757233e5" + "reference": "251b12e13d42279d24fad30f7185a74c72514180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/824cca4350722c7ae353beb5f4e1affe757233e5", - "reference": "824cca4350722c7ae353beb5f4e1affe757233e5", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/251b12e13d42279d24fad30f7185a74c72514180", + "reference": "251b12e13d42279d24fad30f7185a74c72514180", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-04-02 21:05:17" + "time": "2016-04-06 19:56:05" }, { "name": "graphaware/neo4j-common", diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php index f7963c1d..48b55ffa 100644 --- a/tests/Integration/TransactionIntegrationTest.php +++ b/tests/Integration/TransactionIntegrationTest.php @@ -2,6 +2,7 @@ namespace GraphAware\Neo4j\Client\Tests\Integration; +use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; use GraphAware\Neo4j\Client\HttpDriver\Transaction; @@ -72,9 +73,9 @@ public function testTransactionIsCommittedWithBolt() $tx = $this->client->transaction('bolt'); $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); - $this->assertEquals(Transaction::OPENED, $tx->status()); + //$this->assertEquals(Transaction::OPENED, $tx->status()); $tx->commit(); - $this->assertEquals(Transaction::COMMITED, $tx->status()); + //$this->assertEquals(Transaction::COMMITED, $tx->status()); $this->assertXNodesWithLabelExist('Test'); } @@ -84,9 +85,9 @@ public function testTransactionIsRolledBackWithBolt() $tx = $this->client->transaction('bolt'); $result = $tx->run('CREATE (n:Test) RETURN id(n) as id'); $this->assertTrue($result->summarize()->updateStatistics()->containsUpdates()); - $this->assertEquals(Transaction::OPENED, $tx->status()); + //$this->assertEquals(Transaction::OPENED, $tx->status()); $tx->rollback(); - $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + //$this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); $this->assertXNodesWithLabelExist('Test', 0); } @@ -97,10 +98,10 @@ public function testTransactionIsRolledBackInCaseOfExceptionWithBolt() try { $result = $tx->run('CREATE (n:Test) RETURN x'); $this->assertEquals(1, 2); // If we reached here then there is a bug - } catch (Neo4jException $e) { - $this->assertEquals(Neo4jExceptionInterface::EFFECT_ROLLBACK, $e->effect()); + } catch (MessageFailureException $e) { + $this->assertEquals(1,1); } - $this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); + //$this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); $this->assertXNodesWithLabelExist('Test', 0); } @@ -115,7 +116,7 @@ public function testPushShouldStackUntilCommitWithBolt() $this->assertXNodesWithLabelExist('Test', 0); $tx->commit(); $this->assertXNodesWithLabelExist('Test', 2); - $this->assertEquals(Transaction::COMMITED, $tx->status()); + //$this->assertEquals(Transaction::COMMITED, $tx->status()); } private function assertXNodesWithLabelExist($label, $number = 1) From aa9a2eaf15468b8945bf5a2ab696ee62137b138e Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Apr 2016 02:25:57 +0200 Subject: [PATCH 112/217] add timeout to builder --- src/ClientBuilder.php | 18 +++++++++++- src/Connection/Connection.php | 11 ++++++-- src/Connection/ConnectionManager.php | 4 +-- src/HttpDriver/Configuration.php | 41 ++++++++++++++++++++++++++++ src/HttpDriver/Driver.php | 8 ++++-- src/HttpDriver/GraphDatabase.php | 2 +- src/HttpDriver/Session.php | 6 +++- 7 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 src/HttpDriver/Configuration.php diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 98c862b1..418f6933 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -17,6 +17,10 @@ class ClientBuilder { const PREFLIGHT_ENV_DEFAULT = 'NEO4J_DB_VERSION'; + const DEFAULT_TIMEOUT = 5; + + private static $TIMEOUT_CONFIG_KEY = "timeout"; + /** * @var array */ @@ -75,6 +79,13 @@ public function setMaster($connectionAlias) return $this; } + public function setDefaultTimeout($timeout) + { + $this->config[self::$TIMEOUT_CONFIG_KEY] = (int) $timeout; + + return $this; + } + /** * Builds a Client based on the connections given * @@ -84,11 +95,16 @@ public function build() { $connectionManager = new ConnectionManager(); foreach ($this->config['connections'] as $alias => $conn) { - $connectionManager->registerConnection($alias, $conn['uri']); + $connectionManager->registerConnection($alias, $conn['uri'], null, $this->getDefaultTimeout()); if (isset($conn['is_master']) && $conn['is_master'] === true) { $connectionManager->setMaster($alias); } } return new Client($connectionManager); } + + private function getDefaultTimeout() + { + return array_key_exists(self::$TIMEOUT_CONFIG_KEY, $this->config) ? $this->config[self::$TIMEOUT_CONFIG_KEY] : self::DEFAULT_TIMEOUT; + } } diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 8a7799e3..3291520a 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -18,6 +18,7 @@ use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; use GraphAware\Neo4j\Client\Stack; +use GraphAware\Neo4j\Client\HttpDriver\Configuration as HttpConfig; class Connection { @@ -41,16 +42,22 @@ class Connection */ private $session; + /** + * @var int + */ + private $timeout; + /** * Connection constructor. * * @param string $alias * @param string $uri */ - public function __construct($alias, $uri) + public function __construct($alias, $uri, $config = null, $timeout) { $this->alias = (string) $alias; $this->uri = (string) $uri; + $this->timeout = $timeout; $this->buildDriver(); } @@ -75,7 +82,7 @@ private function buildDriver() $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { $uri = $this->uri; - $this->driver = HttpGraphDB::driver($uri); + $this->driver = HttpGraphDB::driver($uri, HttpConfig::withTimeout($this->timeout)); } else { throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 75f06828..84d23d87 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -21,9 +21,9 @@ class ConnectionManager private $master; - public function registerConnection($alias, $uri, $config = null) + public function registerConnection($alias, $uri, $config = null, $timeout) { - $this->connections[$alias] = new Connection($alias, $uri, $config); + $this->connections[$alias] = new Connection($alias, $uri, $config, $timeout); } /** diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php new file mode 100644 index 00000000..728a6570 --- /dev/null +++ b/src/HttpDriver/Configuration.php @@ -0,0 +1,41 @@ +timeout = (int) $timeout; + } + + /** + * @param int $timeout + * @return \GraphAware\Neo4j\Client\HttpDriver\Configuration + */ + public static function withTimeout($timeout) + { + return new self($timeout); + } + + /** + * @return int + */ + public function getTimeout() + { + return $this->timeout; + } + + +} \ No newline at end of file diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index e85b290f..2132c124 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\DriverInterface; use GuzzleHttp\Client; @@ -18,14 +19,17 @@ class Driver implements DriverInterface { protected $uri; - public function __construct($uri) + protected $config; + + public function __construct($uri, ConfigInterface $config) { $this->uri = $uri; + $this->config = $config; } function session() { - return new Session($this->uri, new Client()); + return new Session($this->uri, new Client(['timeout' => $this->config->getTimeout()]), $this->config); } function getUri() diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 71a6ba26..383224ea 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -18,7 +18,7 @@ class GraphDatabase implements GraphDatabaseInterface { static function driver($uri, ConfigInterface $config = null) { - return new Driver($uri); + return new Driver($uri, $config); } } \ No newline at end of file diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index ed916779..f8836e1e 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -12,6 +12,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Cypher\Statement; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\SessionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; @@ -29,11 +30,14 @@ class Session implements SessionInterface public $transaction; - public function __construct($uri, Client $httpClient) + protected $config; + + public function __construct($uri, Client $httpClient, ConfigInterface $config) { $this->uri = $uri; $this->httpClient = $httpClient; $this->responseFormatter = new ResponseFormatter(); + $this->config = $config; } public function run($statement, $parameters = array(), $tag = null) From de59e05391e577cbec61088fcd165fbdb65421bc Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Apr 2016 02:31:19 +0200 Subject: [PATCH 113/217] fix tests and added timeout to doc --- README.md | 14 ++++++++++++++ tests/Integration/ClientSetupIntegrationTest.php | 2 +- tests/Unit/Connection/ConnectionUnitTest.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 395ba7de..9a7ed998 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,20 @@ $results = $tx->commit(); After a commit, you will not be able to `push` or `run` statements in this transaction. +### Settings + +#### Timeout + +You can configure a global timeout for the connections : + +```php +$client = ClientBuilder::create() + ->addConnection('default', 'http://localhost:7474') + ->setDefaultTimeout(3) + ->build(); +``` + +The timeout by default is 5 seconds. ### License diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index 70beb5e7..9cd0224e 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -118,7 +118,7 @@ public function testExceptionIsThrownWhenMasterAliasDoesntExist() public function testSendWriteUseMasterIfAvailable() { $connectionManager = $this->prophesize(ConnectionManager::class); - $conn = new Connection('default', 'http://localhost:7474'); + $conn = new Connection('default', 'http://localhost:7474', 5); $connectionManager->getMasterConnection()->willReturn($conn); $connectionManager->getMasterConnection()->shouldBeCalled(); diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index 3475a8c6..2bd4de21 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -13,7 +13,7 @@ class ConnectionUnitTest extends \PHPUnit_Framework_TestCase { public function testConnectionInstantiation() { - $connection = new Connection('default', 'http://localhost:7474'); + $connection = new Connection('default', 'http://localhost:7474', 5); $this->assertInstanceOf(HttpDriver::class, $connection->getDriver()); } } \ No newline at end of file From bd6ea04e1ff29ce7746d80662477b8fbf6d69fac Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Apr 2016 02:36:26 +0200 Subject: [PATCH 114/217] fix tests --- tests/Integration/ClientSetupIntegrationTest.php | 2 +- tests/Unit/Connection/ConnectionUnitTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index 9cd0224e..915580ef 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -118,7 +118,7 @@ public function testExceptionIsThrownWhenMasterAliasDoesntExist() public function testSendWriteUseMasterIfAvailable() { $connectionManager = $this->prophesize(ConnectionManager::class); - $conn = new Connection('default', 'http://localhost:7474', 5); + $conn = new Connection('default', 'http://localhost:7474', null, 5); $connectionManager->getMasterConnection()->willReturn($conn); $connectionManager->getMasterConnection()->shouldBeCalled(); diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index 2bd4de21..6b3202e5 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -13,7 +13,7 @@ class ConnectionUnitTest extends \PHPUnit_Framework_TestCase { public function testConnectionInstantiation() { - $connection = new Connection('default', 'http://localhost:7474', 5); + $connection = new Connection('default', 'http://localhost:7474', null, 5); $this->assertInstanceOf(HttpDriver::class, $connection->getDriver()); } } \ No newline at end of file From 4b1057b80cc93a91388356da5ccba28c67d4cfb9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Apr 2016 12:56:23 +0200 Subject: [PATCH 115/217] updated common --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index f245c496..fd716f4b 100644 --- a/composer.lock +++ b/composer.lock @@ -52,16 +52,16 @@ }, { "name": "graphaware/neo4j-common", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "e72c533eff9564f7317807e85adb114c3c440d0a" + "reference": "ce9ee12aefb50fb6a0e18e703a77481112c91928" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/e72c533eff9564f7317807e85adb114c3c440d0a", - "reference": "e72c533eff9564f7317807e85adb114c3c440d0a", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ce9ee12aefb50fb6a0e18e703a77481112c91928", + "reference": "ce9ee12aefb50fb6a0e18e703a77481112c91928", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-04-06 14:31:05" + "time": "2016-04-12 10:51:12" }, { "name": "guzzlehttp/guzzle", From b5febde7ed7a9f8c95dec78a8db158c232da23f2 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 15 Apr 2016 16:03:16 +0200 Subject: [PATCH 116/217] update to last bolt driver --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index fd716f4b..5f7fea3f 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "251b12e13d42279d24fad30f7185a74c72514180" + "reference": "0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/251b12e13d42279d24fad30f7185a74c72514180", - "reference": "251b12e13d42279d24fad30f7185a74c72514180", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933", + "reference": "0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-04-06 19:56:05" + "time": "2016-04-15 13:59:14" }, { "name": "graphaware/neo4j-common", From d8451ba7ba078c4a955436b671df1f297522904b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Apr 2016 14:02:08 +0200 Subject: [PATCH 117/217] upgraded to latest commons and latest bolt --- composer.lock | 20 ++++---- src/Formatter/Type/MapAccess.php | 75 +++++++++++++++++++++++++++++ src/Formatter/Type/Node.php | 62 +----------------------- src/Formatter/Type/Relationship.php | 62 +----------------------- 4 files changed, 87 insertions(+), 132 deletions(-) create mode 100644 src/Formatter/Type/MapAccess.php diff --git a/composer.lock b/composer.lock index 5f7fea3f..be7428c3 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.3.4", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933" + "reference": "78332d2b866383fda92dcca6233a33bfaf3b2d38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933", - "reference": "0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/78332d2b866383fda92dcca6233a33bfaf3b2d38", + "reference": "78332d2b866383fda92dcca6233a33bfaf3b2d38", "shasum": "" }, "require": { @@ -48,20 +48,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-04-15 13:59:14" + "time": "2016-04-21 11:57:11" }, { "name": "graphaware/neo4j-common", - "version": "2.0.4", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "ce9ee12aefb50fb6a0e18e703a77481112c91928" + "reference": "4e6c74bb1cb157c91f3b047aa9f63283bf07822c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ce9ee12aefb50fb6a0e18e703a77481112c91928", - "reference": "ce9ee12aefb50fb6a0e18e703a77481112c91928", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4e6c74bb1cb157c91f3b047aa9f63283bf07822c", + "reference": "4e6c74bb1cb157c91f3b047aa9f63283bf07822c", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ "neo4j", "statement" ], - "time": "2016-04-12 10:51:12" + "time": "2016-04-21 11:10:03" }, { "name": "guzzlehttp/guzzle", diff --git a/src/Formatter/Type/MapAccess.php b/src/Formatter/Type/MapAccess.php new file mode 100644 index 00000000..7b0b5e2c --- /dev/null +++ b/src/Formatter/Type/MapAccess.php @@ -0,0 +1,75 @@ +properties) && 1 === func_num_args()) { + throw new \InvalidArgumentException(sprintf('this object has no property with key %s', $key)); + } + + return array_key_exists($key, $this->properties) ? $this->properties[$key] : $default; + } + + /** + * @inheritdoc + */ + public function hasValue($key) + { + return array_key_exists($key, $this->properties); + } + + + /** + * @return array + */ + public function keys() + { + return array_keys($this->properties); + } + + /** + * @param string $key + * + * @return mixed + */ + public function get($key) + { + return $this->value($key); + } + + /** + * @param string $key + * + * @return bool + */ + public function containsKey($key) + { + return array_key_exists($key, $this->properties); + } + + /** + * @return array + */ + public function values() + { + return $this->properties; + } + + /** + * @return array + */ + public function asArray() + { + return $this->properties; + } +} \ No newline at end of file diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php index fa363457..92ebfdcc 100644 --- a/src/Formatter/Type/Node.php +++ b/src/Formatter/Type/Node.php @@ -13,7 +13,7 @@ use GraphAware\Common\Type\NodeInterface; -class Node implements NodeInterface +class Node extends MapAccess implements NodeInterface { /** * @var int @@ -62,64 +62,4 @@ public function hasLabel($label) { return in_array($label, $this->labels); } - - /** - * @param $key - * @return mixed - */ - public function value($key) - { - return $this->properties[$key]; - } - - /** - * @param $key - * @return bool - */ - public function hasValue($key) - { - return array_key_exists($key, $this->properties); - } - - /** - * @return array - */ - public function values() - { - return $this->properties; - } - - /** - * @return array - */ - public function keys() - { - return array_keys($this->properties); - } - - /** - * @param string $key - * @return bool - */ - public function containsKey($key) - { - return array_key_exists($key, $this->properties); - } - - /** - * @param $key - * - * @return mixed - */ - public function get($key) - { - return $this->value($key); - } - - public function asArray() - { - return $this->properties; - } - - } \ No newline at end of file diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index 1135b60f..2a679cee 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -13,7 +13,7 @@ use GraphAware\Common\Type\RelationshipInterface; -class Relationship implements RelationshipInterface +class Relationship extends MapAccess implements RelationshipInterface { /** * @var int @@ -97,64 +97,4 @@ public function endNodeIdentity() { return $this->endNodeIdentity; } - - /** - * @param $key - * @return mixed - */ - public function value($key) - { - return $this->properties[$key]; - } - - /** - * @param $key - * @return bool - */ - public function hasValue($key) - { - return array_key_exists($key, $this->properties); - } - - /** - * @return array - */ - public function values() - { - return $this->properties; - } - - /** - * @return array - */ - public function keys() - { - return array_keys($this->properties); - } - - /** - * @param string $key - * - * @return bool - */ - public function containsKey($key) - { - return array_key_exists($key, $this->properties); - } - - /** - * @param string $key - * @return mixed - */ - public function get($key) - { - return $this->value($key); - } - - public function asArray() - { - return $this->properties; - } - - } \ No newline at end of file From 52e4c273a1a1b8916aa5c0197565fb740107db39 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Apr 2016 14:05:22 +0200 Subject: [PATCH 118/217] use RC1 for tests --- build/install-neo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index b0b6d5eb..e1108da9 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,7 +3,7 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-M05-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-RC1-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-M05-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j.conf From cd6c0aca27991735ad55e8df05d0f8c5eb2d57a9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Apr 2016 14:07:56 +0200 Subject: [PATCH 119/217] fix travis --- build/install-neo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index e1108da9..5689428b 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -5,7 +5,7 @@ export JRE_HOME=/usr/lib/jvm/java-8-oracle wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-RC1-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-3.0.0-M05-unix.tar.gz -C neo --strip-components=1 > null +tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j.conf #sed -i.bak 's/^\(dbms\.bolt\.tls\.enabled=\).*/\1true/' ./neo/conf/neo4j-server.properties neo/bin/neo4j start > null & From 35866112b5212dc9189b9fe15311b30f41496fc8 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Apr 2016 14:24:26 +0200 Subject: [PATCH 120/217] new sed command for disabling auth --- build/install-neo.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index 5689428b..1594ddfb 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -6,8 +6,7 @@ export JRE_HOME=/usr/lib/jvm/java-8-oracle wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-RC1-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null -sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./neo/conf/neo4j.conf -#sed -i.bak 's/^\(dbms\.bolt\.tls\.enabled=\).*/\1true/' ./neo/conf/neo4j-server.properties +sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' conf/neo4j.conf neo/bin/neo4j start > null & #sleep 10 #mv neo/conf/ssl/snakeoil.cert neo/conf/ssl/snakeoil.pem \ No newline at end of file From 5fda8da9e46ef1b045721a265c42e3f430ec44c3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 21 Apr 2016 14:32:48 +0200 Subject: [PATCH 121/217] fix travis 2 --- build/install-neo.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index 1594ddfb..a33fc372 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -6,7 +6,5 @@ export JRE_HOME=/usr/lib/jvm/java-8-oracle wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-RC1-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null -sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' conf/neo4j.conf -neo/bin/neo4j start > null & -#sleep 10 -#mv neo/conf/ssl/snakeoil.cert neo/conf/ssl/snakeoil.pem \ No newline at end of file +sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf +neo/bin/neo4j start > null & \ No newline at end of file From 8bf11473c9870c2423de2763622d2674b97216db Mon Sep 17 00:00:00 2001 From: Bart Riepe Date: Tue, 26 Apr 2016 16:02:11 +0900 Subject: [PATCH 122/217] Fix wrong key specification in RecordView --- src/Formatter/RecordView.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index 5419581e..5ffce41c 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -81,7 +81,7 @@ public function value($key) */ public function nodeValue($key) { - if (!$this->hasValue('n') || !$this->get($key) instanceof NodeInterface) { + if (!$this->hasValue($key) || !$this->get($key) instanceof NodeInterface) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'NODE')); } @@ -156,4 +156,4 @@ public function getByIndex($index) } -} \ No newline at end of file +} From b8a073e7684c296a686109c4afdff0bd7c9ff963 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 12:32:03 +0100 Subject: [PATCH 123/217] graph object value helpers on record --- src/Formatter/RecordView.php | 30 +++++++----- tests/Integration/ResultIntegrationTest.php | 54 +++++++++++++++++++++ 2 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 tests/Integration/ResultIntegrationTest.php diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index 5ffce41c..6d9c1bce 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -12,8 +12,9 @@ namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Result\RecordViewInterface; -use GraphAware\Common\Type\NodeInterface; -use GraphAware\Common\Type\RelationshipInterface; +use GraphAware\Common\Type\Node; +use GraphAware\Common\Type\Path; +use GraphAware\Common\Type\Relationship; class RecordView implements RecordViewInterface { @@ -64,7 +65,7 @@ public function hasValues() /** * @param $key - * @return mixed|\GraphAware\Neo4j\Client\Formatter\Node|\GraphAware\Neo4j\Client\Formatter\Relationship + * @return mixed|\GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship */ public function value($key) { @@ -75,14 +76,14 @@ public function value($key) * Returns the Node for value $key. Ease IDE integration * * @param $key - * @return \GraphAware\Neo4j\Client\Formatter\Node + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node * * @throws \InvalidArgumentException When the value is not null or instance of Node */ public function nodeValue($key) { - if (!$this->hasValue($key) || !$this->get($key) instanceof NodeInterface) { - throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'NODE')); + if (!$this->hasValue($key) || !$this->get($key) instanceof Node) { + throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Node::class)); } return $this->value($key); @@ -90,19 +91,25 @@ public function nodeValue($key) /** * @param $key - * @return \GraphAware\Neo4j\Client\Formatter\Relationship + * @return \GraphAware\Neo4j\Client\Formatter\Type\Relationship * * @throws \InvalidArgumentException When the value is not null or instance of Relationship */ public function relationshipValue($key) { - if ($this->values[$key] !== null && !$this->values[$key] instanceof RelationshipInterface) { - throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'RELATIONSHIP')); + if (!isset($this->values[$key]) || !$this->values[$key] instanceof Relationship) { + throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Relationship::class)); } + + return $this->value($key); } public function pathValue($key) { - // TODO: Implement pathValue() method. + if (!$this->hasValue($key) || !$this->value($key) instanceof Path) { + throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Path::class)); + } + + return $this->value($key); } /** @@ -138,7 +145,7 @@ public function record() /** * @param string $key * - * @return \GraphAware\Neo4j\Client\Formatter\Node|\GraphAware\Neo4j\Client\Formatter\Relationship|mixed + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship|mixed */ public function get($key) { @@ -155,5 +162,4 @@ public function getByIndex($index) return $this->valueByIndex($index); } - } diff --git a/tests/Integration/ResultIntegrationTest.php b/tests/Integration/ResultIntegrationTest.php new file mode 100644 index 00000000..a69db763 --- /dev/null +++ b/tests/Integration/ResultIntegrationTest.php @@ -0,0 +1,54 @@ +emptyDb(); + $result = $this->client->run('CREATE (n) RETURN n'); + $record = $result->firstRecord(); + + $this->assertInstanceOf(Node::class, $record->nodeValue('n')); + } + + public function testRecordRelationshipValue() + { + $this->emptyDb(); + $result = $this->client->run('CREATE (n)-[r:KNOWS]->(x) RETURN n, r'); + $record = $result->firstRecord(); + + $this->assertInstanceOf(Relationship::class, $record->get('r')); + } + + public function testExceptionIsThrownForInvalidNodeValue() + { + $this->emptyDb(); + $result = $this->client->run('CREATE (n) RETURN id(n) as id'); + $record = $result->firstRecord(); + + $this->setExpectedException(InvalidArgumentException::class); + $record->nodeValue('id'); + } + + public function testExceptionIsThrownForInvalidRelationshipValue() + { + $this->emptyDb(); + $result = $this->client->run('CREATE (n)-[r:KNOWS]->(me) RETURN id(r) as r'); + $record = $result->firstRecord(); + + $this->setExpectedException(InvalidArgumentException::class); + $record->relationshipValue('r'); + } +} \ No newline at end of file From 62af6dc603dc17eed5a3ce95006e1004030c476f Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 12:36:06 +0100 Subject: [PATCH 124/217] upgrade tests to 3.0 final --- build/install-neo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index a33fc372..5139a24a 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,7 +3,7 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-RC1-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf From 86cb87d685b41d802e866ee6c3bfae27c023b703 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 12:40:49 +0100 Subject: [PATCH 125/217] try to fix travis --- build/install-neo.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index 5139a24a..e5ba08c5 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -7,4 +7,5 @@ wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf -neo/bin/neo4j start > null & \ No newline at end of file +neo/bin/neo4j start > null & +sleep 10 \ No newline at end of file From e243a1e682d25e155bb293ebd94ccd6550af54cf Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 12:43:51 +0100 Subject: [PATCH 126/217] fix travis2 --- build/install-neo.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index e5ba08c5..cab39424 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -5,7 +5,6 @@ export JRE_HOME=/usr/lib/jvm/java-8-oracle wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-3.0.0-RC1-unix.tar.gz -C neo --strip-components=1 > null +tar xzf neo4j-enterprise-3.0.0-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf -neo/bin/neo4j start > null & -sleep 10 \ No newline at end of file +neo/bin/neo4j start > null & \ No newline at end of file From 3358fbc9af38e4988624fee66bf9bdadda1ae3c4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 12:52:30 +0100 Subject: [PATCH 127/217] changelog upd --- CHANGELOG.md | 97 +++------------------------------------------------- 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e665d0c1..a9d00208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,96 +1,9 @@ -## 4.0 +# Changelog for v4 -* new Statement object +4.0.1 - 27 Apr 2016 +- Fixed a bug where `nodeValue` was using a hardcoded identifier [8bf11473c9870c2423de2763622d2674b97216db](8bf11473c9870c2423de2763622d2674b97216db) -## 3.3.1 & 3.3.2 +4.0.0 - 25 Apr 2016 -* Fixed some bugs concerning live transactions in respect to the send Multiple in the scope of the tx - -## 3.3.0 - -* Introduced optional new response formatter by GraphAware - -## 3.2.0 - -* Added Schema Index and Unique Constraint objects and methods for it in the Client -* Uses now GraphUnit for Integration testing - -## 3.1.2 - -* Fixed docblock in live transaction - -## 3.1.1 - -* When using getTable, if relationships should be present, their data will be returned in the corresponding row's column - -## 3.1.0 - -* Added the possibility to add have headers to define query mode -* Fixed builder preventing setting a custom formatter class via non-yml way - -## 2.2.7 - -* Added method for enabling the HA Mode without YAML Config - -## 2.1.17 - -* Added useful methods for by passing relationships in node objects - -* `getConnectedNodes` -* `getConnectedNode` - - -## 2.1.5 - -* Fixed node internal ID not being casted to int -* added a parameter `removeIndexIfExist` defaulted to false in `createUniqueConstraint` which will drop automatically -the index when creating the constraint - -```php -$client->createUniqueConstraint('Repository', 'name', true); -``` - -* added `changePassword` method for Neo4j 2.2M04+ - -```php -$client->changePassword('myUser', 'newPassword'); -``` - -## 2.1 - -### Bug fixes - -* getProperty() on relationship was returning always true -* sendMultiple was not converting empty arrays to maps in the Request json body - -### Features - -* added Prepared Transaction instance for handling multiple statements in one commit - -## 2.0 - -* The bootstrap process has been changed -* The `getVersion` method has been replaced by the `getNeo4jVersion()` method. -* `listIndex` returns now an array of indexed properties for the given label -* new method `listIndexes` returning an array `label => [$properties]` - - -## 1.5 -- Added a ResponseFormatter for handling API responses - -## 1.4 - -- Added a fallback mode for defining fallback connections in case of main connection failure - -## 1.3 - -- ChangeFeed Module command added to core -- HttpClient send method takes now a fifth parameter `query` to add query strings to the http request - -## 1.2 - -- Auth Extension commands added to core - -- HttpClient receives now the ConnectionManager, it allows further improvement to provide fallback connections -or duplication of commands \ No newline at end of file +Initial 4.0 release for support with Neo4j 3.0 \ No newline at end of file From 6e83d7be98adf9e43d93d4a6465924dea6b8d42a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 16:24:44 +0100 Subject: [PATCH 128/217] added keys() and hasValue() to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 9a7ed998..ca1de58d 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,8 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `identity()` : returns the internal ID of the node * `values()` : returns the properties of the node (array) * `value($key)` : returns the value for the given property key +* `hasValue($key)` : returns whether or not the nodes has a property with the given key +* `keys()` : returns you an array representing the keys of the node properties * `hasLabel($label)` : returns whether or not the node has the given label (boolean) @@ -228,6 +230,8 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `identity()` : returns the internal ID of the relationship * `values()` : returns the properties of the relationship (array) * `value($key)` : returns the value for the given property key +* `hasValue($key)` : returns whether or not the relationship has a property with the given key +* `keys()` : returns you an array representing the keys of the relationship properties * `startNodeIdentity` : returns the start node id * `endNodeIdentity` : returns the end node id From 0aa0ec3f649d490e87c0416c8df4dd32813c7189 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 16:52:12 +0100 Subject: [PATCH 129/217] use multienv for travis --- .travis.yml | 4 ++++ build/install-neo.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58d43e8c..16385956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: php php: - 5.6 - 7.0 +env: + - NEO_VERSION="2.2.6" + - NEO_VERSION="2.3.3" + - NEO_VERSION="3.0.0" before_install: - sudo apt-get update > /dev/null diff --git a/build/install-neo.sh b/build/install-neo.sh index cab39424..9337df1b 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,8 +3,8 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-3.0.0-unix.tar.gz -C neo --strip-components=1 > null +tar xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf neo/bin/neo4j start > null & \ No newline at end of file From 74dbc308b6a78b880be9f627b8cf9bad44ce1ecd Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 17:00:44 +0100 Subject: [PATCH 130/217] revert multienv for now --- .travis.yml | 4 ---- build/install-neo.sh | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16385956..58d43e8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,6 @@ language: php php: - 5.6 - 7.0 -env: - - NEO_VERSION="2.2.6" - - NEO_VERSION="2.3.3" - - NEO_VERSION="3.0.0" before_install: - sudo apt-get update > /dev/null diff --git a/build/install-neo.sh b/build/install-neo.sh index 9337df1b..cab39424 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,8 +3,8 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-$NEO_VERSION-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-$NEO_VERSION-unix.tar.gz -C neo --strip-components=1 > null +tar xzf neo4j-enterprise-3.0.0-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf neo/bin/neo4j start > null & \ No newline at end of file From 16bd138108989bdabb11a2360ae6e451708a5cb3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 18:19:05 +0100 Subject: [PATCH 131/217] allow null to be passed to pushQuery() in Stack objects --- src/Stack.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Stack.php b/src/Stack.php index 4d93b803..fcd061d0 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -51,11 +51,12 @@ public static function create($tag = null, $connectionAlias = null) /** * @param $query - * @param array $parameters + * @param null|array $parameters */ - public function push($query, array $parameters = array(), $tag = null) + public function push($query, $parameters = null, $tag = null) { - $this->statements[] = Statement::create($query, $parameters, $tag); + $params = null !== $parameters ? $parameters : array(); + $this->statements[] = Statement::create($query, $params, $tag); } /** From 20a7a486d092bcc165fc38211b9a03205c3078bc Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 27 Apr 2016 22:30:56 +0100 Subject: [PATCH 132/217] remove alpha state from readme --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index ca1de58d..c3fe6bf3 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ [![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) [![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) -NB: This is the master development branch for 4.x (currently in Alpha), for previous versions refer to the 3.4 branch. - ## Introduction Neo4j-PHP-Client is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. From 561202e71d759e2b5e7184b53c3c52f851927259 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 28 Apr 2016 12:35:08 +0100 Subject: [PATCH 133/217] fixed plural form of relationships deleted in update statistics --- src/HttpDriver/Result/StatementStatistics.php | 4 +- .../Integration/StatisticsIntegrationTest.php | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 tests/Integration/StatisticsIntegrationTest.php diff --git a/src/HttpDriver/Result/StatementStatistics.php b/src/HttpDriver/Result/StatementStatistics.php index 217e382b..af849474 100644 --- a/src/HttpDriver/Result/StatementStatistics.php +++ b/src/HttpDriver/Result/StatementStatistics.php @@ -33,7 +33,7 @@ class StatementStatistics implements StatementStatisticsInterface /** * @var int */ - protected $relationshipsDeleted = 0; + protected $relationshipDeleted = 0; /** * @var int @@ -132,7 +132,7 @@ public function relationshipsCreated() */ public function relationshipsDeleted() { - return $this->relationshipsDeleted; + return $this->relationshipDeleted; } /** diff --git a/tests/Integration/StatisticsIntegrationTest.php b/tests/Integration/StatisticsIntegrationTest.php new file mode 100644 index 00000000..dfa4641c --- /dev/null +++ b/tests/Integration/StatisticsIntegrationTest.php @@ -0,0 +1,49 @@ +emptyDb(); + $result = $this->client->run('CREATE (n)', null, null, 'http'); + $summary = $result->summarize(); + + $this->assertEquals(1, $summary->updateStatistics()->nodesCreated()); + } + + public function testNodesDeletedWithHttp() + { + $this->emptyDb(); + $this->client->run('CREATE (n)'); + $result = $this->client->run('MATCH (n) DETACH DELETE n', null, null, 'http'); + + $this->assertEquals(1, $result->summarize()->updateStatistics()->nodesDeleted()); + } + + public function testRelationshipsCreatedWithHttp() + { + $this->emptyDb(); + $result = $this->client->run('CREATE (n)-[:REL]->(x)', null, null, 'http'); + + $this->assertEquals(1, $result->summarize()->updateStatistics()->relationshipsCreated()); + } + + public function testRelationshipsDeletedWithHttp() + { + $this->emptyDb(); + $this->client->run('CREATE (n)-[:REL]->(x)'); + $result = $this->client->run('MATCH (n) DETACH DELETE n', null, null, 'http'); + + $this->assertEquals(1, $result->summarize()->updateStatistics()->relationshipsDeleted()); + } +} \ No newline at end of file From 775f5609df816e32967b1506516fdfb6d51fb751 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 28 Apr 2016 14:32:09 +0200 Subject: [PATCH 134/217] added changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d00208..fa524ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.0.2 - 28 Apr 2016 + +- Fixed a bug where relationships deleted count was not hydrated in the http result update statistics + 4.0.1 - 27 Apr 2016 - Fixed a bug where `nodeValue` was using a hardcoded identifier [8bf11473c9870c2423de2763622d2674b97216db](8bf11473c9870c2423de2763622d2674b97216db) From 1f6574a1c78a57736b8f2022f793500f247fdfde Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 3 May 2016 15:45:46 +0200 Subject: [PATCH 135/217] added combined statistics for ResultCollection --- composer.lock | 23 +++---- src/Client.php | 6 +- src/Formatter/ResponseFormatter.php | 4 +- .../CombinedStatisticsIntegrationTest.php | 60 +++++++++++++++++++ 4 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 tests/Integration/CombinedStatisticsIntegrationTest.php diff --git a/composer.lock b/composer.lock index be7428c3..a3feecb6 100644 --- a/composer.lock +++ b/composer.lock @@ -9,21 +9,24 @@ "packages": [ { "name": "graphaware/neo4j-bolt", - "version": "1.4.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "78332d2b866383fda92dcca6233a33bfaf3b2d38" + "reference": "6b0c0712a51751c8af4695ca129c88d3ab8555c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/78332d2b866383fda92dcca6233a33bfaf3b2d38", - "reference": "78332d2b866383fda92dcca6233a33bfaf3b2d38", + "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/6b0c0712a51751c8af4695ca129c88d3ab8555c2", + "reference": "6b0c0712a51751c8af4695ca129c88d3ab8555c2", "shasum": "" }, "require": { + "ext-bcmath": "*", + "ext-mbstring": "*", "graphaware/neo4j-common": "^2.0", "myclabs/php-enum": "^1.4", + "php": ">= 5.6", "symfony/event-dispatcher": "^2.7|^3.0" }, "require-dev": { @@ -48,20 +51,20 @@ } ], "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-04-21 11:57:11" + "time": "2016-05-03 13:44:08" }, { "name": "graphaware/neo4j-common", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "4e6c74bb1cb157c91f3b047aa9f63283bf07822c" + "reference": "33abc8647ee01f0ba58fb1aca28db6f61809354b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/4e6c74bb1cb157c91f3b047aa9f63283bf07822c", - "reference": "4e6c74bb1cb157c91f3b047aa9f63283bf07822c", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/33abc8647ee01f0ba58fb1aca28db6f61809354b", + "reference": "33abc8647ee01f0ba58fb1aca28db6f61809354b", "shasum": "" }, "require": { @@ -94,7 +97,7 @@ "neo4j", "statement" ], - "time": "2016-04-21 11:10:03" + "time": "2016-05-03 13:27:58" }, { "name": "guzzlehttp/guzzle", diff --git a/src/Client.php b/src/Client.php index f5a6a610..1e26b70e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -91,11 +91,11 @@ public function stack($tag = null, $connectionAlias = null) /** * @param \GraphAware\Neo4j\Client\Stack $stack * - * @return \GraphAware\Common\Result\ResultCollection + * @return \GraphAware\Neo4j\Client\Result\ResultCollection */ public function runStack(Stack $stack) { - $pipeline = $this->pipeline($stack->getConnectionAlias()); + $pipeline = $this->pipeline(null, null, $stack->getTag(), $stack->getConnectionAlias()); foreach ($stack->statements() as $statement) { $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); } @@ -122,7 +122,7 @@ public function transaction($connectionAlias = null) * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline + * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline|\GraphAware\Bolt\Protocol\Pipeline */ private function pipeline($query = null, $parameters = null, $tag = null, $connectionAlias = null) { diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index e54f9e5c..39d7ebcc 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -11,8 +11,7 @@ namespace GraphAware\Neo4j\Client\Formatter; -use GraphAware\Common\Cypher\Statement; -use GraphAware\Common\Result\ResultCollection; +use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Exception\Neo4jException; class ResponseFormatter @@ -27,7 +26,6 @@ class ResponseFormatter */ public function format(array $response, array $statements) { - //print_r($response); if (isset($response['errors'][0])) { $e = new Neo4jException($response['errors'][0]['message']); $e->setNeo4jStatusCode($response['errors'][0]['code']); diff --git a/tests/Integration/CombinedStatisticsIntegrationTest.php b/tests/Integration/CombinedStatisticsIntegrationTest.php new file mode 100644 index 00000000..5be2922c --- /dev/null +++ b/tests/Integration/CombinedStatisticsIntegrationTest.php @@ -0,0 +1,60 @@ +emptyDb(); + $stack = Stack::create(null, 'http'); + $stack->push('CREATE (n:Node)'); + $stack->push('MATCH (n) RETURN n'); + $results = $this->client->runStack($stack); + + $this->assertTrue($results->updateStatistics()->containsUpdates()); + } + + public function testStatsAreMergedWithHttp() + { + $this->emptyDb(); + $stack = Stack::create(null, 'http'); + $stack->push('CREATE (n:Node)'); + $stack->push('CREATE (n:Node)'); + $results = $this->client->runStack($stack); + + $this->assertEquals(2, $results->updateStatistics()->nodesCreated()); + $this->assertEquals(2, $results->updateStatistics()->labelsAdded()); + } + + public function testContainsUpdatesIsMergedWithBolt() + { + $this->emptyDb(); + $stack = Stack::create(null, 'bolt'); + $stack->push('CREATE (n:Node)'); + $stack->push('MATCH (n) RETURN n'); + $results = $this->client->runStack($stack); + + $this->assertTrue($results->updateStatistics()->containsUpdates()); + } + + public function testStatsAreMergedWithBolt() + { + $this->emptyDb(); + $stack = Stack::create(null, 'bolt'); + $stack->push('CREATE (n:Node)'); + $stack->push('CREATE (n:Node)'); + $results = $this->client->runStack($stack); + + $this->assertEquals(2, $results->updateStatistics()->nodesCreated()); + $this->assertEquals(2, $results->updateStatistics()->labelsAdded()); + } +} \ No newline at end of file From 9caca0fb091a840657b54d241344ad5fcc4799c4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 3 May 2016 15:47:20 +0200 Subject: [PATCH 136/217] 4.1.0 changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa524ad0..d1d0234c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.1.0 - 02 May 2016 + +- Added `updateStatistics()` method on the ResultCollection for combined statistics of stacks, transactions, etc.. + 4.0.2 - 28 Apr 2016 - Fixed a bug where relationships deleted count was not hydrated in the http result update statistics From a278b62c881afdfa5a1730803868a62197392f67 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 4 May 2016 22:37:08 +0200 Subject: [PATCH 137/217] Update README.md Missing ) in example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3fe6bf3..3cc6b470 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ $client->run("CREATE (n:Person) SET n += {infos}", ['infos' => ['name' => 'Ales' #### Reading a Result ```php -$result = $client->run("MATCH (n:Person) RETURN n"; +$result = $client->run("MATCH (n:Person) RETURN n)"; // a result contains always a collection (array) of Record objects // get all records From d41a3f12b2339378ef188a1938fbc2d68091d11a Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Fri, 6 May 2016 13:26:56 +0200 Subject: [PATCH 138/217] Refactoring and typos Typo Refactoring and typos --- README.md | 2 +- src/ClientBuilder.php | 15 ++++++++++++++- src/Connection/ConnectionManager.php | 25 +++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3cc6b470..6d49eb20 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ $client->run("CREATE (n:Person) SET n += {infos}", ['infos' => ['name' => 'Ales' #### Reading a Result ```php -$result = $client->run("MATCH (n:Person) RETURN n)"; +$result = $client->run("MATCH (n:Person) RETURN n"); // a result contains always a collection (array) of Record objects // get all records diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 418f6933..da010d5a 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -34,7 +34,7 @@ public function __construct() /** * Creates a new Client factory * - * @return \GraphAware\Neo4j\Client\ClientBuilder + * @return ClientBuilder */ public static function create() { @@ -61,6 +61,11 @@ public function preflightEnv($variable) $this->config['connection_manager']['preflight_env'] = $variable; } + /** + * @param string $connectionAlias + * + * @return $this + */ public function setMaster($connectionAlias) { if (!isset($this->config['connections']) || !array_key_exists($connectionAlias, $this->config['connections'])) { @@ -79,6 +84,11 @@ public function setMaster($connectionAlias) return $this; } + /** + * @param int $timeout + * + * @return $this + */ public function setDefaultTimeout($timeout) { $this->config[self::$TIMEOUT_CONFIG_KEY] = (int) $timeout; @@ -103,6 +113,9 @@ public function build() return new Client($connectionManager); } + /** + * @return int + */ private function getDefaultTimeout() { return array_key_exists(self::$TIMEOUT_CONFIG_KEY, $this->config) ? $this->config[self::$TIMEOUT_CONFIG_KEY] : self::DEFAULT_TIMEOUT; diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 84d23d87..655193d0 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -19,11 +19,29 @@ class ConnectionManager */ private $connections = []; + /** + * @var Connection|null + */ private $master; + /** + * @param string $alias + * @param string $uri + * @param null $config + * @param int $timeout + */ public function registerConnection($alias, $uri, $config = null, $timeout) { - $this->connections[$alias] = new Connection($alias, $uri, $config, $timeout); + $this->registerExistingConnection($alias, new Connection($alias, $uri, $config, $timeout)); + } + + /** + * @param string $alias + * @param Connection $connection + */ + public function registerExistingConnection($alias, Connection $connection) + { + $this->connections[$alias] = $connection; } /** @@ -44,13 +62,16 @@ public function getConnection($alias = null) return $this->connections[$alias]; } + /** + * @param string $alias + */ public function setMaster($alias) { $this->master = $this->connections[$alias]; } /** - * @return null|\GraphAware\Neo4j\Client\Connection\Connection + * @return Connection|null */ public function getMasterConnection() { From 87c05477417b42a95518217880da104b42d938e4 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 13:59:35 +0200 Subject: [PATCH 139/217] some doc and changelogs --- CHANGELOG.md | 4 ++++ README.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d0234c..98f52b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.1.1 - 06 May 2016 + +- Added `registerExistingConnection` in ConnectionManager + 4.1.0 - 02 May 2016 - Added `updateStatistics()` method on the ResultCollection for combined statistics of stacks, transactions, etc.. diff --git a/README.md b/README.md index 6d49eb20..095f6b8a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ Neo4j is a transactional, open-source graph database. A graph database manages d You can: - * Check out an [example application built with GraphAware Neo4j Client](https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/php/neoclient) * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=graphaware,php,neo4j) * For bugs, please feel free to create a [new issue on GitHub](https://github.com/graphaware/neo4j-php-client/issues/new) @@ -299,6 +298,36 @@ $results = $tx->commit(); After a commit, you will not be able to `push` or `run` statements in this transaction. +### Working with multiple connections + +Generally speaking, you would better use HAProxy for running Neo4j in a cluster environment. However sometimes it makes sense to +have full control to which instance you send your statements. + +Let's assume a environment with 3 neo4j nodes : + +```php +$client = ClientBuilder::create() + ->addConnection('node1', 'bolt://10.0.0.1') + ->addConnection('node2', 'bolt://10.0.0.2') + ->addConnection('node3', 'bolt://10.0.0.3') + ->setMaster('node1') + ->build(); +``` + +By default, the `$client->run()` command will send your Cypher statements to the first registered connection in the list. + +You can specify to which connection to send the statement by specifying its alias as 4th argument to the run parameter : + +```php +$result = $client->run('CREATE (n) RETURN n', null, null, 'node1'); +``` + +The client is also aware of the manually configured master connection, so sending your writes can be easier with : + +```php +$client->runWrite('CREATE (n:User {login: 123})'); +``` + ### Settings #### Timeout From 93aad601b04d44ced89b193e58e623b83feb4c18 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 15:54:50 +0200 Subject: [PATCH 140/217] event dispatching bootstrap --- src/Client.php | 40 ++++++++++++++++++++++++++++----- src/Event/PostRunEvent.php | 38 +++++++++++++++++++++++++++++++ src/Event/PreRunEvent.php | 36 +++++++++++++++++++++++++++++ src/Neo4jClientEvents.php | 19 ++++++++++++++++ src/Result/ResultCollection.php | 9 ++++++++ 5 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/Event/PostRunEvent.php create mode 100644 src/Event/PreRunEvent.php create mode 100644 src/Neo4jClientEvents.php diff --git a/src/Client.php b/src/Client.php index 1e26b70e..bcd41469 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,21 +11,34 @@ namespace GraphAware\Neo4j\Client; +use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\Event\PostRunEvent; +use GraphAware\Neo4j\Client\Event\PreRunEvent; +use GraphAware\Neo4j\Client\Exception\Neo4jException; +use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Transaction\Transaction; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Neo4jClientEvents; class Client { - const NEOCLIENT_VERSION = '4.0.0'; + const NEOCLIENT_VERSION = '4.0'; /** * @var \GraphAware\Neo4j\Client\Connection\ConnectionManager */ protected $connectionManager; + /** + * @var \Symfony\Component\EventDispatcher\EventDispatcher + */ + protected $eventDispatcher; + public function __construct(ConnectionManager $connectionManager) { $this->connectionManager = $connectionManager; + $this->eventDispatcher = new EventDispatcher(); } /** @@ -37,12 +50,22 @@ public function __construct(ConnectionManager $connectionManager) * @param null|string $connectionAlias * * @return \GraphAware\Common\Result\Result + * + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface */ public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); - - return $connection->run($query, $parameters, $tag); + $statement = Statement::create($query, $parameters, $tag); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent(array($statement))); + try { + $result = $connection->run($query, $parameters, $tag); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); + return $result; + } catch (Neo4jException $e) { + // dispatch event + throw $e; + } } /** @@ -99,8 +122,15 @@ public function runStack(Stack $stack) foreach ($stack->statements() as $statement) { $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); } - - return $pipeline->run(); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent($stack->statements())); + try { + $results = $pipeline->run(); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent($results)); + return $results; + } catch(Neo4jException $e) { + //dispatch event + throw $e; + } } /** diff --git a/src/Event/PostRunEvent.php b/src/Event/PostRunEvent.php new file mode 100644 index 00000000..d3045e4f --- /dev/null +++ b/src/Event/PostRunEvent.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Event; + +use GraphAware\Common\Result\ResultCollection; +use Symfony\Component\EventDispatcher\Event; + +class PostRunEvent extends Event +{ + /** + * @var \GraphAware\Neo4j\Client\Result\ResultCollection + */ + protected $results; + + public function __construct(ResultCollection $results) + { + $this->results = $results; + } + + /** + * @return \GraphAware\Neo4j\Client\Result\ResultCollection + */ + public function getResults() + { + return $this->results; + } + + +} \ No newline at end of file diff --git a/src/Event/PreRunEvent.php b/src/Event/PreRunEvent.php new file mode 100644 index 00000000..523a929e --- /dev/null +++ b/src/Event/PreRunEvent.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Event; + +use Symfony\Component\EventDispatcher\Event; + +class PreRunEvent extends Event +{ + /** + * @var \GraphAware\Common\Cypher\StatementInterface[] + */ + private $statements; + + public function __construct(array $statements) + { + $this->statements = $statements; + } + + /** + * @return \GraphAware\Common\Cypher\StatementInterface[] + */ + public function getStatements() + { + return $this->statements; + } + +} \ No newline at end of file diff --git a/src/Neo4jClientEvents.php b/src/Neo4jClientEvents.php new file mode 100644 index 00000000..85d492b4 --- /dev/null +++ b/src/Neo4jClientEvents.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +final class Neo4jClientEvents +{ + const NEO4J_PRE_RUN = 'neo4j.pre_run'; + + const NEO4J_POST_RUN = 'neo4j.post_run'; + + const NEO4J_ON_FAILURE = 'neo4j.on_failure'; +} \ No newline at end of file diff --git a/src/Result/ResultCollection.php b/src/Result/ResultCollection.php index 465305a4..7e76f4f3 100644 --- a/src/Result/ResultCollection.php +++ b/src/Result/ResultCollection.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\Result; +use GraphAware\Common\Result\RecordCursorInterface; use GraphAware\Common\Result\ResultCollection as BaseResultCollection; class ResultCollection extends BaseResultCollection @@ -26,4 +27,12 @@ public function getTag() { return $this->tag; } + + public static function withResult(RecordCursorInterface $result) + { + $coll = new ResultCollection(); + $coll->add($result); + + return $coll; + } } \ No newline at end of file From 81895975bb89bec0e7c7e64254c113425a00d4e7 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 15:57:22 +0200 Subject: [PATCH 141/217] some fixes in namespaces --- src/Client.php | 5 +++-- src/Neo4jClientEvents.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index bcd41469..fb0ed61e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -19,7 +19,7 @@ use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Transaction\Transaction; use Symfony\Component\EventDispatcher\EventDispatcher; -use Neo4jClientEvents; +use GraphAware\Neo4j\Client\Neo4jClientEvents; class Client { @@ -56,7 +56,8 @@ public function __construct(ConnectionManager $connectionManager) public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); - $statement = Statement::create($query, $parameters, $tag); + $params = null !== $parameters ? $parameters : array(); + $statement = Statement::create($query, $params, $tag); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent(array($statement))); try { $result = $connection->run($query, $parameters, $tag); diff --git a/src/Neo4jClientEvents.php b/src/Neo4jClientEvents.php index 85d492b4..3ab5ed23 100644 --- a/src/Neo4jClientEvents.php +++ b/src/Neo4jClientEvents.php @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +namespace GraphAware\Neo4j\Client; + final class Neo4jClientEvents { const NEO4J_PRE_RUN = 'neo4j.pre_run'; From e0adbf2e51febd8c3f2467374a37608c84e848c0 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 16:03:49 +0200 Subject: [PATCH 142/217] failure event --- src/Client.php | 6 +++--- src/Event/FailureEvent.php | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/Event/FailureEvent.php diff --git a/src/Client.php b/src/Client.php index fb0ed61e..5c22626d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -13,13 +13,13 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\Event\FailureEvent; use GraphAware\Neo4j\Client\Event\PostRunEvent; use GraphAware\Neo4j\Client\Event\PreRunEvent; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Transaction\Transaction; use Symfony\Component\EventDispatcher\EventDispatcher; -use GraphAware\Neo4j\Client\Neo4jClientEvents; class Client { @@ -64,7 +64,7 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); return $result; } catch (Neo4jException $e) { - // dispatch event + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, new FailureEvent($e)); throw $e; } } @@ -129,7 +129,7 @@ public function runStack(Stack $stack) $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent($results)); return $results; } catch(Neo4jException $e) { - //dispatch event + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, new FailureEvent($e)); throw $e; } } diff --git a/src/Event/FailureEvent.php b/src/Event/FailureEvent.php new file mode 100644 index 00000000..4c85f646 --- /dev/null +++ b/src/Event/FailureEvent.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Event; + +use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; +use Symfony\Component\EventDispatcher\Event; + +class FailureEvent extends Event +{ + /** + * @var \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + */ + protected $exception; + + public function __construct(Neo4jExceptionInterface $exception) + { + $this->exception = $exception; + } + + /** + * @return \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + */ + public function getException() + { + return $this->exception; + } +} \ No newline at end of file From a139e5d9dfe233b157043bbb891b793153e68b84 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 17:23:11 +0200 Subject: [PATCH 143/217] event listener test --- src/Client.php | 33 +++++++++++--- src/ClientBuilder.php | 19 +++++++- src/Event/FailureEvent.php | 18 ++++++++ ...BuildWithEventListenersIntegrationTest.php | 43 +++++++++++++++++++ tests/Integration/EventListener.php | 36 ++++++++++++++++ 5 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 tests/Integration/BuildWithEventListenersIntegrationTest.php create mode 100644 tests/Integration/EventListener.php diff --git a/src/Client.php b/src/Client.php index 5c22626d..a09769b6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -20,6 +20,7 @@ use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Transaction\Transaction; use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Client { @@ -35,10 +36,10 @@ class Client */ protected $eventDispatcher; - public function __construct(ConnectionManager $connectionManager) + public function __construct(ConnectionManager $connectionManager, EventDispatcherInterface $ev = null) { $this->connectionManager = $connectionManager; - $this->eventDispatcher = new EventDispatcher(); + $this->eventDispatcher = null !== $ev ? $ev : new EventDispatcher(); } /** @@ -64,8 +65,13 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); return $result; } catch (Neo4jException $e) { - $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, new FailureEvent($e)); - throw $e; + $event = new FailureEvent($e); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event); + if ($event->shouldThrowException()) { + throw $e; + } + + return null; } } @@ -116,6 +122,8 @@ public function stack($tag = null, $connectionAlias = null) * @param \GraphAware\Neo4j\Client\Stack $stack * * @return \GraphAware\Neo4j\Client\Result\ResultCollection + * + * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface */ public function runStack(Stack $stack) { @@ -129,8 +137,13 @@ public function runStack(Stack $stack) $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent($results)); return $results; } catch(Neo4jException $e) { - $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, new FailureEvent($e)); - throw $e; + $event = new FailureEvent($e); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event); + if ($event->shouldThrowException()) { + throw $e; + } + + return null; } } @@ -186,4 +199,12 @@ public function getConnectionManager() { return $this->connectionManager; } + + /** + * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + public function getEventDispatcher() + { + return $this->eventDispatcher; + } } diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index da010d5a..aa11eb55 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -12,6 +12,7 @@ namespace GraphAware\Neo4j\Client; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use Symfony\Component\EventDispatcher\EventDispatcher; class ClientBuilder { @@ -96,6 +97,13 @@ public function setDefaultTimeout($timeout) return $this; } + public function registerEventListener($eventName, $callback) + { + $this->config['event_listeners'][$eventName][] = $callback; + + return $this; + } + /** * Builds a Client based on the connections given * @@ -110,7 +118,16 @@ public function build() $connectionManager->setMaster($alias); } } - return new Client($connectionManager); + $ev = null; + if (isset($this->config['event_listeners'])) { + $ev = new EventDispatcher(); + foreach ($this->config['event_listeners'] as $k => $callbacks) { + foreach ($callbacks as $callback) { + $ev->addListener($k, $callback); + } + } + } + return new Client($connectionManager, $ev); } /** diff --git a/src/Event/FailureEvent.php b/src/Event/FailureEvent.php index 4c85f646..2397e887 100644 --- a/src/Event/FailureEvent.php +++ b/src/Event/FailureEvent.php @@ -21,6 +21,11 @@ class FailureEvent extends Event */ protected $exception; + /** + * @var bool + */ + protected $shouldThrowException = true; + public function __construct(Neo4jExceptionInterface $exception) { $this->exception = $exception; @@ -33,4 +38,17 @@ public function getException() { return $this->exception; } + + public function disableException() + { + $this->shouldThrowException = false; + } + + /** + * @return bool + */ + public function shouldThrowException() + { + return $this->shouldThrowException; + } } \ No newline at end of file diff --git a/tests/Integration/BuildWithEventListenersIntegrationTest.php b/tests/Integration/BuildWithEventListenersIntegrationTest.php new file mode 100644 index 00000000..65919cd9 --- /dev/null +++ b/tests/Integration/BuildWithEventListenersIntegrationTest.php @@ -0,0 +1,43 @@ +addConnection('default', 'bolt://localhost') + ->registerEventListener(Neo4jClientEvents::NEO4J_PRE_RUN, array($listener, 'onPreRun')) + ->registerEventListener(Neo4jClientEvents::NEO4J_POST_RUN, array($listener, 'onPostRun')) + ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, array($listener, 'onFailure')) + ->build(); + + $result = $client->run('MATCH (n) RETURN count(n)'); + $this->assertTrue($listener->hookedPreRun); + $this->assertTrue($listener->hookedPostRun); + } + + public function testFailureCanBeDisabled() + { + $listener = new EventListener(); + $client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, array($listener, 'onFailure')) + ->build(); + + $client->run('MATCH (n)'); + $this->assertInstanceOf(Neo4jExceptionInterface::class, $listener->e); + } +} \ No newline at end of file diff --git a/tests/Integration/EventListener.php b/tests/Integration/EventListener.php new file mode 100644 index 00000000..74111550 --- /dev/null +++ b/tests/Integration/EventListener.php @@ -0,0 +1,36 @@ +getStatements()) > 0) { + $this->hookedPreRun = true; + } + } + + public function onPostRun(PostRunEvent $event) + { + if ($event->getResults()->size() > 0) { + $this->hookedPostRun = true; + } + } + + public function onFailure(FailureEvent $event) + { + $this->e = $event->getException(); + $event->disableException(); + } +} \ No newline at end of file From 4699376e138c96f344893e212b4438fa2067f40b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 17:28:55 +0200 Subject: [PATCH 144/217] event listeners doc --- README.md | 21 +++++++++++++++++++++ src/Neo4jClientEvents.php | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index 095f6b8a..bc8adf0a 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,27 @@ The client is also aware of the manually configured master connection, so sendin $client->runWrite('CREATE (n:User {login: 123})'); ``` +### Event Dispatching + +3 types of events are dispatched during the `run` methods : + +* `PreRunEvent` : before the statement or stack is run. +* `PostRunEvent` : after the statement or stack is run. +* `FailureEvent` : in case of failure, you can disable the client to throw an exception with this event. + +##### Registering listeners + +Example : + +```php +$client = ClientBuilder::create() + ->addConnection('default', 'bolt://localhost') + ->registerEventListener(Neo4jClientEvents::NEO4J_PRE_RUN, array($listener, 'onPreRun') + ->build(); +``` + +The event dispatcher is available via the client with the `$client->getEventDispatcher` methods. + ### Settings #### Timeout diff --git a/src/Neo4jClientEvents.php b/src/Neo4jClientEvents.php index 3ab5ed23..b64f8539 100644 --- a/src/Neo4jClientEvents.php +++ b/src/Neo4jClientEvents.php @@ -13,9 +13,21 @@ final class Neo4jClientEvents { + /** + * This event is dispatched before a query or a stack is run. + * An object of type PreRunEvent is given. + */ const NEO4J_PRE_RUN = 'neo4j.pre_run'; + /** + * This event is dispatched after a query or stack is run. + * An object of type PostRunEvent is given. + */ const NEO4J_POST_RUN = 'neo4j.post_run'; + /** + * This event is dispatched in case of failure during the run. + * An event of type FailureEvent is given. + */ const NEO4J_ON_FAILURE = 'neo4j.on_failure'; } \ No newline at end of file From 524e25a892e03349fdc3fb5f102fecced9603e13 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 17:33:17 +0200 Subject: [PATCH 145/217] changelog for 4.2.0 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98f52b00..e0287c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.2.0 - 06 May 2016 + +- Added events dispatching before and after running statements and stacks + 4.1.1 - 06 May 2016 - Added `registerExistingConnection` in ConnectionManager From c791f2cdebbded10a2d35db00c10f21bf5652748 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 17:54:04 +0200 Subject: [PATCH 146/217] updated deps --- build/install-neo.sh | 2 +- composer.lock | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index cab39424..05fff955 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -3,7 +3,7 @@ export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle -wget http://dist.neo4j.org/neo4j-enterprise-3.0.0-unix.tar.gz > null +wget http://dist.neo4j.org/neo4j-enterprise-3.0.1-unix.tar.gz > null mkdir neo tar xzf neo4j-enterprise-3.0.0-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf diff --git a/composer.lock b/composer.lock index a3feecb6..c1e60d87 100644 --- a/composer.lock +++ b/composer.lock @@ -55,16 +55,16 @@ }, { "name": "graphaware/neo4j-common", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "33abc8647ee01f0ba58fb1aca28db6f61809354b" + "reference": "ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/33abc8647ee01f0ba58fb1aca28db6f61809354b", - "reference": "33abc8647ee01f0ba58fb1aca28db6f61809354b", + "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e", + "reference": "ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e", "shasum": "" }, "require": { @@ -97,7 +97,7 @@ "neo4j", "statement" ], - "time": "2016-05-03 13:27:58" + "time": "2016-05-06 15:11:19" }, { "name": "guzzlehttp/guzzle", @@ -214,16 +214,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.2.3", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" + "reference": "31382fef2889136415751badebbd1cb022a4ed72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72", + "reference": "31382fef2889136415751badebbd1cb022a4ed72", "shasum": "" }, "require": { @@ -268,7 +268,7 @@ "stream", "uri" ], - "time": "2016-02-18 21:54:00" + "time": "2016-04-13 19:56:01" }, { "name": "myclabs/php-enum", @@ -365,16 +365,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39" + "reference": "17b04e6b1ede45b57d3ad5146abe50df6c3968b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9002dcf018d884d294b1ef20a6f968efc1128f39", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/17b04e6b1ede45b57d3ad5146abe50df6c3968b4", + "reference": "17b04e6b1ede45b57d3ad5146abe50df6c3968b4", "shasum": "" }, "require": { @@ -421,7 +421,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-10 10:34:12" + "time": "2016-04-12 18:09:53" } ], "packages-dev": [ @@ -1076,16 +1076,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "2292b116f43c272ff4328083096114f84ea46a56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56", + "reference": "2292b116f43c272ff4328083096114f84ea46a56", "shasum": "" }, "require": { @@ -1122,7 +1122,7 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-05-04 07:59:13" }, { "name": "sebastian/exporter", @@ -1331,7 +1331,7 @@ }, { "name": "symfony/stopwatch", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -1380,7 +1380,7 @@ }, { "name": "symfony/yaml", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From d884f2865eeedb596966c434cf70eb2fc3bf64fa Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 18:00:23 +0200 Subject: [PATCH 147/217] fixed session interface implementation in http driver --- src/HttpDriver/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index f8836e1e..6de9f9b3 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -40,7 +40,7 @@ public function __construct($uri, Client $httpClient, ConfigInterface $config) $this->config = $config; } - public function run($statement, $parameters = array(), $tag = null) + public function run($statement, array $parameters = array(), $tag = null) { $parameters = is_array($parameters) ? $parameters : array(); $pipeline = $this->createPipeline($statement, $parameters, $tag); From 0ee055fc124a453f893997adab5947ec33a9c462 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 6 May 2016 18:12:05 +0200 Subject: [PATCH 148/217] fix neo install for build --- build/install-neo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install-neo.sh b/build/install-neo.sh index 05fff955..b2e90172 100755 --- a/build/install-neo.sh +++ b/build/install-neo.sh @@ -5,6 +5,6 @@ export JRE_HOME=/usr/lib/jvm/java-8-oracle wget http://dist.neo4j.org/neo4j-enterprise-3.0.1-unix.tar.gz > null mkdir neo -tar xzf neo4j-enterprise-3.0.0-unix.tar.gz -C neo --strip-components=1 > null +tar xzf neo4j-enterprise-3.0.1-unix.tar.gz -C neo --strip-components=1 > null sed -i.bak '/\(dbms\.security\.auth_enabled=\).*/s/^#//g' ./neo/conf/neo4j.conf neo/bin/neo4j start > null & \ No newline at end of file From c2b616ce9107a6a34047e39fae6cea0b1b932965 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Fri, 6 May 2016 20:05:27 +0200 Subject: [PATCH 149/217] Bumped graphaware/neo4j-common version + CS Fix CS Fix Typo Bumped graphaware/neo4j-common version + CS Fix --- .gitignore | 1 + composer.json | 2 +- composer.lock | 1440 ----------------- src/Client.php | 66 +- src/ClientBuilder.php | 21 +- src/Config.php | 16 +- src/Connection/Connection.php | 75 +- src/Connection/ConnectionManager.php | 8 +- src/Event/FailureEvent.php | 10 +- src/Event/PostRunEvent.php | 12 +- src/Event/PreRunEvent.php | 12 +- src/Exception/Neo4jException.php | 21 +- src/Exception/Neo4jExceptionInterface.php | 6 +- src/Exception/NeoClientExceptionInterface.php | 5 +- src/Formatter/RecordView.php | 56 +- src/Formatter/Response.php | 63 +- src/Formatter/ResponseFormatter.php | 12 +- src/Formatter/Result.php | 124 +- src/Formatter/Type/MapAccess.php | 24 +- src/Formatter/Type/Node.php | 19 +- src/Formatter/Type/Path.php | 51 +- src/Formatter/Type/Relationship.php | 34 +- src/HttpDriver/Configuration.php | 8 +- src/HttpDriver/Driver.php | 26 +- src/HttpDriver/GraphDatabase.php | 12 +- src/HttpDriver/Pipeline.php | 26 +- src/HttpDriver/Result/ResultSummary.php | 28 +- src/HttpDriver/Result/StatementStatistics.php | 9 +- src/HttpDriver/Session.php | 142 +- src/HttpDriver/Transaction.php | 118 +- src/Neo4jClientEvents.php | 3 +- src/Result/ResultCollection.php | 19 +- src/Stack.php | 18 +- src/Transaction/Transaction.php | 55 +- tests/Integration/CypherIntegrationTest.php | 8 +- 35 files changed, 695 insertions(+), 1855 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index f094bd95..a6091939 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tests/_reports tests/database_settings.yml cache/ neoclient.yml +composer.lock diff --git a/composer.json b/composer.json index 7f5fbe6c..c917edfa 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "graphaware/neo4j-bolt": "^1.0", "guzzlehttp/guzzle": "^6.0", "symfony/event-dispatcher": "^2.7|^3.0", - "graphaware/neo4j-common": "^2.0", + "graphaware/neo4j-common": "^3.0", "myclabs/php-enum": "^1.4" }, "require-dev": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index c1e60d87..00000000 --- a/composer.lock +++ /dev/null @@ -1,1440 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "f40b80384469305986ad8d9c5166b979", - "content-hash": "acf95e9978f6cb6522e82dbd4c7405a6", - "packages": [ - { - "name": "graphaware/neo4j-bolt", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/graphaware/neo4j-bolt-php.git", - "reference": "6b0c0712a51751c8af4695ca129c88d3ab8555c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-bolt-php/zipball/6b0c0712a51751c8af4695ca129c88d3ab8555c2", - "reference": "6b0c0712a51751c8af4695ca129c88d3ab8555c2", - "shasum": "" - }, - "require": { - "ext-bcmath": "*", - "ext-mbstring": "*", - "graphaware/neo4j-common": "^2.0", - "myclabs/php-enum": "^1.4", - "php": ">= 5.6", - "symfony/event-dispatcher": "^2.7|^3.0" - }, - "require-dev": { - "behat/behat": "~3.0.4", - "phpunit/phpunit": "^4.8", - "symfony/stopwatch": "^2.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "GraphAware\\Bolt\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Willemsen", - "email": "christophe@graphaware.com" - } - ], - "description": "Neo4j Bolt Binary Protocol PHP Driver", - "time": "2016-05-03 13:44:08" - }, - { - "name": "graphaware/neo4j-common", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/graphaware/neo4j-php-commons.git", - "reference": "ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/graphaware/neo4j-php-commons/zipball/ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e", - "reference": "ed3eafedb5923bea7e8b15c71d0f5a860aed0b4e", - "shasum": "" - }, - "require": { - "myclabs/php-enum": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "GraphAware\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ApacheV2" - ], - "authors": [ - { - "name": "Christophe Willemsen", - "email": "christophe@graphaware.com" - } - ], - "description": "Common Utilities library for Neo4j", - "keywords": [ - "cypher", - "database", - "graph", - "neo4j", - "statement" - ], - "time": "2016-05-06 15:11:19" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.2.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "d094e337976dff9d8e2424e8485872194e768662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", - "reference": "d094e337976dff9d8e2424e8485872194e768662", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2016-03-21 20:02:09" - }, - { - "name": "guzzlehttp/promises", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-03-08 01:15:46" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "31382fef2889136415751badebbd1cb022a4ed72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72", - "reference": "31382fef2889136415751badebbd1cb022a4ed72", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2016-04-13 19:56:01" - }, - { - "name": "myclabs/php-enum", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/php-enum.git", - "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/07da9d1a7469941ae05b046193fac4c83bdb0d7e", - "reference": "07da9d1a7469941ae05b046193fac4c83bdb0d7e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "4.*", - "squizlabs/php_codesniffer": "1.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "MyCLabs\\Enum\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP Enum contributors", - "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" - } - ], - "description": "PHP Enum implementation", - "homepage": "http://github.com/myclabs/php-enum", - "keywords": [ - "enum" - ], - "time": "2015-07-22 16:14:03" - }, - { - "name": "psr/http-message", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "17b04e6b1ede45b57d3ad5146abe50df6c3968b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/17b04e6b1ede45b57d3ad5146abe50df6c3968b4", - "reference": "17b04e6b1ede45b57d3ad5146abe50df6c3968b4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2016-02-15 07:46:21" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06 15:47:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-06-21 13:08:43" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-09-15 10:49:45" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.24", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2016-03-14 06:16:08" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02 06:51:40" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-12-08 07:14:41" - }, - { - "name": "sebastian/environment", - "version": "1.3.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "2292b116f43c272ff4328083096114f84ea46a56" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56", - "reference": "2292b116f43c272ff4328083096114f84ea46a56", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-05-04 07:59:13" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12 03:26:01" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/stopwatch", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "6015187088421e9499d8f8316bdb396f8b806c06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6015187088421e9499d8f8316bdb396f8b806c06", - "reference": "6015187088421e9499d8f8316bdb396f8b806c06", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" - }, - { - "name": "symfony/yaml", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">= 5.6" - }, - "platform-dev": [] -} diff --git a/src/Client.php b/src/Client.php index a09769b6..b41c8e04 100644 --- a/src/Client.php +++ b/src/Client.php @@ -8,10 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; +use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\Event\FailureEvent; use GraphAware\Neo4j\Client\Event\PostRunEvent; @@ -27,12 +27,12 @@ class Client const NEOCLIENT_VERSION = '4.0'; /** - * @var \GraphAware\Neo4j\Client\Connection\ConnectionManager + * @var ConnectionManager */ protected $connectionManager; /** - * @var \Symfony\Component\EventDispatcher\EventDispatcher + * @var EventDispatcherInterface */ protected $eventDispatcher; @@ -43,10 +43,10 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche } /** - * Run a Cypher statement against the default database or the database specified + * Run a Cypher statement against the default database or the database specified. * * @param $query - * @param null|array $parameters + * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * @@ -63,6 +63,7 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = try { $result = $connection->run($query, $parameters, $tag); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); + return $result; } catch (Neo4jException $e) { $event = new FailureEvent($e); @@ -71,18 +72,18 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = throw $e; } - return null; + return; } } /** - * @param string $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * - * @return mixed + * @return AbstractRecordCursor * - * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + * @throws Neo4jException */ public function runWrite($query, $parameters = null, $tag = null) { @@ -92,16 +93,15 @@ public function runWrite($query, $parameters = null, $tag = null) } /** - * * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead. * - * @param string $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * - * @return mixed + * @return AbstractRecordCursor * - * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + * @throws Neo4jException */ public function sendWriteQuery($query, $parameters = null, $tag = null) { @@ -110,8 +110,9 @@ public function sendWriteQuery($query, $parameters = null, $tag = null) /** * @param string|null $tag + * @param string|null $connectionAlias * - * @return \GraphAware\Neo4j\Client\Stack + * @return Stack */ public function stack($tag = null, $connectionAlias = null) { @@ -119,38 +120,43 @@ public function stack($tag = null, $connectionAlias = null) } /** - * @param \GraphAware\Neo4j\Client\Stack $stack + * @param Stack $stack * - * @return \GraphAware\Neo4j\Client\Result\ResultCollection + * @return ResultCollection|null * - * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * @throws Neo4jException */ public function runStack(Stack $stack) { $pipeline = $this->pipeline(null, null, $stack->getTag(), $stack->getConnectionAlias()); + foreach ($stack->statements() as $statement) { $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); } + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent($stack->statements())); + try { $results = $pipeline->run(); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent($results)); - return $results; - } catch(Neo4jException $e) { + } catch (Neo4jException $e) { $event = new FailureEvent($e); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event); + if ($event->shouldThrowException()) { throw $e; } - return null; + return; } + + return $results; } /** - * @param null $connectionAlias + * @param null|string $connectionAlias * - * @return \GraphAware\Neo4j\Client\Transaction\Transaction + * @return Transaction */ public function transaction($connectionAlias = null) { @@ -162,7 +168,7 @@ public function transaction($connectionAlias = null) /** * @param null|string $query - * @param null|array $parameters + * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * @@ -178,12 +184,12 @@ private function pipeline($query = null, $parameters = null, $tag = null, $conne /** * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. * - * @param $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Bolt\Result\Result + * @return AbstractRecordCursor */ public function sendCypherQuery($query, $parameters = null, $tag = null, $connectionAlias = null) { @@ -193,7 +199,7 @@ public function sendCypherQuery($query, $parameters = null, $tag = null, $connec } /** - * @return \GraphAware\Neo4j\Client\Connection\ConnectionManager + * @return ConnectionManager */ public function getConnectionManager() { @@ -201,7 +207,7 @@ public function getConnectionManager() } /** - * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface + * @return EventDispatcherInterface */ public function getEventDispatcher() { diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index aa11eb55..3f45e392 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client; use GraphAware\Neo4j\Client\Connection\ConnectionManager; @@ -20,7 +19,7 @@ class ClientBuilder const DEFAULT_TIMEOUT = 5; - private static $TIMEOUT_CONFIG_KEY = "timeout"; + private static $TIMEOUT_CONFIG_KEY = 'timeout'; /** * @var array @@ -33,7 +32,7 @@ public function __construct() } /** - * Creates a new Client factory + * Creates a new Client factory. * * @return ClientBuilder */ @@ -43,7 +42,7 @@ public static function create() } /** - * Add a connection to the handled connections + * Add a connection to the handled connections. * * @param string $alias * @param string $uri @@ -97,6 +96,12 @@ public function setDefaultTimeout($timeout) return $this; } + /** + * @param string $eventName + * @param mixed $callback + * + * @return $this + */ public function registerEventListener($eventName, $callback) { $this->config['event_listeners'][$eventName][] = $callback; @@ -105,28 +110,34 @@ public function registerEventListener($eventName, $callback) } /** - * Builds a Client based on the connections given + * Builds a Client based on the connections given. * * @return \GraphAware\Neo4j\Client\Client */ public function build() { $connectionManager = new ConnectionManager(); + foreach ($this->config['connections'] as $alias => $conn) { $connectionManager->registerConnection($alias, $conn['uri'], null, $this->getDefaultTimeout()); + if (isset($conn['is_master']) && $conn['is_master'] === true) { $connectionManager->setMaster($alias); } } + $ev = null; + if (isset($this->config['event_listeners'])) { $ev = new EventDispatcher(); + foreach ($this->config['event_listeners'] as $k => $callbacks) { foreach ($callbacks as $callback) { $ev->addListener($k, $callback); } } } + return new Client($connectionManager, $ev); } diff --git a/src/Config.php b/src/Config.php index 2973b46c..aaebda58 100644 --- a/src/Config.php +++ b/src/Config.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client; class Config @@ -17,11 +16,19 @@ class Config protected $defaultTcpPort = 8687; + /** + * @return Config + */ public static function create() { return new self(); } + /** + * @param int $port + * + * @return $this + */ public function withDefaultHttpPort($port) { $this->defaultHttpPort = (int) $port; @@ -29,10 +36,15 @@ public function withDefaultHttpPort($port) return $this; } + /** + * @param int $port + * + * @return $this + */ public function withDefaultTcpPort($port) { $this->defaultTcpPort = (int) $port; return $this; } -} \ No newline at end of file +} diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 3291520a..336b844e 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Bolt\Configuration; @@ -52,12 +51,15 @@ class Connection * * @param string $alias * @param string $uri + * @param null $config + * @param int $timeout */ public function __construct($alias, $uri, $config = null, $timeout) { $this->alias = (string) $alias; $this->uri = (string) $uri; - $this->timeout = $timeout; + $this->timeout = (int) $timeout; + $this->buildDriver(); } @@ -69,25 +71,6 @@ public function getAlias() return $this->alias; } - private function buildDriver() - { - $params = parse_url($this->uri); - if (preg_match('/bolt/', $this->uri)) { - $port = isset($params['port']) ? (int) $params['port'] : 7687; - $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); - $config = null; - if (isset($params['user']) && isset($params['pass'])) { - $config = Configuration::withCredentials($params['user'], $params['pass']); - } - $this->driver = BoltGraphDB::driver($uri, $config); - } elseif (preg_match('/http/', $this->uri)) { - $uri = $this->uri; - $this->driver = HttpGraphDB::driver($uri, HttpConfig::withTimeout($this->timeout)); - } else { - throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); - } - } - /** * @return \GraphAware\Common\Driver\DriverInterface */ @@ -97,9 +80,10 @@ public function getDriver() } /** - * @param null $query + * @param null $query * @param array $parameters - * @param null $tag + * @param null $tag + * * @return \GraphAware\Bolt\Protocol\Pipeline|\GraphAware\Neo4j\Client\HttpDriver\Pipeline */ public function createPipeline($query = null, $parameters = array(), $tag = null) @@ -110,10 +94,20 @@ public function createPipeline($query = null, $parameters = array(), $tag = null return $this->session->createPipeline($query, $parameters, $tag); } - public function run($statement, $parameters, $tag) + /** + * @param string $statement + * @param array|null $parameters + * @param null|string $tag + * + * @return \GraphAware\Common\Result\AbstractRecordCursor + * + * @throws Neo4jException + */ + public function run($statement, $parameters = null, $tag) { $this->checkSession(); - $parameters = is_array($parameters) ? $parameters : array(); + $parameters = (array) $parameters; + try { $results = $this->session->run($statement, $parameters, $tag); @@ -126,10 +120,16 @@ public function run($statement, $parameters, $tag) } } + /** + * @param array $queue + * + * @return \GraphAware\Common\Result\ResultCollection + */ public function runMixed(array $queue) { $this->checkSession(); $pipeline = $this->createPipeline(); + foreach ($queue as $element) { if ($element instanceof Stack) { foreach ($element->statements() as $statement) { @@ -143,9 +143,13 @@ public function runMixed(array $queue) return $pipeline->run(); } + /** + * @return \GraphAware\Common\Transaction\TransactionInterface + */ public function getTransaction() { $this->checkSession(); + return $this->session->transaction(); } @@ -155,9 +159,30 @@ public function getTransaction() public function getSession() { $this->checkSession(); + return $this->session; } + private function buildDriver() + { + $params = parse_url($this->uri); + + if (preg_match('/bolt/', $this->uri)) { + $port = isset($params['port']) ? (int) $params['port'] : 7687; + $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); + $config = null; + if (isset($params['user']) && isset($params['pass'])) { + $config = Configuration::withCredentials($params['user'], $params['pass']); + } + $this->driver = BoltGraphDB::driver($uri, $config); + } elseif (preg_match('/http/', $this->uri)) { + $uri = $this->uri; + $this->driver = HttpGraphDB::driver($uri, HttpConfig::withTimeout($this->timeout)); + } else { + throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); + } + } + private function checkSession() { if (null === $this->session) { diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 655193d0..fdde4b3e 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -8,10 +8,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Connection; - class ConnectionManager { /** @@ -27,8 +25,8 @@ class ConnectionManager /** * @param string $alias * @param string $uri - * @param null $config - * @param int $timeout + * @param null $config + * @param int $timeout */ public function registerConnection($alias, $uri, $config = null, $timeout) { @@ -46,12 +44,14 @@ public function registerExistingConnection($alias, Connection $connection) /** * @param null $alias + * * @return \GraphAware\Neo4j\Client\Connection\Connection */ public function getConnection($alias = null) { if (null === $alias) { list($a) = array_keys($this->connections); + return $this->connections[$a]; } diff --git a/src/Event/FailureEvent.php b/src/Event/FailureEvent.php index 2397e887..5d1c3b0a 100644 --- a/src/Event/FailureEvent.php +++ b/src/Event/FailureEvent.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Event; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; @@ -17,7 +16,7 @@ class FailureEvent extends Event { /** - * @var \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * @var Neo4jExceptionInterface */ protected $exception; @@ -26,13 +25,16 @@ class FailureEvent extends Event */ protected $shouldThrowException = true; + /** + * @param Neo4jExceptionInterface $exception + */ public function __construct(Neo4jExceptionInterface $exception) { $this->exception = $exception; } /** - * @return \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * @return Neo4jExceptionInterface */ public function getException() { @@ -51,4 +53,4 @@ public function shouldThrowException() { return $this->shouldThrowException; } -} \ No newline at end of file +} diff --git a/src/Event/PostRunEvent.php b/src/Event/PostRunEvent.php index d3045e4f..b9d58c51 100644 --- a/src/Event/PostRunEvent.php +++ b/src/Event/PostRunEvent.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Event; use GraphAware\Common\Result\ResultCollection; @@ -17,22 +16,23 @@ class PostRunEvent extends Event { /** - * @var \GraphAware\Neo4j\Client\Result\ResultCollection + * @var ResultCollection */ protected $results; + /** + * @param ResultCollection $results + */ public function __construct(ResultCollection $results) { $this->results = $results; } /** - * @return \GraphAware\Neo4j\Client\Result\ResultCollection + * @return ResultCollection */ public function getResults() { return $this->results; } - - -} \ No newline at end of file +} diff --git a/src/Event/PreRunEvent.php b/src/Event/PreRunEvent.php index 523a929e..ff3900dd 100644 --- a/src/Event/PreRunEvent.php +++ b/src/Event/PreRunEvent.php @@ -8,29 +8,31 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Event; +use GraphAware\Common\Cypher\StatementInterface; use Symfony\Component\EventDispatcher\Event; class PreRunEvent extends Event { /** - * @var \GraphAware\Common\Cypher\StatementInterface[] + * @var StatementInterface[] */ private $statements; + /** + * @param StatementInterface[] $statements + */ public function __construct(array $statements) { $this->statements = $statements; } /** - * @return \GraphAware\Common\Cypher\StatementInterface[] + * @return StatementInterface[] */ public function getStatements() { return $this->statements; } - -} \ No newline at end of file +} diff --git a/src/Exception/Neo4jException.php b/src/Exception/Neo4jException.php index 621179db..e8079f33 100644 --- a/src/Exception/Neo4jException.php +++ b/src/Exception/Neo4jException.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Exception; class Neo4jException extends \Exception implements Neo4jExceptionInterface @@ -19,15 +18,7 @@ class Neo4jException extends \Exception implements Neo4jExceptionInterface protected $statusCode; /** - * @param string $code - */ - public function setNeo4jStatusCode($code) - { - $this->statusCode = $code; - } - - /** - * @return string + * {@inheritdoc} */ public function effect() { @@ -47,6 +38,14 @@ public function effect() } } + /** + * @param string $code + */ + public function setNeo4jStatusCode($code) + { + $this->statusCode = $code; + } + /** * @return string */ @@ -59,4 +58,4 @@ public function classification() return $parts[1]; } -} \ No newline at end of file +} diff --git a/src/Exception/Neo4jExceptionInterface.php b/src/Exception/Neo4jExceptionInterface.php index 7f6434e1..a8d2c956 100644 --- a/src/Exception/Neo4jExceptionInterface.php +++ b/src/Exception/Neo4jExceptionInterface.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Exception; interface Neo4jExceptionInterface extends NeoClientExceptionInterface @@ -17,5 +16,8 @@ interface Neo4jExceptionInterface extends NeoClientExceptionInterface const EFFECT_ROLLBACK = 'ROLLBACK'; + /** + * @return string + */ public function effect(); -} \ No newline at end of file +} diff --git a/src/Exception/NeoClientExceptionInterface.php b/src/Exception/NeoClientExceptionInterface.php index 04a70c48..3f6f3e8e 100644 --- a/src/Exception/NeoClientExceptionInterface.php +++ b/src/Exception/NeoClientExceptionInterface.php @@ -8,7 +8,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Exception; -interface NeoClientExceptionInterface {} \ No newline at end of file +interface NeoClientExceptionInterface +{ +} diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index 6d9c1bce..c1107a2b 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -34,15 +34,6 @@ class RecordView implements RecordViewInterface private $keyToIndexMap = []; /** - * @return array - */ - public function keys() - { - return $this->keys; - } - - /** - * RecordView constructor. * @param array $keys * @param array $values */ @@ -50,13 +41,22 @@ public function __construct(array $keys, array $values) { $this->keys = $keys; $this->values = $values; + foreach ($this->keys as $i => $k) { $this->keyToIndexMap[$k] = $i; } } /** - * @return bool + * {@inheritdoc} + */ + public function keys() + { + return $this->keys; + } + + /** + * {@inheritdoc} */ public function hasValues() { @@ -64,8 +64,9 @@ public function hasValues() } /** - * @param $key - * @return mixed|\GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship + * @param string $key + * + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship */ public function value($key) { @@ -73,9 +74,10 @@ public function value($key) } /** - * Returns the Node for value $key. Ease IDE integration + * Returns the Node for value $key. Ease IDE integration. + * + * @param string $key * - * @param $key * @return \GraphAware\Neo4j\Client\Formatter\Type\Node * * @throws \InvalidArgumentException When the value is not null or instance of Node @@ -90,12 +92,14 @@ public function nodeValue($key) } /** - * @param $key + * @param string $key + * * @return \GraphAware\Neo4j\Client\Formatter\Type\Relationship * * @throws \InvalidArgumentException When the value is not null or instance of Relationship */ - public function relationshipValue($key) { + public function relationshipValue($key) + { if (!isset($this->values[$key]) || !$this->values[$key] instanceof Relationship) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Relationship::class)); } @@ -103,6 +107,9 @@ public function relationshipValue($key) { return $this->value($key); } + /** + * {@inheritdoc} + */ public function pathValue($key) { if (!$this->hasValue($key) || !$this->value($key) instanceof Path) { @@ -113,21 +120,23 @@ public function pathValue($key) } /** - * @return array + * {@inheritdoc} */ public function values() { return $this->values; } + /** + * {@inheritdoc} + */ public function hasValue($key) { return array_key_exists($key, $this->keyToIndexMap); } /** - * @param $index - * @return mixed + * {@inheritdoc} */ public function valueByIndex($index) { @@ -135,11 +144,11 @@ public function valueByIndex($index) } /** - * @return \GraphAware\Neo4j\Client\Formatter\RecordView + * @return RecordView */ public function record() { - return clone($this); + return clone $this; } /** @@ -153,13 +162,10 @@ public function get($key) } /** - * @param int $index - * - * @return mixed + * {@inheritdoc} */ public function getByIndex($index) { return $this->valueByIndex($index); } - } diff --git a/src/Formatter/Response.php b/src/Formatter/Response.php index fee5bfd2..c8534d88 100644 --- a/src/Formatter/Response.php +++ b/src/Formatter/Response.php @@ -8,19 +8,28 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter; class Response { + /** + * @var array + */ private $rawResponse; + /** + * @var Result[] + */ private $results; - private $rows; - + /** + * @var array + */ private $errors = []; + /** + * @param array $rawResponse + */ public function setRawResponse($rawResponse) { $this->rawResponse = $rawResponse; @@ -32,18 +41,25 @@ public function setRawResponse($rawResponse) } } + /** + * @return string + */ public function getJsonResponse() { - $json = json_encode($this->rawResponse); - - return $json; + return json_encode($this->rawResponse); } + /** + * @return array + */ public function getResponse() { return $this->rawResponse; } + /** + * @param Result $result + */ public function addResult(Result $result) { $this->results[] = $result; @@ -71,11 +87,17 @@ public function getResults() return $this->results; } + /** + * @param Result $result + */ public function setResult(Result $result) { $this->results = $result; } + /** + * @return array + */ public function getErrors() { return $this->errors; @@ -94,11 +116,7 @@ public function hasErrors() */ public function containsResults() { - if (isset($this->rawResponse['results']) && !empty($this->rawResponse['results'])) { - return true; - } - - return false; + return isset($this->rawResponse['results']) && !empty($this->rawResponse['results']); } /** @@ -106,31 +124,12 @@ public function containsResults() */ public function containsRows() { - if (isset($this->rawResponse['results'][0]['columns']) && !empty($this->rawResponse['results']['0']['columns'])) { - return true; - } - - return false; - } - - public function setRows(array $rows) - { - $this->rows = $rows; - } - - public function geRows() - { - return $this->rows; + return isset($this->rawResponse['results'][0]['columns']) && !empty($this->rawResponse['results']['0']['columns']); } /** - * @return bool + * @return array */ - public function hasRows() - { - return null !== $this->rows; - } - public function getBody() { return $this->rawResponse; diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 39d7ebcc..0c46b411 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Neo4j\Client\Result\ResultCollection; @@ -19,10 +18,12 @@ class ResponseFormatter /** * Formats the Neo4j Response. * - * @param array $response + * @param array $response * @param \GraphAware\Common\Cypher\Statement[] $statements * - * @return \GraphAware\Common\Result\ResultCollection + * @return ResultCollection + * + * @throws Neo4jException */ public function format(array $response, array $statements) { @@ -32,16 +33,21 @@ public function format(array $response, array $statements) throw $e; } + $results = new ResultCollection(); + foreach ($response['results'] as $k => $result) { $resultO = new Result($statements[$k]); $resultO->setFields($result['columns']); + foreach ($result['data'] as $data) { $resultO->pushRecord($data['rest'], $data['graph']); } + if (array_key_exists('stats', $result)) { $resultO->setStats($result['stats']); } + $results->add($resultO, $statements[$k]->getTag()); } diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 80f9e251..658cda35 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Result\AbstractRecordCursor; @@ -22,7 +21,7 @@ class Result extends AbstractRecordCursor { /** - * @var \GraphAware\Common\Result\RecordViewInterface[] + * @var RecordView[] */ protected $records = []; @@ -32,7 +31,7 @@ class Result extends AbstractRecordCursor protected $fields = []; /** - * @var \GraphAware\Neo4j\Client\HttpDriver\Result\ResultSummary + * @var ResultSummary */ protected $resultSummary; @@ -41,12 +40,36 @@ class Result extends AbstractRecordCursor */ private $graph; + /** + * {@inheritdoc} + */ public function __construct(StatementInterface $statement) { $this->resultSummary = new ResultSummary($statement); + parent::__construct($statement); } + /** + * {@inheritdoc} + */ + public function size() + { + return count($this->records); + } + + /** + * @return RecordView|null + */ + public function firstRecord() + { + if (!empty($this->records)) { + return $this->records[0]; + } + + return; + } + /** * @param array $fields */ @@ -63,19 +86,26 @@ public function setGraph(array $graph) $this->graph = $graph; } + /** + * @param $data + * @param $graph + */ public function pushRecord($data, $graph) { $mapped = $this->array_map_deep($data, $graph); $this->records[] = new RecordView($this->fields, $mapped); } + /** + * @param array $stats + */ public function setStats(array $stats) { $this->resultSummary->setStatistics(new StatementStatistics($stats)); } /** - * @return \GraphAware\Common\Result\RecordViewInterface[] + * @return RecordView[] */ public function getRecords() { @@ -83,7 +113,7 @@ public function getRecords() } /** - * @return \GraphAware\Common\Result\RecordViewInterface|null + * @return RecordView|null */ public function getRecord() { @@ -99,67 +129,66 @@ public function hasRecord() } /** - * @return int - */ - public function size() - { - return count($this->records); - } - - /** - * @return \GraphAware\Common\Result\RecordViewInterface|null + * @param array $array + * @param array $graph + * + * @return array */ - public function firstRecord() - { - if (!empty($this->records)) { - return $this->records[0]; - } - - return null; - } - private function array_map_deep(array $array, array $graph) { foreach ($array as $k => $v) { - if (is_array($v)) { - if (array_key_exists('metadata', $v) && isset($v['metadata']['labels'])) { - $array[$k] = new Node($v['metadata']['id'], $v['metadata']['labels'], $v['data']); - } elseif (array_key_exists('start', $v) && array_key_exists('type', $v)) { - $array[$k] = new Relationship( - $v['metadata']['id'], - $v['type'], - $this->extractIdFromRestUrl($v['start']), - $this->extractIdFromRestUrl($v['end']), - $v['data'] - ); - } elseif(array_key_exists('length', $v) && array_key_exists('relationships', $v) && array_key_exists('nodes', $v)) { - $array[$k] = new Path( - $this->getNodesFromPathMetadata($v, $graph), - $this->getRelationshipsFromPathMetadata($v, $graph) + if (!is_array($v)) { + continue; + } + + if (array_key_exists('metadata', $v) && isset($v['metadata']['labels'])) { + $array[$k] = new Node($v['metadata']['id'], $v['metadata']['labels'], $v['data']); + } elseif (array_key_exists('start', $v) && array_key_exists('type', $v)) { + $array[$k] = new Relationship( + $v['metadata']['id'], + $v['type'], + $this->extractIdFromRestUrl($v['start']), + $this->extractIdFromRestUrl($v['end']), + $v['data'] ); - } else { - $array[$k] = $this->array_map_deep($v, $graph); - } + } elseif (array_key_exists('length', $v) && array_key_exists('relationships', $v) && array_key_exists('nodes', $v)) { + $array[$k] = new Path( + $this->getNodesFromPathMetadata($v, $graph), + $this->getRelationshipsFromPathMetadata($v, $graph) + ); + } else { + $array[$k] = $this->array_map_deep($v, $graph); } } return $array; } + /** + * @param string $url + * + * @return int + */ private function extractIdFromRestUrl($url) { $expl = explode('/', $url); - $v = $expl[count($expl)-1]; - return (int) $v; + return (int) $expl[count($expl) - 1]; } + /** + * @param array $metadata + * @param array $graph + * + * @return array + */ private function getRelationshipsFromPathMetadata(array $metadata, array $graph) { $rels = []; foreach ($metadata['relationships'] as $relationship) { $relId = $this->extractIdFromRestUrl($relationship); + foreach ($graph['relationships'] as $grel) { $grid = (int) $grel['id']; if ($grid === $relId) { @@ -177,13 +206,22 @@ private function getRelationshipsFromPathMetadata(array $metadata, array $graph) return array_values($rels); } + /** + * @param array $metadata + * @param array $graph + * + * @return array + */ private function getNodesFromPathMetadata(array $metadata, array $graph) { $nodes = []; + foreach ($metadata['nodes'] as $node) { $nodeId = $this->extractIdFromRestUrl($node); + foreach ($graph['nodes'] as $gn) { $gnid = (int) $gn['id']; + if ($gnid === $nodeId) { $nodes[$nodeId] = new Node( $gn['id'], diff --git a/src/Formatter/Type/MapAccess.php b/src/Formatter/Type/MapAccess.php index 7b0b5e2c..57147877 100644 --- a/src/Formatter/Type/MapAccess.php +++ b/src/Formatter/Type/MapAccess.php @@ -6,10 +6,13 @@ class MapAccess implements MapAccessor { - protected $properties; + /** + * @var array + */ + protected $properties = []; /** - * @inheritdoc + * {@inheritdoc} */ public function value($key, $default = null) { @@ -21,14 +24,13 @@ public function value($key, $default = null) } /** - * @inheritdoc + * {@inheritdoc} */ public function hasValue($key) { return array_key_exists($key, $this->properties); } - /** * @return array */ @@ -38,9 +40,7 @@ public function keys() } /** - * @param string $key - * - * @return mixed + * {@inheritdoc} */ public function get($key) { @@ -48,9 +48,7 @@ public function get($key) } /** - * @param string $key - * - * @return bool + * {@inheritdoc} */ public function containsKey($key) { @@ -58,7 +56,7 @@ public function containsKey($key) } /** - * @return array + * {@inheritdoc} */ public function values() { @@ -66,10 +64,10 @@ public function values() } /** - * @return array + * {@inheritdoc} */ public function asArray() { return $this->properties; } -} \ No newline at end of file +} diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php index 92ebfdcc..414aac2f 100644 --- a/src/Formatter/Type/Node.php +++ b/src/Formatter/Type/Node.php @@ -8,10 +8,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter\Type; -use GraphAware\Common\Type\NodeInterface; +use GraphAware\Common\Type\Node as NodeInterface; class Node extends MapAccess implements NodeInterface { @@ -26,10 +25,10 @@ class Node extends MapAccess implements NodeInterface protected $labels = []; /** - * @var array + * @param int $id + * @param array $labels + * @param array $properties */ - protected $properties = []; - public function __construct($id, array $labels, array $properties) { $this->id = $id; @@ -38,7 +37,7 @@ public function __construct($id, array $labels, array $properties) } /** - * @return int + * {@inheritdoc} */ public function identity() { @@ -46,7 +45,7 @@ public function identity() } /** - * @return string[] + * {@inheritdoc} */ public function labels() { @@ -54,12 +53,10 @@ public function labels() } /** - * @param string $label - * - * @return bool + * {@inheritdoc} */ public function hasLabel($label) { return in_array($label, $this->labels); } -} \ No newline at end of file +} diff --git a/src/Formatter/Type/Path.php b/src/Formatter/Type/Path.php index 14421f63..3b50bc6f 100644 --- a/src/Formatter/Type/Path.php +++ b/src/Formatter/Type/Path.php @@ -8,29 +8,27 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter\Type; -use GraphAware\Common\Type\NodeInterface; -use GraphAware\Common\Type\PathInterface; -use GraphAware\Common\Type\RelationshipInterface; +use GraphAware\Common\Type\Node; +use GraphAware\Common\Type\Path as PathInterface; +use GraphAware\Common\Type\Relationship; class Path implements PathInterface { /** - * @var \GraphAware\Neo4j\Client\Formatter\Type\Node[] + * @var Node[] */ protected $nodes; /** - * @var \GraphAware\Neo4j\Client\Formatter\Type\Relationship[] + * @var Relationship[] */ protected $relationships; /** - * Path constructor. - * @param array $nodes - * @param array $relationships + * @param Node[] $nodes + * @param Relationship[] $relationships */ public function __construct(array $nodes, array $relationships) { @@ -39,34 +37,33 @@ public function __construct(array $nodes, array $relationships) } /** - * @return \GraphAware\Neo4j\Client\Formatter\Type\Node + * {@inheritdoc} */ - function start() + public function start() { return $this->nodes[0]; } /** - * @return \GraphAware\Neo4j\Client\Formatter\Type\Node + * {@inheritdoc} */ - function end() + public function end() { - return $this->nodes[count($this->nodes)-1]; + return $this->nodes[count($this->nodes) - 1]; } /** - * @return int + * {@inheritdoc} */ - function length() + public function length() { return count($this->relationships); } /** - * @param \GraphAware\Common\Type\NodeInterface $node - * @return bool + * {@inheritdoc} */ - function containsNode(NodeInterface $node) + public function containsNode(Node $node) { foreach ($this->nodes as $n) { if ($n->identity() === $node->identity()) { @@ -78,10 +75,9 @@ function containsNode(NodeInterface $node) } /** - * @param \GraphAware\Common\Type\RelationshipInterface $relationship - * @return bool + * {@inheritdoc} */ - function containsRelationship(RelationshipInterface $relationship) + public function containsRelationship(Relationship $relationship) { foreach ($this->relationships as $rel) { if ($rel->identity() === $relationship->identity()) { @@ -93,19 +89,18 @@ function containsRelationship(RelationshipInterface $relationship) } /** - * @return array|\GraphAware\Neo4j\Client\Formatter\Type\Node[] + * {@inheritdoc} */ - function nodes() + public function nodes() { return $this->nodes; } /** - * @return array|\GraphAware\Neo4j\Client\Formatter\Type\Relationship[] + * {@inheritdoc} */ - function relationships() + public function relationships() { return $this->relationships; } - -} \ No newline at end of file +} diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index 2a679cee..daa5d624 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -8,10 +8,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Formatter\Type; -use GraphAware\Common\Type\RelationshipInterface; +use GraphAware\Common\Type\Relationship as RelationshipInterface; class Relationship extends MapAccess implements RelationshipInterface { @@ -36,19 +35,13 @@ class Relationship extends MapAccess implements RelationshipInterface protected $endNodeIdentity; /** - * @var array - */ - protected $properties; - - /** - * Relationship constructor. - * @param $id - * @param $type - * @param $startNodeId - * @param $endNodeId - * @param array $properties + * @param int $id + * @param string $type + * @param int $startNodeId + * @param int $endNodeId + * @param array $properties */ - public function __construct($id, $type, $startNodeId, $endNodeId, array $properties) + public function __construct($id, $type, $startNodeId, $endNodeId, array $properties = []) { $this->id = $id; $this->type = $type; @@ -58,7 +51,7 @@ public function __construct($id, $type, $startNodeId, $endNodeId, array $propert } /** - * @return mixed + * {@inheritdoc} */ public function identity() { @@ -66,7 +59,7 @@ public function identity() } /** - * @return mixed + * {@inheritdoc} */ public function type() { @@ -74,8 +67,7 @@ public function type() } /** - * @param string $type - * @return bool + * {@inheritdoc} */ public function hasType($type) { @@ -83,7 +75,7 @@ public function hasType($type) } /** - * @return mixed + * @return int */ public function startNodeIdentity() { @@ -91,10 +83,10 @@ public function startNodeIdentity() } /** - * @return mixed + * @return int */ public function endNodeIdentity() { return $this->endNodeIdentity; } -} \ No newline at end of file +} diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index 728a6570..2afe03ca 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -12,7 +12,6 @@ class Configuration implements ConfigInterface protected $timeout; /** - * Configuration constructor. * @param int $timeout */ public function __construct($timeout) @@ -22,7 +21,8 @@ public function __construct($timeout) /** * @param int $timeout - * @return \GraphAware\Neo4j\Client\HttpDriver\Configuration + * + * @return Configuration */ public static function withTimeout($timeout) { @@ -36,6 +36,4 @@ public function getTimeout() { return $this->timeout; } - - -} \ No newline at end of file +} diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 2132c124..2a39ead5 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -8,32 +8,46 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\DriverInterface; use GuzzleHttp\Client; class Driver implements DriverInterface { + /** + * @var string + */ protected $uri; + /** + * @var Configuration + */ protected $config; - public function __construct($uri, ConfigInterface $config) + /** + * @param string $uri + * @param Configuration $config + */ + public function __construct($uri, Configuration $config) { $this->uri = $uri; $this->config = $config; } - function session() + /** + * @return Session + */ + public function session() { return new Session($this->uri, new Client(['timeout' => $this->config->getTimeout()]), $this->config); } - function getUri() + /** + * @return string + */ + public function getUri() { return $this->uri; } -} \ No newline at end of file +} diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 383224ea..12208bcc 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Driver\ConfigInterface; @@ -16,9 +15,14 @@ class GraphDatabase implements GraphDatabaseInterface { - static function driver($uri, ConfigInterface $config = null) + /** + * @param string $uri + * @param ConfigInterface|null $config + * + * @return Driver + */ + public static function driver($uri, ConfigInterface $config = null) { return new Driver($uri, $config); } - -} \ No newline at end of file +} diff --git a/src/HttpDriver/Pipeline.php b/src/HttpDriver/Pipeline.php index beb1c6e5..d363460e 100644 --- a/src/HttpDriver/Pipeline.php +++ b/src/HttpDriver/Pipeline.php @@ -8,42 +8,60 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Cypher\Statement; +use GraphAware\Common\Driver\PipelineInterface; -class Pipeline +class Pipeline implements PipelineInterface { + /** + * @var Session + */ protected $session; /** - * @var \GraphAware\Common\Cypher\Statement[] + * @var Statement[] */ protected $statements = []; + /** + * @param Session $session + */ public function __construct(Session $session) { $this->session = $session; } + /** + * {@inheritdoc} + */ public function push($query, array $parameters = array(), $tag = null) { $this->statements[] = Statement::create($query, $parameters, $tag); } + /** + * {@inheritdoc} + */ public function run() { return $this->session->flush($this); } + /** + * @return Statement[] + */ public function statements() { return $this->statements; } + /** + * @return int + */ public function size() { return count($this->statements); } -} \ No newline at end of file +} diff --git a/src/HttpDriver/Result/ResultSummary.php b/src/HttpDriver/Result/ResultSummary.php index 1a97fd34..7b18184b 100644 --- a/src/HttpDriver/Result/ResultSummary.php +++ b/src/HttpDriver/Result/ResultSummary.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver\Result; use GraphAware\Common\Cypher\StatementInterface; @@ -16,42 +15,65 @@ class ResultSummary implements ResultSummaryInterface { + /** + * @var StatementInterface + */ protected $statement; + /** + * @var StatementStatistics + */ protected $updateStatistics; protected $notifications; protected $type; + /** + * {@inheritdoc} + */ public function __construct(StatementInterface $statement) { $this->statement = $statement; } + /** + * {@inheritdoc} + */ public function statement() { return $this->statement; } + /** + * {@inheritdoc} + */ public function updateStatistics() { return $this->updateStatistics; } + /** + * {@inheritdoc} + */ public function notifications() { return $this->notifications; } + /** + * {@inheritdoc} + */ public function statementType() { return $this->type; } + /** + * @param StatementStatistics $statistics + */ public function setStatistics(StatementStatistics $statistics) { $this->updateStatistics = $statistics; } - -} \ No newline at end of file +} diff --git a/src/HttpDriver/Result/StatementStatistics.php b/src/HttpDriver/Result/StatementStatistics.php index af849474..88882d48 100644 --- a/src/HttpDriver/Result/StatementStatistics.php +++ b/src/HttpDriver/Result/StatementStatistics.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver\Result; use GraphAware\Common\Result\StatementStatisticsInterface; @@ -83,7 +82,7 @@ public function __construct(array $statistics = array()) $keys = [ 'contains_updates', 'nodes_created', 'nodes_deleted', 'properties_set', 'labels_added', 'labels_removed', 'indexes_added', 'indexes_removed', 'constraints_added', 'constraints_removed', 'relationship_deleted', - 'relationships_created' + 'relationships_created', ]; foreach ($statistics as $key => $value) { @@ -193,14 +192,14 @@ public function constraintsRemoved() /** * @param $key + * * @return string */ private function toCamelCase($key) { list($start, $end) = explode('_', $key); - $str = strtolower($start) . ucfirst($end); + $str = strtolower($start).ucfirst($end); return $str; } - -} \ No newline at end of file +} diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 6de9f9b3..90338425 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -8,12 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\SessionInterface; +use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; use GuzzleHttp\Client; @@ -22,16 +21,36 @@ class Session implements SessionInterface { + /** + * @var string + */ protected $uri; + /** + * @var Client + */ protected $httpClient; + /** + * @var ResponseFormatter + */ protected $responseFormatter; + /** + * @var TransactionInterface|null + */ public $transaction; + /** + * @var ConfigInterface + */ protected $config; + /** + * @param string $uri + * @param Client $httpClient + * @param ConfigInterface $config + */ public function __construct($uri, Client $httpClient, ConfigInterface $config) { $this->uri = $uri; @@ -40,6 +59,9 @@ public function __construct($uri, Client $httpClient, ConfigInterface $config) $this->config = $config; } + /** + * {@inheritdoc} + */ public function run($statement, array $parameters = array(), $tag = null) { $parameters = is_array($parameters) ? $parameters : array(); @@ -49,15 +71,37 @@ public function run($statement, array $parameters = array(), $tag = null) return $response->results()[0]; } + /** + * {@inheritdoc} + */ + public function close() + { + // + } + + /** + * @return Transaction + */ + public function transaction() + { + if ($this->transaction instanceof Transaction) { + throw new \RuntimeException('A transaction is already bound to this session'); + } + + return new Transaction($this); + } + /** * @param string|null $query - * @param array $parameters + * @param array $parameters * @param string|null $tag - * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline + * + * @return Pipeline */ public function createPipeline($query = null, array $parameters = array(), $tag = null) { $pipeline = new Pipeline($this); + if (null !== $query) { $pipeline->push($query, $parameters, $tag); } @@ -66,7 +110,8 @@ public function createPipeline($query = null, array $parameters = array(), $tag } /** - * @param \GraphAware\Neo4j\Client\HttpDriver\Pipeline $pipeline + * @param Pipeline $pipeline + * * @return \GraphAware\Common\Result\ResultCollection * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException @@ -96,19 +141,19 @@ public function flush(Pipeline $pipeline) } } - public function close() - { - // - } - + /** + * @param Pipeline $pipeline + * + * @return Request + */ public function prepareRequest(Pipeline $pipeline) { $statements = []; foreach ($pipeline->statements() as $statement) { $st = [ 'statement' => $statement->text(), - 'resultDataContents' => ["REST", "GRAPH"], - 'includeStats' => true + 'resultDataContents' => ['REST', 'GRAPH'], + 'includeStats' => true, ]; if (!empty($statement->parameters())) { $st['parameters'] = $statement->parameters(); @@ -117,40 +162,29 @@ public function prepareRequest(Pipeline $pipeline) } $body = json_encode([ - 'statements' => $statements + 'statements' => $statements, ]); $headers = [ [ 'X-Stream' => true, - 'Content-Type' => 'application/json' - ] + 'Content-Type' => 'application/json', + ], ]; - $request = new Request("POST", sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); - - return $request; - } - - public function transaction() - { - if ($this->transaction instanceof Transaction) { - throw new \RuntimeException('A transaction is already bound to this session'); - } - - return new Transaction($this); + return new Request('POST', sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); } /** - * @return mixed|\Psr\Http\Message\ResponseInterface - * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + * @return \Psr\Http\Message\ResponseInterface + * + * @throws Neo4jException */ public function begin() { - $request = new Request("POST", sprintf('%s/db/data/transaction', $this->uri)); - try { - $response = $this->httpClient->send($request); + $request = new Request('POST', sprintf('%s/db/data/transaction', $this->uri)); - return $response; + try { + return $this->httpClient->send($request); } catch (RequestException $e) { if ($e->hasResponse()) { $body = json_decode($e->getResponse()->getBody(), true); @@ -168,14 +202,22 @@ public function begin() } } + /** + * @param int $transactionId + * @param array $statementsStack + * + * @return \GraphAware\Common\Result\ResultCollection + * + * @throws Neo4jException + */ public function pushToTransaction($transactionId, array $statementsStack) { $statements = []; foreach ($statementsStack as $statement) { $st = [ 'statement' => $statement->text(), - 'resultDataContents' => ["REST", "GRAPH"], - 'includeStats' => true + 'resultDataContents' => ['REST', 'GRAPH'], + 'includeStats' => true, ]; if (!empty($statement->parameters())) { $st['parameters'] = $statement->parameters(); @@ -186,19 +228,20 @@ public function pushToTransaction($transactionId, array $statementsStack) $headers = [ [ 'X-Stream' => true, - 'Content-Type' => 'application/json' - ] + 'Content-Type' => 'application/json', + ], ]; $body = json_encode([ - 'statements' => $statements + 'statements' => $statements, ]); - $request = new Request("POST", sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId), $headers, $body); + + $request = new Request('POST', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId), $headers, $body); + try { $response = $this->httpClient->send($request); - $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); - return $results; + return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); } catch (RequestException $e) { if ($e->hasResponse()) { $body = json_decode($e->getResponse()->getBody(), true); @@ -216,9 +259,14 @@ public function pushToTransaction($transactionId, array $statementsStack) } } + /** + * @param int $transactionId + * + * @throws Neo4jException + */ public function commitTransaction($transactionId) { - $request = new Request("POST", sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); + $request = new Request('POST', sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); try { $this->httpClient->send($request); } catch (RequestException $e) { @@ -238,9 +286,15 @@ public function commitTransaction($transactionId) } } + /** + * @param int $transactionId + * + * @throws Neo4jException + */ public function rollbackTransaction($transactionId) { - $request = new Request("DELETE", sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId)); + $request = new Request('DELETE', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId)); + try { $this->httpClient->send($request); } catch (RequestException $e) { @@ -259,4 +313,4 @@ public function rollbackTransaction($transactionId) throw $e; } } -} \ No newline at end of file +} diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php index 090ffe97..3ff9149d 100644 --- a/src/HttpDriver/Transaction.php +++ b/src/HttpDriver/Transaction.php @@ -8,12 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; -use GraphAware\Neo4j\Client\HttpDriver\Session; use GraphAware\Common\Cypher\Statement; class Transaction implements TransactionInterface @@ -26,56 +24,124 @@ class Transaction implements TransactionInterface protected $state; + /** + * @var Session + */ protected $session; + /** + * @var bool + */ protected $closed = false; + /** + * @var int|null + */ protected $transactionId; protected $expires; + /** + * @param Session $session + */ public function __construct(Session $session) { $this->session = $session; $this->session->transaction = $this; } + /** + * {@inheritdoc} + */ public function isOpen() { return $this->state === self::OPENED; } + /** + * {@inheritdoc} + */ public function isCommited() { return $this->state === self::COMMITED; } + /** + * {@inheritdoc} + */ public function isRolledBack() { return $this->state === self::ROLLED_BACK; } + /** + * {@inheritdoc} + */ + public function rollback() + { + $this->assertNotClosed(); + $this->assertStarted(); + $this->session->rollbackTransaction($this->transactionId); + $this->closed = true; + $this->state = self::ROLLED_BACK; + $this->session->transaction = null; + } + + /** + * {@inheritdoc} + */ + public function status() + { + return $this->state; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + $this->success(); + } + + /** + * {@inheritdoc} + */ + public function push($query, array $parameters = array(), $tag = null) + { + // + } + public function getStatus() { return $this->state; } + /** + * {@inheritdoc} + */ public function begin() { $this->assertNotStarted(); $response = $this->session->begin(); $body = json_decode($response->getBody(), true); $parts = explode('/', $body['commit']); - $this->transactionId = (int) $parts[count($parts)-2]; + $this->transactionId = (int) $parts[count($parts) - 2]; $this->state = self::OPENED; $this->session->transaction = $this; } + /** + * @param Statement $statement + * + * @return \GraphAware\Common\Result\RecordCursorInterface + * + * @throws Neo4jException + */ public function run(Statement $statement) { $this->assertStarted(); try { - $results = $this->session->pushToTransaction($this->transactionId, array($statement)); + $results = $this->session->pushToTransaction($this->transactionId, array($statement)); return $results->results()[0]; } catch (Neo4jException $e) { @@ -88,6 +154,13 @@ public function run(Statement $statement) } } + /** + * @param array $statements + * + * @return \GraphAware\Common\Result\ResultCollection + * + * @throws Neo4jException + */ public function runMultiple(array $statements) { try { @@ -96,9 +169,9 @@ public function runMultiple(array $statements) if ($e->effect() === Neo4jException::EFFECT_ROLLBACK) { $this->closed = true; $this->state = self::ROLLED_BACK; - - throw $e; } + + throw $e; } } @@ -112,14 +185,9 @@ public function success() $this->session->transaction = null; } - public function rollback() + public function getSession() { - $this->assertNotClosed(); - $this->assertStarted(); - $this->session->rollbackTransaction($this->transactionId); - $this->closed = true; - $this->state = self::ROLLED_BACK; - $this->session->transaction = null; + return $this->session; } private function assertStarted() @@ -142,26 +210,4 @@ private function assertNotClosed() throw new \RuntimeException('This Transaction is closed'); } } - - public function status() - { - return $this->state; - } - - public function commit() - { - $this->success(); - } - - public function push($query, array $parameters = array(), $tag = null) - { - // - } - - public function getSession() - { - return $this->session; - } - - -} \ No newline at end of file +} diff --git a/src/Neo4jClientEvents.php b/src/Neo4jClientEvents.php index b64f8539..2e1f8086 100644 --- a/src/Neo4jClientEvents.php +++ b/src/Neo4jClientEvents.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client; final class Neo4jClientEvents @@ -30,4 +29,4 @@ final class Neo4jClientEvents * An event of type FailureEvent is given. */ const NEO4J_ON_FAILURE = 'neo4j.on_failure'; -} \ No newline at end of file +} diff --git a/src/Result/ResultCollection.php b/src/Result/ResultCollection.php index 7e76f4f3..b32ffd7f 100644 --- a/src/Result/ResultCollection.php +++ b/src/Result/ResultCollection.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Result; use GraphAware\Common\Result\RecordCursorInterface; @@ -16,23 +15,37 @@ class ResultCollection extends BaseResultCollection { + /** + * @var string|null + */ protected $tag; + /** + * @param string $tag + */ public function setTag($tag) { $this->tag = $tag; } + /** + * @return null|string + */ public function getTag() { return $this->tag; } + /** + * @param RecordCursorInterface $result + * + * @return ResultCollection + */ public static function withResult(RecordCursorInterface $result) { - $coll = new ResultCollection(); + $coll = new self(); $coll->add($result); return $coll; } -} \ No newline at end of file +} diff --git a/src/Stack.php b/src/Stack.php index fcd061d0..d2a55504 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; @@ -26,13 +25,13 @@ class Stack protected $connectionAlias; /** - * @var \GraphAware\Common\Cypher\Statement[] + * @var Statement[] */ protected $statements = []; /** - * Stack constructor. - * @param null $tag + * @param null $tag + * @param null|string $connectionAlias */ public function __construct($tag = null, $connectionAlias = null) { @@ -41,8 +40,10 @@ public function __construct($tag = null, $connectionAlias = null) } /** - * @param string|null $tag - * @return \GraphAware\Neo4j\Client\Stack + * @param null|string $tag + * @param null|string $connectionAlias + * + * @return Stack */ public static function create($tag = null, $connectionAlias = null) { @@ -50,8 +51,9 @@ public static function create($tag = null, $connectionAlias = null) } /** - * @param $query + * @param string $query * @param null|array $parameters + * @param null|array $tag */ public function push($query, $parameters = null, $tag = null) { @@ -68,7 +70,7 @@ public function size() } /** - * @return \GraphAware\Common\Cypher\Statement[] + * @return Statement[] */ public function statements() { diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index 5a24d895..642f884c 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -8,29 +8,26 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace GraphAware\Neo4j\Client\Transaction; use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Transaction\TransactionInterface; -use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Stack; class Transaction { /** - * @var \GraphAware\Common\Transaction\TransactionInterface + * @var TransactionInterface */ private $driverTransaction; /** - * @var array() + * @var Statement[] */ protected $queue = []; /** - * Transaction constructor. - * @param \GraphAware\Common\Transaction\TransactionInterface $driverTransaction + * @param TransactionInterface $driverTransaction */ public function __construct(TransactionInterface $driverTransaction) { @@ -38,10 +35,10 @@ public function __construct(TransactionInterface $driverTransaction) } /** - * Push a statement to the queue, without actually sending it + * Push a statement to the queue, without actually sending it. * - * @param string $statement - * @param array $parameters + * @param string $statement + * @param array $parameters * @param string|null $tag */ public function push($statement, array $parameters = array(), $tag = null) @@ -50,9 +47,9 @@ public function push($statement, array $parameters = array(), $tag = null) } /** - * @param $statement - * @param array $parameters - * @param null $tag + * @param string $statement + * @param array $parameters + * @param null|string $tag * * @return \GraphAware\Common\Result\Result */ @@ -61,13 +58,12 @@ public function run($statement, array $parameters = array(), $tag = null) if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { $this->driverTransaction->begin(); } - $result = $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); - return $result; + return $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); } /** - * Push a statements Stack to the queue, without actually sending it + * Push a statements Stack to the queue, without actually sending it. * * @param \GraphAware\Neo4j\Client\Stack $stack */ @@ -76,12 +72,19 @@ public function pushStack(Stack $stack) $this->queue[] = $stack; } + /** + * @param Stack $stack + * + * @return mixed + */ public function runStack(Stack $stack) { if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { $this->driverTransaction->begin(); } + $sts = []; + foreach ($stack->statements() as $statement) { $sts[] = $statement; } @@ -94,26 +97,41 @@ public function begin() $this->driverTransaction->begin(); } + /** + * @return bool + */ public function isOpen() { return $this->driverTransaction->isOpen(); } + /** + * @return bool + */ public function isCommited() { return $this->driverTransaction->isCommited(); } + /** + * @return bool + */ public function isRolledBack() { return $this->driverTransaction->isRolledBack(); } + /** + * @return string + */ public function status() { return $this->driverTransaction->status(); } + /** + * @return mixed + */ public function commit() { if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { @@ -134,14 +152,15 @@ public function commit() $result = $this->driverTransaction->runMultiple($stack); $this->driverTransaction->commit(); $this->queue = []; + return $result; - } else { - return $this->driverTransaction->commit(); } + + return $this->driverTransaction->commit(); } public function rollback() { return $this->driverTransaction->rollback(); } -} \ No newline at end of file +} diff --git a/tests/Integration/CypherIntegrationTest.php b/tests/Integration/CypherIntegrationTest.php index e21a0045..0c634ffc 100644 --- a/tests/Integration/CypherIntegrationTest.php +++ b/tests/Integration/CypherIntegrationTest.php @@ -2,12 +2,12 @@ namespace GraphAware\Neo4j\Client\Tests\Integration; -use GraphAware\Common\Type\Node; use GraphAware\Bolt\Result\Type\Node as BoltNode; +use GraphAware\Common\Type\Node; use GraphAware\Neo4j\Client\Formatter\Type\Node as HttpNode; use GraphAware\Neo4j\Client\Formatter\Type\Relationship as HttpRelationship; use GraphAware\Bolt\Result\Type\Relationship as BoltRelationship; -use GraphAware\Common\Type\PathInterface; +use GraphAware\Common\Type\Path; class CypherIntegrationTest extends IntegrationTestCase { @@ -45,7 +45,7 @@ public function testPathIsReturned() $query = 'CREATE p=(a:Cool)-[:RELATES]->(b:NotSoCool) RETURN p'; $record1 = $this->client->run($query, [], null, 'http')->firstRecord(); $record2 = $this->client->run($query, [], null, 'bolt')->firstRecord(); - $this->assertInstanceOf(PathInterface::class, $record1->get('p')); - $this->assertInstanceOf(PathInterface::class, $record2->get('p')); + $this->assertInstanceOf(Path::class, $record1->get('p')); + $this->assertInstanceOf(Path::class, $record2->get('p')); } } \ No newline at end of file From 2edbaf09f0c06afb5c49c8df8efde247f35c6d76 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Sat, 7 May 2016 12:18:24 +0200 Subject: [PATCH 150/217] Bumped graphaware/neo4j-bolt version and removed unecessary dependency to graphaware/neo4j-common --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c917edfa..6e93d08f 100644 --- a/composer.json +++ b/composer.json @@ -22,10 +22,9 @@ ], "require": { "php": ">= 5.6", - "graphaware/neo4j-bolt": "^1.0", + "graphaware/neo4j-bolt": "^1.5", "guzzlehttp/guzzle": "^6.0", "symfony/event-dispatcher": "^2.7|^3.0", - "graphaware/neo4j-common": "^3.0", "myclabs/php-enum": "^1.4" }, "require-dev": { From 03980a6a17e591200cad2662fe66b6ade24c5045 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Sat, 7 May 2016 12:22:18 +0200 Subject: [PATCH 151/217] Cleaned code --- src/Client.php | 6 ++++-- src/Formatter/Type/Path.php | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Client.php b/src/Client.php index b41c8e04..367051f5 100644 --- a/src/Client.php +++ b/src/Client.php @@ -60,20 +60,22 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = $params = null !== $parameters ? $parameters : array(); $statement = Statement::create($query, $params, $tag); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent(array($statement))); + try { $result = $connection->run($query, $parameters, $tag); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); - - return $result; } catch (Neo4jException $e) { $event = new FailureEvent($e); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_ON_FAILURE, $event); + if ($event->shouldThrowException()) { throw $e; } return; } + + return $result; } /** diff --git a/src/Formatter/Type/Path.php b/src/Formatter/Type/Path.php index 3b50bc6f..aca74251 100644 --- a/src/Formatter/Type/Path.php +++ b/src/Formatter/Type/Path.php @@ -10,9 +10,9 @@ */ namespace GraphAware\Neo4j\Client\Formatter\Type; -use GraphAware\Common\Type\Node; +use GraphAware\Common\Type\Node as NodeInterface; use GraphAware\Common\Type\Path as PathInterface; -use GraphAware\Common\Type\Relationship; +use GraphAware\Common\Type\Relationship as RelationshipInterface; class Path implements PathInterface { @@ -63,7 +63,7 @@ public function length() /** * {@inheritdoc} */ - public function containsNode(Node $node) + public function containsNode(NodeInterface $node) { foreach ($this->nodes as $n) { if ($n->identity() === $node->identity()) { @@ -77,7 +77,7 @@ public function containsNode(Node $node) /** * {@inheritdoc} */ - public function containsRelationship(Relationship $relationship) + public function containsRelationship(RelationshipInterface $relationship) { foreach ($this->relationships as $rel) { if ($rel->identity() === $relationship->identity()) { From 15222a1d7875435b9628d3d3a70d65c487ef5e2a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 10 May 2016 15:30:58 +0200 Subject: [PATCH 152/217] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc8adf0a..4b851390 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,11 @@ You can: * [Ask a question on StackOverflow](http://stackoverflow.com/questions/ask?tags=graphaware,php,neo4j) * For bugs, please feel free to create a [new issue on GitHub](https://github.com/graphaware/neo4j-php-client/issues/new) - + +### Implementations + +* [Symfony Framework Bundle](https://github.com/PandawanTechnology/Neo4jBundle) + ## Installation and basic usage ### Installation From 73c1c8bfea3f4e80ee4f4f2e8c7216485314b1e6 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Wed, 11 May 2016 21:25:47 +0200 Subject: [PATCH 153/217] install stable in doc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b851390..477f68c8 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ You can: Add the library to your composer dependencies : ```bash -composer require graphaware/neo4j-php-client:^4.0@alpha +composer require graphaware/neo4j-php-client ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : From cbdb9d29ad6d0de892fab3054f04c96e44ae437c Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 13 May 2016 11:30:22 +0200 Subject: [PATCH 154/217] upgraded to common 3.1 --- src/Formatter/RecordView.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index c1107a2b..d57aeaf2 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -153,11 +153,16 @@ public function record() /** * @param string $key + * @param mixed $defaultValue * * @return \GraphAware\Neo4j\Client\Formatter\Type\Node|\GraphAware\Neo4j\Client\Formatter\Type\Relationship|mixed */ - public function get($key) + public function get($key, $defaultValue = null) { + if (!isset($this->keyToIndexMap[$key]) && 2 === func_num_args()) { + return $defaultValue; + } + return $this->value($key); } From 158ed0ba99dd1573c56c92fb9d5e085542ba8da7 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 13 May 2016 11:32:48 +0200 Subject: [PATCH 155/217] updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0287c30..db8e89a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.3.1 - 13 May 2016 + +- Added the possibility to pass a default value to `Record::get()` to be returned if the record doesn't contains the given key + 4.2.0 - 06 May 2016 - Added events dispatching before and after running statements and stacks From 238044b90ae48a4beafac0accf3f099652eb64ae Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 20 May 2016 13:52:11 +0200 Subject: [PATCH 156/217] added v3 to v4 in the doc --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/README.md b/README.md index 477f68c8..290b0782 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,100 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `startNodeIdentity` : returns the start node id * `endNodeIdentity` : returns the end node id +#### Handling Results (from v3 to v4) + +There are 3 main concepts around this topic : + +1. a Result +2. a Record +3. a RecordValue + +Let's take a look at a query we do in the browser containing multiple possibilities of types : + +``` +MATCH (n:Address) +RETURN n.address as addr, n, collect(id(n)) as ids +LIMIT 5 +``` + +![screen shot 2016-05-11 at 20 54 34bis](https://cloud.githubusercontent.com/assets/1222009/15192806/1a39cb30-17bb-11e6-8687-ed861411af2d.png) + + +##### Result + +A `Result` is a collection of `Record` objects, every **row** you see in the browser is a `Record` and contains `Record Value`s. + +* In blue the Result +* In orange a Record +* In green a RecordValue + +##### Record + +In contrary to the previous versions of the client, there is no more automatic merging of all the records into one big record, so you will need to iterate all the records from the `Result` : + +```php +$query = "MATCH (n:Address) +RETURN n.address as addr, n, collect(id(n)) as ids +LIMIT 5"; +$result = $client->run($query); + +foreach ($result->records() as $record) { + // here we do what we want with one record (one row in the browser result) + print_r($record); +} +``` + +##### Record Value + +Every record contains a collection of `Record Value`s, which are identified by a `key`, the key is the identifier you give in the `RETURN` clause of the Cypher query. In our example, a `Record` will contain the following keys : + +* addr +* n +* ids + +In order to access the value, you make use of the `get()` method on the `Record` object : + +```php +$address = $record->get('addr'); +``` + +The type of the value is depending of what you return from Neo4j, in our case the following values will be returned : + +* a `string` for the `addr` value +* a `Node` for the `n` value +* an `array` of `integers` for the `ids` value + +Meaning that : + +```php +$record->get('addr'); // returns a string +$record->get('n'); // returns a Node object +$record->get('ids'); // returns an array +``` + +`Node`, `Relationship` and `Path` objects have then further methods, so if you know that the node returned by the identifier `n` has a `countries` property on it, you can access it like this : + +```php +$addressNode = $record->get('n'); +$countries = $addressNode->value('countries'); +``` + +The `Record` object contains three methods for IDE friendlyness, namely : + +```php +$record->nodeValue('n'); +$record->relationshipValue('r'); +$record->pathValue('p'); +``` + +This does not offer something extra, just that the docblocks hint the IDE for autocompletion. + + +##### Extra: ResultCollection + +When you use `Stack` objects for sending multiple statements at once, it will return you a `ResultCollection` object containing a collection of `Result`s. So you need to iterate the results before accessing the records. + + ### Working with Transactions The Client provides a Transaction object that ease how you would work with transactions. From d706658ee4fdb1ea78ecba82361b44fc7b1c685b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 28 May 2016 00:07:40 +0200 Subject: [PATCH 157/217] added getLabels procedure handler --- src/Client.php | 16 +++++++++ src/Schema/Label.php | 36 ++++++++++++++++++++ tests/Integration/GetLabelsProcedureTest.php | 26 ++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/Schema/Label.php create mode 100644 tests/Integration/GetLabelsProcedureTest.php diff --git a/src/Client.php b/src/Client.php index 367051f5..e5a68e5d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -12,12 +12,14 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Result\AbstractRecordCursor; +use GraphAware\Common\Result\Record; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\Event\FailureEvent; use GraphAware\Neo4j\Client\Event\PostRunEvent; use GraphAware\Neo4j\Client\Event\PreRunEvent; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Result\ResultCollection; +use GraphAware\Neo4j\Client\Schema\Label; use GraphAware\Neo4j\Client\Transaction\Transaction; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -183,6 +185,20 @@ private function pipeline($query = null, $parameters = null, $tag = null, $conne return $connection->createPipeline($query, $parameters, $tag); } + /** + * @param string|null $conn + * @return Label[] + */ + public function getLabels($conn = null) + { + $connection = $this->connectionManager->getConnection($conn); + $result = $connection->getSession()->run("CALL db.labels()"); + + return array_map(function(Record $record) { + return new Label($record->get('label')); + }, $result->records()); + } + /** * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. * diff --git a/src/Schema/Label.php b/src/Schema/Label.php new file mode 100644 index 00000000..6dd186ea --- /dev/null +++ b/src/Schema/Label.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\Schema; + +final class Label +{ + /** + * @var string + */ + private $name; + + /** + * @param string $name + */ + public function __construct($name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } +} \ No newline at end of file diff --git a/tests/Integration/GetLabelsProcedureTest.php b/tests/Integration/GetLabelsProcedureTest.php new file mode 100644 index 00000000..38604283 --- /dev/null +++ b/tests/Integration/GetLabelsProcedureTest.php @@ -0,0 +1,26 @@ +emptyDb(); + $this->client->run("CREATE (:Label1), (:Label2), (:Label3)"); + $result = $this->client->getLabels(); + $this->assertCount(3, $result); + foreach ($result as $label) { + $this->assertInstanceOf(Label::class, $label); + } + } +} \ No newline at end of file From 10d6ef5a6f0f2617841b2039a624ea27bde6fddb Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 28 May 2016 00:09:06 +0200 Subject: [PATCH 158/217] getLabels doc and changelog --- CHANGELOG.md | 4 ++++ README.md | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8e89a8..0949ce24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.4.0 - 28 May 2016 + +- Added getLabels method to the client + 4.3.1 - 13 May 2016 - Added the possibility to pass a default value to `Record::get()` to be returned if the record doesn't contains the given key diff --git a/README.md b/README.md index 290b0782..f78ecac4 100644 --- a/README.md +++ b/README.md @@ -426,6 +426,14 @@ The client is also aware of the manually configured master connection, so sendin $client->runWrite('CREATE (n:User {login: 123})'); ``` +### Helper Methods + +``` +$client->getLabels(); +``` + +Returns an array of `Label` objects. + ### Event Dispatching 3 types of events are dispatched during the `run` methods : From 8487f69c66c766efab796d0358f3d688d1bbcfa2 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 28 May 2016 00:19:06 +0200 Subject: [PATCH 159/217] updated neo4j version support matrix --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f78ecac4..b1ed9d69 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Neo4j is a transactional, open-source graph database. A graph database manages d | >= 2.2.6 | Yes | | 2.2 | Yes | | 2.3 | Yes | +| 3.0 + | Yes | #### Neo4j Feature Support From e9f71edf002c3554c307cfceeca08caebdf6c507 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 30 May 2016 21:07:03 +0200 Subject: [PATCH 160/217] added doc for Path object --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index b1ed9d69..1ef322f0 100644 --- a/README.md +++ b/README.md @@ -237,8 +237,17 @@ The client takes care of the hydration of Graph objects to PHP Objects, so it is * `startNodeIdentity` : returns the start node id * `endNodeIdentity` : returns the end node id +##### Path + +* `start()` : returns the start node of the path +* `end()` : returns the end node of the path +* `length()` : returns the length of the path +* `nodes()` : returns all the nodes in the path +* `relationships` : returns all the relationships in the path + #### Handling Results (from v3 to v4) + There are 3 main concepts around this topic : 1. a Result From ed501f23fcf72379a4ed24bffd824523963dc613 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 4 Jun 2016 22:48:19 +0200 Subject: [PATCH 161/217] issue40 test --- tests/Issues/Issue40Test.php | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/Issues/Issue40Test.php diff --git a/tests/Issues/Issue40Test.php b/tests/Issues/Issue40Test.php new file mode 100644 index 00000000..8d79ddf5 --- /dev/null +++ b/tests/Issues/Issue40Test.php @@ -0,0 +1,45 @@ +emptyDb(); + $this->client->run('CREATE (:BRIEF {id: 123})'); + + $query = 'MATCH (s:BRIEF {id:{brief_id}}) + CREATE (n:BRIEFNOTECARD) + SET n += {data} + CREATE (n)-[:CARD_OF {order:0}]->(s) + RETURN n'; + + $parameters = [ + 'brief_id' => 123, + 'data' => [ + 'key_1' => 'test', + 'key_2' => 'other' + ] + ]; + + $this->client->run($query, $parameters); + $this->assertGraphExist('(n:BRIEF {id: 123})<-[:CARD_OF {order:0}]-(:BRIEFNOTECARD)'); + } + + private function assertGraphExist($pattern) + { + $q = sprintf('MATCH %s RETURN *', $pattern); + $result = $this->client->run($q); + + $this->assertTrue(0 !== $result->size()); + } +} \ No newline at end of file From bc36b78cba72d29929e4c6bb44428084896bacfb Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 6 Jun 2016 16:14:46 +0200 Subject: [PATCH 162/217] added test for issue 40 --- tests/Integration/IntegrationTestCase.php | 4 ++-- tests/Issues/Issue40Test.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index 8db48858..8be1bcb5 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -15,7 +15,7 @@ class IntegrationTestCase extends \PHPUnit_Framework_TestCase public function setUp() { $this->client = ClientBuilder::create() - ->addConnection('http', 'http://localhost:7474') + //->addConnection('http', 'http://localhost:7474') ->addConnection('bolt', 'bolt://localhost') ->build(); } @@ -27,6 +27,6 @@ public function setUp() */ public function emptyDb() { - $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n', null, null, 'http'); + $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n', null, null); } } \ No newline at end of file diff --git a/tests/Issues/Issue40Test.php b/tests/Issues/Issue40Test.php index 8d79ddf5..20c765b8 100644 --- a/tests/Issues/Issue40Test.php +++ b/tests/Issues/Issue40Test.php @@ -35,6 +35,12 @@ public function testIssue() $this->assertGraphExist('(n:BRIEF {id: 123})<-[:CARD_OF {order:0}]-(:BRIEFNOTECARD)'); } + public function testIssueNTest() + { + $this->emptyDb(); + $this->client->run("\n"); + } + private function assertGraphExist($pattern) { $q = sprintf('MATCH %s RETURN *', $pattern); From 87c419f8c5785ff2eeb0b657ffef7523bfa8b036 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 6 Jun 2016 16:17:56 +0200 Subject: [PATCH 163/217] implemented method --- src/Formatter/Type/MapAccess.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Formatter/Type/MapAccess.php b/src/Formatter/Type/MapAccess.php index 57147877..83d6495f 100644 --- a/src/Formatter/Type/MapAccess.php +++ b/src/Formatter/Type/MapAccess.php @@ -70,4 +70,12 @@ public function asArray() { return $this->properties; } + + /** + * {@inheritdoc} + */ + public function __get($name) + { + return $this->get($name); + } } From 9e94d3c494841b65b5be76327761bdafbc0d9abf Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 6 Jun 2016 23:34:42 +0200 Subject: [PATCH 164/217] fixed tests --- tests/Integration/IntegrationTestCase.php | 2 +- tests/Issues/Issue40Test.php | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index 8be1bcb5..a7ae1519 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -15,7 +15,7 @@ class IntegrationTestCase extends \PHPUnit_Framework_TestCase public function setUp() { $this->client = ClientBuilder::create() - //->addConnection('http', 'http://localhost:7474') + ->addConnection('http', 'http://localhost:7474') ->addConnection('bolt', 'bolt://localhost') ->build(); } diff --git a/tests/Issues/Issue40Test.php b/tests/Issues/Issue40Test.php index 20c765b8..8d79ddf5 100644 --- a/tests/Issues/Issue40Test.php +++ b/tests/Issues/Issue40Test.php @@ -35,12 +35,6 @@ public function testIssue() $this->assertGraphExist('(n:BRIEF {id: 123})<-[:CARD_OF {order:0}]-(:BRIEFNOTECARD)'); } - public function testIssueNTest() - { - $this->emptyDb(); - $this->client->run("\n"); - } - private function assertGraphExist($pattern) { $q = sprintf('MATCH %s RETURN *', $pattern); From 7299ad6f0e30da66f5f0fc537b020382ac2bd168 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 9 Jun 2016 00:49:12 +0200 Subject: [PATCH 165/217] fix issue where empty nested arrays are not converted to json maps --- src/HttpDriver/Session.php | 17 +++++++++++++- tests/Integration/StatementParametersTest.php | 23 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 tests/Integration/StatementParametersTest.php diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 90338425..4fee1754 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -156,7 +156,7 @@ public function prepareRequest(Pipeline $pipeline) 'includeStats' => true, ]; if (!empty($statement->parameters())) { - $st['parameters'] = $statement->parameters(); + $st['parameters'] = $this->formatParams($statement->parameters()); } $statements[] = $st; } @@ -174,6 +174,21 @@ public function prepareRequest(Pipeline $pipeline) return new Request('POST', sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); } + private function formatParams(array $params) + { + foreach ($params as $key => $v) { + if (is_array($v)) { + if (empty($v)) { + $params[$key] = new \stdClass(); + } else { + $params[$key] = $this->formatParams($params[$key]); + } + } + } + + return $params; + } + /** * @return \Psr\Http\Message\ResponseInterface * diff --git a/tests/Integration/StatementParametersTest.php b/tests/Integration/StatementParametersTest.php new file mode 100644 index 00000000..b5433c56 --- /dev/null +++ b/tests/Integration/StatementParametersTest.php @@ -0,0 +1,23 @@ +(b) + SET r += {fields} RETURN id(r) as id'; + + $params = ['fields' => []]; + $result = $this->client->run($query, $params, null, 'http'); + $this->assertTrue(is_numeric($result->firstRecord()->get('id'))); + } +} \ No newline at end of file From 69f6fee87b115da9a262384cefdbfcd9e61d63c8 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 9 Jun 2016 00:51:26 +0200 Subject: [PATCH 166/217] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0949ce24..fa4f878b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog for v4 +4.4.2 - 09 June 2016 + +- Fixed an issue where empty nested arrays were not converted to json objects + +4.4.1 - 06 June 2016 + +- Upgraded to latest commons + 4.4.0 - 28 May 2016 - Added getLabels method to the client From 0ac937483f80b2461d86ea9c36b80c5fd0c1d667 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 9 Jun 2016 01:03:03 +0200 Subject: [PATCH 167/217] fixed last issue in a transaction --- src/HttpDriver/Session.php | 2 +- tests/Integration/StatementParametersTest.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 4fee1754..bb82ef30 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -235,7 +235,7 @@ public function pushToTransaction($transactionId, array $statementsStack) 'includeStats' => true, ]; if (!empty($statement->parameters())) { - $st['parameters'] = $statement->parameters(); + $st['parameters'] = $this->formatParams($statement->parameters()); } $statements[] = $st; } diff --git a/tests/Integration/StatementParametersTest.php b/tests/Integration/StatementParametersTest.php index b5433c56..2de0cc7a 100644 --- a/tests/Integration/StatementParametersTest.php +++ b/tests/Integration/StatementParametersTest.php @@ -16,8 +16,22 @@ public function testEmptyArraysCanBeUsedAsNestedParameters() MERGE (a)-[r:RELATES]->(b) SET r += {fields} RETURN id(r) as id'; - $params = ['fields' => []]; + $params = ['a' => 30, 'b' => 31, 'fields' => []]; $result = $this->client->run($query, $params, null, 'http'); $this->assertTrue(is_numeric($result->firstRecord()->get('id'))); } + + public function testEmptyArraysInTransaction() + { + $query = 'CREATE (a), (b) + MERGE (a)-[r:RELATES]->(b) + SET r += {fields} RETURN id(r) as id'; + + $params = ['a' => 30, 'b' => 31, 'fields' => []]; + $tx = $this->client->transaction('http'); + $tx->push($query, $params); + $results = $tx->commit(); + + $this->assertTrue(is_numeric($results->results()[0]->firstRecord()->get('id'))); + } } \ No newline at end of file From b34fac59fd9f82903f1ec8c7de678fd6ec6ea4e3 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 9 Jun 2016 01:03:41 +0200 Subject: [PATCH 168/217] updated chnagelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4f878b..42a37e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.4.3 - 09 June 2016 + +- Fixed same issue as 4.4.2 in a transaction + 4.4.2 - 09 June 2016 - Fixed an issue where empty nested arrays were not converted to json objects From 745eb55a7df908bdd7d5cd5a425523df6068c552 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 30 Jun 2016 14:16:57 +0200 Subject: [PATCH 169/217] added test for push in tx --- tests/Integration/TransactionIntegrationTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php index 48b55ffa..ab93f1fa 100644 --- a/tests/Integration/TransactionIntegrationTest.php +++ b/tests/Integration/TransactionIntegrationTest.php @@ -119,6 +119,19 @@ public function testPushShouldStackUntilCommitWithBolt() //$this->assertEquals(Transaction::COMMITED, $tx->status()); } + /** + * @group tx-bug + */ + public function testPushAndCommitInTxWithBolt() + { + $this->emptyDb(); + $tx = $this->client->transaction('bolt'); + $tx->push('MATCH (n) RETURN count(n)'); + $tx->push('MATCH (n) RETURN count(n)'); + $results = $tx->commit(); + $this->assertEquals(2, $results->size()); + } + private function assertXNodesWithLabelExist($label, $number = 1) { $query = 'MATCH (n:' . $label . ') RETURN count(n) as c'; From 5e745a6ceb369082fbe10b2a25b2e1e6fb44b149 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 1 Jul 2016 00:20:24 +0200 Subject: [PATCH 170/217] added preflights to Stack --- src/Stack.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Stack.php b/src/Stack.php index d2a55504..3db9525a 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -29,6 +29,11 @@ class Stack */ protected $statements = []; + /** + * @var Statement[] + */ + protected $preflights = []; + /** * @param null $tag * @param null|string $connectionAlias @@ -61,6 +66,33 @@ public function push($query, $parameters = null, $tag = null) $this->statements[] = Statement::create($query, $params, $tag); } + /** + * @param $query + * @param array|null $parameters + * @param array|null $tag + */ + public function addPreflight($query, $parameters = null, $tag = null) + { + $params = null !== $parameters ? $parameters : array(); + $this->preflights[] = Statement::create($query, $params, $tag); + } + + /** + * @return bool + */ + public function hasPreflights() + { + return !empty($this->preflights); + } + + /** + * @return \GraphAware\Common\Cypher\Statement[] + */ + public function getPreflights() + { + return $this->preflights; + } + /** * @return int */ From 9e2c154e1e2f38a2d4a90cb1f8985b902b91c862 Mon Sep 17 00:00:00 2001 From: Stefan Gehrig Date: Mon, 4 Jul 2016 17:39:44 +0200 Subject: [PATCH 171/217] fixes issue #45: use RecordView::value() to access values Due to issue #45 `RecordView::relationshipValue()` did not work because undefined indexes are accessed. This commit changes `RecordView::relationshipValue()` (which directly accessed the `values` array) and `RecordView::nodeValue()` (which used `RecordView::get()` before) to use `RecordView::value()`. --- src/Formatter/RecordView.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index d57aeaf2..ce3e8fe5 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -84,7 +84,7 @@ public function value($key) */ public function nodeValue($key) { - if (!$this->hasValue($key) || !$this->get($key) instanceof Node) { + if (!$this->hasValue($key) || !$this->value($key) instanceof Node) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Node::class)); } @@ -100,7 +100,7 @@ public function nodeValue($key) */ public function relationshipValue($key) { - if (!isset($this->values[$key]) || !$this->values[$key] instanceof Relationship) { + if (!isset($this->values[$key]) || !$this->value($key) instanceof Relationship) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Relationship::class)); } From 1b3fd29e1a28d7f5cd0d7b5b5b1aee1805ae02ea Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 5 Jul 2016 11:23:25 +0200 Subject: [PATCH 172/217] last addition to changelog and fix badges --- CHANGELOG.md | 8 ++++++++ README.md | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42a37e09..ecd49a46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog for v4 +4.4.5 - 05 July 2016 + +- Fixed an issue with `relationshipValue()` + +4.4.4 + +- Added preflight to stack + 4.4.3 - 09 June 2016 - Fixed same issue as 4.4.2 in a transaction diff --git a/README.md b/README.md index 1ef322f0..33a71413 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![Build Status](https://travis-ci.org/graphaware/neo4j-php-client.svg?branch=master)](https://travis-ci.org/graphaware/neo4j-php-client) [![Latest Stable Version](https://poser.pugx.org/graphaware/neo4j-php-client/v/stable.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) -[![Total Downloads](https://poser.pugx.org/neoxygen/neoclient/downloads.svg)](https://packagist.org/packages/neoxygen/neoclient) -[![License](https://poser.pugx.org/neoxygen/neoclient/license.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) +[![Total Downloads](https://poser.pugx.org/graphaware/neo4j-php-client/downloads.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) +[![License](https://poser.pugx.org/graphaware/neo4j-php-client/license.svg)](https://packagist.org/packages/graphaware/neo4j-php-client) ## Introduction From 9a7381b1187b02c189a507afd4d831462bf2c3f6 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Fri, 8 Jul 2016 01:54:03 +0200 Subject: [PATCH 173/217] Refactored default bolt port --- src/Connection/Connection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 336b844e..4a47a9ed 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Bolt\Configuration; +use GraphAware\Bolt\Driver as BoltDriver; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -168,7 +169,7 @@ private function buildDriver() $params = parse_url($this->uri); if (preg_match('/bolt/', $this->uri)) { - $port = isset($params['port']) ? (int) $params['port'] : 7687; + $port = isset($params['port']) ? (int) $params['port'] : BoltDriver::DEFAULT_TCP_PORT; $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); $config = null; if (isset($params['user']) && isset($params['pass'])) { From 2e04dcfbfeb786ff7788764e07ea69c048847b99 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 10 Jul 2016 02:36:59 +0200 Subject: [PATCH 174/217] added possibility to pass extra curl options --- src/ClientBuilder.php | 19 +++++++++++++++-- src/Connection/Connection.php | 14 ++++++++----- src/Connection/ConnectionManager.php | 9 ++++---- src/HttpDriver/Configuration.php | 31 +++++++++++++++++++++++----- src/HttpDriver/Driver.php | 19 ++++++++++++++--- 5 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 3f45e392..58fcbc22 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -10,7 +10,9 @@ */ namespace GraphAware\Neo4j\Client; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Neo4j\Client\Connection\ConnectionManager; +use GraphAware\Neo4j\Client\HttpDriver\Configuration; use Symfony\Component\EventDispatcher\EventDispatcher; class ClientBuilder @@ -46,12 +48,16 @@ public static function create() * * @param string $alias * @param string $uri + * @param array $extraParameters * * @return $this */ - public function addConnection($alias, $uri) + public function addConnection($alias, $uri, ConfigInterface $config = null) { $this->config['connections'][$alias]['uri'] = $uri; + if (null !== $config) { + if ($this->config['connections'][$alias]['config'] = $config); + } return $this; } @@ -119,7 +125,16 @@ public function build() $connectionManager = new ConnectionManager(); foreach ($this->config['connections'] as $alias => $conn) { - $connectionManager->registerConnection($alias, $conn['uri'], null, $this->getDefaultTimeout()); + $config = + isset($this->config['connections'][$alias]['config']) + ? $this->config['connections'][$alias]['config'] + : Configuration::create() + ->withTimeout($this->getDefaultTimeout()); + $connectionManager->registerConnection( + $alias, + $conn['uri'], + $config + ); if (isset($conn['is_master']) && $conn['is_master'] === true) { $connectionManager->setMaster($alias); diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 4a47a9ed..d4089ea5 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -37,6 +37,11 @@ class Connection */ private $driver; + /** + * @var array + */ + private $config; + /** * @var \GraphAware\Common\Driver\SessionInterface */ @@ -52,14 +57,13 @@ class Connection * * @param string $alias * @param string $uri - * @param null $config - * @param int $timeout + * @param Configuration|null $config */ - public function __construct($alias, $uri, $config = null, $timeout) + public function __construct($alias, $uri, $config = null) { $this->alias = (string) $alias; $this->uri = (string) $uri; - $this->timeout = (int) $timeout; + $this->config = $config; $this->buildDriver(); } @@ -178,7 +182,7 @@ private function buildDriver() $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { $uri = $this->uri; - $this->driver = HttpGraphDB::driver($uri, HttpConfig::withTimeout($this->timeout)); + $this->driver = HttpGraphDB::driver($uri, $this->config); } else { throw new \RuntimeException(sprintf('Unable to build a driver from uri "%s"', $this->uri)); } diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index fdde4b3e..3db6f7ed 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -10,6 +10,8 @@ */ namespace GraphAware\Neo4j\Client\Connection; +use GraphAware\Neo4j\Client\HttpDriver\Configuration; + class ConnectionManager { /** @@ -25,12 +27,11 @@ class ConnectionManager /** * @param string $alias * @param string $uri - * @param null $config - * @param int $timeout + * @param null|Configuration $config */ - public function registerConnection($alias, $uri, $config = null, $timeout) + public function registerConnection($alias, $uri, $config = null) { - $this->registerExistingConnection($alias, new Connection($alias, $uri, $config, $timeout)); + $this->registerExistingConnection($alias, new Connection($alias, $uri, $config)); } /** diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index 2afe03ca..0d238c45 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -12,11 +12,13 @@ class Configuration implements ConfigInterface protected $timeout; /** - * @param int $timeout + * @var string */ - public function __construct($timeout) + protected $curlInterface; + + public static function create() { - $this->timeout = (int) $timeout; + return new self(); } /** @@ -24,9 +26,20 @@ public function __construct($timeout) * * @return Configuration */ - public static function withTimeout($timeout) + public function withTimeout($timeout) + { + $this->timeout = $timeout; + return $this; + } + + /** + * @param string $interface + * @return $this + */ + public function withCurlInterface($interface) { - return new self($timeout); + $this->curlInterface = $interface; + return $this; } /** @@ -36,4 +49,12 @@ public function getTimeout() { return $this->timeout; } + + /** + * @return string + */ + public function getCurlInterface() + { + return $this->curlInterface; + } } diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 2a39ead5..82ad46a9 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -12,6 +12,7 @@ use GraphAware\Common\Driver\DriverInterface; use GuzzleHttp\Client; +use GraphAware\Common\Driver\ConfigInterface; class Driver implements DriverInterface { @@ -29,10 +30,10 @@ class Driver implements DriverInterface * @param string $uri * @param Configuration $config */ - public function __construct($uri, Configuration $config) + public function __construct($uri, ConfigInterface $config = null) { $this->uri = $uri; - $this->config = $config; + $this->config = null !== $config ? $config : Configuration::create(); } /** @@ -40,7 +41,19 @@ public function __construct($uri, Configuration $config) */ public function session() { - return new Session($this->uri, new Client(['timeout' => $this->config->getTimeout()]), $this->config); + $options = []; + if (null !== $this->config->getTimeout()) { + $options['timeout'] = $this->config->getTimeout(); + } + + if (null !== $this->config->getCurlInterface()) { + $options['curl'] = [ + 'CURLOPT_INTERFACE' => $this->config->getCurlInterface() + ]; + } + + return new Session( + $this->uri, new Client($options), $this->config); } /** From 01ac965b3a42b5c907b5c7f159be633586bcf330 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Tue, 12 Jul 2016 11:08:08 +0200 Subject: [PATCH 175/217] updated composer to require ext-mbstring and ext-bcmath, update README to specify 4.0 version --- README.md | 4 +++- composer.json | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 33a71413..23d65e4e 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ Neo4j is a transactional, open-source graph database. A graph database manages d ### Requirements * PHP >= 5.6 +* ext-bcmath +* ext-mbstring * A Neo4j database (minimum version 2.2.6) ### Getting Help @@ -65,7 +67,7 @@ You can: Add the library to your composer dependencies : ```bash -composer require graphaware/neo4j-php-client +composer require graphaware/neo4j-php-client:^4.0 ``` Require the composer autoloader, configure your connection by providing a connection alias and your connection settings : diff --git a/composer.json b/composer.json index 6e93d08f..0b0c7e9c 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,8 @@ ], "require": { "php": ">= 5.6", + "ext-bcmath": "*", + "ext-mbstring": "*", "graphaware/neo4j-bolt": "^1.5", "guzzlehttp/guzzle": "^6.0", "symfony/event-dispatcher": "^2.7|^3.0", From 40eef6c7718e845bb62ebe09a6403da30a428cb9 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Thu, 14 Jul 2016 16:11:35 +0200 Subject: [PATCH 176/217] fix last change in bolt --- src/Connection/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index d4089ea5..3a2f1265 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -177,7 +177,7 @@ private function buildDriver() $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); $config = null; if (isset($params['user']) && isset($params['pass'])) { - $config = Configuration::withCredentials($params['user'], $params['pass']); + $config = Configuration::newInstance()->withCredentials($params['user'], $params['pass']); } $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { From 0c89de30eb43329467ad4136423e4d8eaafcb395 Mon Sep 17 00:00:00 2001 From: Tim Strehle Date: Wed, 10 Aug 2016 22:27:13 +0200 Subject: [PATCH 177/217] Fixed PHP parse error in example code --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23d65e4e..69d29a4f 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ $query = "MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name, collect(friend) a $result = $client->run($query); foreach ($result->getRecords() as $record) { - echo sprintf('Person name is : %s and has %d number of friends', $record->value('name'), count($record->value('friends')); + echo sprintf('Person name is : %s and has %d number of friends', $record->value('name'), count($record->value('friends'))); } ``` From ca30a94162724020bc74d323482ac152b2ff80a0 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 26 Aug 2016 23:46:43 +0200 Subject: [PATCH 178/217] use fresh_connect and forbid_reuse in curl --- src/HttpDriver/Driver.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 82ad46a9..6c6c85b7 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -47,11 +47,12 @@ public function session() } if (null !== $this->config->getCurlInterface()) { - $options['curl'] = [ - 'CURLOPT_INTERFACE' => $this->config->getCurlInterface() - ]; + $options['curl'][10062] = $this->config->getCurlInterface(); } + $options['curl'][74] = true; + $options['curl'][75] = true; + return new Session( $this->uri, new Client($options), $this->config); } From af8f01475a3cf63549498449574eb9c4bb8e7254 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 5 Sep 2016 00:05:14 +0200 Subject: [PATCH 179/217] fix issue when a neo4j exception is thrown during a tx and not reported back to user --- src/HttpDriver/Session.php | 18 ++++++++++- src/HttpDriver/Transaction.php | 14 ++++++++- tests/Issues/ReportedIssuesTest.php | 48 +++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 tests/Issues/ReportedIssuesTest.php diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index bb82ef30..8fad3fd3 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -255,7 +255,15 @@ public function pushToTransaction($transactionId, array $statementsStack) try { $response = $this->httpClient->send($request); + $data = json_decode((string) $response->getBody(), true); + if (!empty($data['errors'])) { + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($data['errors'][0]['code']); + + throw $exception; + } return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); } catch (RequestException $e) { if ($e->hasResponse()) { @@ -283,7 +291,15 @@ public function commitTransaction($transactionId) { $request = new Request('POST', sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); try { - $this->httpClient->send($request); + $response = $this->httpClient->send($request); + $data = json_decode((string) $response->getBody(), true); + if (!empty($data['errors'])) { + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($data['errors'][0]['code']); + throw $exception; + + } } catch (RequestException $e) { if ($e->hasResponse()) { $body = json_decode($e->getResponse()->getBody(), true); diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php index 3ff9149d..59c62ef4 100644 --- a/src/HttpDriver/Transaction.php +++ b/src/HttpDriver/Transaction.php @@ -13,6 +13,7 @@ use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Common\Cypher\Statement; +use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; class Transaction implements TransactionInterface { @@ -41,6 +42,8 @@ class Transaction implements TransactionInterface protected $expires; + protected $pending = []; + /** * @param Session $session */ @@ -179,7 +182,15 @@ public function success() { $this->assertNotClosed(); $this->assertStarted(); - $this->session->commitTransaction($this->transactionId); + try { + $this->session->commitTransaction($this->transactionId); + } catch (Neo4jException $e) { + if ($e->effect() === Neo4jExceptionInterface::EFFECT_ROLLBACK) { + $this->state = self::ROLLED_BACK; + } + + throw $e; + } $this->state = self::COMMITED; $this->closed = true; $this->session->transaction = null; @@ -194,6 +205,7 @@ private function assertStarted() { if ($this->state !== self::OPENED) { throw new \RuntimeException('This transaction has not been started'); + //$this->begin(); } } diff --git a/tests/Issues/ReportedIssuesTest.php b/tests/Issues/ReportedIssuesTest.php new file mode 100644 index 00000000..891e68c2 --- /dev/null +++ b/tests/Issues/ReportedIssuesTest.php @@ -0,0 +1,48 @@ +emptyDb(); + $this->createNodeWithRels(); + $tx = $this->client->transaction(); + $tx->push('MATCH (n:Node) DELETE n'); + $this->setExpectedException(Neo4jException::class); + $tx->commit(); + } + + /** + * + * @group issue-so-3 + */ + public function testTryingToDeleteNodeWithRelsInTransactionShouldFailAndTxBeRolledBack() + { + $this->emptyDb(); + $this->createNodeWithRels(); + $tx = $this->client->transaction(); + $tx->push('MATCH (n:Node) DELETE n'); + try { + $tx->commit(); + // it should fail + throw new RuntimeException(); + } catch (Neo4jException $e) { + $this->assertTrue($tx->isRolledBack()); + } + } + + private function createNodeWithRels() + { + $this->client->run('CREATE (n:Node)-[:REL]->(:OtherNode)'); + } +} \ No newline at end of file From 1da1ad5d8be44afa1c8b89264edeedb03c37095f Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 9 Sep 2016 23:54:45 +0200 Subject: [PATCH 180/217] handle neo4j errors on flush --- src/HttpDriver/Session.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 8fad3fd3..e03ee8b1 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -121,6 +121,15 @@ public function flush(Pipeline $pipeline) $request = $this->prepareRequest($pipeline); try { $response = $this->httpClient->send($request); + $data = json_decode((string) $response->getBody(), true); + if (!empty($data['errors'])) { + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); + $exception = new Neo4jException($msg); + $exception->setNeo4jStatusCode($data['errors'][0]['code']); + + throw $exception; + + } $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $pipeline->statements()); return $results; From 42083f784f82ee449a8c0e54c66e92cbd4fe3c12 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Thu, 15 Sep 2016 12:18:29 +0200 Subject: [PATCH 181/217] Fixed optionnal parameter value --- src/Connection/Connection.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 336b844e..b460790c 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -103,15 +103,13 @@ public function createPipeline($query = null, $parameters = array(), $tag = null * * @throws Neo4jException */ - public function run($statement, $parameters = null, $tag) + public function run($statement, $parameters = null, $tag = null) { $this->checkSession(); $parameters = (array) $parameters; try { - $results = $this->session->run($statement, $parameters, $tag); - - return $results; + return $this->session->run($statement, $parameters, $tag); } catch (MessageFailureException $e) { $exception = new Neo4jException($e->getMessage()); $exception->setNeo4jStatusCode($e->getStatusCode()); From 661af09cb13720dd8a2d5dedc2a9590d1c16c5ee Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 30 Sep 2016 21:28:04 +0200 Subject: [PATCH 182/217] added info about forcing TLS required --- Dockerfile | 11 +++++++++++ README.md | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..93a72a4f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM php:7.0-cli +RUN apt-get update && apt-get install -y \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + && docker-php-ext-install -j$(nproc) iconv mcrypt \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install -j$(nproc) gd \ + && docker-php-ext-install -j$(nproc) bcmath \ + && docker-php-ext-install -j$(nproc) mbstring \ No newline at end of file diff --git a/README.md b/README.md index 69d29a4f..a5407107 100644 --- a/README.md +++ b/README.md @@ -482,6 +482,20 @@ $client = ClientBuilder::create() The timeout by default is 5 seconds. +### TLS + +You can enable TLS encryption for the Bolt Protocol by passing a `Configuration` instance when building the connection, here +is a simple example : + +``` +$config = \GraphAware\Bolt\Configuration::newInstance() + ->withCredentials('bolttest', 'L7n7SfTSj') + ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED); + +$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb.com:24786', $config); +$session = $driver->session(); +``` + ### License The library is released under the MIT License, refer to the LICENSE file bundled with this package. From 7917ce35350f6d228ae5ab6b6e1a12d3fe02d2f3 Mon Sep 17 00:00:00 2001 From: roy Date: Fri, 30 Sep 2016 23:21:04 +0200 Subject: [PATCH 183/217] - Implemented ClientInterface and StackInterface - Implemented class overruling in ClientBuilder, so you can use your own Client --- src/Client.php | 6 +- src/ClientBuilder.php | 14 +++-- src/ClientInterface.php | 106 ++++++++++++++++++++++++++++++++ src/Connection/Connection.php | 4 +- src/Stack.php | 4 +- src/StackInterface.php | 62 +++++++++++++++++++ src/Transaction/Transaction.php | 12 ++-- 7 files changed, 189 insertions(+), 19 deletions(-) create mode 100644 src/ClientInterface.php create mode 100644 src/StackInterface.php diff --git a/src/Client.php b/src/Client.php index e5a68e5d..96477e12 100644 --- a/src/Client.php +++ b/src/Client.php @@ -24,7 +24,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -class Client +class Client implements ClientInterface { const NEOCLIENT_VERSION = '4.0'; @@ -116,7 +116,7 @@ public function sendWriteQuery($query, $parameters = null, $tag = null) * @param string|null $tag * @param string|null $connectionAlias * - * @return Stack + * @return StackInterface */ public function stack($tag = null, $connectionAlias = null) { @@ -130,7 +130,7 @@ public function stack($tag = null, $connectionAlias = null) * * @throws Neo4jException */ - public function runStack(Stack $stack) + public function runStack(StackInterface $stack) { $pipeline = $this->pipeline(null, null, $stack->getTag(), $stack->getConnectionAlias()); diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 58fcbc22..d81fe129 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -28,9 +28,13 @@ class ClientBuilder */ protected $config = []; - public function __construct() + public function __construct($config = []) { $this->config['connection_manager']['preflight_env'] = self::PREFLIGHT_ENV_DEFAULT; + $this->config['client_class'] = \GraphAware\Neo4j\Client\Client::class; + if(!empty($config)){ + $this->config = array_merge($this->config, $config); + } } /** @@ -38,9 +42,9 @@ public function __construct() * * @return ClientBuilder */ - public static function create() + public static function create($config = []) { - return new self(); + return new static($config); } /** @@ -117,8 +121,6 @@ public function registerEventListener($eventName, $callback) /** * Builds a Client based on the connections given. - * - * @return \GraphAware\Neo4j\Client\Client */ public function build() { @@ -153,7 +155,7 @@ public function build() } } - return new Client($connectionManager, $ev); + return new $this->config['client_class']($connectionManager, $ev); } /** diff --git a/src/ClientInterface.php b/src/ClientInterface.php new file mode 100644 index 00000000..0b35058a --- /dev/null +++ b/src/ClientInterface.php @@ -0,0 +1,106 @@ +$client->runWrite() instead. + * + * @param string $query + * @param null|array $parameters + * @param null|string $tag + * + * @return AbstractRecordCursor + * + * @throws Neo4jException + */ + public function sendWriteQuery($query, $parameters = null, $tag = null); + + /** + * @param string|null $tag + * @param string|null $connectionAlias + * + * @return Stack + */ + public function stack($tag = null, $connectionAlias = null); + + /** + * @param StackInterface $stack + * + * @return ResultCollection|null + * + * @throws Neo4jException + */ + public function runStack(StackInterface $stack); + + /** + * @param null|string $connectionAlias + * + * @return Transaction + */ + public function transaction($connectionAlias = null); + + /** + * @param string|null $conn + * @return Label[] + */ + public function getLabels($conn = null); + + /** + * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. + * + * @param string $query + * @param null|array $parameters + * @param null|string $tag + * @param null|string $connectionAlias + * + * @return AbstractRecordCursor + */ + public function sendCypherQuery($query, $parameters = null, $tag = null, $connectionAlias = null); + + /** + * @return ConnectionManager + */ + public function getConnectionManager(); + + /** + * @return EventDispatcherInterface + */ + public function getEventDispatcher(); +} \ No newline at end of file diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index e12bbf0b..7dad6227 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -17,8 +17,8 @@ use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; -use GraphAware\Neo4j\Client\Stack; use GraphAware\Neo4j\Client\HttpDriver\Configuration as HttpConfig; +use GraphAware\Neo4j\Client\StackInterface; class Connection { @@ -134,7 +134,7 @@ public function runMixed(array $queue) $pipeline = $this->createPipeline(); foreach ($queue as $element) { - if ($element instanceof Stack) { + if ($element instanceof StackInterface) { foreach ($element->statements() as $statement) { $pipeline->push($statement->text(), $statement->parameters(), $statement->getTag()); } diff --git a/src/Stack.php b/src/Stack.php index 3db9525a..a749500b 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -12,7 +12,7 @@ use GraphAware\Common\Cypher\Statement; -class Stack +class Stack implements StackInterface { /** * @var null|string @@ -52,7 +52,7 @@ public function __construct($tag = null, $connectionAlias = null) */ public static function create($tag = null, $connectionAlias = null) { - return new self($tag, $connectionAlias); + return new static($tag, $connectionAlias); } /** diff --git a/src/StackInterface.php b/src/StackInterface.php new file mode 100644 index 00000000..fc1f9574 --- /dev/null +++ b/src/StackInterface.php @@ -0,0 +1,62 @@ +queue[] = $stack; } /** - * @param Stack $stack + * @param StackInterface $stack * * @return mixed */ - public function runStack(Stack $stack) + public function runStack(StackInterface $stack) { if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { $this->driverTransaction->begin(); @@ -140,7 +140,7 @@ public function commit() if (!empty($this->queue)) { $stack = []; foreach ($this->queue as $element) { - if ($element instanceof Stack) { + if ($element instanceof StackInterface) { foreach ($element->statements() as $statement) { $stack[] = $statement; } From c6bc0960426d3f97ab819539a28421366d54c50b Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sat, 1 Oct 2016 13:27:05 +0200 Subject: [PATCH 184/217] changelog for 4.6.0 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecd49a46..7f51eb4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for v4 +4.6.0 - 01 October 2016 + +- Client class parameterizable + 4.4.5 - 05 July 2016 - Fixed an issue with `relationshipValue()` From 7c097eaff182774bf8e889753f396b07eab41d66 Mon Sep 17 00:00:00 2001 From: rpouls Date: Sat, 1 Oct 2016 14:01:40 +0200 Subject: [PATCH 185/217] Added @return tag for autocompletion --- src/ClientBuilder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index d81fe129..b6511f38 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -121,6 +121,8 @@ public function registerEventListener($eventName, $callback) /** * Builds a Client based on the connections given. + * + * @return ClientInterface */ public function build() { From bb3532839e05579ff04e48eb977c29cd30ea3556 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 10 Oct 2016 02:11:17 +0200 Subject: [PATCH 186/217] Fixed the result returning null when calling getRecord on an empty cursor. Fixes #54 --- src/Formatter/Result.php | 14 +++++++++---- tests/Integration/ResultIntegrationTest.php | 22 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 658cda35..5721ad26 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -59,7 +59,8 @@ public function size() } /** - * @return RecordView|null + * @return RecordView + * @throws \RuntimeException When there is no record */ public function firstRecord() { @@ -67,7 +68,7 @@ public function firstRecord() return $this->records[0]; } - return; + throw new \RuntimeException('There is no recrods'); } /** @@ -113,11 +114,16 @@ public function getRecords() } /** - * @return RecordView|null + * @return RecordView + * @throws \RuntimeException When there is no records */ public function getRecord() { - return !empty($this->records) ? $this->records[0] : null; + if (!empty($this->records)) { + return $this->records[0]; + } + + throw new \RuntimeException('There is no recrods'); } /** diff --git a/tests/Integration/ResultIntegrationTest.php b/tests/Integration/ResultIntegrationTest.php index a69db763..acbd8644 100644 --- a/tests/Integration/ResultIntegrationTest.php +++ b/tests/Integration/ResultIntegrationTest.php @@ -51,4 +51,26 @@ public function testExceptionIsThrownForInvalidRelationshipValue() $this->setExpectedException(InvalidArgumentException::class); $record->relationshipValue('r'); } + + /** + * @group issue54 + */ + public function testExceptionIsThrownWhenTryingToGetRecordOnEmptyCursor() + { + $this->emptyDb(); + $result = $this->client->run('MATCH (n) RETURN n'); + $this->setExpectedException(\RuntimeException::class); + $result->firstRecord(); + } + + /** + * @group issue54 + */ + public function testExceptionIsThrownWhenTryingToGetRecordOnEmptyCursorWithGetRecord() + { + $this->emptyDb(); + $result = $this->client->run('MATCH (n) RETURN n'); + $this->setExpectedException(\RuntimeException::class); + $result->getRecord(); + } } \ No newline at end of file From 541c4a28f015c127c7821d9db5752e048b2f1ee6 Mon Sep 17 00:00:00 2001 From: Mark Boessenkool Date: Fri, 14 Oct 2016 16:16:11 +0200 Subject: [PATCH 187/217] fixed issue where reference of a relation was given an incorrect InvalidArgumentException that the value was not of the correct type --- src/Formatter/RecordView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index ce3e8fe5..e17157c1 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -100,7 +100,7 @@ public function nodeValue($key) */ public function relationshipValue($key) { - if (!isset($this->values[$key]) || !$this->value($key) instanceof Relationship) { + if (!$this->hasValue($key) || !$this->value($key) instanceof Relationship) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Relationship::class)); } From 77946bc8070ec2ecc6b1ce4470a63cc44a72ea6a Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Sun, 16 Oct 2016 09:50:13 -0700 Subject: [PATCH 188/217] implemented firstRecordOrDefault convenient method --- CHANGELOG.md | 8 ++++++++ src/Formatter/Result.php | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f51eb4c..0f4fe71c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog for v4 +4.6.3 - 16 October 2016 + +- Added a convenient method for having a default return when there is no record and firstRecord is called + +4.6.2 - 10 October 2016 + +- Fixes Issue 54 (inconsistent behavior of getRecord on empty cursor between http and bolt + 4.6.0 - 01 October 2016 - Client class parameterizable diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index 5721ad26..a21af5d4 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\Formatter; use GraphAware\Common\Result\AbstractRecordCursor; +use GraphAware\Common\Result\Record; use GraphAware\Neo4j\Client\Formatter\Type\Node; use GraphAware\Neo4j\Client\Formatter\Type\Path; use GraphAware\Neo4j\Client\Formatter\Type\Relationship; @@ -71,6 +72,19 @@ public function firstRecord() throw new \RuntimeException('There is no recrods'); } + /** + * {@inheritdoc} + */ + public function firstRecordOrDefault($default) + { + if (0 === $this->size()) { + return $default; + } + + return $this->firstRecord(); + } + + /** * @param array $fields */ From 38db945a472fb5fd324a8b8e3caa619f1553b72d Mon Sep 17 00:00:00 2001 From: Kevin Saliou Date: Thu, 27 Oct 2016 16:16:40 +0200 Subject: [PATCH 189/217] global cs fixes (including configuration of php_cs) --- .editorconfig | 9 ++++ .gitignore | 11 ++-- .php_cs | 47 ++++++++++++++++ composer.json | 38 +++++-------- src/Client.php | 32 +++++------ src/ClientBuilder.php | 5 +- src/ClientInterface.php | 53 +++++++++++-------- src/Config.php | 3 +- src/Connection/Connection.php | 20 +++---- src/Connection/ConnectionManager.php | 9 ++-- src/Event/FailureEvent.php | 3 +- src/Event/PostRunEvent.php | 3 +- src/Event/PreRunEvent.php | 3 +- src/Exception/Neo4jException.php | 3 +- src/Exception/Neo4jExceptionInterface.php | 3 +- src/Exception/NeoClientExceptionInterface.php | 3 +- src/Formatter/RecordView.php | 10 ++-- src/Formatter/Response.php | 3 +- src/Formatter/ResponseFormatter.php | 9 ++-- src/Formatter/Result.php | 12 +++-- src/Formatter/Type/MapAccess.php | 9 ++++ src/Formatter/Type/Node.php | 5 +- src/Formatter/Type/Path.php | 3 +- src/Formatter/Type/Relationship.php | 3 +- src/HttpDriver/Configuration.php | 12 +++++ src/HttpDriver/Driver.php | 5 +- src/HttpDriver/GraphDatabase.php | 3 +- src/HttpDriver/Pipeline.php | 5 +- src/HttpDriver/Result/ResultSummary.php | 3 +- src/HttpDriver/Result/StatementStatistics.php | 7 +-- src/HttpDriver/Session.php | 26 +++++---- src/HttpDriver/Transaction.php | 18 +++---- src/Neo4jClientEvents.php | 3 +- src/Result/ResultCollection.php | 3 +- src/Schema/Label.php | 4 +- src/Stack.php | 7 +-- src/StackInterface.php | 20 +++++-- src/Transaction/Transaction.php | 13 ++--- tests/Example/ExampleTestCase.php | 8 +-- tests/Example/ReadmeExampleTest.php | 16 +++--- ...BuildWithEventListenersIntegrationTest.php | 26 +++++---- .../ClientGetExceptionIntegrationTest.php | 8 +-- .../ClientSetupIntegrationTest.php | 26 +++++---- .../CombinedStatisticsIntegrationTest.php | 16 ++++-- tests/Integration/CypherIntegrationTest.php | 17 ++++-- tests/Integration/EventListener.php | 13 ++++- tests/Integration/GetLabelsProcedureTest.php | 18 +++++-- tests/Integration/IntegrationTestCase.php | 16 ++++-- tests/Integration/ResultIntegrationTest.php | 18 +++++-- tests/Integration/StatementParametersTest.php | 16 ++++-- .../Integration/StatisticsIntegrationTest.php | 16 ++++-- .../TransactionIntegrationTest.php | 20 ++++--- tests/Issues/Issue40Test.php | 20 ++++--- tests/Issues/ReportedIssuesTest.php | 17 ++++-- tests/Unit/Connection/ConnectionUnitTest.php | 13 ++++- tests/Unit/Stub/DummyDriver.php | 13 +++-- 56 files changed, 474 insertions(+), 251 deletions(-) create mode 100644 .editorconfig create mode 100644 .php_cs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..677e36e2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index a6091939..446e2677 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ -vendor/ -test.php +.php_cs.cache bin/* -tests/_reports -tests/database_settings.yml cache/ -neoclient.yml composer.lock +neoclient.yml +test.php +tests/_reports +tests/database_settings.yml +vendor/ diff --git a/.php_cs b/.php_cs new file mode 100644 index 00000000..1c86779b --- /dev/null +++ b/.php_cs @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$header = <<<'EOF' +This file is part of the GraphAware Neo4j Client package. + +(c) GraphAware Limited + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; +!Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); + +$finder = (new \Symfony\Component\Finder\Finder()) + ->files() + ->ignoreVCS(true) + ->name('*.php') + ->in(__DIR__.'/src/') + ->in(__DIR__.'/tests/') +; + +return Symfony\CS\Config\Config::create() + ->setUsingCache(true) + ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) + ->fixers([ + 'ereg_to_preg', // Replace deprecated ereg regular expression functions with preg. + 'header_comment', + 'no_useless_return', // There should not be an empty return statement at the end of a function. + 'newline_after_open_tag', // Ensure there is no code on the same line as the PHP open tag. + 'ordered_use', // Ordering use statements. + 'php4_constructor', // Convert PHP4-style constructors to __construct. Warning! This could change code behavior. + 'phpdoc_order', // Annotations in phpdocs should be ordered so that param annotations come first, then throws annotations, then return annotations. + 'short_array_syntax', // PHP arrays should use the PHP 5.4 short-syntax. + 'strict', // Comparison should be strict. + 'strict_param', + ]) + ->finder($finder) + ->setUsingCache(true) +; diff --git a/composer.json b/composer.json index 0b0c7e9c..fe1101e1 100644 --- a/composer.json +++ b/composer.json @@ -2,37 +2,25 @@ "name": "graphaware/neo4j-php-client", "type": "library", "description": "Neo4j-PHP-Client is the most advanced PHP Client for Neo4j", - "keywords": [ - "graph", - "database", - "neo4j", - "cluster", - "client", - "bolt", - "http", - "high-availibility" - ], + "keywords": ["graph", "database", "neo4j", "cluster", "client", "bolt", "http", "high-availibility"], "homepage": "http://graphaware.com", "license": "MIT", - "authors": [ - { - "name": "Christophe Willemsen", - "email": "christophe@graphaware.com" - } - ], + "authors": [{ + "name": "Christophe Willemsen", + "email": "christophe@graphaware.com" + }], "require": { - "php": ">= 5.6", - "ext-bcmath": "*", - "ext-mbstring": "*", - "graphaware/neo4j-bolt": "^1.5", - "guzzlehttp/guzzle": "^6.0", - "symfony/event-dispatcher": "^2.7|^3.0", - "myclabs/php-enum": "^1.4" + "php": ">= 5.6", + "ext-bcmath": "*", + "ext-mbstring": "*", + "graphaware/neo4j-bolt": "^1.5", + "guzzlehttp/guzzle": "^6.0", + "myclabs/php-enum": "^1.4", + "symfony/event-dispatcher": "^2.7|^3.0" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^4.0", "symfony/stopwatch": "^3.0" - }, "autoload": { "psr-4": { diff --git a/src/Client.php b/src/Client.php index 96477e12..ddeca53f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; @@ -52,16 +53,16 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Common\Result\Result - * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * + * @return \GraphAware\Common\Result\Result */ public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); - $params = null !== $parameters ? $parameters : array(); + $params = null !== $parameters ? $parameters : []; $statement = Statement::create($query, $params, $tag); - $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent(array($statement))); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$statement])); try { $result = $connection->run($query, $parameters, $tag); @@ -85,9 +86,9 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor - * * @throws Neo4jException + * + * @return AbstractRecordCursor */ public function runWrite($query, $parameters = null, $tag = null) { @@ -97,15 +98,15 @@ public function runWrite($query, $parameters = null, $tag = null) } /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead * * @param string $query * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor - * * @throws Neo4jException + * + * @return AbstractRecordCursor */ public function sendWriteQuery($query, $parameters = null, $tag = null) { @@ -126,9 +127,9 @@ public function stack($tag = null, $connectionAlias = null) /** * @param Stack $stack * - * @return ResultCollection|null - * * @throws Neo4jException + * + * @return ResultCollection|null */ public function runStack(StackInterface $stack) { @@ -187,20 +188,21 @@ private function pipeline($query = null, $parameters = null, $tag = null, $conne /** * @param string|null $conn + * * @return Label[] */ public function getLabels($conn = null) { $connection = $this->connectionManager->getConnection($conn); - $result = $connection->getSession()->run("CALL db.labels()"); + $result = $connection->getSession()->run('CALL db.labels()'); - return array_map(function(Record $record) { + return array_map(function (Record $record) { return new Label($record->get('label')); }, $result->records()); } /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead * * @param string $query * @param null|array $parameters diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index b6511f38..7dca5fb2 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Driver\ConfigInterface; @@ -32,7 +33,7 @@ public function __construct($config = []) { $this->config['connection_manager']['preflight_env'] = self::PREFLIGHT_ENV_DEFAULT; $this->config['client_class'] = \GraphAware\Neo4j\Client\Client::class; - if(!empty($config)){ + if (!empty($config)) { $this->config = array_merge($this->config, $config); } } diff --git a/src/ClientInterface.php b/src/ClientInterface.php index 0b35058a..420dc71c 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -1,4 +1,15 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client; use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Neo4j\Client\Connection\ConnectionManager; @@ -9,8 +20,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** - * Interface ClientInterface - * @package GraphAware\Neo4j\Client + * Interface ClientInterface. */ interface ClientInterface { @@ -18,37 +28,37 @@ interface ClientInterface * Run a Cypher statement against the default database or the database specified. * * @param $query - * @param null|array $parameters + * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Common\Result\Result - * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * + * @return \GraphAware\Common\Result\Result */ public function run($query, $parameters = null, $tag = null, $connectionAlias = null); /** - * @param string $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor - * * @throws Neo4jException + * + * @return AbstractRecordCursor */ public function runWrite($query, $parameters = null, $tag = null); /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead * - * @param string $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor - * * @throws Neo4jException + * + * @return AbstractRecordCursor */ public function sendWriteQuery($query, $parameters = null, $tag = null); @@ -63,9 +73,9 @@ public function stack($tag = null, $connectionAlias = null); /** * @param StackInterface $stack * - * @return ResultCollection|null - * * @throws Neo4jException + * + * @return ResultCollection|null */ public function runStack(StackInterface $stack); @@ -78,15 +88,16 @@ public function transaction($connectionAlias = null); /** * @param string|null $conn + * * @return Label[] */ public function getLabels($conn = null); /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead * - * @param string $query - * @param null|array $parameters + * @param string $query + * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * @@ -103,4 +114,4 @@ public function getConnectionManager(); * @return EventDispatcherInterface */ public function getEventDispatcher(); -} \ No newline at end of file +} diff --git a/src/Config.php b/src/Config.php index aaebda58..eeee25cd 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; class Config diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 7dad6227..1b15588d 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -1,6 +1,6 @@ @@ -8,16 +8,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Bolt\Configuration; use GraphAware\Bolt\Driver as BoltDriver; +use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; -use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; -use GraphAware\Neo4j\Client\HttpDriver\Configuration as HttpConfig; use GraphAware\Neo4j\Client\StackInterface; class Connection @@ -55,9 +55,9 @@ class Connection /** * Connection constructor. * - * @param string $alias - * @param string $uri - * @param Configuration|null $config + * @param string $alias + * @param string $uri + * @param Configuration|null $config */ public function __construct($alias, $uri, $config = null) { @@ -91,10 +91,10 @@ public function getDriver() * * @return \GraphAware\Bolt\Protocol\Pipeline|\GraphAware\Neo4j\Client\HttpDriver\Pipeline */ - public function createPipeline($query = null, $parameters = array(), $tag = null) + public function createPipeline($query = null, $parameters = [], $tag = null) { $this->checkSession(); - $parameters = is_array($parameters) ? $parameters : array(); + $parameters = is_array($parameters) ? $parameters : []; return $this->session->createPipeline($query, $parameters, $tag); } @@ -104,9 +104,9 @@ public function createPipeline($query = null, $parameters = array(), $tag = null * @param array|null $parameters * @param null|string $tag * - * @return \GraphAware\Common\Result\AbstractRecordCursor - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\AbstractRecordCursor */ public function run($statement, $parameters = null, $tag = null) { diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 3db6f7ed..857c5e2a 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Neo4j\Client\HttpDriver\Configuration; @@ -25,9 +26,9 @@ class ConnectionManager private $master; /** - * @param string $alias - * @param string $uri - * @param null|Configuration $config + * @param string $alias + * @param string $uri + * @param null|Configuration $config */ public function registerConnection($alias, $uri, $config = null) { diff --git a/src/Event/FailureEvent.php b/src/Event/FailureEvent.php index 5d1c3b0a..b2ea5a24 100644 --- a/src/Event/FailureEvent.php +++ b/src/Event/FailureEvent.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Event; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; diff --git a/src/Event/PostRunEvent.php b/src/Event/PostRunEvent.php index b9d58c51..36ae4440 100644 --- a/src/Event/PostRunEvent.php +++ b/src/Event/PostRunEvent.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Event; use GraphAware\Common\Result\ResultCollection; diff --git a/src/Event/PreRunEvent.php b/src/Event/PreRunEvent.php index ff3900dd..db0397a8 100644 --- a/src/Event/PreRunEvent.php +++ b/src/Event/PreRunEvent.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Event; use GraphAware\Common\Cypher\StatementInterface; diff --git a/src/Exception/Neo4jException.php b/src/Exception/Neo4jException.php index e8079f33..82ecb76c 100644 --- a/src/Exception/Neo4jException.php +++ b/src/Exception/Neo4jException.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Exception; class Neo4jException extends \Exception implements Neo4jExceptionInterface diff --git a/src/Exception/Neo4jExceptionInterface.php b/src/Exception/Neo4jExceptionInterface.php index a8d2c956..05943fed 100644 --- a/src/Exception/Neo4jExceptionInterface.php +++ b/src/Exception/Neo4jExceptionInterface.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Exception; interface Neo4jExceptionInterface extends NeoClientExceptionInterface diff --git a/src/Exception/NeoClientExceptionInterface.php b/src/Exception/NeoClientExceptionInterface.php index 3f6f3e8e..d280305c 100644 --- a/src/Exception/NeoClientExceptionInterface.php +++ b/src/Exception/NeoClientExceptionInterface.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Exception; interface NeoClientExceptionInterface diff --git a/src/Formatter/RecordView.php b/src/Formatter/RecordView.php index e17157c1..d0f713fb 100644 --- a/src/Formatter/RecordView.php +++ b/src/Formatter/RecordView.php @@ -3,7 +3,7 @@ /* * This file is part of the GraphAware Neo4j Client package. * - * (c) Graph Aware Limited + * (c) GraphAware Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -78,9 +78,9 @@ public function value($key) * * @param string $key * - * @return \GraphAware\Neo4j\Client\Formatter\Type\Node - * * @throws \InvalidArgumentException When the value is not null or instance of Node + * + * @return \GraphAware\Neo4j\Client\Formatter\Type\Node */ public function nodeValue($key) { @@ -94,9 +94,9 @@ public function nodeValue($key) /** * @param string $key * - * @return \GraphAware\Neo4j\Client\Formatter\Type\Relationship - * * @throws \InvalidArgumentException When the value is not null or instance of Relationship + * + * @return \GraphAware\Neo4j\Client\Formatter\Type\Relationship */ public function relationshipValue($key) { diff --git a/src/Formatter/Response.php b/src/Formatter/Response.php index c8534d88..d419d018 100644 --- a/src/Formatter/Response.php +++ b/src/Formatter/Response.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter; class Response diff --git a/src/Formatter/ResponseFormatter.php b/src/Formatter/ResponseFormatter.php index 0c46b411..d856c648 100644 --- a/src/Formatter/ResponseFormatter.php +++ b/src/Formatter/ResponseFormatter.php @@ -1,6 +1,6 @@ @@ -8,10 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter; -use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\Exception\Neo4jException; +use GraphAware\Neo4j\Client\Result\ResultCollection; class ResponseFormatter { @@ -21,9 +22,9 @@ class ResponseFormatter * @param array $response * @param \GraphAware\Common\Cypher\Statement[] $statements * - * @return ResultCollection - * * @throws Neo4jException + * + * @return ResultCollection */ public function format(array $response, array $statements) { diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index a21af5d4..8b80bff5 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -1,6 +1,6 @@ @@ -8,14 +8,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter; +use GraphAware\Common\Cypher\StatementInterface; use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Common\Result\Record; use GraphAware\Neo4j\Client\Formatter\Type\Node; use GraphAware\Neo4j\Client\Formatter\Type\Path; use GraphAware\Neo4j\Client\Formatter\Type\Relationship; -use GraphAware\Common\Cypher\StatementInterface; use GraphAware\Neo4j\Client\HttpDriver\Result\ResultSummary; use GraphAware\Neo4j\Client\HttpDriver\Result\StatementStatistics; @@ -60,8 +61,9 @@ public function size() } /** - * @return RecordView * @throws \RuntimeException When there is no record + * + * @return RecordView */ public function firstRecord() { @@ -84,7 +86,6 @@ public function firstRecordOrDefault($default) return $this->firstRecord(); } - /** * @param array $fields */ @@ -128,8 +129,9 @@ public function getRecords() } /** - * @return RecordView * @throws \RuntimeException When there is no records + * + * @return RecordView */ public function getRecord() { diff --git a/src/Formatter/Type/MapAccess.php b/src/Formatter/Type/MapAccess.php index 83d6495f..cb4d85d0 100644 --- a/src/Formatter/Type/MapAccess.php +++ b/src/Formatter/Type/MapAccess.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\MapAccessor; diff --git a/src/Formatter/Type/Node.php b/src/Formatter/Type/Node.php index 414aac2f..005a9764 100644 --- a/src/Formatter/Type/Node.php +++ b/src/Formatter/Type/Node.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\Node as NodeInterface; @@ -57,6 +58,6 @@ public function labels() */ public function hasLabel($label) { - return in_array($label, $this->labels); + return in_array($label, $this->labels, true); } } diff --git a/src/Formatter/Type/Path.php b/src/Formatter/Type/Path.php index aca74251..c4ca334b 100644 --- a/src/Formatter/Type/Path.php +++ b/src/Formatter/Type/Path.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\Node as NodeInterface; diff --git a/src/Formatter/Type/Relationship.php b/src/Formatter/Type/Relationship.php index daa5d624..68b305fa 100644 --- a/src/Formatter/Type/Relationship.php +++ b/src/Formatter/Type/Relationship.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Formatter\Type; use GraphAware\Common\Type\Relationship as RelationshipInterface; diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index 0d238c45..1fbd1605 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Driver\ConfigInterface; @@ -29,16 +38,19 @@ public static function create() public function withTimeout($timeout) { $this->timeout = $timeout; + return $this; } /** * @param string $interface + * * @return $this */ public function withCurlInterface($interface) { $this->curlInterface = $interface; + return $this; } diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 6c6c85b7..b59d36bf 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -1,6 +1,6 @@ @@ -8,11 +8,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\DriverInterface; use GuzzleHttp\Client; -use GraphAware\Common\Driver\ConfigInterface; class Driver implements DriverInterface { diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 12208bcc..9679613e 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Driver\ConfigInterface; diff --git a/src/HttpDriver/Pipeline.php b/src/HttpDriver/Pipeline.php index d363460e..74b933f3 100644 --- a/src/HttpDriver/Pipeline.php +++ b/src/HttpDriver/Pipeline.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Cypher\Statement; @@ -36,7 +37,7 @@ public function __construct(Session $session) /** * {@inheritdoc} */ - public function push($query, array $parameters = array(), $tag = null) + public function push($query, array $parameters = [], $tag = null) { $this->statements[] = Statement::create($query, $parameters, $tag); } diff --git a/src/HttpDriver/Result/ResultSummary.php b/src/HttpDriver/Result/ResultSummary.php index 7b18184b..16984c21 100644 --- a/src/HttpDriver/Result/ResultSummary.php +++ b/src/HttpDriver/Result/ResultSummary.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver\Result; use GraphAware\Common\Cypher\StatementInterface; diff --git a/src/HttpDriver/Result/StatementStatistics.php b/src/HttpDriver/Result/StatementStatistics.php index 88882d48..c72aa103 100644 --- a/src/HttpDriver/Result/StatementStatistics.php +++ b/src/HttpDriver/Result/StatementStatistics.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver\Result; use GraphAware\Common\Result\StatementStatisticsInterface; @@ -77,7 +78,7 @@ class StatementStatistics implements StatementStatisticsInterface /** * @param array $statistics */ - public function __construct(array $statistics = array()) + public function __construct(array $statistics = []) { $keys = [ 'contains_updates', 'nodes_created', 'nodes_deleted', 'properties_set', 'labels_added', 'labels_removed', @@ -86,7 +87,7 @@ public function __construct(array $statistics = array()) ]; foreach ($statistics as $key => $value) { - if (!in_array($key, $keys)) { + if (!in_array($key, $keys, true)) { throw new \InvalidArgumentException(sprintf('Key %s is invalid in statement statistics', $key)); } $k = $this->toCamelCase($key); diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index e03ee8b1..e5811c70 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Driver\ConfigInterface; @@ -62,9 +63,9 @@ public function __construct($uri, Client $httpClient, ConfigInterface $config) /** * {@inheritdoc} */ - public function run($statement, array $parameters = array(), $tag = null) + public function run($statement, array $parameters = [], $tag = null) { - $parameters = is_array($parameters) ? $parameters : array(); + $parameters = is_array($parameters) ? $parameters : []; $pipeline = $this->createPipeline($statement, $parameters, $tag); $response = $pipeline->run(); @@ -76,7 +77,6 @@ public function run($statement, array $parameters = array(), $tag = null) */ public function close() { - // } /** @@ -98,7 +98,7 @@ public function transaction() * * @return Pipeline */ - public function createPipeline($query = null, array $parameters = array(), $tag = null) + public function createPipeline($query = null, array $parameters = [], $tag = null) { $pipeline = new Pipeline($this); @@ -112,9 +112,9 @@ public function createPipeline($query = null, array $parameters = array(), $tag /** * @param Pipeline $pipeline * - * @return \GraphAware\Common\Result\ResultCollection - * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jException + * + * @return \GraphAware\Common\Result\ResultCollection */ public function flush(Pipeline $pipeline) { @@ -128,7 +128,6 @@ public function flush(Pipeline $pipeline) $exception->setNeo4jStatusCode($data['errors'][0]['code']); throw $exception; - } $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $pipeline->statements()); @@ -199,9 +198,9 @@ private function formatParams(array $params) } /** - * @return \Psr\Http\Message\ResponseInterface - * * @throws Neo4jException + * + * @return \Psr\Http\Message\ResponseInterface */ public function begin() { @@ -230,9 +229,9 @@ public function begin() * @param int $transactionId * @param array $statementsStack * - * @return \GraphAware\Common\Result\ResultCollection - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\ResultCollection */ public function pushToTransaction($transactionId, array $statementsStack) { @@ -271,8 +270,8 @@ public function pushToTransaction($transactionId, array $statementsStack) $exception->setNeo4jStatusCode($data['errors'][0]['code']); throw $exception; - } + return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); } catch (RequestException $e) { if ($e->hasResponse()) { @@ -307,7 +306,6 @@ public function commitTransaction($transactionId) $exception = new Neo4jException($msg); $exception->setNeo4jStatusCode($data['errors'][0]['code']); throw $exception; - } } catch (RequestException $e) { if ($e->hasResponse()) { diff --git a/src/HttpDriver/Transaction.php b/src/HttpDriver/Transaction.php index 59c62ef4..8bd222a4 100644 --- a/src/HttpDriver/Transaction.php +++ b/src/HttpDriver/Transaction.php @@ -1,6 +1,6 @@ @@ -8,11 +8,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; -use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; class Transaction implements TransactionInterface @@ -109,9 +110,8 @@ public function commit() /** * {@inheritdoc} */ - public function push($query, array $parameters = array(), $tag = null) + public function push($query, array $parameters = [], $tag = null) { - // } public function getStatus() @@ -136,15 +136,15 @@ public function begin() /** * @param Statement $statement * - * @return \GraphAware\Common\Result\RecordCursorInterface - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\RecordCursorInterface */ public function run(Statement $statement) { $this->assertStarted(); try { - $results = $this->session->pushToTransaction($this->transactionId, array($statement)); + $results = $this->session->pushToTransaction($this->transactionId, [$statement]); return $results->results()[0]; } catch (Neo4jException $e) { @@ -160,9 +160,9 @@ public function run(Statement $statement) /** * @param array $statements * - * @return \GraphAware\Common\Result\ResultCollection - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\ResultCollection */ public function runMultiple(array $statements) { diff --git a/src/Neo4jClientEvents.php b/src/Neo4jClientEvents.php index 2e1f8086..3b5f435e 100644 --- a/src/Neo4jClientEvents.php +++ b/src/Neo4jClientEvents.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; final class Neo4jClientEvents diff --git a/src/Result/ResultCollection.php b/src/Result/ResultCollection.php index b32ffd7f..8d4f344d 100644 --- a/src/Result/ResultCollection.php +++ b/src/Result/ResultCollection.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Result; use GraphAware\Common\Result\RecordCursorInterface; diff --git a/src/Schema/Label.php b/src/Schema/Label.php index 6dd186ea..9f0a4d7b 100644 --- a/src/Schema/Label.php +++ b/src/Schema/Label.php @@ -1,6 +1,6 @@ @@ -33,4 +33,4 @@ public function getName() { return $this->name; } -} \ No newline at end of file +} diff --git a/src/Stack.php b/src/Stack.php index a749500b..b635face 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; @@ -62,7 +63,7 @@ public static function create($tag = null, $connectionAlias = null) */ public function push($query, $parameters = null, $tag = null) { - $params = null !== $parameters ? $parameters : array(); + $params = null !== $parameters ? $parameters : []; $this->statements[] = Statement::create($query, $params, $tag); } @@ -73,7 +74,7 @@ public function push($query, $parameters = null, $tag = null) */ public function addPreflight($query, $parameters = null, $tag = null) { - $params = null !== $parameters ? $parameters : array(); + $params = null !== $parameters ? $parameters : []; $this->preflights[] = Statement::create($query, $params, $tag); } diff --git a/src/StackInterface.php b/src/StackInterface.php index fc1f9574..e0749abf 100644 --- a/src/StackInterface.php +++ b/src/StackInterface.php @@ -1,10 +1,20 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; /** - * Interface StackInterface - * @package GraphAware\Neo4j\Client + * Interface StackInterface. */ interface StackInterface { @@ -17,7 +27,7 @@ interface StackInterface public static function create($tag = null, $connectionAlias = null); /** - * @param string $query + * @param string $query * @param null|array $parameters * @param null|array $tag */ @@ -59,4 +69,4 @@ public function getTag(); * @return null|string */ public function getConnectionAlias(); -} \ No newline at end of file +} diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index a61c25a7..a5ffbe0c 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -1,6 +1,6 @@ @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Transaction; use GraphAware\Common\Cypher\Statement; @@ -41,7 +42,7 @@ public function __construct(TransactionInterface $driverTransaction) * @param array $parameters * @param string|null $tag */ - public function push($statement, array $parameters = array(), $tag = null) + public function push($statement, array $parameters = [], $tag = null) { $this->queue[] = Statement::create($statement, $parameters, $tag); } @@ -53,9 +54,9 @@ public function push($statement, array $parameters = array(), $tag = null) * * @return \GraphAware\Common\Result\Result */ - public function run($statement, array $parameters = array(), $tag = null) + public function run($statement, array $parameters = [], $tag = null) { - if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'], true)) { $this->driverTransaction->begin(); } @@ -79,7 +80,7 @@ public function pushStack(StackInterface $stack) */ public function runStack(StackInterface $stack) { - if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'], true)) { $this->driverTransaction->begin(); } @@ -134,7 +135,7 @@ public function status() */ public function commit() { - if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'])) { + if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'], true)) { $this->driverTransaction->begin(); } if (!empty($this->queue)) { diff --git a/tests/Example/ExampleTestCase.php b/tests/Example/ExampleTestCase.php index 055cd6e7..4ef96971 100644 --- a/tests/Example/ExampleTestCase.php +++ b/tests/Example/ExampleTestCase.php @@ -1,6 +1,6 @@ @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\Tests\Example; +namespace GraphAware\Neo4j\Client\tests\Example; use GraphAware\Neo4j\Client\ClientBuilder; @@ -29,6 +29,6 @@ public function setUp() public function emptyDB() { - $this->client->run("MATCH (n) DETACH DELETE n"); + $this->client->run('MATCH (n) DETACH DELETE n'); } -} \ No newline at end of file +} diff --git a/tests/Example/ReadmeExampleTest.php b/tests/Example/ReadmeExampleTest.php index c7e7bb00..37f4b7d0 100644 --- a/tests/Example/ReadmeExampleTest.php +++ b/tests/Example/ReadmeExampleTest.php @@ -1,6 +1,6 @@ @@ -9,21 +9,21 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\Tests\Example; +namespace GraphAware\Neo4j\Client\tests\Example; -class ReadmeExamleTest extends ExampleTestCase +class ReadmeExampleTest extends ExampleTestCase { public function testReadingAResult() { $this->emptyDB(); - $this->client->run("CREATE (n:Person {name: {name} }) + $this->client->run('CREATE (n:Person {name: {name} }) CREATE (n2:Person {name: {friend_name} }) - CREATE (n)-[:FOLLOWS]->(n2)", [ + CREATE (n)-[:FOLLOWS]->(n2)', [ 'name' => 'Chris', - 'friend_name' => 'Ales' + 'friend_name' => 'Ales', ]); - $result = $this->client->run("MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name as name, collect(friend) as friends"); + $result = $this->client->run('MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name as name, collect(friend) as friends'); $this->assertCount(1, $result->records()); $record = $result->firstRecord(); @@ -31,4 +31,4 @@ public function testReadingAResult() $this->assertCount(1, $record->value('friends')); $this->assertEquals('Ales', $record->get('friends')[0]->get('name')); } -} \ No newline at end of file +} diff --git a/tests/Integration/BuildWithEventListenersIntegrationTest.php b/tests/Integration/BuildWithEventListenersIntegrationTest.php index 65919cd9..6b568f8e 100644 --- a/tests/Integration/BuildWithEventListenersIntegrationTest.php +++ b/tests/Integration/BuildWithEventListenersIntegrationTest.php @@ -1,14 +1,22 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; -use GraphAware\Neo4j\Client\Neo4jClientEvents; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; +use GraphAware\Neo4j\Client\Neo4jClientEvents; /** - * Class BuildWithEventListenersIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class BuildWithEventListenersIntegrationTest. * * @group listener */ @@ -19,9 +27,9 @@ public function testListenersAreRegistered() $listener = new EventListener(); $client = ClientBuilder::create() ->addConnection('default', 'bolt://localhost') - ->registerEventListener(Neo4jClientEvents::NEO4J_PRE_RUN, array($listener, 'onPreRun')) - ->registerEventListener(Neo4jClientEvents::NEO4J_POST_RUN, array($listener, 'onPostRun')) - ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, array($listener, 'onFailure')) + ->registerEventListener(Neo4jClientEvents::NEO4J_PRE_RUN, [$listener, 'onPreRun']) + ->registerEventListener(Neo4jClientEvents::NEO4J_POST_RUN, [$listener, 'onPostRun']) + ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, [$listener, 'onFailure']) ->build(); $result = $client->run('MATCH (n) RETURN count(n)'); @@ -34,10 +42,10 @@ public function testFailureCanBeDisabled() $listener = new EventListener(); $client = ClientBuilder::create() ->addConnection('default', 'bolt://localhost') - ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, array($listener, 'onFailure')) + ->registerEventListener(Neo4jClientEvents::NEO4J_ON_FAILURE, [$listener, 'onFailure']) ->build(); $client->run('MATCH (n)'); $this->assertInstanceOf(Neo4jExceptionInterface::class, $listener->e); } -} \ No newline at end of file +} diff --git a/tests/Integration/ClientGetExceptionIntegrationTest.php b/tests/Integration/ClientGetExceptionIntegrationTest.php index 9dee502c..acb8669a 100644 --- a/tests/Integration/ClientGetExceptionIntegrationTest.php +++ b/tests/Integration/ClientGetExceptionIntegrationTest.php @@ -1,6 +1,6 @@ @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\Tests\Integration; +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -23,6 +23,6 @@ public function testExceptionHandling() ->build(); $this->setExpectedException(Neo4jException::class); - $result = $client->run("CREATE (n:Cool"); + $result = $client->run('CREATE (n:Cool'); } -} \ No newline at end of file +} diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index 915580ef..1d2a880e 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -1,6 +1,6 @@ @@ -9,20 +9,18 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\Tests\Integration; +namespace GraphAware\Neo4j\Client\tests\Integration; +use GraphAware\Bolt\Driver as BoltDriver; use GraphAware\Neo4j\Client\Client; use GraphAware\Neo4j\Client\ClientBuilder; use GraphAware\Neo4j\Client\Connection\Connection; -use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; -use GraphAware\Bolt\Driver as BoltDriver; -use \InvalidArgumentException; use GraphAware\Neo4j\Client\Connection\ConnectionManager; -use Prophecy\Prophet; +use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; +use InvalidArgumentException; /** - * Class ClientSetupIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class ClientSetupIntegrationTest. * * @group setup */ @@ -79,17 +77,17 @@ public function testNullIseReturnedForMasterWhenNoMasterIsDefined() $this->assertNull($client->getConnectionManager()->getMasterConnection()); } - public function testICanDefineConnectionAsWriteOrRead() - { - $client = ClientBuilder::create() + public function testICanDefineConnectionAsWriteOrRead() + { + $client = ClientBuilder::create() ->addConnection('default', 'http://localhost:7474') ->addConnection('conn2', 'http://localhost:7575') ->addConnection('conn3', 'http://localhost:7676') ->setMaster('conn2') ->build(); - $this->assertEquals('conn2', $client->getConnectionManager()->getMasterConnection()->getAlias()); - } + $this->assertEquals('conn2', $client->getConnectionManager()->getMasterConnection()->getAlias()); + } public function testSecondIsMasterCallOverridesPreviousOne() { @@ -125,4 +123,4 @@ public function testSendWriteUseMasterIfAvailable() $client = new Client($connectionManager->reveal()); $client->runWrite('MATCH (n) RETURN count(n)'); } -} \ No newline at end of file +} diff --git a/tests/Integration/CombinedStatisticsIntegrationTest.php b/tests/Integration/CombinedStatisticsIntegrationTest.php index 5be2922c..c251b504 100644 --- a/tests/Integration/CombinedStatisticsIntegrationTest.php +++ b/tests/Integration/CombinedStatisticsIntegrationTest.php @@ -1,12 +1,20 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\Stack; /** - * Class CombinedStatisticsIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class CombinedStatisticsIntegrationTest. * * @group combined-stats-it */ @@ -57,4 +65,4 @@ public function testStatsAreMergedWithBolt() $this->assertEquals(2, $results->updateStatistics()->nodesCreated()); $this->assertEquals(2, $results->updateStatistics()->labelsAdded()); } -} \ No newline at end of file +} diff --git a/tests/Integration/CypherIntegrationTest.php b/tests/Integration/CypherIntegrationTest.php index 0c634ffc..30785ed6 100644 --- a/tests/Integration/CypherIntegrationTest.php +++ b/tests/Integration/CypherIntegrationTest.php @@ -1,13 +1,22 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Bolt\Result\Type\Node as BoltNode; +use GraphAware\Bolt\Result\Type\Relationship as BoltRelationship; use GraphAware\Common\Type\Node; +use GraphAware\Common\Type\Path; use GraphAware\Neo4j\Client\Formatter\Type\Node as HttpNode; use GraphAware\Neo4j\Client\Formatter\Type\Relationship as HttpRelationship; -use GraphAware\Bolt\Result\Type\Relationship as BoltRelationship; -use GraphAware\Common\Type\Path; class CypherIntegrationTest extends IntegrationTestCase { @@ -48,4 +57,4 @@ public function testPathIsReturned() $this->assertInstanceOf(Path::class, $record1->get('p')); $this->assertInstanceOf(Path::class, $record2->get('p')); } -} \ No newline at end of file +} diff --git a/tests/Integration/EventListener.php b/tests/Integration/EventListener.php index 74111550..636f1b91 100644 --- a/tests/Integration/EventListener.php +++ b/tests/Integration/EventListener.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\Event\FailureEvent; use GraphAware\Neo4j\Client\Event\PostRunEvent; @@ -33,4 +42,4 @@ public function onFailure(FailureEvent $event) $this->e = $event->getException(); $event->disableException(); } -} \ No newline at end of file +} diff --git a/tests/Integration/GetLabelsProcedureTest.php b/tests/Integration/GetLabelsProcedureTest.php index 38604283..d8d04010 100644 --- a/tests/Integration/GetLabelsProcedureTest.php +++ b/tests/Integration/GetLabelsProcedureTest.php @@ -1,13 +1,21 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\Tests; -use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; use GraphAware\Neo4j\Client\Schema\Label; +use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; /** - * Class GetLabelsProcedureTest - * @package GraphAware\Neo4j\Client\Tests + * Class GetLabelsProcedureTest. * * @group procedure */ @@ -16,11 +24,11 @@ class GetLabelsProcedureTest extends IntegrationTestCase public function testCanGetLabels() { $this->emptyDb(); - $this->client->run("CREATE (:Label1), (:Label2), (:Label3)"); + $this->client->run('CREATE (:Label1), (:Label2), (:Label3)'); $result = $this->client->getLabels(); $this->assertCount(3, $result); foreach ($result as $label) { $this->assertInstanceOf(Label::class, $label); } } -} \ No newline at end of file +} diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index a7ae1519..5a29f9d5 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; @@ -11,7 +20,6 @@ class IntegrationTestCase extends \PHPUnit_Framework_TestCase */ protected $client; - public function setUp() { $this->client = ClientBuilder::create() @@ -21,7 +29,7 @@ public function setUp() } /** - * Empties the graph database + * Empties the graph database. * * @void */ @@ -29,4 +37,4 @@ public function emptyDb() { $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n', null, null); } -} \ No newline at end of file +} diff --git a/tests/Integration/ResultIntegrationTest.php b/tests/Integration/ResultIntegrationTest.php index acbd8644..09af6b5a 100644 --- a/tests/Integration/ResultIntegrationTest.php +++ b/tests/Integration/ResultIntegrationTest.php @@ -1,14 +1,22 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Common\Type\Node; use GraphAware\Common\Type\Relationship; -use \InvalidArgumentException; +use InvalidArgumentException; /** - * Class ResultIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class ResultIntegrationTest. * * @group result-it */ @@ -73,4 +81,4 @@ public function testExceptionIsThrownWhenTryingToGetRecordOnEmptyCursorWithGetRe $this->setExpectedException(\RuntimeException::class); $result->getRecord(); } -} \ No newline at end of file +} diff --git a/tests/Integration/StatementParametersTest.php b/tests/Integration/StatementParametersTest.php index 2de0cc7a..0820e9ee 100644 --- a/tests/Integration/StatementParametersTest.php +++ b/tests/Integration/StatementParametersTest.php @@ -1,10 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; /** - * Class StatementParametersTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class StatementParametersTest. * * @group params */ @@ -34,4 +42,4 @@ public function testEmptyArraysInTransaction() $this->assertTrue(is_numeric($results->results()[0]->firstRecord()->get('id'))); } -} \ No newline at end of file +} diff --git a/tests/Integration/StatisticsIntegrationTest.php b/tests/Integration/StatisticsIntegrationTest.php index dfa4641c..b8ecb0fc 100644 --- a/tests/Integration/StatisticsIntegrationTest.php +++ b/tests/Integration/StatisticsIntegrationTest.php @@ -1,12 +1,20 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; /** - * Class StatisticsIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class StatisticsIntegrationTest. * * @group stats-it */ @@ -46,4 +54,4 @@ public function testRelationshipsDeletedWithHttp() $this->assertEquals(1, $result->summarize()->updateStatistics()->relationshipsDeleted()); } -} \ No newline at end of file +} diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php index ab93f1fa..402a0499 100644 --- a/tests/Integration/TransactionIntegrationTest.php +++ b/tests/Integration/TransactionIntegrationTest.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Integration; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -8,8 +17,7 @@ use GraphAware\Neo4j\Client\HttpDriver\Transaction; /** - * Class TransactionIntegrationTest - * @package GraphAware\Neo4j\Client\Tests\Integration + * Class TransactionIntegrationTest. * * @group tx-it */ @@ -99,7 +107,7 @@ public function testTransactionIsRolledBackInCaseOfExceptionWithBolt() $result = $tx->run('CREATE (n:Test) RETURN x'); $this->assertEquals(1, 2); // If we reached here then there is a bug } catch (MessageFailureException $e) { - $this->assertEquals(1,1); + $this->assertEquals(1, 1); } //$this->assertEquals(Transaction::ROLLED_BACK, $tx->status()); $this->assertXNodesWithLabelExist('Test', 0); @@ -134,10 +142,10 @@ public function testPushAndCommitInTxWithBolt() private function assertXNodesWithLabelExist($label, $number = 1) { - $query = 'MATCH (n:' . $label . ') RETURN count(n) as c'; + $query = 'MATCH (n:'.$label.') RETURN count(n) as c'; $result = $this->client->run($query, null, null, 'http'); $this->assertNotNull($result->firstRecord()); $this->assertEquals($number, $result->firstRecord()->get('c')); } -} \ No newline at end of file +} diff --git a/tests/Issues/Issue40Test.php b/tests/Issues/Issue40Test.php index 8d79ddf5..76c61c77 100644 --- a/tests/Issues/Issue40Test.php +++ b/tests/Issues/Issue40Test.php @@ -1,12 +1,20 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Issues; use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; /** - * Class Issue40Test - * @package GraphAware\Neo4j\Client\Tests\Issues + * Class Issue40Test. * * @group issues */ @@ -27,8 +35,8 @@ public function testIssue() 'brief_id' => 123, 'data' => [ 'key_1' => 'test', - 'key_2' => 'other' - ] + 'key_2' => 'other', + ], ]; $this->client->run($query, $parameters); @@ -42,4 +50,4 @@ private function assertGraphExist($pattern) $this->assertTrue(0 !== $result->size()); } -} \ No newline at end of file +} diff --git a/tests/Issues/ReportedIssuesTest.php b/tests/Issues/ReportedIssuesTest.php index 891e68c2..b484bbbf 100644 --- a/tests/Issues/ReportedIssuesTest.php +++ b/tests/Issues/ReportedIssuesTest.php @@ -1,15 +1,23 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Issues; -use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; use GraphAware\Neo4j\Client\Exception\Neo4jException; +use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; use Symfony\Component\Yaml\Exception\RuntimeException; class ReportedIssuesTest extends IntegrationTestCase { /** - * * @group issue-so-2 */ public function testTryingToDeleteNodeWithRelsInTransactionShouldFail() @@ -23,7 +31,6 @@ public function testTryingToDeleteNodeWithRelsInTransactionShouldFail() } /** - * * @group issue-so-3 */ public function testTryingToDeleteNodeWithRelsInTransactionShouldFailAndTxBeRolledBack() @@ -45,4 +52,4 @@ private function createNodeWithRels() { $this->client->run('CREATE (n:Node)-[:REL]->(:OtherNode)'); } -} \ No newline at end of file +} diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index 6b3202e5..3f78065a 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace GraphAware\Neo4j\Client\tests\Unit\Connection; use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; @@ -16,4 +25,4 @@ public function testConnectionInstantiation() $connection = new Connection('default', 'http://localhost:7474', null, 5); $this->assertInstanceOf(HttpDriver::class, $connection->getDriver()); } -} \ No newline at end of file +} diff --git a/tests/Unit/Stub/DummyDriver.php b/tests/Unit/Stub/DummyDriver.php index dfac658b..ba9dfdf4 100644 --- a/tests/Unit/Stub/DummyDriver.php +++ b/tests/Unit/Stub/DummyDriver.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace GraphAware\Neo4j\Client\Tests\Unit\Stub; use GraphAware\Common\Driver\DriverInterface; @@ -23,7 +32,5 @@ public function getUri() public function session() { - } - -} \ No newline at end of file +} From a971862c70c66ef3fe24929cfd42e93e3aa8d395 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 30 Oct 2016 23:20:36 +0100 Subject: [PATCH 190/217] Be more specific with PHP versions We do not support PHP6 and we have no idea if we ever will support PHP8 or 9. I updated the version to be more specific. I did also use the proper syntax for "or". --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0b0c7e9c..ec933f1f 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,12 @@ } ], "require": { - "php": ">= 5.6", + "php": "^5.6 || ^7.0", "ext-bcmath": "*", "ext-mbstring": "*", "graphaware/neo4j-bolt": "^1.5", "guzzlehttp/guzzle": "^6.0", - "symfony/event-dispatcher": "^2.7|^3.0", + "symfony/event-dispatcher": "^2.7 || ^3.0", "myclabs/php-enum": "^1.4" }, "require-dev": { From ce128a9d5e008aeb00345d29a3d30983baefc3c2 Mon Sep 17 00:00:00 2001 From: Tim Strehle Date: Wed, 9 Nov 2016 21:04:45 +0100 Subject: [PATCH 191/217] Fix typo in Result.php exception message "records" not "recrods" :) --- src/Formatter/Result.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatter/Result.php b/src/Formatter/Result.php index a21af5d4..513adcb8 100644 --- a/src/Formatter/Result.php +++ b/src/Formatter/Result.php @@ -69,7 +69,7 @@ public function firstRecord() return $this->records[0]; } - throw new \RuntimeException('There is no recrods'); + throw new \RuntimeException('There is no records'); } /** @@ -137,7 +137,7 @@ public function getRecord() return $this->records[0]; } - throw new \RuntimeException('There is no recrods'); + throw new \RuntimeException('There is no records'); } /** From d52e601792927a32e2e7ffce542dc33a1d65a20e Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Thu, 10 Nov 2016 22:58:14 +0100 Subject: [PATCH 192/217] Removed unecessary code + phpdoc improvements Typo + php doc + CS fix Renamed event dispatcher parameter name --- src/Client.php | 41 ++++++++++++++++---------------- src/ClientBuilder.php | 41 +++++++++++++++++++------------- src/Connection/Connection.php | 10 ++------ src/HttpDriver/Configuration.php | 6 +++++ src/Stack.php | 3 ++- 5 files changed, 56 insertions(+), 45 deletions(-) diff --git a/src/Client.php b/src/Client.php index 96477e12..134e62bf 100644 --- a/src/Client.php +++ b/src/Client.php @@ -8,10 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; -use GraphAware\Common\Result\AbstractRecordCursor; use GraphAware\Common\Result\Record; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\Event\FailureEvent; @@ -26,7 +26,7 @@ class Client implements ClientInterface { - const NEOCLIENT_VERSION = '4.0'; + const NEOCLIENT_VERSION = '4.6.3'; /** * @var ConnectionManager @@ -38,10 +38,10 @@ class Client implements ClientInterface */ protected $eventDispatcher; - public function __construct(ConnectionManager $connectionManager, EventDispatcherInterface $ev = null) + public function __construct(ConnectionManager $connectionManager, EventDispatcherInterface $eventDispatcher = null) { $this->connectionManager = $connectionManager; - $this->eventDispatcher = null !== $ev ? $ev : new EventDispatcher(); + $this->eventDispatcher = null !== $eventDispatcher ? $eventDispatcher : new EventDispatcher(); } /** @@ -52,7 +52,7 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Common\Result\Result + * @return \GraphAware\Common\Result\Result|null * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface */ @@ -85,25 +85,25 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor + * @return \GraphAware\Common\Result\Result * * @throws Neo4jException */ public function runWrite($query, $parameters = null, $tag = null) { - $connection = $this->connectionManager->getMasterConnection(); - - return $connection->run($query, $parameters, $tag); + return $this->connectionManager + ->getMasterConnection() + ->run($query, $parameters, $tag); } /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->runWrite() instead * * @param string $query * @param null|array $parameters * @param null|string $tag * - * @return AbstractRecordCursor + * @return \GraphAware\Common\Result\Result * * @throws Neo4jException */ @@ -124,7 +124,7 @@ public function stack($tag = null, $connectionAlias = null) } /** - * @param Stack $stack + * @param StackInterface $stack * * @return ResultCollection|null * @@ -176,7 +176,7 @@ public function transaction($connectionAlias = null) * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Neo4j\Client\HttpDriver\Pipeline|\GraphAware\Bolt\Protocol\Pipeline + * @return \GraphAware\Common\Driver\PipelineInterface */ private function pipeline($query = null, $parameters = null, $tag = null, $connectionAlias = null) { @@ -187,33 +187,34 @@ private function pipeline($query = null, $parameters = null, $tag = null, $conne /** * @param string|null $conn + * * @return Label[] */ public function getLabels($conn = null) { $connection = $this->connectionManager->getConnection($conn); - $result = $connection->getSession()->run("CALL db.labels()"); + $result = $connection->getSession()->run('CALL db.labels()'); - return array_map(function(Record $record) { + return array_map(function (Record $record) { return new Label($record->get('label')); }, $result->records()); } /** - * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead. + * @deprecated since 4.0 - will be removed in 5.0 - use $client->run() instead * * @param string $query * @param null|array $parameters * @param null|string $tag * @param null|string $connectionAlias * - * @return AbstractRecordCursor + * @return \GraphAware\Common\Result\Result */ public function sendCypherQuery($query, $parameters = null, $tag = null, $connectionAlias = null) { - $connection = $this->connectionManager->getConnection($connectionAlias); - - return $connection->run($query, $parameters, $tag); + return $this->connectionManager + ->getConnection($connectionAlias) + ->run($query, $parameters, $tag); } /** diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index b6511f38..a443c43b 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Driver\ConfigInterface; @@ -21,18 +22,22 @@ class ClientBuilder const DEFAULT_TIMEOUT = 5; - private static $TIMEOUT_CONFIG_KEY = 'timeout'; + const TIMEOUT_CONFIG_KEY = 'timeout'; /** * @var array */ protected $config = []; - public function __construct($config = []) + /** + * @param array $config + */ + public function __construct(array $config = []) { $this->config['connection_manager']['preflight_env'] = self::PREFLIGHT_ENV_DEFAULT; - $this->config['client_class'] = \GraphAware\Neo4j\Client\Client::class; - if(!empty($config)){ + $this->config['client_class'] = Client::class; + + if (!empty($config)) { $this->config = array_merge($this->config, $config); } } @@ -40,6 +45,8 @@ public function __construct($config = []) /** * Creates a new Client factory. * + * @param array $config + * * @return ClientBuilder */ public static function create($config = []) @@ -50,11 +57,11 @@ public static function create($config = []) /** * Add a connection to the handled connections. * - * @param string $alias - * @param string $uri - * @param array $extraParameters + * @param string $alias + * @param string $uri + * @param ConfigInterface $config * - * @return $this + * @return ClientBuilder */ public function addConnection($alias, $uri, ConfigInterface $config = null) { @@ -66,6 +73,9 @@ public function addConnection($alias, $uri, ConfigInterface $config = null) return $this; } + /** + * @param string $variable + */ public function preflightEnv($variable) { $this->config['connection_manager']['preflight_env'] = $variable; @@ -82,12 +92,11 @@ public function setMaster($connectionAlias) throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); } - if (isset($this->config['connections'])) { - foreach ($this->config['connections'] as $k => $conn) { - $conn['is_master'] = false; - $this->config['connections'][$k] = $conn; - } - } + $this->config['connections'] = array_map(function ($connectionSettings) { + $connectionSettings['is_master'] = false; + + return $connectionSettings; + }, $this->config['connections']); $this->config['connections'][$connectionAlias]['is_master'] = true; @@ -101,7 +110,7 @@ public function setMaster($connectionAlias) */ public function setDefaultTimeout($timeout) { - $this->config[self::$TIMEOUT_CONFIG_KEY] = (int) $timeout; + $this->config[static::TIMEOUT_CONFIG_KEY] = (int) $timeout; return $this; } @@ -165,6 +174,6 @@ public function build() */ private function getDefaultTimeout() { - return array_key_exists(self::$TIMEOUT_CONFIG_KEY, $this->config) ? $this->config[self::$TIMEOUT_CONFIG_KEY] : self::DEFAULT_TIMEOUT; + return array_key_exists(static::TIMEOUT_CONFIG_KEY, $this->config) ? $this->config[static::TIMEOUT_CONFIG_KEY] : self::DEFAULT_TIMEOUT; } } diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 7dad6227..370cd3b5 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -17,7 +17,6 @@ use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; -use GraphAware\Neo4j\Client\HttpDriver\Configuration as HttpConfig; use GraphAware\Neo4j\Client\StackInterface; class Connection @@ -47,11 +46,6 @@ class Connection */ private $session; - /** - * @var int - */ - private $timeout; - /** * Connection constructor. * @@ -89,7 +83,7 @@ public function getDriver() * @param array $parameters * @param null $tag * - * @return \GraphAware\Bolt\Protocol\Pipeline|\GraphAware\Neo4j\Client\HttpDriver\Pipeline + * @return \GraphAware\Common\Driver\PipelineInterface */ public function createPipeline($query = null, $parameters = array(), $tag = null) { @@ -104,7 +98,7 @@ public function createPipeline($query = null, $parameters = array(), $tag = null * @param array|null $parameters * @param null|string $tag * - * @return \GraphAware\Common\Result\AbstractRecordCursor + * @return \GraphAware\Common\Result\Result * * @throws Neo4jException */ diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index 0d238c45..b0afa42a 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -16,6 +16,9 @@ class Configuration implements ConfigInterface */ protected $curlInterface; + /** + * @return Configuration + */ public static function create() { return new self(); @@ -29,16 +32,19 @@ public static function create() public function withTimeout($timeout) { $this->timeout = $timeout; + return $this; } /** * @param string $interface + * * @return $this */ public function withCurlInterface($interface) { $this->curlInterface = $interface; + return $this; } diff --git a/src/Stack.php b/src/Stack.php index a749500b..95e1c85f 100644 --- a/src/Stack.php +++ b/src/Stack.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client; use GraphAware\Common\Cypher\Statement; @@ -48,7 +49,7 @@ public function __construct($tag = null, $connectionAlias = null) * @param null|string $tag * @param null|string $connectionAlias * - * @return Stack + * @return StackInterface */ public static function create($tag = null, $connectionAlias = null) { From 5aa7c309ff3ee39219c6ee526b8f787088e3ef48 Mon Sep 17 00:00:00 2001 From: Xavier Coureau Date: Fri, 9 Dec 2016 03:36:23 +0100 Subject: [PATCH 193/217] Added default http port driver as a constant --- src/Config.php | 4 +++- src/HttpDriver/Driver.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Config.php b/src/Config.php index aaebda58..6808d8c0 100644 --- a/src/Config.php +++ b/src/Config.php @@ -10,9 +10,11 @@ */ namespace GraphAware\Neo4j\Client; +use GraphAware\Neo4j\Client\HttpDriver\Driver; + class Config { - protected $defaultHttpPort = 7474; + protected $defaultHttpPort = Driver::DEFAULT_HTTP_PORT; protected $defaultTcpPort = 8687; diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 6c6c85b7..16059969 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -16,6 +16,8 @@ class Driver implements DriverInterface { + const DEFAULT_HTTP_PORT = 7474; + /** * @var string */ From e0d291f82c152d7cf9e2a66f6d1d20d107f869f6 Mon Sep 17 00:00:00 2001 From: Saddam H Date: Mon, 19 Dec 2016 11:40:58 +0600 Subject: [PATCH 194/217] Fixed missing parentheses Missing parentheses added at line 221 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5407107..718d0dda 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ $query = "MATCH (n:Person) n, n.name as name, n.age as age"; $result = $client->run($query); foreach ($result->records() as $record) { - print_r($record->get('n'); // nodes returned are automatically hydrated to Node objects + print_r($record->get('n')); // nodes returned are automatically hydrated to Node objects echo $record->value('name') . PHP_EOL; echo $record->value('age') . PHP_EOL; From 0450c49aba035fc1274012c7eeb82bdde4f45171 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 20 Feb 2017 17:18:38 +0100 Subject: [PATCH 195/217] Typo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0b0c7e9c..c5bd46ed 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "client", "bolt", "http", - "high-availibility" + "high-availability" ], "homepage": "http://graphaware.com", "license": "MIT", From efba96aeed0e8493db3a6d19afed096ae6c9155f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 20 Feb 2017 18:37:28 +0100 Subject: [PATCH 196/217] Test on PHP7.1 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 58d43e8c..a8303770 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php php: - 5.6 - 7.0 + - 7.1 before_install: - sudo apt-get update > /dev/null From a4a753ca8a6170f47744ef3554a129ff87fb9b26 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 20 Feb 2017 18:49:41 +0100 Subject: [PATCH 197/217] Updated link to Symfony bundle --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 718d0dda..a5f60a4d 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ You can: ### Implementations -* [Symfony Framework Bundle](https://github.com/PandawanTechnology/Neo4jBundle) +* [Symfony Framework Bundle](https://github.com/neo4j-contrib/neo4j-symfony) ## Installation and basic usage From c331740b849b89924b4a4ae754ede4473650d702 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 20 Feb 2017 18:31:48 +0100 Subject: [PATCH 198/217] Use HTTPlug This is a BC update to use HTTPlug. We still use the Guzzle adapter. --- composer.json | 11 ++- src/HttpDriver/Configuration.php | 68 ++++++++++++- src/HttpDriver/Driver.php | 38 ++++--- src/HttpDriver/Session.php | 165 +++++++++++++++---------------- 4 files changed, 182 insertions(+), 100 deletions(-) diff --git a/composer.json b/composer.json index 63da80d9..65044fe3 100644 --- a/composer.json +++ b/composer.json @@ -25,14 +25,19 @@ "ext-bcmath": "*", "ext-mbstring": "*", "graphaware/neo4j-bolt": "^1.5", - "guzzlehttp/guzzle": "^6.0", "symfony/event-dispatcher": "^2.7 || ^3.0", - "myclabs/php-enum": "^1.4" + "myclabs/php-enum": "^1.4", + "php-http/httplug": "^1.0", + "php-http/message-factory": "^1.0", + "php-http/client-common": "^1.0", + "php-http/discovery": "^1.0", + + "php-http/message": "^1.0", + "php-http/guzzle6-adapter": "^1.0" }, "require-dev": { "phpunit/phpunit": "4.*", "symfony/stopwatch": "^3.0" - }, "autoload": { "psr-4": { diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index b0afa42a..be886fd1 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -3,31 +3,92 @@ namespace GraphAware\Neo4j\Client\HttpDriver; use GraphAware\Common\Driver\ConfigInterface; +use Http\Client\HttpClient; +use Http\Discovery\HttpClientDiscovery; +use Http\Discovery\MessageFactoryDiscovery; +use Http\Message\RequestFactory; class Configuration implements ConfigInterface { /** * @var int + * @deprecated Will be removed in 5.0 */ protected $timeout; /** * @var string + * @deprecated Will be removed in 5.0 */ protected $curlInterface; + /** + * @var HttpClient + */ + private $httpClient; + + /** + * @var RequestFactory + */ + private $requestFactory; + /** * @return Configuration */ - public static function create() + public static function create(HttpClient $httpClient = null, RequestFactory $requestFactory = null) + { + $config = new self(); + $config->httpClient = $httpClient ?: HttpClientDiscovery::find(); + $config->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find(); + + return $config; + } + + /** + * @return HttpClient + */ + public function getHttpClient() { - return new self(); + return $this->httpClient; + } + + /** + * @param HttpClient $httpClient + * + * @return Configuration + */ + public function setHttpClient(HttpClient $httpClient) + { + $this->httpClient = $httpClient; + + return $this; + } + + /** + * @return RequestFactory + */ + public function getRequestFactory() + { + return $this->requestFactory; + } + + /** + * @param RequestFactory $requestFactory + * + * @return Configuration + */ + public function setRequestFactory(RequestFactory $requestFactory) + { + $this->requestFactory = $requestFactory; + + return $this; } /** * @param int $timeout * * @return Configuration + * @deprecated Will be removed in 5.0 */ public function withTimeout($timeout) { @@ -40,6 +101,7 @@ public function withTimeout($timeout) * @param string $interface * * @return $this + * @deprecated Will be removed in 5.0 */ public function withCurlInterface($interface) { @@ -50,6 +112,7 @@ public function withCurlInterface($interface) /** * @return int + * @deprecated Will be removed in 5.0 */ public function getTimeout() { @@ -58,6 +121,7 @@ public function getTimeout() /** * @return string + * @deprecated Will be removed in 5.0 */ public function getCurlInterface() { diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index 16059969..40ede0cd 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -10,9 +10,9 @@ */ namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Driver\DriverInterface; -use GuzzleHttp\Client; use GraphAware\Common\Driver\ConfigInterface; +use GraphAware\Common\Driver\DriverInterface; +use Http\Adapter\Guzzle6\Client; class Driver implements DriverInterface { @@ -42,6 +42,23 @@ public function __construct($uri, ConfigInterface $config = null) * @return Session */ public function session() + { + return new Session($this->uri, $this->getHttpClient(), $this->config); + } + + /** + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * + * @return \Http\Client\HttpClient + */ + private function getHttpClient() { $options = []; if (null !== $this->config->getTimeout()) { @@ -52,18 +69,15 @@ public function session() $options['curl'][10062] = $this->config->getCurlInterface(); } + if (empty($options)) { + return $this->config->getHttpClient(); + } + + // This is to keep BC. Will be removed in 5.0 + $options['curl'][74] = true; $options['curl'][75] = true; - return new Session( - $this->uri, new Client($options), $this->config); - } - - /** - * @return string - */ - public function getUri() - { - return $this->uri; + return Client::createWithConfig($options); } } diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index e03ee8b1..2bc9bed6 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -15,9 +15,16 @@ use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Formatter\ResponseFormatter; -use GuzzleHttp\Client; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Psr7\Request; +use GuzzleHttp\Client as GuzzleClient; +use Http\Adapter\Guzzle6\Client; +use Http\Client\Common\Plugin\ErrorPlugin; +use Http\Client\Common\PluginClient; +use Http\Client\Exception\HttpException; +use Http\Client\Exception\RequestException; +use Http\Client\HttpClient; +use Http\Discovery\MessageFactoryDiscovery; +use Http\Message\RequestFactory; +use Psr\Http\Message\RequestInterface; class Session implements SessionInterface { @@ -27,7 +34,7 @@ class Session implements SessionInterface protected $uri; /** - * @var Client + * @var HttpClient */ protected $httpClient; @@ -42,21 +49,34 @@ class Session implements SessionInterface public $transaction; /** - * @var ConfigInterface + * @var Configuration */ protected $config; /** - * @param string $uri - * @param Client $httpClient - * @param ConfigInterface $config + * @var RequestFactory */ - public function __construct($uri, Client $httpClient, ConfigInterface $config) + private $requestFactory; + + /** + * @param string $uri + * @param GuzzleClient|HttpClient $httpClient + * @param Configuration|ConfigInterface $config + */ + public function __construct($uri, $httpClient, ConfigInterface $config) { + if ($httpClient instanceof GuzzleClient) { + @trigger_error('Passing a Guzzle client to Session is deprecrated. Will be removed in 5.0. Use a HTTPlug client'); + $httpClient = new Client($httpClient); + } elseif (!$httpClient instanceof HttpClient) { + throw new \RuntimeException('Second argument to Session::__construct must be an instance of Http\Client\HttpClient.'); + } + $this->uri = $uri; - $this->httpClient = $httpClient; + $this->httpClient = new PluginClient($httpClient, [new ErrorPlugin()]); $this->responseFormatter = new ResponseFormatter(); $this->config = $config; + $this->requestFactory = $config->getRequestFactory(); } /** @@ -120,7 +140,7 @@ public function flush(Pipeline $pipeline) { $request = $this->prepareRequest($pipeline); try { - $response = $this->httpClient->send($request); + $response = $this->httpClient->sendRequest($request); $data = json_decode((string) $response->getBody(), true); if (!empty($data['errors'])) { $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); @@ -128,32 +148,27 @@ public function flush(Pipeline $pipeline) $exception->setNeo4jStatusCode($data['errors'][0]['code']); throw $exception; - } $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $pipeline->statements()); return $results; - } catch (RequestException $e) { - if ($e->hasResponse()) { - $body = json_decode($e->getResponse()->getBody(), true); - if (!isset($body['code'])) { - throw $e; - } - $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); - $exception = new Neo4jException($msg); - $exception->setNeo4jStatusCode($body['errors'][0]['code']); - - throw $exception; + } catch (HttpException $e) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg, 0, $e); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $e; + throw $exception; } } /** * @param Pipeline $pipeline * - * @return Request + * @return RequestInterface */ public function prepareRequest(Pipeline $pipeline) { @@ -180,7 +195,7 @@ public function prepareRequest(Pipeline $pipeline) ], ]; - return new Request('POST', sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); + return $this->requestFactory->createRequest('POST', sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body); } private function formatParams(array $params) @@ -205,24 +220,20 @@ private function formatParams(array $params) */ public function begin() { - $request = new Request('POST', sprintf('%s/db/data/transaction', $this->uri)); + $request = $this->requestFactory->createRequest('POST', sprintf('%s/db/data/transaction', $this->uri)); try { - return $this->httpClient->send($request); - } catch (RequestException $e) { - if ($e->hasResponse()) { - $body = json_decode($e->getResponse()->getBody(), true); - if (!isset($body['code'])) { - throw $e; - } - $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); - $exception = new Neo4jException($msg); - $exception->setNeo4jStatusCode($body['errors'][0]['code']); - - throw $exception; + return $this->httpClient->sendRequest($request); + } catch (HttpException $e) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg, 0, $e); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $e; + throw $exception; } } @@ -260,10 +271,10 @@ public function pushToTransaction($transactionId, array $statementsStack) 'statements' => $statements, ]); - $request = new Request('POST', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId), $headers, $body); + $request = $this->requestFactory->createRequest('POST', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId), $headers, $body); try { - $response = $this->httpClient->send($request); + $response = $this->httpClient->sendRequest($request); $data = json_decode((string) $response->getBody(), true); if (!empty($data['errors'])) { $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); @@ -271,23 +282,19 @@ public function pushToTransaction($transactionId, array $statementsStack) $exception->setNeo4jStatusCode($data['errors'][0]['code']); throw $exception; - } - return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); - } catch (RequestException $e) { - if ($e->hasResponse()) { - $body = json_decode($e->getResponse()->getBody(), true); - if (!isset($body['code'])) { - throw $e; - } - $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); - $exception = new Neo4jException($msg); - $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $exception; + return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); + } catch (HttpException $e) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg, 0, $e); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $e; + throw $exception; } } @@ -298,9 +305,9 @@ public function pushToTransaction($transactionId, array $statementsStack) */ public function commitTransaction($transactionId) { - $request = new Request('POST', sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); + $request = $this->requestFactory->createRequest('POST', sprintf('%s/db/data/transaction/%d/commit', $this->uri, $transactionId)); try { - $response = $this->httpClient->send($request); + $response = $this->httpClient->sendRequest($request); $data = json_decode((string) $response->getBody(), true); if (!empty($data['errors'])) { $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $data['errors'][0]['code'], $data['errors'][0]['message']); @@ -309,20 +316,16 @@ public function commitTransaction($transactionId) throw $exception; } - } catch (RequestException $e) { - if ($e->hasResponse()) { - $body = json_decode($e->getResponse()->getBody(), true); - if (!isset($body['code'])) { - throw $e; - } - $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); - $exception = new Neo4jException($msg); - $exception->setNeo4jStatusCode($body['errors'][0]['code']); - - throw $exception; + } catch (HttpException $e) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg, 0, $e); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $e; + throw $exception; } } @@ -333,24 +336,20 @@ public function commitTransaction($transactionId) */ public function rollbackTransaction($transactionId) { - $request = new Request('DELETE', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId)); + $request = $this->requestFactory->createRequest('DELETE', sprintf('%s/db/data/transaction/%d', $this->uri, $transactionId)); try { - $this->httpClient->send($request); - } catch (RequestException $e) { - if ($e->hasResponse()) { - $body = json_decode($e->getResponse()->getBody(), true); - if (!isset($body['code'])) { - throw $e; - } - $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); - $exception = new Neo4jException($msg); - $exception->setNeo4jStatusCode($body['errors'][0]['code']); - - throw $exception; + $this->httpClient->sendRequest($request); + } catch (HttpException $e) { + $body = json_decode($e->getResponse()->getBody(), true); + if (!isset($body['code'])) { + throw $e; } + $msg = sprintf('Neo4j Exception with code "%s" and message "%s"', $body['errors'][0]['code'], $body['errors'][0]['message']); + $exception = new Neo4jException($msg, 0, $e); + $exception->setNeo4jStatusCode($body['errors'][0]['code']); - throw $e; + throw $exception; } } } From da66fd15a5359eda6001a173e80a0723583cae02 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 21 Feb 2017 08:07:52 +0100 Subject: [PATCH 199/217] Made config immutable --- src/HttpDriver/Configuration.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index be886fd1..a10bfe84 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -59,9 +59,10 @@ public function getHttpClient() */ public function setHttpClient(HttpClient $httpClient) { - $this->httpClient = $httpClient; + $new = clone $this; + $new->httpClient = $httpClient; - return $this; + return $new; } /** @@ -79,9 +80,10 @@ public function getRequestFactory() */ public function setRequestFactory(RequestFactory $requestFactory) { - $this->requestFactory = $requestFactory; + $new = clone $this; + $new->requestFactory = $requestFactory; - return $this; + return $new; } /** From 4204ae0d115693f54895a7b97d89d12fbbc8d544 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 21 Feb 2017 08:22:10 +0100 Subject: [PATCH 200/217] Added readme --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5f60a4d..9b64bd3f 100644 --- a/README.md +++ b/README.md @@ -469,7 +469,7 @@ The event dispatcher is available via the client with the `$client->getEventDisp ### Settings -#### Timeout +#### Timeout (deprecated) You can configure a global timeout for the connections : @@ -482,6 +482,8 @@ $client = ClientBuilder::create() The timeout by default is 5 seconds. +This feature is deprecated and will be removed in version 5. See Http client settings below. + ### TLS You can enable TLS encryption for the Bolt Protocol by passing a `Configuration` instance when building the connection, here @@ -496,6 +498,26 @@ $driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb $session = $driver->session(); ``` +#### HTTP client settings + +We use HTTPlug to give you full control of the HTTP client. Version 4 of the Neo4jClient comes with Guzzle6 by default +to preserve backward compatibility. Version 5 will give you the option to choose whatever client you want. Read more +about HTTPlug [in their documentation](http://docs.php-http.org/en/latest/httplug/users.html). + +To configure your client you may add it to `Configuration`. + +```php +$options = [ + CURLOPT_CONNECTTIMEOUT => 3, // The number of seconds to wait while trying to connect. + CURLOPT_SSL_VERIFYPEER => false // Stop cURL from verifying the peer's certificate +]; +$httpClient = new Client(null, null, $options); + +$config = \GraphAware\Neo4j\Client\HttpDriver\Configuration::craete($httpClient); +$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb.com:24786', $config); +$session = $driver->session(); +``` + ### License The library is released under the MIT License, refer to the LICENSE file bundled with this package. From e476f617b9b4807439edb160fe252af9b62c2c75 Mon Sep 17 00:00:00 2001 From: Kevin Saliou Date: Tue, 21 Feb 2017 11:19:14 +0100 Subject: [PATCH 201/217] fix tests' namespaces --- README.md | 33 +++++++------------ tests/Example/ExampleTestCase.php | 2 +- tests/Example/ReadmeExampleTest.php | 2 +- ...BuildWithEventListenersIntegrationTest.php | 2 +- .../ClientGetExceptionIntegrationTest.php | 2 +- .../ClientSetupIntegrationTest.php | 2 +- .../CombinedStatisticsIntegrationTest.php | 2 +- tests/Integration/CypherIntegrationTest.php | 2 +- tests/Integration/EventListener.php | 2 +- tests/Integration/IntegrationTestCase.php | 2 +- tests/Integration/ResultIntegrationTest.php | 2 +- tests/Integration/StatementParametersTest.php | 2 +- .../Integration/StatisticsIntegrationTest.php | 2 +- .../TransactionIntegrationTest.php | 2 +- tests/Issues/Issue40Test.php | 2 +- tests/Issues/ReportedIssuesTest.php | 2 +- tests/Unit/Connection/ConnectionUnitTest.php | 2 +- 17 files changed, 28 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index a5407107..17869e3d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Introduction -Neo4j-PHP-Client is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. +Neo4j-PHP-Client is the most advanced and flexible [Neo4j](http://neo4j.com) Client for PHP. ### What is Neo4j? @@ -94,20 +94,20 @@ NB: The build method will process configuration settings and return you a `Clien #### Sending a Cypher Query ```php -$client->run("CREATE (n:Person)"); +$client->run('CREATE (n:Person)'); ``` #### Sending a Cypher Query with parameters ```php -$client->run("CREATE (n:Person) SET n += {infos}", ['infos' => ['name' => 'Ales', 'age' => 34]]); +$client->run('CREATE (n:Person) SET n += {infos}', ['infos' => ['name' => 'Ales', 'age' => 34]]); ``` #### Reading a Result ```php -$result = $client->run("MATCH (n:Person) RETURN n"); -// a result contains always a collection (array) of Record objects +$result = $client->run('MATCH (n:Person) RETURN n'); +// a result always contains a collection (array) of Record objects // get all records $records = $result->getRecords(); @@ -120,7 +120,7 @@ $record = $result->getRecord(); A `Record` object contains the values of one record from your Cypher query : ```php -$query = "MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name, collect(friend) as friends"; +$query = 'MATCH (n:Person)-[:FOLLOWS]->(friend) RETURN n.name, collect(friend) as friends'; $result = $client->run($query); foreach ($result->getRecords() as $record) { @@ -135,7 +135,6 @@ Ideally, you would stack your statements and issue them all at once in order to You can create Cypher statement stacks that act as a Bag and run this stack with the client, example : ```php - $stack = $client->stack(); $stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); @@ -204,7 +203,7 @@ Each record contains one row of values returned by the Cypher query : ``` -$query = "MATCH (n:Person) n, n.name as name, n.age as age"; +$query = 'MATCH (n:Person) n, n.name as name, n.age as age'; $result = $client->run($query); foreach ($result->records() as $record) { @@ -280,9 +279,9 @@ A `Result` is a collection of `Record` objects, every **row** you see in the bro In contrary to the previous versions of the client, there is no more automatic merging of all the records into one big record, so you will need to iterate all the records from the `Result` : ```php -$query = "MATCH (n:Address) +$query = 'MATCH (n:Address) RETURN n.address as addr, n, collect(id(n)) as ids -LIMIT 5"; +LIMIT 5'; $result = $client->run($query); foreach ($result->records() as $record) { @@ -349,7 +348,6 @@ The Client provides a Transaction object that ease how you would work with trans #### Creating a Transaction ```php - $tx = $client->transaction(); ``` @@ -358,7 +356,7 @@ At this stage, nothing has been sent to the server yet (the statement BEGIN has #### Stack a query ``` -$tx->push("CREATE (n:Person) RETURN id(n)"); +$tx->push('CREATE (n:Person) RETURN id(n)'); ``` Again, until now nothing has been sent. @@ -368,19 +366,16 @@ Again, until now nothing has been sent. Sometimes you want to get an immediate result of a statement inside the transaction, this can be done with the `run` method : ```php - -$result = $tx->run("CREATE (n:Person) SET n.name = {name} RETURN id(n)", ['name' => 'Michal']); +$result = $tx->run('CREATE (n:Person) SET n.name = {name} RETURN id(n)', ['name' => 'Michal']); echo $result->getRecord()->value("id(n)"); ``` If the transaction has not yet begun, the BEGIN of the transaction will be done automatically. -``` #### You can also push or run Stacks ```php - $stack = $client->stack(); $stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); $stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[:FOLLOWS]->(n2)', ['uuid1' => '123-fff', 'uuid2' => '456-ddd']); @@ -401,7 +396,7 @@ $stack->push('CREATE (n:Person {uuid: {uuid} })', ['uuid' => '123-fff']); $stack->push('MATCH (n:Person {uuid: {uuid1} }), (n2:Person {uuid: {uuid2} }) MERGE (n)-[:FOLLOWS]->(n2)', ['uuid1' => '123-fff', 'uuid2' => '456-ddd']); $tx->pushStack($stack); -$tx->pushQuery("MATCH (n) RETURN count(n)"); +$tx->pushQuery('MATCH (n) RETURN count(n)'); $results = $tx->commit(); ``` @@ -499,7 +494,3 @@ $session = $driver->session(); ### License The library is released under the MIT License, refer to the LICENSE file bundled with this package. - - - - diff --git a/tests/Example/ExampleTestCase.php b/tests/Example/ExampleTestCase.php index 4ef96971..b1bb0208 100644 --- a/tests/Example/ExampleTestCase.php +++ b/tests/Example/ExampleTestCase.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Example; +namespace GraphAware\Neo4j\Client\Tests\Example; use GraphAware\Neo4j\Client\ClientBuilder; diff --git a/tests/Example/ReadmeExampleTest.php b/tests/Example/ReadmeExampleTest.php index 37f4b7d0..3846831b 100644 --- a/tests/Example/ReadmeExampleTest.php +++ b/tests/Example/ReadmeExampleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Example; +namespace GraphAware\Neo4j\Client\Tests\Example; class ReadmeExampleTest extends ExampleTestCase { diff --git a/tests/Integration/BuildWithEventListenersIntegrationTest.php b/tests/Integration/BuildWithEventListenersIntegrationTest.php index 6b568f8e..8c2bcf79 100644 --- a/tests/Integration/BuildWithEventListenersIntegrationTest.php +++ b/tests/Integration/BuildWithEventListenersIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; use GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface; diff --git a/tests/Integration/ClientGetExceptionIntegrationTest.php b/tests/Integration/ClientGetExceptionIntegrationTest.php index acb8669a..a5ea0e8d 100644 --- a/tests/Integration/ClientGetExceptionIntegrationTest.php +++ b/tests/Integration/ClientGetExceptionIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; use GraphAware\Neo4j\Client\Exception\Neo4jException; diff --git a/tests/Integration/ClientSetupIntegrationTest.php b/tests/Integration/ClientSetupIntegrationTest.php index 1d2a880e..86697f90 100644 --- a/tests/Integration/ClientSetupIntegrationTest.php +++ b/tests/Integration/ClientSetupIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Bolt\Driver as BoltDriver; use GraphAware\Neo4j\Client\Client; diff --git a/tests/Integration/CombinedStatisticsIntegrationTest.php b/tests/Integration/CombinedStatisticsIntegrationTest.php index c251b504..cd249cc2 100644 --- a/tests/Integration/CombinedStatisticsIntegrationTest.php +++ b/tests/Integration/CombinedStatisticsIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\Stack; diff --git a/tests/Integration/CypherIntegrationTest.php b/tests/Integration/CypherIntegrationTest.php index 30785ed6..96bbc061 100644 --- a/tests/Integration/CypherIntegrationTest.php +++ b/tests/Integration/CypherIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Bolt\Result\Type\Node as BoltNode; use GraphAware\Bolt\Result\Type\Relationship as BoltRelationship; diff --git a/tests/Integration/EventListener.php b/tests/Integration/EventListener.php index 636f1b91..f12618f5 100644 --- a/tests/Integration/EventListener.php +++ b/tests/Integration/EventListener.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\Event\FailureEvent; use GraphAware\Neo4j\Client\Event\PostRunEvent; diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index 5a29f9d5..f9c7f74f 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\ClientBuilder; diff --git a/tests/Integration/ResultIntegrationTest.php b/tests/Integration/ResultIntegrationTest.php index 09af6b5a..0c1c66ad 100644 --- a/tests/Integration/ResultIntegrationTest.php +++ b/tests/Integration/ResultIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Common\Type\Node; use GraphAware\Common\Type\Relationship; diff --git a/tests/Integration/StatementParametersTest.php b/tests/Integration/StatementParametersTest.php index 0820e9ee..e3c200ae 100644 --- a/tests/Integration/StatementParametersTest.php +++ b/tests/Integration/StatementParametersTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; /** * Class StatementParametersTest. diff --git a/tests/Integration/StatisticsIntegrationTest.php b/tests/Integration/StatisticsIntegrationTest.php index b8ecb0fc..263fc44e 100644 --- a/tests/Integration/StatisticsIntegrationTest.php +++ b/tests/Integration/StatisticsIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; diff --git a/tests/Integration/TransactionIntegrationTest.php b/tests/Integration/TransactionIntegrationTest.php index 402a0499..45ae6384 100644 --- a/tests/Integration/TransactionIntegrationTest.php +++ b/tests/Integration/TransactionIntegrationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Integration; +namespace GraphAware\Neo4j\Client\Tests\Integration; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\Exception\Neo4jException; diff --git a/tests/Issues/Issue40Test.php b/tests/Issues/Issue40Test.php index 76c61c77..632fce6e 100644 --- a/tests/Issues/Issue40Test.php +++ b/tests/Issues/Issue40Test.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Issues; +namespace GraphAware\Neo4j\Client\Tests\Issues; use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; diff --git a/tests/Issues/ReportedIssuesTest.php b/tests/Issues/ReportedIssuesTest.php index b484bbbf..8b03fd77 100644 --- a/tests/Issues/ReportedIssuesTest.php +++ b/tests/Issues/ReportedIssuesTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Issues; +namespace GraphAware\Neo4j\Client\Tests\Issues; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; diff --git a/tests/Unit/Connection/ConnectionUnitTest.php b/tests/Unit/Connection/ConnectionUnitTest.php index 3f78065a..63a28344 100644 --- a/tests/Unit/Connection/ConnectionUnitTest.php +++ b/tests/Unit/Connection/ConnectionUnitTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace GraphAware\Neo4j\Client\tests\Unit\Connection; +namespace GraphAware\Neo4j\Client\Tests\Unit\Connection; use GraphAware\Neo4j\Client\Connection\Connection; use GraphAware\Neo4j\Client\HttpDriver\Driver as HttpDriver; From 2efbda68f4df6b86cbfdaebf6d80560621da4413 Mon Sep 17 00:00:00 2001 From: Kevin Saliou Date: Tue, 21 Feb 2017 12:18:31 +0100 Subject: [PATCH 202/217] upgrade to php-cs-fixer 2 --- .php_cs | 38 +++++++++---------- composer.json | 1 + src/ClientBuilder.php | 2 +- .../Integration/StatisticsIntegrationTest.php | 2 - 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/.php_cs b/.php_cs index 1c86779b..0c7f2b20 100644 --- a/.php_cs +++ b/.php_cs @@ -17,31 +17,27 @@ This file is part of the GraphAware Neo4j Client package. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOF; -!Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); -$finder = (new \Symfony\Component\Finder\Finder()) - ->files() - ->ignoreVCS(true) - ->name('*.php') +$finder = PhpCsFixer\Finder::create() ->in(__DIR__.'/src/') ->in(__DIR__.'/tests/') ; -return Symfony\CS\Config\Config::create() - ->setUsingCache(true) - ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers([ - 'ereg_to_preg', // Replace deprecated ereg regular expression functions with preg. - 'header_comment', - 'no_useless_return', // There should not be an empty return statement at the end of a function. - 'newline_after_open_tag', // Ensure there is no code on the same line as the PHP open tag. - 'ordered_use', // Ordering use statements. - 'php4_constructor', // Convert PHP4-style constructors to __construct. Warning! This could change code behavior. - 'phpdoc_order', // Annotations in phpdocs should be ordered so that param annotations come first, then throws annotations, then return annotations. - 'short_array_syntax', // PHP arrays should use the PHP 5.4 short-syntax. - 'strict', // Comparison should be strict. - 'strict_param', +return PhpCsFixer\Config::create() + ->setRules([ + '@Symfony' => true, + + 'array_syntax' => ['syntax' => 'short'], + 'header_comment' => ['header' => $header], + 'linebreak_after_opening_tag' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + + // 'modernize_types_casting' => true, + // 'no_useless_return' => true, + // 'phpdoc_add_missing_param_annotation' => true, + // 'protected_to_private' => true, + // 'strict_param' => true, ]) - ->finder($finder) - ->setUsingCache(true) + ->setFinder($finder) ; diff --git a/composer.json b/composer.json index fe1101e1..6c87b044 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "symfony/event-dispatcher": "^2.7|^3.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", "phpunit/phpunit": "^4.0", "symfony/stopwatch": "^3.0" }, diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 7dca5fb2..d9cc6aa6 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -80,7 +80,7 @@ public function preflightEnv($variable) public function setMaster($connectionAlias) { if (!isset($this->config['connections']) || !array_key_exists($connectionAlias, $this->config['connections'])) { - throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); + throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); } if (isset($this->config['connections'])) { diff --git a/tests/Integration/StatisticsIntegrationTest.php b/tests/Integration/StatisticsIntegrationTest.php index 263fc44e..091db28a 100644 --- a/tests/Integration/StatisticsIntegrationTest.php +++ b/tests/Integration/StatisticsIntegrationTest.php @@ -11,8 +11,6 @@ namespace GraphAware\Neo4j\Client\Tests\Integration; -use GraphAware\Neo4j\Client\Tests\Integration\IntegrationTestCase; - /** * Class StatisticsIntegrationTest. * From c90869277a74796bbb7497c13213198c364f7fca Mon Sep 17 00:00:00 2001 From: Kevin Saliou Date: Tue, 21 Feb 2017 12:23:42 +0100 Subject: [PATCH 203/217] post merge cs fix --- src/Client.php | 22 +++++++++++----------- src/ClientBuilder.php | 4 ++-- src/Connection/Connection.php | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Client.php b/src/Client.php index 134e62bf..fe8b50d0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,6 +1,6 @@ @@ -52,16 +52,16 @@ public function __construct(ConnectionManager $connectionManager, EventDispatche * @param null|string $tag * @param null|string $connectionAlias * - * @return \GraphAware\Common\Result\Result|null - * * @throws \GraphAware\Neo4j\Client\Exception\Neo4jExceptionInterface + * + * @return \GraphAware\Common\Result\Result|null */ public function run($query, $parameters = null, $tag = null, $connectionAlias = null) { $connection = $this->connectionManager->getConnection($connectionAlias); - $params = null !== $parameters ? $parameters : array(); + $params = null !== $parameters ? $parameters : []; $statement = Statement::create($query, $params, $tag); - $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent(array($statement))); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$statement])); try { $result = $connection->run($query, $parameters, $tag); @@ -85,9 +85,9 @@ public function run($query, $parameters = null, $tag = null, $connectionAlias = * @param null|array $parameters * @param null|string $tag * - * @return \GraphAware\Common\Result\Result - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\Result */ public function runWrite($query, $parameters = null, $tag = null) { @@ -103,9 +103,9 @@ public function runWrite($query, $parameters = null, $tag = null) * @param null|array $parameters * @param null|string $tag * - * @return \GraphAware\Common\Result\Result - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\Result */ public function sendWriteQuery($query, $parameters = null, $tag = null) { @@ -126,9 +126,9 @@ public function stack($tag = null, $connectionAlias = null) /** * @param StackInterface $stack * - * @return ResultCollection|null - * * @throws Neo4jException + * + * @return ResultCollection|null */ public function runStack(StackInterface $stack) { diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index a443c43b..8c4198e9 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -1,6 +1,6 @@ @@ -89,7 +89,7 @@ public function preflightEnv($variable) public function setMaster($connectionAlias) { if (!isset($this->config['connections']) || !array_key_exists($connectionAlias, $this->config['connections'])) { - throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); + throw new \InvalidArgumentException(sprintf('The connection "%s" is not registered', (string) $connectionAlias)); } $this->config['connections'] = array_map(function ($connectionSettings) { diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 370cd3b5..e61ae13f 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -1,6 +1,6 @@ @@ -8,14 +8,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace GraphAware\Neo4j\Client\Connection; use GraphAware\Bolt\Configuration; use GraphAware\Bolt\Driver as BoltDriver; +use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; -use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; use GraphAware\Neo4j\Client\StackInterface; @@ -49,9 +50,9 @@ class Connection /** * Connection constructor. * - * @param string $alias - * @param string $uri - * @param Configuration|null $config + * @param string $alias + * @param string $uri + * @param Configuration|null $config */ public function __construct($alias, $uri, $config = null) { @@ -85,10 +86,10 @@ public function getDriver() * * @return \GraphAware\Common\Driver\PipelineInterface */ - public function createPipeline($query = null, $parameters = array(), $tag = null) + public function createPipeline($query = null, $parameters = [], $tag = null) { $this->checkSession(); - $parameters = is_array($parameters) ? $parameters : array(); + $parameters = is_array($parameters) ? $parameters : []; return $this->session->createPipeline($query, $parameters, $tag); } @@ -98,9 +99,9 @@ public function createPipeline($query = null, $parameters = array(), $tag = null * @param array|null $parameters * @param null|string $tag * - * @return \GraphAware\Common\Result\Result - * * @throws Neo4jException + * + * @return \GraphAware\Common\Result\Result */ public function run($statement, $parameters = null, $tag = null) { From a341b65db9380a416c51d69a4ee7e7578614e3e8 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 21 Feb 2017 15:24:49 +0100 Subject: [PATCH 204/217] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b64bd3f..c3805be6 100644 --- a/README.md +++ b/README.md @@ -513,7 +513,7 @@ $options = [ ]; $httpClient = new Client(null, null, $options); -$config = \GraphAware\Neo4j\Client\HttpDriver\Configuration::craete($httpClient); +$config = \GraphAware\Neo4j\Client\HttpDriver\Configuration::create($httpClient); $driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb.com:24786', $config); $session = $driver->session(); ``` From 288e2256d7515ca55cc67f3bed9b4526d38dfee3 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 21 Feb 2017 19:38:24 +0100 Subject: [PATCH 205/217] Updated docs of how to configure a client --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c3805be6..71ae309b 100644 --- a/README.md +++ b/README.md @@ -494,8 +494,9 @@ $config = \GraphAware\Bolt\Configuration::newInstance() ->withCredentials('bolttest', 'L7n7SfTSj') ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED); -$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb.com:24786', $config); -$session = $driver->session(); +$client = ClientBuilder::create() + ->addConnection('default', 'bolt://hodccomjfkgdenl.dbs.gdb.com:24786', config) + ->build(); ``` #### HTTP client settings @@ -514,8 +515,9 @@ $options = [ $httpClient = new Client(null, null, $options); $config = \GraphAware\Neo4j\Client\HttpDriver\Configuration::create($httpClient); -$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hodccomjfkgdenl.dbs.gdb.com:24786', $config); -$session = $driver->session(); +$client = ClientBuilder::create() + ->addConnection('default', 'http://neo4j:password@localhost:7474', config) + ->build(); ``` ### License From 48a83fad20c5c229b79a520a0db82c92e71b69f2 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 21 Feb 2017 19:45:18 +0100 Subject: [PATCH 206/217] Avoid using ConfigInterface since it does not provide any type safety Instead we are using the Configuration implementations or mixed. We throw exceptions on places that would have generated Errors if the wrong Configuration implementation was provided. --- src/ClientBuilder.php | 9 ++++----- src/Connection/Connection.php | 4 ++-- src/Connection/ConnectionManager.php | 2 -- src/HttpDriver/Driver.php | 7 +++++-- src/HttpDriver/GraphDatabase.php | 4 ++-- src/HttpDriver/Session.php | 13 ++++++++----- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 8c4198e9..4bf61d24 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -11,7 +11,6 @@ namespace GraphAware\Neo4j\Client; -use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\HttpDriver\Configuration; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -57,13 +56,13 @@ public static function create($config = []) /** * Add a connection to the handled connections. * - * @param string $alias - * @param string $uri - * @param ConfigInterface $config + * @param string $alias + * @param string $uri + * @param mixed $config * * @return ClientBuilder */ - public function addConnection($alias, $uri, ConfigInterface $config = null) + public function addConnection($alias, $uri, $config = null) { $this->config['connections'][$alias]['uri'] = $uri; if (null !== $config) { diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index e61ae13f..1a02acd1 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -11,7 +11,7 @@ namespace GraphAware\Neo4j\Client\Connection; -use GraphAware\Bolt\Configuration; +use GraphAware\Bolt\Configuration as BoltConfiguration; use GraphAware\Bolt\Driver as BoltDriver; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; @@ -170,7 +170,7 @@ private function buildDriver() $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); $config = null; if (isset($params['user']) && isset($params['pass'])) { - $config = Configuration::newInstance()->withCredentials($params['user'], $params['pass']); + $config = BoltConfiguration::newInstance()->withCredentials($params['user'], $params['pass']); } $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index 857c5e2a..e794b2c3 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -11,8 +11,6 @@ namespace GraphAware\Neo4j\Client\Connection; -use GraphAware\Neo4j\Client\HttpDriver\Configuration; - class ConnectionManager { /** diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index b3f61bac..e3dc6d6d 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -11,7 +11,6 @@ namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\DriverInterface; use Http\Adapter\Guzzle6\Client; @@ -33,8 +32,12 @@ class Driver implements DriverInterface * @param string $uri * @param Configuration $config */ - public function __construct($uri, ConfigInterface $config = null) + public function __construct($uri, $config = null) { + if (null !== $config && !$config instanceof Configuration) { + throw new \RuntimeException(sprintf('Second argument to "%s" must be null or "%s"', __CLASS__, Configuration::class)); + } + $this->uri = $uri; $this->config = null !== $config ? $config : Configuration::create(); } diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 9679613e..602fddfc 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -17,8 +17,8 @@ class GraphDatabase implements GraphDatabaseInterface { /** - * @param string $uri - * @param ConfigInterface|null $config + * @param string $uri + * @param Configuration|null $config * * @return Driver */ diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 9c944e5c..296c3d50 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -11,7 +11,6 @@ namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\SessionInterface; use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -60,11 +59,11 @@ class Session implements SessionInterface private $requestFactory; /** - * @param string $uri - * @param GuzzleClient|HttpClient $httpClient - * @param Configuration|ConfigInterface $config + * @param string $uri + * @param GuzzleClient|HttpClient $httpClient + * @param Configuration $config */ - public function __construct($uri, $httpClient, ConfigInterface $config) + public function __construct($uri, $httpClient, $config) { if ($httpClient instanceof GuzzleClient) { @trigger_error('Passing a Guzzle client to Session is deprecrated. Will be removed in 5.0. Use a HTTPlug client'); @@ -73,6 +72,10 @@ public function __construct($uri, $httpClient, ConfigInterface $config) throw new \RuntimeException('Second argument to Session::__construct must be an instance of Http\Client\HttpClient.'); } + if (null !== $config && !$config instanceof Configuration) { + throw new \RuntimeException(sprintf('Third argument to "%s" must be null or "%s"', __CLASS__, Configuration::class)); + } + $this->uri = $uri; $this->httpClient = new PluginClient($httpClient, [new ErrorPlugin()]); $this->responseFormatter = new ResponseFormatter(); From 38feb0b46fe02c43cb7a8d8b0d3a4d971bac1d62 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 14:38:23 +0100 Subject: [PATCH 207/217] Use the new base configuration class --- src/HttpDriver/Configuration.php | 69 +++++++++----------------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index 944924a9..c5f958eb 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -16,8 +16,12 @@ use Http\Discovery\HttpClientDiscovery; use Http\Discovery\MessageFactoryDiscovery; use Http\Message\RequestFactory; +use GraphAware\Common\Connection\Configuration as BaseConfiguration; -class Configuration implements ConfigInterface +/** + * @author Tobias Nyholm + */ +class Configuration extends BaseConfiguration implements ConfigInterface { /** * @var int @@ -31,34 +35,15 @@ class Configuration implements ConfigInterface */ protected $curlInterface; - /** - * @var HttpClient - */ - private $httpClient; - - /** - * @var RequestFactory - */ - private $requestFactory; - /** * @return Configuration */ public static function create(HttpClient $httpClient = null, RequestFactory $requestFactory = null) { - $config = new self(); - $config->httpClient = $httpClient ?: HttpClientDiscovery::find(); - $config->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find(); - - return $config; - } - - /** - * @return HttpClient - */ - public function getHttpClient() - { - return $this->httpClient; + return new self([ + 'http_client' => $httpClient ?: HttpClientDiscovery::find(), + 'request_factory' => $requestFactory ?: MessageFactoryDiscovery::find(), + ]); } /** @@ -68,18 +53,7 @@ public function getHttpClient() */ public function setHttpClient(HttpClient $httpClient) { - $new = clone $this; - $new->httpClient = $httpClient; - - return $new; - } - - /** - * @return RequestFactory - */ - public function getRequestFactory() - { - return $this->requestFactory; + return $this->setValue('http_client', $httpClient); } /** @@ -89,36 +63,29 @@ public function getRequestFactory() */ public function setRequestFactory(RequestFactory $requestFactory) { - $new = clone $this; - $new->requestFactory = $requestFactory; - - return $new; + return $this->setValue('request_factory', $requestFactory); } /** * @param int $timeout * * @return Configuration - * @deprecated Will be removed in 5.0 + * @deprecated Will be removed in 5.0. The Timeout option will disappear. */ public function withTimeout($timeout) { - $this->timeout = $timeout; - - return $this; + return $this->setValue('timeout', $timeout); } /** * @param string $interface * * @return $this - * @deprecated Will be removed in 5.0 + * @deprecated Will be removed in 5.0. The CurlInterface option will disappear. */ public function withCurlInterface($interface) { - $this->curlInterface = $interface; - - return $this; + return $this->setValue('curl_interface', $interface); } /** @@ -127,15 +94,15 @@ public function withCurlInterface($interface) */ public function getTimeout() { - return $this->timeout; + return $this->getValue('timeout'); } /** * @return string - * @deprecated Will be removed in 5.0 + * @deprecated Will be removed in 5.0. */ public function getCurlInterface() { - return $this->curlInterface; + return $this->getValue('curl_interface'); } } From 3d6cb9fc62341761b781f675fcdc47be7900c362 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 14:40:23 +0100 Subject: [PATCH 208/217] Update doc block --- src/HttpDriver/GraphDatabase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 602fddfc..03626a52 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Connection\Configuration; use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\GraphDatabaseInterface; From 5a99ac1c85168d49c95beb292572f8948274361b Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 14:51:44 +0100 Subject: [PATCH 209/217] Use BaseConfiguratuion on non "HTTP client classes" --- src/ClientBuilder.php | 10 ++++++---- src/Connection/Connection.php | 9 +++++---- src/Connection/ConnectionManager.php | 8 +++++--- src/HttpDriver/Configuration.php | 2 +- src/HttpDriver/Driver.php | 14 ++++++++------ src/HttpDriver/GraphDatabase.php | 6 +++--- src/HttpDriver/Session.php | 3 ++- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 4bf61d24..154947a7 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -11,6 +11,8 @@ namespace GraphAware\Neo4j\Client; +use GraphAware\Common\Connection\BaseConfiguration; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Neo4j\Client\Connection\ConnectionManager; use GraphAware\Neo4j\Client\HttpDriver\Configuration; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -56,13 +58,13 @@ public static function create($config = []) /** * Add a connection to the handled connections. * - * @param string $alias - * @param string $uri - * @param mixed $config + * @param string $alias + * @param string $uri + * @param BaseConfiguration $config * * @return ClientBuilder */ - public function addConnection($alias, $uri, $config = null) + public function addConnection($alias, $uri, ConfigInterface $config = null) { $this->config['connections'][$alias]['uri'] = $uri; if (null !== $config) { diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 1a02acd1..2a2cd193 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -15,6 +15,7 @@ use GraphAware\Bolt\Driver as BoltDriver; use GraphAware\Bolt\Exception\MessageFailureException; use GraphAware\Bolt\GraphDatabase as BoltGraphDB; +use GraphAware\Common\Connection\BaseConfiguration; use GraphAware\Common\Cypher\Statement; use GraphAware\Neo4j\Client\Exception\Neo4jException; use GraphAware\Neo4j\Client\HttpDriver\GraphDatabase as HttpGraphDB; @@ -50,9 +51,9 @@ class Connection /** * Connection constructor. * - * @param string $alias - * @param string $uri - * @param Configuration|null $config + * @param string $alias + * @param string $uri + * @param BaseConfiguration|null $config */ public function __construct($alias, $uri, $config = null) { @@ -170,7 +171,7 @@ private function buildDriver() $uri = sprintf('%s://%s:%d', $params['scheme'], $params['host'], $port); $config = null; if (isset($params['user']) && isset($params['pass'])) { - $config = BoltConfiguration::newInstance()->withCredentials($params['user'], $params['pass']); + $config = BoltConfiguration::create()->withCredentials($params['user'], $params['pass']); } $this->driver = BoltGraphDB::driver($uri, $config); } elseif (preg_match('/http/', $this->uri)) { diff --git a/src/Connection/ConnectionManager.php b/src/Connection/ConnectionManager.php index e794b2c3..08215b6f 100644 --- a/src/Connection/ConnectionManager.php +++ b/src/Connection/ConnectionManager.php @@ -11,6 +11,8 @@ namespace GraphAware\Neo4j\Client\Connection; +use GraphAware\Common\Connection\BaseConfiguration; + class ConnectionManager { /** @@ -24,9 +26,9 @@ class ConnectionManager private $master; /** - * @param string $alias - * @param string $uri - * @param null|Configuration $config + * @param string $alias + * @param string $uri + * @param BaseConfiguration|null $config */ public function registerConnection($alias, $uri, $config = null) { diff --git a/src/HttpDriver/Configuration.php b/src/HttpDriver/Configuration.php index c5f958eb..3890d816 100644 --- a/src/HttpDriver/Configuration.php +++ b/src/HttpDriver/Configuration.php @@ -16,7 +16,7 @@ use Http\Discovery\HttpClientDiscovery; use Http\Discovery\MessageFactoryDiscovery; use Http\Message\RequestFactory; -use GraphAware\Common\Connection\Configuration as BaseConfiguration; +use GraphAware\Common\Connection\BaseConfiguration; /** * @author Tobias Nyholm diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index e3dc6d6d..c1d148fc 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -11,6 +11,8 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Connection\BaseConfiguration; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\DriverInterface; use Http\Adapter\Guzzle6\Client; @@ -32,7 +34,7 @@ class Driver implements DriverInterface * @param string $uri * @param Configuration $config */ - public function __construct($uri, $config = null) + public function __construct($uri, ConfigInterface $config = null) { if (null !== $config && !$config instanceof Configuration) { throw new \RuntimeException(sprintf('Second argument to "%s" must be null or "%s"', __CLASS__, Configuration::class)); @@ -65,16 +67,16 @@ public function getUri() private function getHttpClient() { $options = []; - if (null !== $this->config->getTimeout()) { - $options['timeout'] = $this->config->getTimeout(); + if ($this->config->hasValue('timeout')) { + $options['timeout'] = $this->config->getValue('timeout'); } - if (null !== $this->config->getCurlInterface()) { - $options['curl'][10062] = $this->config->getCurlInterface(); + if ($this->config->hasValue('curl_interface')) { + $options['curl'][10062] = $this->config->getValue('curl_interface'); } if (empty($options)) { - return $this->config->getHttpClient(); + return $this->config->get('http_client'); } // This is to keep BC. Will be removed in 5.0 diff --git a/src/HttpDriver/GraphDatabase.php b/src/HttpDriver/GraphDatabase.php index 03626a52..263d6c1a 100644 --- a/src/HttpDriver/GraphDatabase.php +++ b/src/HttpDriver/GraphDatabase.php @@ -11,15 +11,15 @@ namespace GraphAware\Neo4j\Client\HttpDriver; -use GraphAware\Common\Connection\Configuration; +use GraphAware\Common\Connection\BaseConfiguration; use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\GraphDatabaseInterface; class GraphDatabase implements GraphDatabaseInterface { /** - * @param string $uri - * @param Configuration|null $config + * @param string $uri + * @param BaseConfiguration|null $config * * @return Driver */ diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index 296c3d50..c232e0a3 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\SessionInterface; use GraphAware\Common\Transaction\TransactionInterface; use GraphAware\Neo4j\Client\Exception\Neo4jException; @@ -63,7 +64,7 @@ class Session implements SessionInterface * @param GuzzleClient|HttpClient $httpClient * @param Configuration $config */ - public function __construct($uri, $httpClient, $config) + public function __construct($uri, $httpClient, ConfigInterface $config) { if ($httpClient instanceof GuzzleClient) { @trigger_error('Passing a Guzzle client to Session is deprecrated. Will be removed in 5.0. Use a HTTPlug client'); From 895d49516ebca7622f318b3417ccf16b2c210a78 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 14:53:01 +0100 Subject: [PATCH 210/217] Make sure to require common 3.4 --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 1b893e40..2766bcec 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "php": "^5.6 || ^7.0", "ext-bcmath": "*", "ext-mbstring": "*", + "graphaware/neo4j-common": "^3.4", "graphaware/neo4j-bolt": "^1.5", "symfony/event-dispatcher": "^2.7 || ^3.0", "myclabs/php-enum": "^1.4", From 306f49ae1d28b4e486aa725a46b433b5920e36be Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 15:17:46 +0100 Subject: [PATCH 211/217] Only use BaseConfiguration --- src/HttpDriver/Driver.php | 8 ++++---- src/HttpDriver/Session.php | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index c1d148fc..c61db115 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -31,13 +31,13 @@ class Driver implements DriverInterface protected $config; /** - * @param string $uri - * @param Configuration $config + * @param string $uri + * @param BaseConfiguration $config */ public function __construct($uri, ConfigInterface $config = null) { - if (null !== $config && !$config instanceof Configuration) { - throw new \RuntimeException(sprintf('Second argument to "%s" must be null or "%s"', __CLASS__, Configuration::class)); + if (null !== $config && !$config instanceof BaseConfiguration) { + throw new \RuntimeException(sprintf('Second argument to "%s" must be null or "%s"', __CLASS__, BaseConfiguration::class)); } $this->uri = $uri; diff --git a/src/HttpDriver/Session.php b/src/HttpDriver/Session.php index c232e0a3..9866376d 100644 --- a/src/HttpDriver/Session.php +++ b/src/HttpDriver/Session.php @@ -11,6 +11,7 @@ namespace GraphAware\Neo4j\Client\HttpDriver; +use GraphAware\Common\Connection\BaseConfiguration; use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Driver\SessionInterface; use GraphAware\Common\Transaction\TransactionInterface; @@ -62,7 +63,7 @@ class Session implements SessionInterface /** * @param string $uri * @param GuzzleClient|HttpClient $httpClient - * @param Configuration $config + * @param BaseConfiguration $config */ public function __construct($uri, $httpClient, ConfigInterface $config) { @@ -73,15 +74,15 @@ public function __construct($uri, $httpClient, ConfigInterface $config) throw new \RuntimeException('Second argument to Session::__construct must be an instance of Http\Client\HttpClient.'); } - if (null !== $config && !$config instanceof Configuration) { - throw new \RuntimeException(sprintf('Third argument to "%s" must be null or "%s"', __CLASS__, Configuration::class)); + if (null !== $config && !$config instanceof BaseConfiguration) { + throw new \RuntimeException(sprintf('Third argument to "%s" must be null or "%s"', __CLASS__, BaseConfiguration::class)); } $this->uri = $uri; $this->httpClient = new PluginClient($httpClient, [new ErrorPlugin()]); $this->responseFormatter = new ResponseFormatter(); $this->config = $config; - $this->requestFactory = $config->getRequestFactory(); + $this->requestFactory = $config->getValue('request_factory'); } /** From 967c29aaf9df86480a284ed2e1b6bbcc75f68a7d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 17:18:29 +0100 Subject: [PATCH 212/217] Added minimum-stability:dev --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2766bcec..2818e51f 100644 --- a/composer.json +++ b/composer.json @@ -50,5 +50,6 @@ "psr-4": { "GraphAware\\Neo4j\\Client\\Tests\\": "tests/" } - } + }, + "minimum-stability": "dev" } From 1588d24a0f0009e2c43ef03b1bfef5c4d65fa06e Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 23 Feb 2017 17:41:44 +0100 Subject: [PATCH 213/217] Fixed typo --- src/HttpDriver/Driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HttpDriver/Driver.php b/src/HttpDriver/Driver.php index c61db115..8aa34ba9 100644 --- a/src/HttpDriver/Driver.php +++ b/src/HttpDriver/Driver.php @@ -76,7 +76,7 @@ private function getHttpClient() } if (empty($options)) { - return $this->config->get('http_client'); + return $this->config->getValue('http_client'); } // This is to keep BC. Will be removed in 5.0 From 73f419a3b68658e7e6ea2d0eea8b1065812d0c96 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Feb 2017 09:18:02 +0100 Subject: [PATCH 214/217] Renamed phpunit.xml to phpunit.xml.dist phpunit.xml is reserved to be for the local environment only. --- .gitignore | 1 + phpunit.xml => phpunit.xml.dist | 0 2 files changed, 1 insertion(+) rename phpunit.xml => phpunit.xml.dist (100%) diff --git a/.gitignore b/.gitignore index 446e2677..e931b1eb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ test.php tests/_reports tests/database_settings.yml vendor/ +phpunit.xml diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 100% rename from phpunit.xml rename to phpunit.xml.dist From b0332c725e74304340f85e368cbab994bac60f30 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 27 Feb 2017 02:18:38 +0100 Subject: [PATCH 215/217] dispatch events from a Transaction --- src/Client.php | 2 +- src/Connection/Connection.php | 3 ++- src/Transaction/Transaction.php | 26 ++++++++++++++++--- .../Integration/StatisticsIntegrationTest.php | 16 ++++++++++++ 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/Client.php b/src/Client.php index fe8b50d0..6c4a06a0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -167,7 +167,7 @@ public function transaction($connectionAlias = null) $connection = $this->connectionManager->getConnection($connectionAlias); $driverTransaction = $connection->getTransaction(); - return new Transaction($driverTransaction); + return new Transaction($driverTransaction, $this->eventDispatcher); } /** diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 2a2cd193..5829d8f4 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -110,7 +110,8 @@ public function run($statement, $parameters = null, $tag = null) $parameters = (array) $parameters; try { - return $this->session->run($statement, $parameters, $tag); + $result = $this->session->run($statement, $parameters, $tag); + return $result; } catch (MessageFailureException $e) { $exception = new Neo4jException($e->getMessage()); $exception->setNeo4jStatusCode($e->getStatusCode()); diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index a5ffbe0c..158b176c 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -13,7 +13,12 @@ use GraphAware\Common\Cypher\Statement; use GraphAware\Common\Transaction\TransactionInterface; +use GraphAware\Neo4j\Client\Event\PostRunEvent; +use GraphAware\Neo4j\Client\Event\PreRunEvent; +use GraphAware\Neo4j\Client\Neo4jClientEvents; +use GraphAware\Neo4j\Client\Result\ResultCollection; use GraphAware\Neo4j\Client\StackInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Transaction { @@ -27,12 +32,19 @@ class Transaction */ protected $queue = []; + /** + * @var EventDispatcherInterface + */ + protected $eventDispatcher; + /** * @param TransactionInterface $driverTransaction + * @param EventDispatcherInterface $eventDispatcher */ - public function __construct(TransactionInterface $driverTransaction) + public function __construct(TransactionInterface $driverTransaction, EventDispatcherInterface $eventDispatcher) { $this->driverTransaction = $driverTransaction; + $this->eventDispatcher = $eventDispatcher; } /** @@ -59,8 +71,12 @@ public function run($statement, array $parameters = [], $tag = null) if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'], true)) { $this->driverTransaction->begin(); } + $statement = Statement::create($statement, $parameters, $tag); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$statement])); + $result = $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); - return $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); + return $result; } /** @@ -90,7 +106,11 @@ public function runStack(StackInterface $stack) $sts[] = $statement; } - return $this->driverTransaction->runMultiple($sts); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent($stack->statements())); + $results = $this->driverTransaction->runMultiple($sts); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent($results)); + + return $results; } public function begin() diff --git a/tests/Integration/StatisticsIntegrationTest.php b/tests/Integration/StatisticsIntegrationTest.php index 091db28a..b65884bf 100644 --- a/tests/Integration/StatisticsIntegrationTest.php +++ b/tests/Integration/StatisticsIntegrationTest.php @@ -10,6 +10,7 @@ */ namespace GraphAware\Neo4j\Client\Tests\Integration; +use GraphAware\Common\Result\StatementStatisticsInterface; /** * Class StatisticsIntegrationTest. @@ -52,4 +53,19 @@ public function testRelationshipsDeletedWithHttp() $this->assertEquals(1, $result->summarize()->updateStatistics()->relationshipsDeleted()); } + + /** + * @group bolt-stats + */ + public function testNodesCreatedWithBolt() + { + $this->emptyDb(); + $result = $this->client->run('MATCH (n) RETURN count(n)', [], null, 'bolt'); + $this->assertInstanceOf(StatementStatisticsInterface::class, $result->summarize()->updateStatistics()); + + $tx = $this->client->transaction('bolt'); + $result = $tx->run('MATCH (n) RETURN count(n)'); + $tx->commit(); + $this->assertInstanceOf(StatementStatisticsInterface::class, $result->summarize()->updateStatistics()); + } } From 1eae8975abedb42b63842991b349e3755616f866 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Mon, 27 Feb 2017 02:23:04 +0100 Subject: [PATCH 216/217] fixed variable override --- src/Transaction/Transaction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Transaction/Transaction.php b/src/Transaction/Transaction.php index 158b176c..2e1bdbd8 100644 --- a/src/Transaction/Transaction.php +++ b/src/Transaction/Transaction.php @@ -71,8 +71,8 @@ public function run($statement, array $parameters = [], $tag = null) if (!$this->driverTransaction->isOpen() && !in_array($this->driverTransaction->status(), ['COMMITED', 'ROLLED_BACK'], true)) { $this->driverTransaction->begin(); } - $statement = Statement::create($statement, $parameters, $tag); - $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$statement])); + $stmt = Statement::create($statement, $parameters, $tag); + $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_PRE_RUN, new PreRunEvent([$stmt])); $result = $this->driverTransaction->run(Statement::create($statement, $parameters, $tag)); $this->eventDispatcher->dispatch(Neo4jClientEvents::NEO4J_POST_RUN, new PostRunEvent(ResultCollection::withResult($result))); From 7d2b5cf0b26a2ebb5e136a4449c9dde7578c4340 Mon Sep 17 00:00:00 2001 From: Christophe Willemsen Date: Fri, 24 Mar 2017 13:11:45 +0100 Subject: [PATCH 217/217] added test for issue 105, fix #105 --- tests/Issues/Issue105Test.php | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/Issues/Issue105Test.php diff --git a/tests/Issues/Issue105Test.php b/tests/Issues/Issue105Test.php new file mode 100644 index 00000000..91a2e05d --- /dev/null +++ b/tests/Issues/Issue105Test.php @@ -0,0 +1,44 @@ +emptyDb(); + $stack = $this->client->stack(); + $stack->push('CREATE (n:Node {id:1})'); + $stack->push('MATCH (n:Node {id: 1}) CREATE (n2:Node {id: 2}) MERGE (n)-[r:RELATES]->(n2) RETURN id(r)'); + $results = $this->client->runStack($stack); + + $this->assertCount(2, $results); + $relId = $results->results()[1]->firstRecord()->get('id(r)'); + $this->assertNotNull($relId); + } + + public function testMatchNodeFromDbInAStack() + { + $this->emptyDb(); + // Create Region node + $this->client->run('CREATE (n:Region {name: "Picardie"})'); + + // Create stack, create department in first push, match department and region and relates them in second push + $stack = $this->client->stack(); + $stack->push('CREATE (d:Department {name:"Somme"})'); + $stack->push('MATCH (d:Department {name:"Somme"}), (r:Region {name:"Picardie"}) MERGE (d)-[:IN_REGION]->(r)'); + $this->client->runStack($stack); + + // Assert that the relationship is in the graph after stack execution + + $result = $this->client->run('MATCH (n:Department {name:"Somme"})-[r:IN_REGION]->(re:Region {name:"Picardie"}) RETURN n, r, re'); + $this->assertEquals(1, $result->size()); + $this->assertEquals('Picardie', $result->firstRecord()->nodeValue('re')->value('name')); + } +} \ No newline at end of file