Posts

Showing posts with the label neo4j

Unparseable date: “NULL” with APOC.DATE.PARSE

Unparseable date: “NULL” with APOC.DATE.PARSE I am using apoc to calculate difference between two dates. It works when I supply value for N.ID in the MATCH clause. But it fails when I remove N.ID because I am trying to process the code for a bunch of IDs not a single one. apoc N.ID MATCH N.ID MATCH (N:PERSON)-[M:PLACED]-(K:ORDER) WHERE K.ORDER_CODE="A23" and N.ID=2511217 WITH N ,max(apoc.date.parse(SUBSTRING(M.ORDER_DATE,0,8),'d',"yyyymmdd")) AS initialTime, apoc.date.parse(SUBSTRING(N.charge_DATE,0,8),'d',"yyyymmdd") AS finalTime RETURN N.ID, finalTime - initialTime as difference ; N.ID difference 2511217 4 N.ID However, when N.ID is removed, I get: N.ID MATCH (N:PERSON)-[M:PLACED]-(K:ORDER) WHERE K.ORDER_CODE="A23" WITH N ,max(apoc.date.parse(SUBSTRING(M.ORDER_DATE,0,8),'d',"yyyymmdd")) AS initialTime, apoc.date.parse(SUBSTRING(N.charge_DATE,0,8),'d',"yyyymmdd") AS finalTime...

Grouping nodes of the same label by parameter

Grouping nodes of the same label by parameter I'm new to graph databases, so apologies if I get some of the correct terminology wrong. I'm using Neo4j and have a dataset made up of - mostly - one kind of node. These nodes have a variety of parameters and relationships between each other and the other labeled nodes in the graph. To give a simple example of what I'm trying to achieve, let's assume I have a label of "Person". Each Person has a parameter named "gender", which will have a value of "male" or "female". What's the best practice if I want to run a query that will return all males in one variable, and all females in the other? Should they be separate labels? That seems like a bad idea given the parameters on each are identical. 2 Answers 2 Since the neo4j DB maintains label count statistics, using Male and Female labels will get yo...

How to show graph of nodes/relationships in Neo4j Browser

How to show graph of nodes/relationships in Neo4j Browser Basic question: I've figured out how to use the Neo4j Desktop/Browser to run some of the sample graphGists code. However, I can't figure out how to see the database graphcically (circles for nodes, lines for connections) within the Browser. Is this even possible to do? If so, tips much appreciated. I'm using a Linux laptop. Thanks! Kurt You need to issue a query that returns nodes and relationships, or paths. You might want to take a look at the Movies graph for examples (use :play movies ) in the browser – InverseFalcon Jun 25 at 4:33 :play movies 2 Answers 2 By default there is a web browser if you go to port 7474 of your server IP or http://localhost:7474 in case of default installa...