Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

[JanusGraph] Fixed - should contain id property #243

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Tin-Nguyen
Copy link

Description

This is the fix related to my comment in #230 (comment) about the issue I'm facing in my Java application using spring-data-gremlin working with janusgraph database

java.lang.IllegalArgumentException: should contain id property

Gremlin-driver: 3.2.4
spring-data-gremlin: 2.1.7
Spring Boot: 2.1.8.RELEASE

Root cause

  • The issue happened after the library finished inserting the new data into JanusGraph database.
  • gremlin-driver returns a different data structure, like as below
    image
    That's why validate() function raises IllegalArgumentException when it identifies there is no id, label, type, etc... contained in the Result instance.

I'm going to write some Tests to cover the logics and test it via my application shortly today.

Related PRs

N/A

Todos

  • Tests
  • Documentation

Steps to Test

Steps to test code change

@msftclas
Copy link

msftclas commented Sep 28, 2019

CLA assistant check
All CLA requirements met.

@codecov-io
Copy link

codecov-io commented Sep 28, 2019

Codecov Report

Merging #243 into master will decrease coverage by 0.46%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #243      +/-   ##
==========================================
- Coverage   86.24%   85.77%   -0.47%     
==========================================
  Files          60       60              
  Lines        1352     1364      +12     
  Branches      231      234       +3     
==========================================
+ Hits         1166     1170       +4     
- Misses         74       80       +6     
- Partials      112      114       +2
Impacted Files Coverage Δ
...icrosoft/spring/data/gremlin/common/Constants.java 87.5% <ø> (ø) ⬆️
...lin/conversion/result/GremlinResultEdgeReader.java 87.5% <100%> (-0.38%) ⬇️
...n/conversion/result/GremlinResultVertexReader.java 95.83% <100%> (-0.17%) ⬇️
...conversion/result/AbstractGremlinResultReader.java 55% <42.85%> (-32.5%) ⬇️
...ta/gremlin/config/GremlinConfigurationSupport.java 95.83% <0%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b249bae...1e043e5. Read the comment docs.

@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@microsoft microsoft deleted a comment Sep 28, 2019
@Tin-Nguyen
Copy link
Author

Tin-Nguyen commented Sep 29, 2019

I found another issue related Edge id field returned from JanusGraph
image
id value isn't Integer type, it's the map with relationId: <String>

@microsoft microsoft deleted a comment Sep 29, 2019
@microsoft microsoft deleted a comment Sep 29, 2019
@microsoft microsoft deleted a comment Sep 29, 2019
@microsoft microsoft deleted a comment Sep 29, 2019
@Tin-Nguyen
Copy link
Author

I'm facing another issue when getting the data from JanusGraph using findAll() function. The data structure returned from gremlin-driver is quite different as the code is doing
image
Need to fix it as well

@microsoft microsoft deleted a comment Sep 30, 2019
@microsoft microsoft deleted a comment Sep 30, 2019
@microsoft microsoft deleted a comment Oct 1, 2019
@microsoft microsoft deleted a comment Oct 1, 2019
@superrdean
Copy link
Contributor

@Tin-Nguyen Travis-ci seems not to pass, please check it and fix it.

@Tin-Nguyen
Copy link
Author

@neuqlz I'm going to fix the PR within next week. I will let you know once it fixed soon. Thanks.

@manjurhassan
Copy link

Hi everyone, I am new to open source development but I have a fair enough problem solving background in Graphs, this looks like an interesting project to start my open source contribution journey. It would be great if you could point me in the right direction to get started.

Copy link

@nuspy nuspy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code to be eliminated.
Absolutely important changes, affect OrangoDb too.

@Tin-Nguyen
Copy link
Author

Tin-Nguyen commented Jan 10, 2020

sorry guys, I was busy with some urgent works. it's time to back to get this change done within next week.

@Incarnation-p-lee
Copy link
Contributor

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- src/main/java/com/microsoft/spring/data/gremlin/conversion/result/AbstractGremlinResultReader.java  4
         

Clones removed
==============
+ src/main/java/com/microsoft/spring/data/gremlin/conversion/result/GremlinResultEdgeReader.java  -1
+ src/main/java/com/microsoft/spring/data/gremlin/conversion/result/GremlinResultVertexReader.java  -1
         

See the complete overview on Codacy

@microsoft microsoft deleted a comment Jan 10, 2020
@arvind-das
Copy link

arvind-das commented Feb 2, 2020

is anyone going to merge this fix ? This is a blocker in integrating this orm framework.

@codecov-commenter
Copy link

Codecov Report

Merging #243 into master will decrease coverage by 0.44%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #243      +/-   ##
==========================================
- Coverage   86.21%   85.77%   -0.45%     
==========================================
  Files          60       60              
  Lines        1357     1364       +7     
  Branches      232      234       +2     
==========================================
  Hits         1170     1170              
- Misses         74       80       +6     
- Partials      113      114       +1     
Impacted Files Coverage Δ
...icrosoft/spring/data/gremlin/common/Constants.java 87.50% <ø> (ø)
...conversion/result/AbstractGremlinResultReader.java 55.00% <42.85%> (-32.50%) ⬇️
...lin/conversion/result/GremlinResultEdgeReader.java 87.50% <100.00%> (-0.38%) ⬇️
...n/conversion/result/GremlinResultVertexReader.java 95.83% <100.00%> (-0.17%) ⬇️
...soft/spring/data/gremlin/common/GremlinConfig.java 100.00% <0.00%> (ø)
...ta/gremlin/config/GremlinConfigurationSupport.java 95.83% <0.00%> (+0.37%) ⬆️
...oft/spring/data/gremlin/common/GremlinFactory.java 91.30% <0.00%> (+2.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1c230f...c24ed3b. Read the comment docs.

@arvind-das
Copy link

is this branch ever going to merge ? this is a highly needed issue fix, one can not get started with it since it does not assure it will save.

@Tin-Nguyen
Copy link
Author

@arvind-das sorry for the delay, I will try to improve the test coverage and merge the PR this weekend.

@arvind-das
Copy link

@arvind-das sorry for the delay, I will try to improve the test coverage and merge the PR this weekend.

Thanks for the update Tim. I know you are busy in your work office work too. Meanwhile I created some generic methods to do my job. They solved the problem for a short time , still need to handle a lot of conditions. Once you merge this, I will be integrating thins into my app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants