Skip to content

neo4j-examples/sql2cypher-api

Repository files navigation

neo4j-jdbc-sql2cypher-api

This project is a proof of concept how to use the default translator of the Neo4j JDBC Driver 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.

Requirements

Java 21+

Running the application

./mvnw spring-boot:run

Packaging the application

As Java package

./mvnw clean verify

Run with

java -jar target/sql2cypher-api.jar 

As native image

GraalVM 21+ is required

./mvnw native:compile -Pnative

Run with

./target/sql2cypher-api

More information in the HELP.md.

About

A PoC how to use the SQL To Cypher Translator of Neo4j-JDBC as a Web API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages