JanusGraph / JanusGraph/janusgraph

Adding support for custom edge ids

Open
#1,514 7 comments 7 reactions 0 assignees View on GitHub
kind/enhancement
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

I think this feature might be useful in some situations. For example when we want to remove the edge and then add it with the same id or if we want to rewrite current edges.
I didn't find the reason why we shouldn't allow the users to use custom ids for edges.
https://github.com/JanusGraph/janusgraph/blob/d12adfbf083f575fa48860daa37bfbd0e6095369/janusgraph-core/src/main/java/org/janusgraph/graphdb/util/ElementHelper.java#L61

The edge key consists of `label` + `direction` + `sort key` + `adjacent vertex id` + `edge id`. I think that we can allow users to use custom id for the last part `edge id`.
There is already property `graph.set-vertex-id` which allows to set custom vertex ids. We could create `graph.set-edge-id` which will be an analog for edge id (the last part).

Contributor guide

Open the contributing guide

Research direction

Start with ElementHelper.java at the linked edge-key handling and compare it with the existing graph.set-vertex-id behavior. Trace how edge identifiers are represented and configured before deciding the scope of graph.set-edge-id. Done would mean a reviewed design and consistent support for user-supplied edge IDs, including the replacement scenarios described.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.