Notes for "Cypher"

Posted by Andrew Sun on February 27, 2019 · 151 1 min read

Query node by label and attribution

    # return note which label is '中药'; id is 'md4233'
    MATCH (n:`中药`) where n.id='md4233' RETURN n 

Query node by relationship

  • Return relationshio type
      MATCH (n:中药)-[r]->(m) RETURN r,type(r); 
      """ return r's type 
      ╒════════════╤═════════╕
      │"r"         │"type(r)"│
      ╞════════════╪═════════╡
      │{"weight":1}│"子概念"  │
      ├────────────┼─────────┤
      │{"weight":1}│"子概念"  │
      ├────────────┼─────────┤
      """
    
  • Query node by relationship type
      # return notes which are the start nodes of relationship '子概念'
      MATCH (n)-[r:子概念]->(m) RETURN n;