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

allow accessing other databases via bolt #483

Closed
jexp opened this issue Jun 29, 2017 · 4 comments
Closed

allow accessing other databases via bolt #483

jexp opened this issue Jun 29, 2017 · 4 comments
Assignees
Labels

Comments

@jexp
Copy link
Member

jexp commented Jun 29, 2017

similar to other databases

  • add bolt dependency
  • add configuration possibility for bolt-urls
  • add procedure to load & execute statements data from the other database apoc.load.bolt(url, statement, params, config) and apoc.run.bolt(url, statement, params, config)
  • consider turning returned nodes / rels into virtual ones (via config) or map structures { _id, _labels, _start, _end, _type, ... property1, property2 } (by default)
  • we could have some auto-merge option for nodes / relationships e.g. via apoc.merge.bolt....

This will enable cross cluster operations later and also importing (sub)graphs from other databases directly without exporting the data first.

@albertodelazzari
Copy link
Contributor

@jexp "apoc.run.bolt" will only execute queries on another Neo4j instance and show only the result without modifying the current instance while "apoc.load.bolt" will load data into the current instance as virtual nodes/rels or as actual nodes/rels, right?
The map structures can be used only for "apoc.run.bolt" and if I want to load data I can iterate over the result and add custom merge/create.
We have also to deal with scalar results for "apoc.run.bolt" while for "apoc.run.load" if we have a scalar result we should raise an error.

@jexp
Copy link
Member Author

jexp commented Aug 23, 2017

Perhaps use apoc.execute.bolt instead of apoc.run.bolt for read-write transactions

Use URL with username and password OR key like in mongo/ES

@jexp
Copy link
Member Author

jexp commented Aug 23, 2017

{virtual:true}

@jexp
Copy link
Member Author

jexp commented Sep 3, 2017

@DanielBerton

I looked at your file: https://github.com/larusba/neo4j-apoc-procedures/blob/issue_483/src/main/java/apoc/execute/Bolt.java

Some feedback, as I can't comment there directly:

  • config should not be between statement and params, probably after or before

  • add default values for config and params

  • the UriCreator should generalize around the other URL handling (including config-keys) like in Mongo/ES -> and be moved outside of the class

  • why is the procedure mode=WRITE?

  • that whole conversion handling should be moved to a set of small separate methods

  • there is a TypeSystem in Bolt that should be used (see in the spark-connector)

  • use Util.map() instad of map.put

  • don't use "_" fields, remove that prefix, but a separate properties: {...} entry for the actual data (if it's set)

  • the code in this section (!(value instanceof InternalPath)) is very confusing, not sure what you intend to do

  • InternalEntity is not handled correctly as the first if already handles all non-paths -> it should also handle Node and Relationship explicitely

  • please improve variable names to what they actual mean, e.g stringObjectMap, listOfPairs

  • misses a procedure / support for virtual-nodes/rels/paths

  • for operations that are writing, we should also have a variant that rather returns the result-summary and no data

  • I don#t think username/pwd should be passed into config (we don't do that anywhere else)

  • so perhaps separate into apoc.load.bolt() -> which should also be able (via config) to return virtual entities

  • and apoc.excecute.bolt -> for writes

DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 6, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 6, 2017
AngeloBusato added a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 6, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 8, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 8, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 15, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 15, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 15, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 15, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 16, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 16, 2017
DanielBerton pushed a commit to larusba/neo4j-apoc-procedures that referenced this issue Sep 16, 2017
@jexp jexp closed this as completed in 1737368 Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants