A basic Java Maven project with a simple main class and test setup.
To build the project, run:
mvn clean package
After building, you can run the application with:
java -cp target/my-app-1.0-SNAPSHOT.jar com.example.App
To run the tests:
mvn test
mvn dependency:sources dependency:resolve -Dclassifier=javadoc
Neo4j browser interface url: http://localhost:7474
In the browser interface the following query can be used to query all data for display in table, text, code, or graph:
MATCH (n)-[r]->(m) RETURN *
- First, create the installation directory and download the Neo4j key:
# Create directory for Neo4j installation files
mkdir -p neo4j_install
cd neo4j_install
wget https://debian.neo4j.com/neotechnology.gpg.key
cd ..
- Create an installation script e.g.,
install-neo4j-ubuntu.sh
and add following content:
# Content of install-neo4j-ubuntu.sh
# Create directory for Neo4j installation files, change directory and download the Neo4j key
mkdir -p neo4j_install && cd neo4j_install && wget https://debian.neo4j.com/neotechnology.gpg.key
# Add the key to apt
sudo apt-key add neo4j_install/neotechnology.gpg.key
# Add the Neo4j repository
echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list
# Update package list
sudo apt-get update
# Install Neo4j
sudo apt-get install neo4j
# Start Neo4j service
sudo systemctl start neo4j
# Enable Neo4j to start on boot
sudo systemctl enable neo4j
- Make the script executable (if necessary), and run it:
chmod +x install-neo4j-ubuntu.sh
./install-neo4j-ubuntu.sh
- Initial Database Setup To set up the database first time, Exec:
cypher-shell -u neo4j -p neo4j
To enter neo4j shell exec: cypher-shell -u 'neo4j' -p 'password'
where -u sets the user and -p the password
- Verify the installation:
# Check Neo4j service status
sudo systemctl status neo4j
# Check Neo4j version
neo4j --version
Data directory: Default location: /var/lib/neo4j/data Logs: /var/log/neo4j
7474: HTTP port for Neo4j Browser 7687: Bolt port for database connections (used by the Java application)
After installation create file Neo4jConfig.java
in folder src/main/java/com/sdg/graph/
with the following content:
package com.sdg.graph;
public class Neo4jConfig {
private Neo4jConfig() {
throw new IllegalStateException("Cannot instantiate this class");
}
public static final String DB_URI = "bolt://localhost:7687";
public static final String DB_USER = "neo4j";
public static final String DB_PASSWORD = "your-password"; // Replace with the password you set
}
// TODO add Windows installation steps
pip install -r src/main/python/requirements.txt
python src/main/python/microservice/multiply_service.py