Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph db consistency issue #2861

Closed
andrii0lomakin opened this issue Sep 30, 2014 · 7 comments
Closed

Graph db consistency issue #2861

andrii0lomakin opened this issue Sep 30, 2014 · 7 comments
Assignees
Milestone

Comments

@andrii0lomakin
Copy link
Member

Hi,
Hi Andrey,

Thanks for looking into this problem. The attached file ndexdb.tar.gz is the database that has data in my 2 questions.

  1. I got inconsistent results from these 2 queries.
orientdb {db=ndex}> load record #21:0

--------------------------------------------------
ODocument - Class: null   id: #21:0   v.3
--------------------------------------------------
                  id : -2                 
        in_eCitation : [size=2]           

OK
orientdb {db=ndex}> traverse in_eCitation from #21:0

----+-----+----+------------+-------------
#   |@RID |id  |in_eCitation|out_eCitation
----+-----+----+------------+-------------
0   |#21:0|-2  |[size=2]    |null        
1   |#23:0|-3  |null        |[size=2]    
----+-----+----+------------+-------------

2 item(s) found. Traverse executed in 0.007 sec(s).
orientdb {db=ndex}>

The traverse will only report one edge. from #21:0 to #23:0. This was caused by creating the same edge twice using the Graph API. It can be reproduced by running test1() in Unit test class org.ndexbio.task.parsingengines.xbelParserTest. The source code is in the attached file ndextest.tar.gz.

  1. I also got inconsistent data from these 2 command,
orientdb {db=ndex}> load record #21:3

--------------------------------------------------
ODocument - Class: null   id: #21:3   v.112
--------------------------------------------------
                  id : 373                
               title : Trends in molecular medicine
              idType : URI                
          identifier : pmid:15350900      
             authors : [Barry RE, Krek W] 
        in_citations : #26:0{UUID:dd5023d3-45a3-11e4-b9ac-90b11c72aefa,createdTime:Fri Sep 26 10:38:02 PDT 2014,modificationTime:Fri Sep 26 10:38:02 PDT 2014,name:BEL Framework Small Corpus Document,isLocked:false,isComplete:true,visibility:PRIVATE,version:1.2,in_admin:#18:0,description:Approximately 2000 hand curated statements drawn from 57 PubMeds,out_networkNS:[size=39],out_BaseTerms:[size=1091],out_citations:[size=57],out_supports:[size=792],out_networkNodes:[size=1598],out_networkEdges:[size=2174],out_reifiedETerms:[size=228],provenance:{"properties":[],"uri":"http://ws1.ndexbio.org/network/dd5023d3-45a3-11e4-b9ac-90b11c72aefa","creationEvent":{"eventType":"FILE_UPLOAD","properties":[{"name":"filename","value":"small_corpus.xbel","type":"SimplePropertyValuePair"}],"endedAtTime":1411753126870,"startedAtTime":1411753082297,"inputs":null,"type":"ProvenanceEvent"},"type":"ProvenanceEntity"},edgeCount:2174,nodeCount:1598} v501
         in_citeFrom : [size=27]          
        in_eCitation : [size=80]          
        in_nCitation : [size=3]           

OK
orientdb {db=ndex}> select count(*) from edge where out_eCitation=#21:3;

----+-----+-----
#   |@RID |count
----+-----+-----
0   |#-2:0|82  
----+-----+-----

1 item(s) found. Query executed in 0.126 sec(s).

This looks like a separate issue from 1), and it only happens if I use remote connection to populate the db. It looks like some edges are missing in one direction. It can be reproduced by running test2() in the same unit test class I mentioned above.

If you want to run the test code, you can save the attached ndex.properties file and modify the propertyFilePath field in the xbelParserTest class to point to it and modify line 98 to point the test file to where your unzipped ndextest.tar.gz.

We are using your 1.7.9 release for Linux.

Feel free to drop me an email if you have any questions.

@andrii0lomakin andrii0lomakin self-assigned this Sep 30, 2014
@andrii0lomakin andrii0lomakin added this to the 2.0 Final milestone Sep 30, 2014
@andrii0lomakin
Copy link
Member Author

Hi,
The first issue, I mean edge duplication is not an issue, because edges duplications are allowed by tinkerpop contract so that is normal.
About the traverse it omits duplication in traverse to avoid cycles during traverse that is why you see single vertex

@andrii0lomakin
Copy link
Member Author

Hi,
I have ran test2() and got

orientdb {db=ndex}> load record #21:3                        

--------------------------------------------------
ODocument - Class: citation   id: #21:3   v.147
--------------------------------------------------
                  id : 718                 
               title : Journal of clinical oncology : official journal of the American Society of Clinical Oncology
              idType : URI                 
          identifier : pmid:16170185       
             authors : [Beeram M, Patnaik A, Rowinsky EK]
        in_citations : [size=1]            
         in_citeFrom : [size=28]           
        in_eCitation : [size=-1]           
        in_nCitation : [size=8]            

what should I do further ?

P.S. I used 2.0-M2 release

@andrii0lomakin
Copy link
Member Author

Also I performed following query:

orientdb {db=ndex}> select from citation where id = 373

----+-----+----+----------------------------+------+-------------+-------+------------+-----------+------------+------------
#   |@RID |id  |title                       |idType|identifier   |authors|in_citations|in_citeFrom|in_eCitation|in_nCitation
----+-----+----+----------------------------+------+-------------+-------+------------+-----------+------------+------------
0   |#21:2|373 |Trends in molecular medicine|URI   |pmid:15350900|[2]    |[size=1]    |[size=27]  |[size=-1]   |[size=3]    
----+-----+----+----------------------------+------+-------------+-------+------------+-----------+------------+------------

1 item(s) found. Query executed in 0.034 sec(s).
orientdb {db=ndex}> load record #21:2

--------------------------------------------------
ODocument - Class: citation   id: #21:2   v.113
--------------------------------------------------
                  id : 373                 
               title : Trends in molecular medicine
              idType : URI                 
          identifier : pmid:15350900       
             authors : [Barry RE, Krek W]  
        in_citations : [size=1]            
         in_citeFrom : [size=27]           
        in_eCitation : [size=-1]           
        in_nCitation : [size=3]            

OK

@andrii0lomakin
Copy link
Member Author

I reproduced issue

andrii0lomakin added a commit that referenced this issue Oct 1, 2014
@andrii0lomakin
Copy link
Member Author

Could you try now with 2.0-SNAPSHOT ?

andrii0lomakin added a commit that referenced this issue Oct 2, 2014
@jingjingbic
Copy link

Could you also fix it in 1.7.10?

@andrii0lomakin
Copy link
Member Author

yes. it is done there too.

andrii0lomakin added a commit that referenced this issue Oct 5, 2014
Conflicts:
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBag.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBagDelegate.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/embedded/OEmbeddedRidBag.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/sbtree/OSBTreeRidBag.java
andrii0lomakin added a commit that referenced this issue Oct 5, 2014
Conflicts:
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBag.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBagDelegate.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/embedded/OEmbeddedRidBag.java
	core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/sbtree/OSBTreeRidBag.java
andrii0lomakin added a commit that referenced this issue Oct 5, 2014
@lvca lvca removed the In Progress label Oct 14, 2014
@lvca lvca modified the milestones: 2.0 Final, 2.0-M3 Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants