Home  >  Article  >  Backend Development  >  Gremlin-Go: tree steps not serializable

Gremlin-Go: tree steps not serializable

王林
王林forward
2024-02-09 10:51:19989browse

Gremlin-Go: tree steps not serializable

php editor Apple Gremlin-Go is a new type of distributed database. It uses the technology of non-serializable tree steps to provide users with more efficient and reliable data. Storage and handling options. By storing data in a tree structure and using non-serializable steps to read and write data, Gremlin-Go is able to maintain data consistency and reliability in a distributed environment. This innovative design concept makes Gremlin-Go one of the leading distributed databases currently, providing powerful data support for enterprises of all sizes.

Question content

I am running a query to iterate through all "in" edges behind a specific label, later I will perform a similar query for the "out" edges. I want to make this a tree as there may be a vertex with multiple edges to traverse and need to reflect this in my client so I can't just use tolist() here .

I'm currently using the gremlin-go sdk, but I'm getting a deserialization error when calling the tree() step. Here is a snippet of my client code:

    res, err := g.v(id).
        emit().
        repeat(__.in(label)).
        tree().
        next() // other terminal steps produce same issue

This will generate a deserialization error on data type 0x2b which is the graphbinary core data type "tree"

2023/02/28 12:23:05 Error occurred during operation gremlinServerWSProtocol.readLoop(): 'E0408: unknown data type to deserialize 0x2b'
2023/02/28 12:23:05 Read loop error 'E0408: unknown data type to deserialize 0x2b', closing read loop.
2023/02/28 12:23:05 Connection error callback invoked, closing protocol.

The gremlin-go reference documentation doesn't seem to mention anything about specific serialization support. According to the gremlin-go readme, it supports all core graphbinary data types. I've tested my query in gremlin console to verify query and server: g.v(<id>).emit().repeat(__.in(<label>)).tree().next()</label></id>.

For some additional context, I'm developing locally against gremlin-server:3.5.3 to experiment with the goal of completing queries with support for aws neptune. I know these are not completely interchangeable and will follow the neptune-gremlin reference. The latest version of neptune specifies that the latest supported version of gremlin is 3.5.3.

Workaround

In general, only Java (and other JVM-based clients) can deserialize structures like subgraphs or trees. This is because these are the only Gremlin clients that have native implementations of currently available data structures (e.g. JVM clients have TinkerGraph available).

This is one the TinkerPop community knows very well, and it's on the list of things worth improving.

One possible workaround (not very nice) is to use an HTTP endpoint (send the query as text) and process the returned GraphSON (if such a data structure must be returned).

The above is the detailed content of Gremlin-Go: tree steps not serializable. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete