Neo4j

Aus Claimbase (Testinstanz)
Zur Navigation springen Zur Suche springen

run neo4j

docker run \
  --name neo4j \
  -p 7474:7474 -p 7687:7687 \
  -v $HOME/neo4j/data:/data \
  -v $HOME/neo4j/import:/import \
  -e NEO4J_AUTH=neo4j/password \
  -e NEO4JLABS_PLUGINS='["apoc", "graph-data-science"]' \
  -e NEO4J_dbms_security_procedures_unrestricted=gds.*,apoc.* \
  -e NEO4J_apoc_import_file_enabled=true \
  -e NEO4J_apoc_import_file_use__neo4j__config=true \
  neo4j:latest

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