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

Database version update #387

Open
herencalik opened this issue Jun 22, 2022 · 12 comments
Open

Database version update #387

herencalik opened this issue Jun 22, 2022 · 12 comments
Assignees

Comments

@herencalik
Copy link
Collaborator

Example Visuall program currently uses Neo4j database with version 3.5.20 and the newest version of Neo4j is 4.4.8. Between these two versions there are notable functionality and performance differences. However, newer versions break the "General Queries". Necessary parts of database API should be updated to make the program compatible with Neo4j's newest version.

@herencalik herencalik self-assigned this Jun 22, 2022
@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Oct 30, 2022

The visual program currently uses the Neo4j database with version 3.5.20 and the newest version of Neo4j is 4.4.12. Newer versions break some places.

1. Using CALL apoc.cypher.runTimeboxed()

Side effect of some internal change along the way from 3.x -> 4.x: a node, relationship or path instance is now bound to the transaction it originates No longer reuse such a instance in a different transaction except using id(x) to get it's internal id.
neo4j-contrib/neo4j-apoc-procedures#1652 (comment)

2. Using General Queries

CALL graphOfInterest
CALL commonStream
CALL neighborhood

Also ;

Release Release Date End of Support Date Compatible Driver Versions
3.5n1 November 29, 2018 May 27, 2022 n3 4.4, 4.3, 4.2, 4.1, 4.0, 1.7

NEO4J 3.5 not supported anymore

@ugurdogrusoz ugurdogrusoz assigned LaraMerdol and unassigned herencalik Sep 5, 2023
@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Sep 6, 2023

Some side effect of some internal change along the way from 3.x -> 4.x: a node, relationship or path instance is now bound to the transaction it originates to. You can no longer reuse such a instance in a different transaction except using id(x) to get it’s internal id.
In Neo4j 4 and later versions, the APOC procedure apoc.cypher.runTimeboxed has indeed been deprecated, and the newer versions of APOC do not include a direct replacement with a built-in timeout parameter.

LaraMerdol added a commit that referenced this issue Sep 9, 2023
@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Sep 10, 2023

Also, the visuall-advanced-query should be updated.
The changes for migrating neo4j 3. to 5.10 will be mainly done. However, there are some big changes that may require a logic change in queries. For now, the neo4j methods used for the current logic are still valid but they are marked as deprecated and will be removed.
Screen Shot 2023-09-11 at 13 59 39
The id property which is an internal unique identifier automatically assigned to every node and relationship in the Neo4j database is deprecated and related meyhods will be removed.

@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Sep 10, 2023

The new neo4j database should be uploaded to the server.
Neo4j Version: 5.10.0

LaraMerdol added a commit to iVis-at-Bilkent/visuall-advanced-query that referenced this issue Sep 28, 2023
LaraMerdol added a commit to iVis-at-Bilkent/visuall-advanced-query that referenced this issue Oct 4, 2023
@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Oct 5, 2023

Using function ID() is deprecated and it is recommended to use elementID() instead.
Screen Shot 2023-10-05 at 11 04 26

https://neo4j.com/docs

Although using the function ID() is deprecated, it's important to note that Visuall still identifies everything by this ID. Even Cytoscape uses this ID to identify nodes and edges. The elementID is a string type and is structured like "4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0". While using elementID instead of ID is one possible solution, the problem is that Cytoscape uses this ID as a selector. However, this type of id is not a proper selector id because it is also used as a CSS selector. According to the valid CSS ids rules, ids should begin with a letter (a-z or A-Z) or an underscore (). Subsequent characters can be letters, numbers (0-9), hyphens (-), or underscores (). It's important to note that colons (:) are not valid characters for CSS IDs.

Valid CSS ids should adhere to the following rules:

  • Must begin with a letter (a-z or A-Z) or an underscore (_).
  • Subsequent characters can be letters, numbers (0-9), hyphens (-), or underscores (_). Colons (:) are not valid characters for CSS IDs.

@LaraMerdol
Copy link
Collaborator

Also, the visuall-advanced-query should be updated. The changes for migrating neo4j 3. to 5.10 will be mainly done. However, there are some big changes that may require a logic change in queries. For now, the neo4j methods used for the current logic are still valid but they are marked as deprecated and will be removed. Screen Shot 2023-09-11 at 13 59 39 The id property which is an internal unique identifier automatically assigned to every node and relationship in the Neo4j database is deprecated and related meyhods will be removed.

The Advanced Queries have been updated to use the elementId instead of ID. This update was necessary due to some significant changes that came with the migration from neo4j 3.x to 5.10. While the current logic still works, some of the neo4j methods used are marked as deprecated and will eventually be removed.

@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Oct 5, 2023

Neo4j reuses its internal ids when nodes and relationships are deleted. This means that applications using, and relying on internal Neo4j ids, are brittle or at risk of making mistakes. It is therefore recommended to rather use application-generated ids.
Possible Problems Example: https://community.neo4j.com/t/unrelated-node-and-relationship-have-same-id/31104

The second possible solution is to create application-generated ids and use them instead of IDs.

We can use UUIDs;
https://neo4j.com/labs/apoc/5/graph-updates/uuid/

@LaraMerdol
Copy link
Collaborator

Neo4j reuses its internal ids when nodes and relationships are deleted. This means that applications using, and relying on internal Neo4j ids, are brittle or at risk of making mistakes. It is therefore recommended to rather use application-generated ids. Possible Problems Example: https://community.neo4j.com/t/unrelated-node-and-relationship-have-same-id/31104

The second possible solution is to create application-generated ids and use them instead of IDs.

We can use UUIDs; https://neo4j.com/labs/apoc/5/graph-updates/uuid/

Not Worked !! I tried it, but it caused some internal issues.(Such as edges not holding the application-generated IDs for their source and target nodes, it causes another query to find the nodes.)) Moreover, assigning an application-generated ID to all nodes is not quite practical. To address this, I added UUID using procedures that handle the automatic addition of UUID properties via the UUID Handler Lifecycle. The UUID handler is a transaction event handler that automatically adds the UUID property to a provided label and for the provided property name.

@LaraMerdol
Copy link
Collaborator

I have decided to use elementId instead of id to solve this problem. To overcome the problem described below;

Using function ID() is deprecated and it is recommended to use elementID() instead. Screen Shot 2023-10-05 at 11 04 26

https://neo4j.com/docs

Although using the function ID() is deprecated, it's important to note that Visuall still identifies everything by this ID. Even Cytoscape uses this ID to identify nodes and edges. The elementID is a string type and is structured like "4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0". While using elementID instead of ID is one possible solution, the problem is that Cytoscape uses this ID as a selector. However, this type of id is not a proper selector id because it is also used as a CSS selector. According to the valid CSS ids rules, ids should begin with a letter (a-z or A-Z) or an underscore (). Subsequent characters can be letters, numbers (0-9), hyphens (-), or underscores (). It's important to note that colons (:) are not valid characters for CSS IDs.

Valid CSS ids should adhere to the following rules:

  • Must begin with a letter (a-z or A-Z) or an underscore (_).
  • Subsequent characters can be letters, numbers (0-9), hyphens (-), or underscores (_). Colons (:) are not valid characters for CSS IDs.

I converted the colon (:) to an underscore (_) to create a valid CSS selector character sequence.
example:
"4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0" --> "n4_c0a65d96-4993-4b0c-b036-e7ebd9174905_0"

@LaraMerdol
Copy link
Collaborator

LaraMerdol commented Oct 8, 2023

I have updated the visuall-advanced-queries and visuall to use Neo4j v5.10. To accomplish this, I had to convert all parts that were using ID to use elementId instead. The new Neo4j v5.10 database is now available on the ivis server and can be found under the name neo4j-server-visuall-new. The code changes are located under the branch unstable-neo4j-update for both repositories.

@LaraMerdol
Copy link
Collaborator

New Neo4j 5.10 database is now running on port 3001; the credentials are username: neo4j and password: 12345678.
http://ivis.cs.bilkent.edu.tr:3001/browser/

LaraMerdol added a commit to iVis-at-Bilkent/visuall-advanced-query that referenced this issue Oct 11, 2023
LaraMerdol added a commit that referenced this issue Oct 13, 2023
LaraMerdol added a commit that referenced this issue Oct 17, 2023
LaraMerdol added a commit that referenced this issue Oct 22, 2023
LaraMerdol added a commit that referenced this issue Oct 23, 2023
LaraMerdol added a commit that referenced this issue Oct 23, 2023
@LaraMerdol LaraMerdol removed their assignment Oct 23, 2023
@LaraMerdol
Copy link
Collaborator

During the review process, some parts were changed. You can review the changes from #388. That pull request was closed because the branch was renamed to unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants