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

Gremlin-Go: tree steps not serializable

王林
Release: 2024-02-09 10:51:19
forward
1015 people have browsed it

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
Copy after login

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.
Copy after login

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!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template