https://github.com/neo4j-examples/sql2cypher-api
A PoC how to use the SQL To Cypher Translator of Neo4j-JDBC as a Web API
https://github.com/neo4j-examples/sql2cypher-api
neo4j sql2cypher
Last synced: 6 months ago
JSON representation
A PoC how to use the SQL To Cypher Translator of Neo4j-JDBC as a Web API
- Host: GitHub
- URL: https://github.com/neo4j-examples/sql2cypher-api
- Owner: neo4j-examples
- License: apache-2.0
- Created: 2025-05-22T19:12:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-05-22T20:25:02.000Z (7 months ago)
- Last Synced: 2025-06-09T18:51:44.880Z (6 months ago)
- Topics: neo4j, sql2cypher
- Language: Java
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.adoc
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# neo4j-jdbc-sql2cypher-api
This project is a proof of concept how to use the default translator of the [Neo4j JDBC Driver](https://github.com/neo4j/neo4j-jdbc) to translate SQL to Cypher.
Here are two possible example requests:
```
POST 127.0.0.1:8080/translate
Content-Type: text/plain
SELECT p, m FROM Person p
JOIN Movie m USING (ACTED_IN)
```
Or you can use a JSON body like this
```
POST 127.0.0.1:8080/translate
Content-Type: application/json
{
"sql": "SELECT name, born FROM People"
}
```
The application is not connected to a database, hence it has not any knowledge of a Neo4j database schema.
When used with the full JDBC driver, translation is more accurate and has additional features, please read more on our official documentation [SQL to Cypher translation](https://neo4j.com/docs/jdbc-manual/current/sql2cypher/).
## Requirements
Java 21+
## Running the application
```bash
./mvnw spring-boot:run
```
## Packaging the application
### As Java package
```bash
./mvnw clean verify
```
Run with
```bash
java -jar target/sql2cypher-api.jar
```
### As native image
GraalVM 21+ is required
```bash
./mvnw native:compile -Pnative
```
Run with
```
./target/sql2cypher-api
```
More information in the [`HELP.md`](HELP.md).