How do I programmatically validate a cypher query in Neo4j?

Tags: java neo4j cypher
Question!

Is there any way to use the Java API to validate a Neo4J Cypher query programmatically?

By : darkfrog


Answers

Based upon this thread, the compilation of cypher is handled by scala:

http://grokbase.com/t/gg/neo4j/14amay53ch/cypher-grammar-file

The link on that thread is out of date, so heres the latest on github:

https://github.com/neo4j/neo4j/blob/3.1/community/cypher/cypher-compiler-3.1/src/main/scala/org/neo4j/cypher/internal/compiler/v3_1/CypherCompiler.scala

Beyond that you're on your own - @stdob comment about using EXPLAIN is still your best bet in my opinion (and should be submitted as an answer)



$(this) is JQuery context, and you are inside javascript function. You can change the click button to JQuery to use it:

var test; 
$("button").click(function(){
    test = $(this).attr('id');
    console.log(test);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button id="btnTeste">
  Teste
  </button>



If I am reading this correctly, Message would contain a List<MessageUser>.

If that's the case then this should get you close:

var List<Message> messages = 
    ( from m 
      in db.Messages 
      where 
          m.UserID == userid || m.MessageUsers.Any(mu => mu.UserID == userID) 
      select m).ToList();
By : Sam Axe


This video can help you solving your question :)
By: admin