JanusGraph / JanusGraph/janusgraph
Unique index is not supported for edge property but doc says yes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
https://docs.janusgraph.org/index-management/index-performance/#index-uniqueness says
> If a composite graph index is defined as unique() there can be at most one vertex or edge for any given concatenation of property values associated with the keys of that index.
However, unique() is not supported for edge property due to:
https://github.com/JanusGraph/janusgraph/blob/26259ddd350c6f93b230a49857c702745644a879/janusgraph-core/src/main/java/org/janusgraph/graphdb/database/management/ManagementSystem.java#L663-L666
I am not sure why this feature is not supported for edge property. At least we should update the documentation. It would be great if someone can investigate if this can be supported.
btw there was an issue for this on titan repository: https://github.com/thinkaurelius/titan/issues/1222
For confirmed bugs, please report:
- Version: all
- Storage Backend: does not matter
- Mixed Index Backend: does not matter
- Gitter chat URL: https://gitter.im/janusgraph/janusgraph?at=5fbbd69b771c185e0ec0e774
- Steps to Reproduce:
```
m.buildIndex('hasNamespaceCIndex', Edge.class) \
.addKey(typeEdgeProperty) \
.addKey(namespaceEdgeProperty) \
.unique() \
.buildCompositeIndex();
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the index uniqueness documentation at the linked index-performance page and inspect ManagementSystem.java around lines 663-666. Run or adapt the provided composite-index example for edge properties to confirm the limitation. Done means either documenting the limitation accurately or establishing the implementation work needed to support unique edge-property indexes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100