Neo4j: Unterschied zwischen den Versionen

Aus Claimbase (Testinstanz)
Zur Navigation springen Zur Suche springen
Tinghui Duan (Diskussion | Beiträge)
Die Seite wurde neu angelegt: „<poem> CALL apoc.load.json("file:///locations.json") YIELD value MERGE (l:Location {id: value.id}) SET l.name = value.name WITH l, value UNWIND value.lemmaID AS regestId MERGE (r:Regest {id: regestId}) MERGE (l)-[:MENTIONED_IN]->(r); </poem>“
 
Tinghui Duan (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
<poem>
<code>
   CALL apoc.load.json("file:///locations.json") YIELD value
   CALL apoc.load.json("file:///locations.json") YIELD value
 
  // Create the Location node
   MERGE (l:Location {id: value.id})
   MERGE (l:Location {id: value.id})
     SET l.name = value.name
     SET l.name = value.name
 
  // Create Regest nodes and relationships
   WITH l, value
   WITH l, value
   UNWIND value.lemmaID AS regestId
   UNWIND value.lemmaID AS regestId
   MERGE (r:Regest {id: regestId})
   MERGE (r:Regest {id: regestId})
   MERGE (l)-[:MENTIONED_IN]->(r);
   MERGE (l)-[:MENTIONED_IN]->(r);
</poem>
</code>

Version vom 11. Juni 2025, 17:42 Uhr

 CALL apoc.load.json("file:///locations.json") YIELD value
 
 // Create the Location node
 MERGE (l:Location {id: value.id})
   SET l.name = value.name
 
 // Create Regest nodes and relationships
 WITH l, value
 UNWIND value.lemmaID AS regestId
 MERGE (r:Regest {id: regestId})
 MERGE (l)-[:MENTIONED_IN]->(r);