- Docker 20 or newer
- Run a Docker container with JanusGraph:
docker run \
--name janusgraph \
-v ~/Development/thesis:/opt/janusgraph/thesis \
-v ~/janusgraph/data:/opt/janusgraph/mydata \
-m 6g \
-it \
janusgraph/janusgraph:0.6.2 \
bash- Copy the server configuration to the right location:
cp conf/janusgraph-berkeleyje-server.properties /etc/opt/janusgraph/janusgraph.propertiesIf you want to use the container you created with docker run after ending the session, you can start it again using:
docker start -i janusgraph-
Download the recommendations data and place all CSV files in a directory
~/janusgraph/data/recomendations. -
Package the app (locally):
mvn package- Run the app (in the container) with the
loadcommand and passnig the path to the directory containing the CSV files. Note that the--dropflag drops all existing data!
java -jar thesis/janusgraph/target/janusgraph-schema-0.1.jar load recommendations mydata/directory --drop-
Download the Social Network Benchmark dataset file
social_network-csv_basic-sf$SCALE_FACTOR.tar.zst(where$SCALE_FACTORis0.1,0.3,1etc.) from this repository and extract the CSV files using the instructions. -
Package the app (locally):
mvn package- Run the app (in the container) with the
loadcommand and passnig the path to the directory containing the CSV files. Note that the--dropflag drops all existing data!
java -jar thesis/janusgraph/target/janusgraph-schema-0.1.jar load snb mydata/directory --drop- Package the app (locally):
mvn package- Run the app (in the container) with the
validatecommand:
java -jar thesis/janusgraph/target/janusgraph-schema-0.1.jar validate- Run JanusGraph server (in the container):
bin/janusgraph-server.sh conf/janusgraph-server.yaml- Open the Gremlin console, either by installing locally, or using a separate Docker container:
docker run \
--name janusgraph-client \
--link janusgraph \
-e GREMLIN_REMOTE_HOSTS=janusgraph \
-it \
janusgraph/janusgraph:0.6.2 \
bin/gremlin.sh- Connect to the server and start a session:
// Use default configuration to connect to a Gremlin server on localhost
// and start a session (to persist variables)
:remote connect tinkerpop.server conf/remote.yaml session
// Open the remote console so all following commands are sent to the remote
:remote console- Open the graph
graph = JanusGraphFactory.open("conf/janusgraph-berkeleyje-server.properties")
- Run queries like
g = graph.traversal(),g.V().hasLabel("Movie").count()or do whatever you want.