© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Apache TinkerPopAT
Apache TinkerPop•15mo ago•
2 replies
blacklight

mergeV with onMerge when extra properties are unknown

I'm in the following situation:

jobId = "spark:bdx_job_1"

// Initial vertices
vertices = [
    [
        (T.id): "spark:bdx_job_1",
        (T.label): "job",
        "url": single("spark://some/url"),
        "status": single("running"),
    ],
]

// First insertion
g.inject(vertices) \
    .unfold() \
    .mergeV() \
    .iterate()

// Updated vertices
updatedVertices = vertices = [
    [
        (T.id): jobId,
        (T.label): "job",
        "url": "spark://another/url",
        "status": "completed"
        }
    ]
]
jobId = "spark:bdx_job_1"

// Initial vertices
vertices = [
    [
        (T.id): "spark:bdx_job_1",
        (T.label): "job",
        "url": single("spark://some/url"),
        "status": single("running"),
    ],
]

// First insertion
g.inject(vertices) \
    .unfold() \
    .mergeV() \
    .iterate()

// Updated vertices
updatedVertices = vertices = [
    [
        (T.id): jobId,
        (T.label): "job",
        "url": "spark://another/url",
        "status": "completed"
        }
    ]
]


I want to inject
updatedVertices
updatedVertices
in such a way that the node is created if it doesn't exist, and its properties (excluding
id
id
and
label
label
) are updated if a match is found on
<id, label>
<id, label>
.

I tried this approach, but I'm in a situation where the extra properties are not known upfront, so the
range
range
/
tail
tail
approach probably isn't feasible. I've tried ti tinker with
sideEffect
sideEffect
, but any attempts resulted in a serialization error through the JDK proxy. I've also tried some of the solutions suggested here, but I haven't had much luck either.
Stack Overflow
Efficiently bulk upserting vertices and edges containing properties...
Context
We're ingesting a combined total of between (500, 1500, 5000) (P25, P50, P75) vertices and edges per minute. Each vertex has roughly 5 "records" on it (id, label, 3 string propert...
Efficiently bulk upserting vertices and edges containing properties...
Apache TinkerPop banner
Apache TinkerPopJoin
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,376Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Gremlin python MergeV update properties
Apache TinkerPopATApache TinkerPop / questions
13mo ago
MergeV uint32 properties inserted as long
Apache TinkerPopATApache TinkerPop / questions
3y ago
.mergeV() with Javascript not working
Apache TinkerPopATApache TinkerPop / questions
2y ago
using mergeV/E
Apache TinkerPopATApache TinkerPop / questions
4y ago