0
votes

I am creating a node using the particular query :-

create (n:HMP_QUERY_NODE{attributeTypes: '"attrMap":{}',dependentId:85,isSingle:false, nodeCategory: "MDFConcept", queryDesc:" MATCH(mdf:MDFConcept)-[:_properties]->(auditnode)-->(spoke) where spoke.identifier='MDF.Alternate' AND spoke.status ='Confirmed' AND spoke.start_date <= timestamp() <= spoke.end_date with distinct mdf OPTIONAL MATCH (mdf)<-[r]-() where NOT(type(r) IN ['ConceptHasChild','hasInstance']) AND r.status = 'Confirmed' AND r.start_date <= timestamp() <= r.end_date with mdf,count(r) as relCount where relCount=0 return mdf.elementLabel, mdf._type, relCount", queryId:123,queryLabel:" MDF – AlternateNodes Without Relationship",queryName:" MDF - General Reports ", queryOptionId:1 ,queryOptions:"" ,status:"D"}) RETURN n

I am able to create the query but still its giving error in UI. Error In Neo4j Server

Next, I tried to get this particular node through this query :

MATCH (node:HMP_QUERY_NODE) WHERE node.status = 'D' AND node.queryName = 'MDF - General Reports' RETURN node.queryLabel,node.dependentId,node.queryId

The result I m getting should have the current node I created from the above query but its not there.

Match stmt resultset

Now, I am unable to understand whats the issue. I tried getting the node with other variables also but still no gain.

Neo4j Browser version: 3.0.11

1

1 Answers

1
votes

You put spaces in your create query: queryName:" MDF - General Reports ". I would recommend to use the function: trim() in your cypher and you will see the result.

MATCH (node:HMP_QUERY_NODE) WHERE node.status = 'D' AND trim(node.queryName) = 'MDF - General Reports' RETURN node.queryLabel,node.dependentId,node.queryId

Result:

╒════════════════════════════════════════════╤══════════════════╤══════════════╤═════════════════════════╕
│"node.queryLabel"                           │"node.dependentId"│"node.queryId"│"node.queryName"         │
╞════════════════════════════════════════════╪══════════════════╪══════════════╪═════════════════════════╡
│" MDF – AlternateNodes Without Relationship"│85                │123           │" MDF - General Reports "│
└────────────────────────────────────────────┴──────────────────┴──────────────┴─────────────────────────┘