Graph Utils

Utilities for working with Tinkerpop graphs

License

License

GroupId

GroupId

uk.gov.nca.graph
ArtifactId

ArtifactId

utils
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

Graph Utils
Utilities for working with Tinkerpop graphs
Project URL

Project URL

https://github.com/NationalCrimeAgency/graph-utils
Source Code Management

Source Code Management

https://github.com/NationalCrimeAgency/graph-utils

Download utils

How to add to project

<!-- https://jarcasting.com/artifacts/uk.gov.nca.graph/utils/ -->
<dependency>
    <groupId>uk.gov.nca.graph</groupId>
    <artifactId>utils</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/uk.gov.nca.graph/utils/
implementation 'uk.gov.nca.graph:utils:1.1'
// https://jarcasting.com/artifacts/uk.gov.nca.graph/utils/
implementation ("uk.gov.nca.graph:utils:1.1")
'uk.gov.nca.graph:utils:jar:1.1'
<dependency org="uk.gov.nca.graph" name="utils" rev="1.1">
  <artifact name="utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='uk.gov.nca.graph', module='utils', version='1.1')
)
libraryDependencies += "uk.gov.nca.graph" % "utils" % "1.1"
[uk.gov.nca.graph/utils "1.1"]

Dependencies

compile (5)

Group / Artifact Type Version
commons-cli : commons-cli jar 1.4
org.slf4j : slf4j-api jar 1.7.25
org.apache.tinkerpop : gremlin-core jar 3.3.4
org.apache.tinkerpop : tinkergraph-gremlin jar 3.3.4
org.mockito : mockito-core jar 2.23.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.25

Project Modules

There are no modules declared in this project.

Graph Utils

Provides a number of Java utilities for interacting with graphs through Tinkerpop, thereby reducing the amount of boilerplate code required for common tasks such as getting and copying properties from graphs, splitting graphs into sub-graphs, and reading and writing graphs to file.

Command Line Utilities

A number of the functions provided by Graph Utils have been wrapped up to provide a simple CLI.

The available tools are as follows:

Tool Name Description
CleanGraph Take a file and remove any control characters from it
ConvertGraph Convert a graph between two graph formats
ExportGraph Export a graph to file
ImportGraph Import a graph into an existing graph without merging
SplitGraph Split a graph into multiple subgraphs

Running the above commands without any options will print out the available flags and input parameters. For example:

$ java -cp utils-1.1-shaded.jar uk.gov.nca.graph.utils.ConvertGraph

usage: uk.gov.nca.graph.utils.cli.ConvertGraph -f <arg> -g <arg> -i <arg>
       -o <arg>

Convert a graph file between formats

 -f,--inputformat <arg>    The format of the input file, either GraphML,
                           GraphSON or Gryo
 -g,--outputformat <arg>   The format of the output file, either GraphML,
                           GraphSON or Gryo
 -i,--input <arg>          The input file to read the graph from
 -o,--output <arg>         The output file to save the graph to
uk.gov.nca.graph

National Crime Agency

National Crime Agency. Leading the UK's fight to cut serious and organised crime.

Versions

Version
1.1
1.0