JanusGraphDriver

class JanusGraphDriver: GremlinDriver, ISchemaSafeDriver

The driver used to connect to a remote JanusGraph instance.

Methods

connect

fun connect(): JanusGraphDriver

Connects to the graph database with the given configuration. Set REMOTE_CONFIG to the path of the remote-graph.properties configuration file. See JanusGraph Documentation.

ReturnValue

Name Description
JanusGraphDriver

close

fun close()

Attempts to close the graph database connection and resources.

ReturnValue

Name Description
Unit

remoteConfig

fun remoteConfig(remoteConfigPath: String): (remoteConfigPath: String)

Sets the path of the remote-graph.properties configuration file. See JanusGraph Documentation.

Parameters

Name Description
remoteConfigPath: String

the path to remote-graph.properties.

ReturnValue

Name Description
(remoteConfigPath: String)

updateVertexProperty

fun updateVertexProperty(id: Long, label: String?, key: String, value: Any)

Updates a vertex's property if the node exists.

Parameters

Name Description
id: Long

The ID of the vertex to update.

label: String?

The label of the node, if known.

key: String

The key of the property to update.

value: Any

The updated value.

ReturnValue

Name Description
Unit

prepareVertexProperties

protected fun prepareVertexProperties(v: NewNodeBuilder): Map<String, Any>

Parameters

Name Description
v: NewNodeBuilder

ReturnValue

Name Description
Map<String, Any>

mapVertexKeys

protected fun mapVertexKeys(props: Map<Any, Any>): (props: Map)

Parameters

Name Description
props: Map<Any, Any>

ReturnValue

Name Description
(props: Map)

buildSchema

fun buildSchema()

Builds and installs the CPG schema in the target database. The schema executed is from ISchemaSafeDriver.buildSchemaPayload.

ReturnValue

Name Description
Unit

buildSchemaPayload

fun buildSchemaPayload(): String

Builds the schema from generated CPG code and returns it as a String to be executed on the database.

ReturnValue

Name Description
String

CompanionObject

JanusGraphDriver

class JanusGraphDriver: GremlinDriver, ISchemaSafeDriver

The driver used to connect to a remote JanusGraph instance.

Fields

Name Description
const REMOTE_CONFIG: String

The configuration key to set the remote-graph.properties path. See JanusGraph Documentation for what to set the value to.