[英]Issue in Match Cypher Query
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
创建(n:HMP_QUERY_NODE {attributeTypes:'“ attrMap”:{}',dependentId:85,isSingle:false,nodeCategory:“ MDFConcept”,queryDesc:“ MATCH(mdf:MDFConcept)-[:_ properties]->(auditnode) ->(辐条)其中辐条.identifier ='MDF.Alternate'和辐条。状态='已确认'和辐条.start_date <= timestamp()<=辐条。结束日期,具有不同的mdf可选匹配(mdf)<-[r ]-()其中,NOT(type(r)IN ['ConceptHasChild','hasInstance'])AND r.status ='Confirmed'AND r.start_date <= timestamp()<= r.end_date with mdf,count(r )作为relCount,其中relCount = 0返回mdf.elementLabel,mdf._type,relCount“,queryId:123,queryLabel:” MDF –无关系的AlternateNodes“,queryName:” MDF-常规报告“,queryOptionId:1,queryOptions:”“ ,status:“ D”})返回n
I am able to create the query but still its giving error in UI. 我能够创建查询,但仍然在UI中给出错误。
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
匹配(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. 我得到的结果应该具有我从上述查询创建的当前节点,但不存在。
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 Neo4j浏览器版本:3.0.11
You put spaces in your create query: queryName:" MDF - General Reports ". 您在创建查询中放置空格:queryName:“ MDF-General Reports”。 I would recommend to use the function: trim() in your cypher and you will see the result.
我建议在您的密码中使用函数:trim(),您将看到结果。
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 "│
└────────────────────────────────────────────┴──────────────────┴──────────────┴─────────────────────────┘
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.