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
Neo4j export #91
Neo4j export #91
Changes from 4 commits
b9f2081
8b6714c
c0d9558
80dc844
7abcbd7
234f057
9f7225d
e9cf1c5
faabd7e
6f0df20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
### Export edge attributes to Neo4j | ||
|
||
Exports edge attributes from a graph in LynxKite to a | ||
corresponding graph in https://neo4j.com/[Neo4j]. | ||
|
||
The relationships in Neo4j are identified by a key property (or properties). | ||
You must have a corresponding edge attribute in LynxKite by the same name. | ||
This will be used to find the right relationship to update in Neo4j. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to explicitly spell out what happens if multiple edges match a given key value combination There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done. I've also added the full Cypher query to the docs. I imagine this may be of interest to advanced Neo4j users and it's not too scary. |
||
The properties of the Neo4j relationships will be updated with the exported edge attributes. | ||
|
||
==== | ||
|
||
[p-url]#Neo4j connection#:: | ||
The Neo4j connection string of the form `bolt://localhost:7687`. | ||
|
||
[p-username]#Neo4j username#:: | ||
Username for the connection. | ||
|
||
[p-password]#Neo4j password#:: | ||
Password for the connection. It will be saved in the workspace and visible to anyone with | ||
access to the workspace. | ||
|
||
[p-version]#Export repetition ID#:: | ||
LynxKite only re-computes outputs if parameters or inputs have changed. | ||
This is true for exports too. If you want to repeat a previous export, you can increase this | ||
export repetition ID parameter. | ||
|
||
[p-labels]#Relationship type#:: | ||
Makes it possible to restrict the export to one relationship type in Neo4j. | ||
This is useful to make sure no other relationship type is accidentally affected. | ||
The format is as in Cypher: `:TYPE`. Leave empty to allow updating any node. | ||
|
||
[p-keys]#Attribute(s) to use as key#:: | ||
Select the attribute (or attributes) to identify the Neo4j relationships by. | ||
The attribute name must match the property name in Neo4j. | ||
|
||
==== |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### Export graph to Neo4j | ||
|
||
Exports a graph from LynxKite to https://neo4j.com/[Neo4j]. | ||
The whole graph will be copied to Neo4j with all attributes. | ||
No existing data is modified in Neo4j. | ||
|
||
A `!LynxKite export timestamp` property is added to each new | ||
node and relationship in Neo4j. This helps clean up the export if needed. | ||
|
||
==== | ||
|
||
[p-url]#Neo4j connection#:: | ||
The Neo4j connection string of the form `bolt://localhost:7687`. | ||
|
||
[p-username]#Neo4j username#:: | ||
Username for the connection. | ||
|
||
[p-password]#Neo4j password#:: | ||
Password for the connection. It will be saved in the workspace and visible to anyone with | ||
access to the workspace. | ||
|
||
[p-version]#Export repetition ID#:: | ||
LynxKite only re-computes outputs if parameters or inputs have changed. | ||
This is true for exports too. If you want to repeat a previous export, you can increase this | ||
export repetition ID parameter. | ||
|
||
[p-node_labels]#Node labels#:: | ||
A string vertex attribute that is a comma-separated list of labels to apply to the newly | ||
created nodes. Optional. You must have https://neo4j.com/developer/neo4j-apoc/[Neo4j APOC] | ||
installed on the Neo4j instance to use this. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If omitted, the nodes will have no label, right? Is this acceptable in Neo4J then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Surprisingly, yes. |
||
|
||
[p-relationship_type]#Attribute with relationship type#:: | ||
A string edge attribute that specifies the relationship type for each newly created relationship. | ||
Optional. You must have https://neo4j.com/developer/neo4j-apoc/[Neo4j APOC] | ||
installed on the Neo4j instance to use this. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. So edges can have only one relationship type, but vertices can have multiple labels? Sorry for bothering you with basic neo4j questions.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. Edges must always have a type, and they can only have a single type. Nodes can have multiple labels or no labels. It's pretty clear that you didn't design this system. 😄 |
||
|
||
==== |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
### Export vertex attributes to Neo4j | ||
|
||
Exports vertex attributes from a graph in LynxKite to a | ||
corresponding graph in https://neo4j.com/[Neo4j]. | ||
|
||
The nodes in Neo4j are identified by a key property (or properties). | ||
You must have a corresponding vertex attribute in LynxKite by the same name. | ||
This will be used to find the right nodes to update in Neo4j. | ||
|
||
The properties of the Neo4j nodes will be updated with the exported vertex attributes. | ||
|
||
==== | ||
|
||
[p-url]#Neo4j connection#:: | ||
The Neo4j connection string of the form `bolt://localhost:7687`. | ||
|
||
[p-username]#Neo4j username#:: | ||
Username for the connection. | ||
|
||
[p-password]#Neo4j password#:: | ||
Password for the connection. It will be saved in the workspace and visible to anyone with | ||
access to the workspace. | ||
|
||
[p-version]#Export repetition ID#:: | ||
LynxKite only re-computes outputs if parameters or inputs have changed. | ||
This is true for exports too. If you want to repeat a previous export, you can increase this | ||
export repetition ID parameter. | ||
|
||
[p-labels]#Node labels#:: | ||
Makes it possible to restrict the export to one label (or combination of labels) in Neo4j. | ||
This is useful to make sure no other node type is accidentally affected. | ||
The format is as in Cypher: `:Label1:Label2`. Leave empty to allow updating any node. | ||
|
||
[p-keys]#Attribute(s) to use as key#:: | ||
Select the attribute (or attributes) to identify the Neo4j nodes by. | ||
The attribute name must match the property name in Neo4j. | ||
|
||
==== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention that the value of this attribute can be a comma separated list of label values if user wants multiple labels. Would be more elegant to allow vectors here, but probably now is not the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect you usually just use one label. Described the commas in the help.