SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top