Neo4j: Unterschied zwischen den Versionen

Aus Claimbase (Testinstanz)
Zur Navigation springen Zur Suche springen
Tinghui Duan (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Tinghui Duan (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
<code>
import data in json format
 
   CALL apoc.load.json("file:///locations.json") YIELD value
   CALL apoc.load.json("file:///locations.json") YIELD value
    
    
Zeile 11: Zeile 12:
   MERGE (r:Regest {id: regestId})
   MERGE (r:Regest {id: regestId})
   MERGE (l)-[:MENTIONED_IN]->(r);
   MERGE (l)-[:MENTIONED_IN]->(r);
</code>

Version vom 11. Juni 2025, 17:44 Uhr

import data in json format

 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);