JanusGraph / JanusGraph/janusgraph

VertexProgram Fails to Persist Multiproperties (FulgoraGraphComputer)

Open
#943 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

When setting a multiproperty in the execute() method of a `VertexProgram`, it updates an `ArrayList` with new values of the property. This `ArrayList` is supposed to be iterated over when persisting results to the graph in` FulgoraGraphComputer.submit()`. However, when performing a persist to the original graph (`ResultGraph.ORIGINAL`), it attempts to write the `ArrayList` as a single property, which fails since JanusGraph does not provide a default `ArrayList` serializer. I have code demonstrating this bug in https://github.com/bgamer50/janusgraph-test.

The fix for this is to check if an `ArrayList` is being written, and if so, write each individual value using `forEach()` using the predefined JanusGraph schema (either `Cardinality.LIST` or `Cardinality.SET`). If the JanusGraph schema was not defined as one of those two, throw an Exception. I have code for this fix in https://github.com/bgamer50/janusgraph-ab/tree/fix-vp-persist (`FulgoraGraphComputer` class).

Contributor guide

Open the contributing guide

Research direction

Start in FulgoraGraphComputer.submit(), focusing on persistence for ResultGraph.ORIGINAL, and reproduce the multiproperty case with the linked janusgraph-test project. Compare the linked fix-vp-persist implementation and verify that persistence follows the predefined Cardinality.LIST or Cardinality.SET schema while rejecting other cardinalities.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.