Guest User

Untitled

a guest
Jan 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. MATCH (u:User {uid: $userId})
  2. WITH u UNWIND $statements as statement
  3. WITH u, statement
  4. UNWIND statement.conceptsRelations as conceptsRelation
  5. MATCH (c_from:Concept{name: conceptsRelation.from})
  6. MATCH (c_to:Concept{name: conceptsRelation.to})
  7. CREATE (c_from)-[:TO {context:conceptsRelation.context,statement:conceptsRelation.statement,user:u.uid,timestamp:conceptsRelation.timestamp, uid:apoc.create.uuid(), gapscan:conceptsRelation.gapscan, weight: conceptsRelation.weight}]->(c_to)
  8. WITH u, statement
  9. UNWIND statement.mentionsRelations as mentionsRelation
  10. MATCH (m_from:Concept{name: mentionsRelation.from})
  11. MATCH (m_to:Concept{name: mentionsRelation.to}) return m_from, m_to
  12.  
  13. MATCH (u:User {uid: $userId})
  14. WITH u UNWIND $statements as statement
  15. WITH u, statement
  16. UNWIND statement.mentionsRelations as mentionsRelation
  17. MATCH (m_from:Concept{name: mentionsRelation.from})
  18. MATCH (m_to:Concept{name: mentionsRelation.to}) return m_from, m_to
Add Comment
Please, Sign In to add comment