Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

py2neo - How can i fill a cypher query result to another neo4j database?

i tried to use py2neo and run the code

res = graph.run('MATCH p=()-[r:TargetGene]->() RETURN DISTINCT p LIMIT 3')
data = res.to_subgraph()

and it`s return a result like

Subgraph({Node('Gene', Chromosome='8', Gene_name='MYC Proto-oncogene, BHLH Transcription Factor', Gene_symbol='MYC', Protein_name='Myc Proto-oncogene Protein', id='SMTT02203'), Node('Mol', Alias='nan', Molecule_formula='nan', Molecule_name='Daturameteloside I', Molecule_structure='nan', Molecule_weight='636.86', OB_score='19.15225873', id='SMIT12398'), Node('Mol', Alias='l-Evodiamine|CHEMBL486598|ZINC2031813|BDBM50366821', Molecule_formula='C19H17N3O', Molecule_name='Evodiamine', Molecule_structure='nan', Molecule_weight='303.363', OB_score='nan', id='SMIT01413'), Node('Mol', Alias='nan', Molecule_formula='nan', Molecule_name='Threo-Austrobailignan-5', Molecule_structure='nan', Molecule_weight='326.42', OB_score='49.4868716', id='SMIT10425')}, {TargetGene(Node('Mol', Alias='nan', Molecule_formula='nan', Molecule_name='Daturameteloside I', Molecule_structure='nan', Molecule_weight='636.86', OB_score='19.15225873', id='SMIT12398'), Node('Gene', Chromosome='8', Gene_name='MYC Proto-oncogene, BHLH Transcription Factor', Gene_symbol='MYC', Protein_name='Myc Proto-oncogene Protein', id='SMTT02203')), TargetGene(Node('Mol', Alias='nan', Molecule_formula='nan', Molecule_name='Threo-Austrobailignan-5', Molecule_structure='nan', Molecule_weight='326.42', OB_score='49.4868716', id='SMIT10425'), Node('Gene', Chromosome='8', Gene_name='MYC Proto-oncogene, BHLH Transcription Factor', Gene_symbol='MYC', Protein_name='Myc Proto-oncogene Protein', id='SMTT02203')), TargetGene(Node('Mol', Alias='l-Evodiamine|CHEMBL486598|ZINC2031813|BDBM50366821', Molecule_formula='C19H17N3O', Molecule_name='Evodiamine', Molecule_structure='nan', Molecule_weight='303.363', OB_score='nan', id='SMIT01413'), Node('Gene', Chromosome='8', Gene_name='MYC Proto-oncogene, BHLH Transcription Factor', Gene_symbol='MYC', Protein_name='Myc Proto-oncogene Protein', id='SMTT02203'))})

just a subgraph

but when i tried to create graph to another neo4j database via the code followed:

graph_anthor.create(data)

nothing happened, no output and the database is still empty.

i want to know why cause the problem, and find a way to achieve my goal. (fill a cypher query result to another neo4j database)

thanks??

question from:https://stackoverflow.com/questions/65952333/how-can-i-fill-a-cypher-query-result-to-another-neo4j-database

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...