{"id":10286,"date":"2023-06-18T19:52:10","date_gmt":"2023-06-19T00:52:10","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=10286"},"modified":"2023-08-28T10:36:58","modified_gmt":"2023-08-28T15:36:58","slug":"debugging-a-cypher-query","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=10286","title":{"rendered":"NEO4J: Debugging a Cypher Query"},"content":{"rendered":"<p>It is somewhat ironic that I continue to use print statements as my debugging tool of choice when programming but spent a decent bit of time trying to find a cypher query debugger. Just use a print statement &#8212; or, in this case, <em>return<\/em>.<\/p>\n<p>When my query returned an error indicating that the variable isn&#8217;t defined even though I copy\/pasted the variable name from whence I defined it:<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10287\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0.png\" alt=\"\" width=\"1395\" height=\"329\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0.png 1395w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0-300x71.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0-1024x242.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0-768x181.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_0-750x177.png 750w\" sizes=\"auto, (max-width: 1395px) 100vw, 1395px\" \/><\/a><\/p>\n<p>I could just omit the component of the query with the error and try returning this variable<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10288\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1.png\" alt=\"\" width=\"1423\" height=\"738\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1.png 1423w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1-300x156.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1-1024x531.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1-768x398.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_1-750x389.png 750w\" sizes=\"auto, (max-width: 1423px) 100vw, 1423px\" \/><\/a><\/p>\n<p>And performing operations on null values may not get me anywhere. Adding a replacement command to drop the commas produces integer values:<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10289\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_2.png\" alt=\"\" width=\"722\" height=\"612\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_2.png 722w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2023\/08\/cypher_debug_2-300x254.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is somewhat ironic that I continue to use print statements as my debugging tool of choice when programming but spent a decent bit of time trying to find a cypher query debugger. Just use a print statement &#8212; or, in this case, return. When my query returned an error indicating that the variable isn&#8217;t &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1896],"tags":[1902,1905,1897],"class_list":["post-10286","post","type-post","status-publish","format-standard","hentry","category-neo4j","tag-cypher","tag-debuggin-cypher-queries","tag-neo4j"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10286"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10286\/revisions"}],"predecessor-version":[{"id":10296,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10286\/revisions\/10296"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}