https://github.com/soroushj/neo4j-proximity-score-plugin
A proximity score plugin for Neo4j.
https://github.com/soroushj/neo4j-proximity-score-plugin
neo4j neo4j-plugin
Last synced: 2 days ago
JSON representation
A proximity score plugin for Neo4j.
- Host: GitHub
- URL: https://github.com/soroushj/neo4j-proximity-score-plugin
- Owner: soroushj
- License: gpl-3.0
- Created: 2018-12-13T14:45:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-13T14:46:17.000Z (over 6 years ago)
- Last Synced: 2025-06-13T10:06:05.423Z (2 days ago)
- Topics: neo4j, neo4j-plugin
- Language: Java
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Neo4j Proximity Score Plugin
This is a user-defined function for Neo4j which returns a proximity score for two nodes. The proximity score is defined as *proximity(A, B) = log(1 + paths(A, B))*, where *A* and *B* are two nodes in the graph and *paths(A, B)* is the number of all shortest paths between *A* and *B*.
## Test & Build
```shell
gradle build
```
## Deploy
Copy the built jar file found in `./build/libs/` to the Neo4j `plugins` directory. For the default Neo4j `plugins` path on Ubuntu 16.04+:
```shell
sudo cp ./build/libs/neo4j-proximity-score-plugin.jar /var/lib/neo4j/plugins/
```
After copying the jar file, you need to restart the Neo4j service. On Ubuntu 16.04+:
```shell
sudo service neo4j restart
```
## Usage
Now you can use the function `com.github.soroushj.proximityScore` in Cypher queries:
```cypher
MATCH (a:User {username: "alice"}), (b:User {username: "bob"})
RETURN com.github.soroushj.proximityScore(a, b)
```