Since version 2.1 Neo4j provides out-of-the box support for CSV ingestion. The LOAD CSV command that was added to the Cypher Query language is a versatile and powerful ETL tool. It allows you to ingest CSV data from any URL into a friendly parameter stream for your simple or complex graph update operation, that … conversion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# english output for tools | |
export JAVA_TOOL_OPTIONS=-Duser.language=en | |
# sdkman | |
sdk list | |
sdk list java | |
#sdk install java 20-open | |
sdk use java 20-open | |
java -version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create constraint user_key if not exists for (u:User) require (u.key) is unique; | |
// add nodes | |
call apoc.load.json("https://bsky.jazco.dev/exported_graph_minified.json","$.nodes") | |
yield value as nv | |
call { with nv | |
merge (n:User {key:nv.key}) | |
on create set n += apoc.map.clean(nv.attributes,["key"],[]) | |
} in transactions of 10000 rows; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sdk install java 20-open | |
// java -version | |
/* | |
openjdk version "20" 2023-03-21 | |
OpenJDK Runtime Environment (build 20+36-2344) | |
OpenJDK 64-Bit Server VM (build 20+36-2344, mixed mode, sharing) | |
*/ | |
// jshell --enable-preview --add-exports java.base/jdk.internal.vm=ALL-UNNAMED --add-modules=jdk.incubator.concurrent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Tag { | |
name: String! | |
questions: [Question] @relation(name: "TAGGED", direction: "IN") | |
} | |
type Answer { | |
createdAt: DateTime | |
downVotes: Int | |
id: Int! | |
link: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load initial package, adjust your name and version | |
with "org.neo4j:neo4j-kernel" as name, '4.2.6' as version | |
call apoc.load.json("https://deps.dev/_/s/maven/p/"+name+"/v/"+version+"/dependencies") yield value | |
where value.package.system = 'MAVEN' | |
merge (p:Package:Maven {name:value.package.name, version:value.version}) | |
with * | |
unwind value.dependencies as dep | |
with p, dep where dep.package.system = 'MAVEN' | |
merge (d:Package:Maven {name:dep.package.name, version:dep.version}) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"laureates": [ | |
{ | |
"id": "745", | |
"knownName": { | |
"en": "A. Michael Spence", | |
"se": "A. Michael Spence" | |
}, | |
"givenName": { | |
"en": "A. Michael", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with split($input, "\n\n") as elves | |
unwind elves as elf | |
return reduce(s=0, c in split(elf,"\n") | s + toInteger(c)) as total | |
order by total desc limit 1; | |
with split($input, "\n\n") as elves | |
unwind elves as elf | |
with reduce(s=0, c in split(elf,"\n") | s + toInteger(c)) as total | |
order by total desc limit 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17 | |
//DEPS org.neo4j:neo4j:5.2.0 | |
import static java.lang.System.*; | |
import org.neo4j.dbms.api.*; | |
import org.neo4j.graphdb.*; | |
import java.nio.file.Path; | |
import java.util.Map; |