1
- # Neo4jQueryAPI client
1
+ # Neo4j Query API client
2
2
3
3
## Interact programmatically with Top Graph Technology
4
4
5
- - Easy configuration to pick and choose drivers
6
- - An intuitive API for smooth query execution
7
- - Extensibility for custom use cases
5
+ - Easy to start with, just build your client in one line and start running queries
6
+ - Use an intuitive API for smooth query execution
8
7
- Built and tested under close collaboration with the official Neo4j driver team
9
- - Easier to start with, just need a client to any neo4j instance
10
8
- Fully typed with Psalm and CS fixed for code quality
11
- - It does not supports Bolt, Rather compatible with HTTP, and auto-routed drivers
12
-
9
+ - Uses HTTP under the hood instead of bolt
10
+ - Small, lightweight, well maintained and fully tested codebase
13
11
14
12
15
13
## Installation
16
14
17
15
You can install the package via Composer:
18
16
19
17
``` sh
20
- composer require this-repo/neo4j-client
18
+ composer require neo4j-php/query-api
21
19
```
22
20
21
+ ## Client Installation
22
+
23
+ If you plan on using the HTTP drivers, make sure you have psr-7, psr-17, and psr-18 implementations included in your project.
24
+ If you don't have any, you can install them via Composer:
25
+
26
+ ``` sh
27
+ composer require psr/http-message psr/http-factory psr/http-client
28
+ ```
29
+
30
+ > ** _ NOTE:_ ** PSR-17 and PSR-18 are essential for HTTP client communication. Other compatible clients like Guzzle can also be used.
31
+ > \* [ PSR auto-discovery] ( https://docs.php-http.org/en/latest/discovery.html ) will detect the installed HTTP client automatically.
32
+
23
33
## Usage
24
34
25
35
### Connecting to Neo4j
26
36
27
37
28
38
``` php
29
39
use Neo4j\QueryAPI\Neo4jQueryAPI;
30
- use Neo4j\QueryAPI\Authentication\AuthenticateInterface ;
40
+ use Neo4j\QueryAPI\Objects\Authentication ;
31
41
32
- $client = Neo4jQueryAPI::login('http://localhost:7474', new AuthenticateInterface ('username', 'password'));
42
+ $client = Neo4jQueryAPI::login('http://localhost:7474', Authentication::basic ('username', 'password'));
33
43
```
34
44
35
45
### Running a Query
@@ -90,29 +100,34 @@ Cypher values and types map to these php types and classes:
90
100
| Null | ``` * null ``` |
91
101
| String | ``` * string ``` |
92
102
| Array | ``` * array ``` |
93
- | Local DateTime | |
94
- | Local Time | |
95
- | Zoned DateTime | |
96
- | Zoned Time | |
103
+ | Local DateTime | ``` * string ``` (will be upgraded in version 1.1) |
104
+ | Local Time | ``` * string ``` (will be upgraded in version 1.1) |
105
+ | Zoned DateTime | ``` * string ``` (will be upgraded in version 1.1) |
106
+ | Zoned Time | ``` * string ``` (will be upgraded in version 1.1) |
97
107
| Duration | ``` * string ``` (will be upgraded in version 1.1) |
98
- | WGS 84 2D Point | ``` * string ``` (will be upgraded in version 1.1) |
99
- | WGS 84 3D Point | ``` * string ``` (will be upgraded in version 1.1) |
100
- | Cartesian 2D Point | ``` * string ``` (will be upgraded in version 1.1) |
101
- | Cartesian 3D Point | ``` * string ``` (will be upgraded in version 1.1) |
102
- | Map | ``` * string ``` |
108
+ | WGS 84 2D Point | ` Neo4j\QueryAPI\Objects\Point ` |
109
+ | WGS 84 3D Point | ` Neo4j\QueryAPI\Objects\Point ` |
110
+ | Cartesian 2D Point | ` Neo4j\QueryAPI\Objects\Point ` |
111
+ | Cartesian 3D Point | ` Neo4j\QueryAPI\Objects\Point ` |
112
+ | Map | ``` * array ``` |
113
+ | Node | ``` Neo4j\QueryAPI\Objects\Node ``` |
114
+ | Relationship | ``` Neo4j\QueryAPI\Objects\Relationship ``` |
115
+ | Path | ``` Neo4j\QueryAPI\Objects\Relationship ``` |
103
116
104
117
## Diving deeper:
105
118
106
- | Feature | Supported? |
107
- | ----------| :-------------:|
108
- | Authentication | Yes |
109
- | Transaction | Yes |
110
- | HTTP | Yes |
111
- | Cluster | Yes |
112
- | Aura | Partly (recent versions) |
113
- | Bookmarks | Yes |
119
+ | Feature | Supported? |
120
+ | ----------| :----------:|
121
+ | Authentication | Yes |
122
+ | Transaction | Yes |
123
+ | HTTP | Yes |
124
+ | Cluster | Partly* |
125
+ | Aura | Yes |
126
+ | Bookmarks | Yes |
127
+ | Bolt | No |
114
128
115
- > ** _ NOTE:_ ** It supports neo4j databases versions > 5.25 (which has QueryAPI enabled.)
129
+ > ** _ NOTE:_ ** It supports neo4j databases versions > 5.25 or Neo4j Aura (which has QueryAPI enabled.)
130
+ > \* Client side routing is only supported in the Neo4j driver
116
131
117
132
118
133
@@ -127,7 +142,7 @@ If you discover any security-related issues, please email *
[email protected] *
127
142
## Credits
128
143
129
144
- Created with ❤️ by Nagels
130
- - [ All Contributors ] ( https://github. com/your-repo/neo4j-client/graphs/contributors )
145
+ - [ Ghlen Nagels ] ( https://www.linkedin. com/in/ghlen/ ) , [ Kiran Chandani ] ( https://www.linkedin.com/in/kiran-chandani-5628a1213/ ) , [ Pratiksha Zalte ] ( )
131
146
132
147
## License
133
148
0 commit comments