Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added reference to JanusGraph-Python package #4750

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion docs/basics/connecting/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,38 @@ print(f'Hercules is {hercules_age} years old.')
`next()` is a terminal step that submits the traversal to the
Gremlin Server and returns a single result.

## JanusGraph Specific Types and Predicates
## JanusGraph-Python for JanusGraph Specific Types and Predicates

JanusGraph contains some types and [predicates](../search-predicates.md) that
are not part of Apache TinkerPop and are therefore also not supported by
Gremlin-Python.
[JanusGraph-Python](https://github.com/JanusGraph/janusgraph-python) is a Python
package that adds support for some of these types and predicates to Gremlin-Python.

After installing the package, a message serializer needs to be configured for
JanusGraph which can be done like this for GraphSON 3:

```python
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from janusgraph_python.driver.serializer import JanusGraphSONSerializersV3d0

connection = DriverRemoteConnection(
'ws://localhost:8182/gremlin', 'g',
message_serializer=JanusGraphSONSerializersV3d0())
```

or like this for GraphBinary:

```python
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from janusgraph_python.driver.serializer import JanusGraphBinarySerializersV1

connection = DriverRemoteConnection(
'ws://localhost:8182/gremlin', 'g',
message_serializer=JanusGraphBinarySerializersV1())
```

Refer to [the documentation of JanusGraph-Python](https://github.com/JanusGraph/janusgraph-python#janusgraph-python)
for more information about the package, including its [compatibility with
different JanusGraph versions](https://github.com/JanusGraph/janusgraph-python#version-compatibility)
and differences in support between the different [serialization formats](https://github.com/JanusGraph/janusgraph-python#serialization-formats).
Loading