@@ -47,8 +47,38 @@ print(f'Hercules is {hercules_age} years old.')
4747 `next()` is a terminal step that submits the traversal to the
4848 Gremlin Server and returns a single result.
4949
50- ## JanusGraph Specific Types and Predicates
50+ ## JanusGraph-Python for JanusGraph Specific Types and Predicates
5151
5252JanusGraph contains some types and [ predicates] ( ../search-predicates.md ) that
5353are not part of Apache TinkerPop and are therefore also not supported by
5454Gremlin-Python.
55+ [ JanusGraph-Python] ( https://github.com/JanusGraph/janusgraph-python ) is a Python
56+ package that adds support for some of these types and predicates to Gremlin-Python.
57+
58+ After installing the package, a message serializer needs to be configured for
59+ JanusGraph which can be done like this for GraphSON 3:
60+
61+ ``` python
62+ from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
63+ from janusgraph_python.driver.serializer import JanusGraphSONSerializersV3d0
64+
65+ connection = DriverRemoteConnection(
66+ ' ws://localhost:8182/gremlin' , ' g' ,
67+ message_serializer = JanusGraphSONSerializersV3d0())
68+ ```
69+
70+ or like this for GraphBinary:
71+
72+ ``` python
73+ from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
74+ from janusgraph_python.driver.serializer import JanusGraphBinarySerializersV1
75+
76+ connection = DriverRemoteConnection(
77+ ' ws://localhost:8182/gremlin' , ' g' ,
78+ message_serializer = JanusGraphBinarySerializersV1())
79+ ```
80+
81+ Refer to [ the documentation of JanusGraph-Python] ( https://github.com/JanusGraph/janusgraph-python#janusgraph-python )
82+ for more information about the package, including its [ compatibility with
83+ different JanusGraph versions] ( https://github.com/JanusGraph/janusgraph-python#version-compatibility )
84+ and differences in support between the different [ serialization formats] ( https://github.com/JanusGraph/janusgraph-python#serialization-formats ) .
0 commit comments