MCPcopy Create free account
hub / github.com/ICIJ/offshoreleaks-data-packages / Example

Class Example

code/java/Example.java:10–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import static org.neo4j.driver.Values.parameters;
9
10public class Example {
11
12 public static void main(String...args) {
13
14 Driver driver = GraphDatabase.driver("bolt://<HOST>:<BOLTPORT>",
15 AuthTokens.basic("<USERNAME>","<PASSWORD>"));
16
17 try (Session session = driver.session(SessionConfig.forDatabase("neo4j"))) {
18
19 String cypherQuery =
20 "MATCH (a:Officer {name:$name})-[r:officer_of|intermediary_of|registered_address*..10]-(b)\n" +
21 "RETURN b.name as name LIMIT 20";
22
23 var result = session.readTransaction(
24 tx -> tx.run(cypherQuery,
25 parameters("name","Ross, Jr. - Wilbur Louis"))
26 .list());
27
28 for (Record record : result) {
29 System.out.println(record.get("name").asString());
30 }
31 }
32 driver.close();
33 }
34}
35
36

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected