Skip to content

[EXPERIMENTAL - DO NOT USE] A Neo4J Cypher Query Language Syntactic Sugar

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

neo4j-rstats/cyphersugar

Repository files navigation

lifecycle

Disclaimer: this repo is just a Proof of Concept and should not be used.

cyphersugar

{cyphersugar} is intended to bring syntactic sugar to Neo4J cypher langugage, so you can write cypher queries in a more natural way if you come from R.

Convention

Every cypher function is in uppercase (MATCH, RETURN, LIMIT…). The wrappers are in lower case (node, to, from…)

Example

library(cyphersugar)
MATCH() %>%
  node(n = "Person", labels = c(name = "Colin")) %>%
  to(k = "KNOWS") %>%
  node("Person") %>%
  RETURN(person = "n", knows = "k") %>%
  LIMIT(25)
#> MATCH (n:Person {name : 'Colin'}) -[k:KNOWS]-> (:Person) RETURN n, k LIMIT 25

The end idea is, of course, to be able to use it with neo4r, or other Neo4J R Drivers.

library(neo4r)
con <- neo4j_api$new(url = "http://localhost:7474", 
                     user = "neo4j", password = "neo4j")
con$ping()

MATCH() %>%
  node('n') %>%
  RETURN(node = "n") %>%
  LIMIT(25) %>%
  call_api(con)

Examples

CREATE(node(adam = "User", labels = c(name = "Adam")), 
       node(pernilla = "User", labels = c(name = "pernilla")), 
       node(david = "User", labels = c(name = "david")))
#> CREATE  (adam:User {name : 'Adam'}),  (pernilla:User {name : 'pernilla'}),  (david:User {name : 'david'})
MATCH() %>%
  node(r = "record") %>%
  to("WAS_RECORDED") %>% 
  node(b = "Band") %>% 
  RETURN("r AS band")
#> MATCH (r:record) -[:WAS_RECORDED]-> (b:Band) RETURN r AS band

About

[EXPERIMENTAL - DO NOT USE] A Neo4J Cypher Query Language Syntactic Sugar

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages