CKG icon indicating copy to clipboard operation
CKG copied to clipboard

Cannot perform minimal update on drugbank

Open danielwalke opened this issue 1 year ago • 2 comments

Describe the bug Cannot perform minimal update after reading the docs

To Reproduce Steps to reproduce the behavior:

  1. Install Neo4j desktop
  2. Add dump from https://data.mendeley.com/datasets/mrcf7f4tc2/3 in neo4j
  3. Setup database from dump with Neo4j version 4.2.3
  4. Clone repo via git clone
  5. Unzip data.zip from https://data.mendeley.com/datasets/mrcf7f4tc2/3 in "CKG\data"
  6. Add DrugBase Full Database "full database.xml" in "CKG\data\databases\DrugBank"
  7. Change connector configs (username and password)
  8. Create conda environment
  9. python setup.py install
  10. Navigate into CKG\ckg\graphdb_builder\builder
  11. python builder.py -b minimal -u username -n 1

Expected behavior Creation of drug nodes and links in the database

Results* Errors like: Connection error:{code: Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists} {message: An equivalent constraint already exists, 'Constraint( id=2, name='constraint_6f637020', type='UNIQUENESS', schema=(:Disease {id}), ownedIndex=1 )'.}. (<class 'neo4j.exceptions.ClientError'>, ClientError("An equivalent constraint already exists, 'Constraint( id=2, name='constraint_6f637020', type='UNIQUENESS', schema=(:Disease {id}), ownedIndex=1 )'."), <traceback object at 0x000001A202313D48>), file: connector.py,line: 99 Connection error:{code: Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists} {message: An equivalent index already exists, 'Index( id=3, name='index_662b2000', type='GENERAL BTREE', schema=(:Disease {name}), indexProvider='native-btree-1.0' )'.}. (<class 'neo4j.exceptions.ClientError'>, ClientError("An equivalent index already exists, 'Index( id=3, name='index_662b2000', type='GENERAL BTREE', schema=(:Disease {name}), indexProvider='native-btree-1.0' )'."), <traceback object at 0x000001A202430688>), file: connector.py,line: 99 Connection error:{code: Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists} {message: An equivalent constraint already exists, 'Constraint( id=5, name='constraint_80dda1d2', type='UNIQUENESS', schema=(:Tissue {id}), ownedIndex=4 )'.}. (<class 'neo4j.exceptions.ClientError'>, ClientError("An equivalent constraint already exists, 'Constraint( id=5, name='constraint_80dda1d2', type='UNIQUENESS', schema=(:Tissue {id}), ownedIndex=4 )'."), <traceback object at 0x000001A202366708>), file: connector.py,line: 99 Connection error:{code: Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists} {message: An equivalent index already exists, 'Index( id=6, name='index_846155cf', type='GENERAL BTREE', schema=(:Tissue {name}), indexProvider='native-btree-1.0' )'.}.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows10

danielwalke avatar Feb 02 '24 13:02 danielwalke

I get the same error. But I think it builds normally (I can see the drug nodes in the graph after the minimal update) at some point neo4j changed dealing with the constraint uniqueness. I believe this is the cause of the warning message but I am not fully sure.

bolak92 avatar Apr 03 '24 09:04 bolak92

Thanks, I found the error and i added on all occurrences the "IF NOT EXISTS" to index and constraint creations. Nevertheless, the underyling issue why drugs were not updated were due to the fact that my neo4j db did not allow updates from resources outside of the "import" directory, which I already fixed now

danielwalke avatar Apr 03 '24 09:04 danielwalke