Skip to content

Microservice exposing various features for working with Cypher

License

Notifications You must be signed in to change notification settings

graphaware/cypher-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cypher Tools

Experimental project exposing cypher tooling features as a rest service.

Docker image

The docker image is available as graphaware/cypher-tools:<tag>.

Ex :

docker run --rm -it --name cypher-tools-1 -p 8080:8080 graphaware/cypher-tools:1.0.0

Schema enforcement

LLM based Cypher query generation can lead to relationships being in the wrong direction, the following endpoint allows you to fix the directions of a query based on a provided list of schema relationships.

Example :

Generated query :

MATCH (n:Person)-[:OWNED_BY]->(v:Vehicle)
RETURN n.name, v.model

However, the database schema has the relationship between the vehicle and the person instead (Vehicle)-[:OWNED_BY]->(Person)

Fix it by calling the cypher endpoint

curl --location 'http://localhost:8080/enforceSchema' \
--header 'Content-Type: application/json' \
--data '{"cypher": "MATCH (n:Person)-[:OWNED_BY]->(v:Vehicle) RETURN n.name, v.model", "relationships": ["(Person, LIVES_IN, City)","(Person, HAS_ACCOUNT, UserAccount)","(Vehicle, LICENCED_TO, LicensePlate)","(Vehicle, OWNED_BY, Person)"]}'

Response :

{
    "cypher": "MATCH (n:`Person`)<-[:`OWNED_BY`]-(v:`Vehicle`)\nRETURN n.name, v.model"
}

About

Microservice exposing various features for working with Cypher

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published