Skip to content

SoftwareHeritage/swh-graph-tinkerpop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webgraph-tinkerpop implementation for swh-graph

Showcases the usage of webgraph-tinkerpop for the Software Heritage graph.

Also includes benchmarking code.


Build

The code depends on webgraph-tinkerpop and swh-graph installed into the local Maven repository.

Installing webgraph-tinkerpop:

git clone https://github.com/SoftwareHeritage/webgraph-tinkerpop.git
cd webgraph-tinkerpop
mvn install

Installing swh-graph version 0.6.1:

git clone https://forge.softwareheritage.org/source/swh-graph.git
cd swh-graph/java
mvn package -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
mvn install:install-file -Dfile=target/swh-graph-0.6.1.jar -DgroupId=org.softwareheritage.graph -DartifactId=swh-graph -Dversion=0.6.1 -Dpackaging=jar

To build the library:

mvn compile assembly:single

Properties

In SwhProperties.java you can find all registered properties. These include:

Key Type Description
-- (Label) String Node type
author_timestamp Long Author timestamp from author_timestamp.bin file
swhid String The SWHID of the node
message String The message for the node
__arc_label_property__ DirEntry[] The DirEntry for the edge
dir_entry_str DirEntryString[] The DirEntry for the edge with the filename converted to String

Server

Running Gremlin queries on an SWH graph (Java 11):

java -cp target/*.jar org.softwareheritage.graph.tinkerpop.Server <graph_path> <query> [--profile]
  • graph_path - path to the graph folder
  • query - a Gremlin query to execute on the graph
  • --profile - instead of query results outputs profiling results

Benchmarker

To run the benchmarker (Java 11):

java -cp target/*.jar org.softwareheritage.graph.tinkerpop.Benchmark <options>

Available options:

  • --path <graphPath> - path to the graph folder. Defaults to example graph
  • --query <query> - the query key: earliestContainingRevision | originOfRevision | recursiveContentPathsWithPermissions | snapshotRevisionsWithBranches
  • --samples <samples> - the number of samples to run the query on
  • --iters <iters> - the number of iterations per sample
  • --argument <argument> - if present, profiles the query with the argument, instead of doing iterations
  • --print - if present, prints the query outputs

Example (Java 11):

java -cp target/*.jar org.softwareheritage.graph.tinkerpop.Benchmark --path src/main/resources/example/example --query recursiveContentPathsWithPermissions --iters 3 --samples 100

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages