cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Basic Neo4J Match query

I am trying to use the POLE dataset and list a few things but I am struggling to graph the outputs that I want and im just a bit confused on the documention.

I want to list all the crimes committed at "27 Maiden Close" as well as the Crimes listed at piccadilly and the count of those crimes.

4 REPLIES 4

I am not familiar with that dataset, but the structure of the query will look similar to the following. You can adapt to the specific data model. You will not be able list the crimes, as well as count them, as the count function needs to group over a collection of rows. You can collect the results in a list so you can get the total too. Assuming there is a ‘Crime’ node with a ‘location’ attribute, the following should work:

match(n:Crime)
where n.location = "27 Maiden Close” or n.location = “piccadilly”
return collect(n) as crimes, count(*) as cnt

ameyasoft
Graph Maven

Please send the link for your dataset download, so that I can answer your question correctly. Thanks

Hello Mr Genrleman

Is it a real dataset or a dummy dataset (for testing purposes only). And if it is a real dataset please use Data Anonymiser to avoid confusion for the Tester.So that he or she can use standard testing best practises.

Many thanks
Mr Sameer Sudhir G

Hope you know the meaning of POLE.