JanusGraph

Thu, 04 Aug 2022 17:50:31 GMT

 Properties

Key Value
Identifier janusgraph
Name JanusGraph
Type Topic
Creation timestamp Thu, 04 Aug 2022 17:50:31 GMT
Modification timestamp Sat, 27 Jul 2024 09:47:39 GMT
Tags
lpg

Using Python

from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.anonymous_traversal_source import traversal

# The connection should be closed on shut down
# Close open connections with 'connection.close()'
connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')

# Reuse 'g' across the application
g = traversal().withRemote(connection)

hercules_age = g.V().has('name', 'hercules').values('age').next()
print(f"Hercules is {hercules_age} years old.")

Back to top