Skip to content

Commit 947f502

Browse files
committed
Upgrade code to Neo4j 5
Upgrade to Neo4j 5
1 parent ffd5bd0 commit 947f502

23 files changed

+806
-446
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
.DS_Store
3+
src/.DS_Store
4+
src/main/.DS_Store
5+
src/main/java/.DS_Store
6+
src/main/java/com/.DS_Store
7+
src/main/resources/.DS_Store

README.md

100644100755
Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Neo4jH3
2-
3-
Usage of Uber H3 with Neo4j
4-
This project requires Neo4j 3.5.x or higher
1+
# Neo4j H3 Library
2+
This library provides a set of H3 functions and procedures for Neo4j 5
3+
H3 is a hexagonal hierarchical geospatial indexing system (https://h3geo.org)
4+
This library uses the H3 api which can be found at https://h3geo.org/docs/api/indexing
55

66
Instructions
77
------------
@@ -11,16 +11,39 @@ project, simply package the project with maven:
1111

1212
mvn clean package
1313

14-
This will produce a jar-file, `target/uberh3-0.1-SNAPSHOT.jar`,
14+
This will produce a jar-file, `neo4jh3-0.5.0-SNAPSHOT.jar `,
1515
that can be copied to the `plugin` directory of your Neo4j instance.
1616

17-
cp target/uberh3-0.1-SNAPSHOT.jar neo4j-enterprise-3.5.2/plugins/.
18-
19-
Restart your Neo4j Server. Several new stored procedures are available:
17+
cp target/neo4jh3-0.9.1-SNAPSHOT.jar neo4j-enterprise-5.x.0/plugins/.
18+
2019

20+
Edit your Neo4j/conf/neo4j.conf file by adding this line:
2121

22-
CALL com.dfauth.h3.returnHexAddress(38.439779, -77.410522,"9");
23-
CALL com.dfauth.h3.polygonSearch
24-
CALL com.dfauth.h3.lineBetweenLocations(38.418582, -77.385268,38.500603, -77.444288);
25-
26-
More examples can be found at: http://www.intelliwareness.org/2019/02/neo4j-uber-h3-geospatial/
22+
dbms.security.procedures.unrestricted=apoc.*,gds.*,com.neo4jh3.*
23+
dbms.security.procedures.allowlist=apoc.*,gds.*,com.neo4jh3.*
24+
25+
26+
(Re)start Neo4j
27+
28+
# Functions
29+
com.neo4jh3.uber.h3HexAddress(Double Lat, Double Long, Long Resolution) returns hexAddress;
30+
com.neo4jh3.uber.h3HexAddressNumber(Double Lat, Double Long, Long Resolution) returns Long;
31+
com.neo4jh3.uber.h3RingsForDistance(Double Resolution, Double Distance in KM) returns Long;
32+
com.neo4jh3.gridDistance(String hexAddress, String hexAddress) returns int;
33+
com.neo4jh3.gridDistanceNumber(Long hexAddress, Long hexAddress) returns int;
34+
com.neo4jh3.cellToParent(String hexAddress, Long Resolution) returns String;
35+
com.neo4jh3.cellToLatLng(String hexAddress) returns String;
36+
com.neo4jh3.cellToLatLngNumber(Long hexAddress) returns String;
37+
com.neo4jh3.distanceBetweenHexes(String hexAddress, String HexAddress) returns Long (km);
38+
com.neo4jh3.distanceBetweenHexesNumber(String hexAddress, String HexAddress) returns Long (km);
39+
40+
41+
# Procedures
42+
com.neo4jh3.gridDisk(String hexAddress, Long ringSize) returns String;
43+
com.neo4jh3.cellToChildren(String hexAddress, Long resolution) returns String;
44+
com.neo4jh3.returnHexAddress(Double Lat, Double Long, Long Resolution) returns String hexAddress;
45+
com.neo4jh3.returnLongAddress(Double Lat, Double Long, Long Resolution) returns Long hexAddress;
46+
com.neo4jh3.polygonToCells(List String(lat,lon), List String(lat,lon), Long resolution) returns String;
47+
com.neo4jh3.gridPathCells(Double latitude, Double longitude, Double latitude, Double longitude, Long resolution) return string;
48+
com.neo4jh3.gridPathCellsHexAddress(String hexAddress, String hexAddress, Long resolution) returns String;
49+
com.neo4jh3.lineHexAddresses(List String(lat,lon), Long resolution) returns String;

dependency-reduced-pom.xml

Lines changed: 73 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.dfauth</groupId>
5-
<artifactId>uberh3</artifactId>
6-
<version>0.1-SNAPSHOT</version>
4+
<groupId>com.neo4jh3</groupId>
5+
<artifactId>neo4jh3</artifactId>
6+
<version>0.9.1</version>
77
<build>
88
<plugins>
99
<plugin>
1010
<artifactId>maven-compiler-plugin</artifactId>
1111
<version>3.1</version>
1212
<configuration>
13-
<source>1.8</source>
14-
<target>1.8</target>
13+
<source>17</source>
14+
<target>17</target>
1515
</configuration>
1616
</plugin>
1717
<plugin>
@@ -32,27 +32,35 @@
3232
<dependency>
3333
<groupId>org.neo4j</groupId>
3434
<artifactId>neo4j</artifactId>
35-
<version>3.5.1</version>
35+
<version>5.1.0</version>
3636
<scope>provided</scope>
3737
<exclusions>
38+
<exclusion>
39+
<artifactId>annotations</artifactId>
40+
<groupId>org.neo4j</groupId>
41+
</exclusion>
3842
<exclusion>
3943
<artifactId>neo4j-kernel</artifactId>
4044
<groupId>org.neo4j</groupId>
4145
</exclusion>
4246
<exclusion>
43-
<artifactId>neo4j-lucene-index</artifactId>
47+
<artifactId>neo4j-fabric</artifactId>
4448
<groupId>org.neo4j</groupId>
4549
</exclusion>
4650
<exclusion>
47-
<artifactId>neo4j-fulltext-index</artifactId>
51+
<artifactId>neo4j-procedure</artifactId>
4852
<groupId>org.neo4j</groupId>
4953
</exclusion>
5054
<exclusion>
51-
<artifactId>neo4j-graph-algo</artifactId>
55+
<artifactId>neo4j-lucene-index</artifactId>
5256
<groupId>org.neo4j</groupId>
5357
</exclusion>
5458
<exclusion>
55-
<artifactId>neo4j-udc</artifactId>
59+
<artifactId>neo4j-fulltext-index</artifactId>
60+
<groupId>org.neo4j</groupId>
61+
</exclusion>
62+
<exclusion>
63+
<artifactId>neo4j-graph-algo</artifactId>
5664
<groupId>org.neo4j</groupId>
5765
</exclusion>
5866
<exclusion>
@@ -64,7 +72,7 @@
6472
<groupId>org.neo4j</groupId>
6573
</exclusion>
6674
<exclusion>
67-
<artifactId>neo4j-jmx</artifactId>
75+
<artifactId>neo4j-security</artifactId>
6876
<groupId>org.neo4j</groupId>
6977
</exclusion>
7078
<exclusion>
@@ -75,33 +83,49 @@
7583
<artifactId>neo4j-consistency-check</artifactId>
7684
<groupId>org.neo4j</groupId>
7785
</exclusion>
78-
</exclusions>
79-
</dependency>
80-
<dependency>
81-
<groupId>org.neo4j.test</groupId>
82-
<artifactId>neo4j-harness</artifactId>
83-
<version>3.5.1</version>
84-
<scope>test</scope>
85-
<exclusions>
86+
<exclusion>
87+
<artifactId>neo4j-record-storage-engine</artifactId>
88+
<groupId>org.neo4j</groupId>
89+
</exclusion>
90+
<exclusion>
91+
<artifactId>neo4j-dbms</artifactId>
92+
<groupId>org.neo4j</groupId>
93+
</exclusion>
94+
<exclusion>
95+
<artifactId>neo4j-import-tool</artifactId>
96+
<groupId>org.neo4j</groupId>
97+
</exclusion>
8698
<exclusion>
8799
<artifactId>neo4j-server</artifactId>
88100
<groupId>org.neo4j.app</groupId>
89101
</exclusion>
90102
<exclusion>
91-
<artifactId>neo4j-common</artifactId>
103+
<artifactId>neo4j-buffers</artifactId>
92104
<groupId>org.neo4j</groupId>
93105
</exclusion>
94106
<exclusion>
95-
<artifactId>neo4j-kernel</artifactId>
107+
<artifactId>neo4j-capabilities</artifactId>
96108
<groupId>org.neo4j</groupId>
97109
</exclusion>
110+
</exclusions>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.neo4j.test</groupId>
114+
<artifactId>neo4j-harness</artifactId>
115+
<version>5.1.0</version>
116+
<scope>test</scope>
117+
<exclusions>
98118
<exclusion>
99-
<artifactId>neo4j-io</artifactId>
119+
<artifactId>slf4j-nop</artifactId>
120+
<groupId>org.slf4j</groupId>
121+
</exclusion>
122+
<exclusion>
123+
<artifactId>test-utils</artifactId>
100124
<groupId>org.neo4j</groupId>
101125
</exclusion>
102126
<exclusion>
103-
<artifactId>jersey-client</artifactId>
104-
<groupId>com.sun.jersey</groupId>
127+
<artifactId>io-test-utils</artifactId>
128+
<groupId>org.neo4j</groupId>
105129
</exclusion>
106130
<exclusion>
107131
<artifactId>neo4j-server</artifactId>
@@ -112,20 +136,38 @@
112136
<groupId>commons-codec</groupId>
113137
</exclusion>
114138
<exclusion>
115-
<artifactId>httpclient</artifactId>
116-
<groupId>org.apache.httpcomponents</groupId>
139+
<artifactId>annotations</artifactId>
140+
<groupId>org.neo4j</groupId>
117141
</exclusion>
118142
<exclusion>
119-
<artifactId>httpcore</artifactId>
120-
<groupId>org.apache.httpcomponents</groupId>
143+
<artifactId>neo4j-kernel</artifactId>
144+
<groupId>org.neo4j</groupId>
121145
</exclusion>
122146
</exclusions>
123147
</dependency>
124148
<dependency>
125149
<groupId>org.neo4j.driver</groupId>
126150
<artifactId>neo4j-java-driver</artifactId>
127-
<version>1.4.3</version>
151+
<version>5.2.0</version>
128152
<scope>test</scope>
153+
<exclusions>
154+
<exclusion>
155+
<artifactId>reactive-streams</artifactId>
156+
<groupId>org.reactivestreams</groupId>
157+
</exclusion>
158+
<exclusion>
159+
<artifactId>netty-handler</artifactId>
160+
<groupId>io.netty</groupId>
161+
</exclusion>
162+
<exclusion>
163+
<artifactId>netty-tcnative-classes</artifactId>
164+
<groupId>io.netty</groupId>
165+
</exclusion>
166+
<exclusion>
167+
<artifactId>reactor-core</artifactId>
168+
<groupId>io.projectreactor</groupId>
169+
</exclusion>
170+
</exclusions>
129171
</dependency>
130172
<dependency>
131173
<groupId>junit</groupId>
@@ -141,11 +183,11 @@
141183
</dependency>
142184
</dependencies>
143185
<properties>
186+
<neo4j.version>5.1.0</neo4j.version>
144187
<commons.version>4.1</commons.version>
145-
<uber.version>3.3.0</uber.version>
146-
<neo4j.version>3.5.1</neo4j.version>
147188
<csv.version>1.2</csv.version>
148189
<lang3.version>3.7</lang3.version>
190+
<uber.version>4.0.2</uber.version>
149191
</properties>
150192
</project>
151193

pom.xml

100644100755
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.dfauth</groupId>
8-
<artifactId>uberh3</artifactId>
9-
<version>0.1-SNAPSHOT</version>
7+
<groupId>com.neo4jh3</groupId>
8+
<artifactId>neo4jh3</artifactId>
9+
<version>0.9.1</version>
1010

1111
<properties>
12-
<neo4j.version>3.5.1</neo4j.version>
12+
<neo4j.version>5.1.0</neo4j.version>
1313
<csv.version>1.2</csv.version>
1414
<lang3.version>3.7</lang3.version>
15-
<uber.version>3.3.0</uber.version>
15+
<uber.version>4.0.2</uber.version>
1616
<commons.version>4.1</commons.version>
1717
</properties>
1818

@@ -56,7 +56,7 @@
5656
<!-- Used to send cypher statements to our procedure. -->
5757
<groupId>org.neo4j.driver</groupId>
5858
<artifactId>neo4j-java-driver</artifactId>
59-
<version>1.4.3</version>
59+
<version>5.2.0</version>
6060
<scope>test</scope>
6161
</dependency>
6262

@@ -85,7 +85,8 @@
8585
<version>${neo4j.version}</version>
8686
<optional>true</optional>
8787
<scope>compile</scope>
88-
</dependency>
88+
</dependency>
89+
8990
</dependencies>
9091

9192
<build>
@@ -94,9 +95,9 @@
9495
<artifactId>maven-compiler-plugin</artifactId>
9596
<version>3.1</version>
9697
<configuration>
97-
<!-- Neo4j Procedures require Java 8 -->
98-
<source>1.8</source>
99-
<target>1.8</target>
98+
<!-- Neo4j 5 Procedures require Java 17 -->
99+
<source>17</source>
100+
<target>17</target>
100101
</configuration>
101102
</plugin>
102103
<plugin>

src/.DS_Store

100644100755
File mode changed.

src/main/.DS_Store

100644100755
File mode changed.

src/main/java/.DS_Store

100644100755
File mode changed.

src/main/java/com/.DS_Store

100644100755
0 Bytes
Binary file not shown.

src/main/java/com/dfauth/.DS_Store

-6 KB
Binary file not shown.

src/main/java/com/dfauth/results/NodeListResult.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)