You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/11/15 10:43:54 UTC

[GitHub] [age-viewer] bruinend opened a new issue, #66: Some relations are not showing in AG viewer

bruinend opened a new issue, #66:
URL: https://github.com/apache/age-viewer/issues/66

   **Describe the bug**
   Some relations are not showing in AG viewer when they are clearly in the database. When you play with the weight thickness of the edge then you can see sometimes the edge appearing for a brief moment
   
   **To Reproduce**
   it happens randomly so you cannot reproduce
   
   **Expected behavior**
   the viewer needs to to display all the relations in the database
   
   **Screenshots**
   
   ![image](https://user-images.githubusercontent.com/116341150/201899185-8967b780-5580-4e94-95a4-582022f74aaf.png)
   
   now editing the weight:
   
   now the missing edge appears and the other one dissappears?
   
   ![image](https://user-images.githubusercontent.com/116341150/201899576-0e61ed6d-21bf-4c7c-96a9-26dbd0052e10.png)
   
   
   
   
   
   
   **Desktop (please complete the following information):**
    - OS: Windows
    - Browser : Chrome and Edge
    -  Version 107.0.5304.107 (Official Build) (64-bit)
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1326741150

   @bruinend Ok, thank you for clearing that up.
   I'll need some more information to be able to resolve the bug. Since this doesn't occur all the time and I have not personally ran into this issue this may be some edge case. This may be a bug from the viewer app or from one of the libraries used by the viewer app. May I know how you're initializing this data using python? More specifically what query is created to generate nodes and edges.
   Also, @TahminaBegum, are you programmatically generating your data as well?
   
   Appreciate any additional information in order to be able to resolve this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1363708462

   @marodins yes that is exactly what happens! also I already mentioned this behaviour in this topic...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1318277296

   Hi marodins, 
   
   Thank you for your reply!
   But the id you are talking about is the database id. The ID shown in my examples  are Node attributes. I changed the attribute ID to node_id to see if this would solve the problem but it doesn't :(
   
   See printscreens: GRAPH
   
   ![image](https://user-images.githubusercontent.com/116341150/202397217-37713d90-00e3-4dab-9887-4a4addf73d1f.png)
   
   
   Table:
   
   ![image](https://user-images.githubusercontent.com/116341150/202397463-00d7ac4f-f242-4027-a1ad-08ff9afe5c64.png)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1327509745

   @marodins another thing I noticed what might be strange: the count of the edges is almost double then the edges i defined in the excelsheet?
   
   ![image](https://user-images.githubusercontent.com/116341150/204000808-8f6c5f36-2da9-4859-b559-e9405a8b71a0.png)
   
   
   excel:
   
   ![image](https://user-images.githubusercontent.com/116341150/204000957-b3620d8b-e99c-449d-bd6a-bbd9649f85b4.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1319136577

   Yes, the nodes will need an attribute named 'id'. The attribute's value will need to be an integer. If data is initialized using a csv file and there is no 'id' field then an extra argument needs to be passed to the load_labels_from_file function (linked below) when initializing the graph.
   This may be the cause of this bug. Please let me know if that works.
   
   here's an example file of data:
   https://github.com/apache/age/blob/master/regress/age_load/data/countries.csv
   
   https://age.apache.org/age-manual/master/intro/agload.html#explanation-about-the-csv-format
   <img width="725" alt="Screen Shot 2022-11-17 at 11 38 18 AM" src="https://user-images.githubusercontent.com/67288224/202543531-b577206c-ef46-4227-9a4c-f4ad3d70b133.png">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1362099634

   @bruinend 
   I have not yet reproduced this bug. However, I have found the possible location of the bug.
   After clicking one of the edge labels from the chart legend. Do the edges appear when changing the size from the footer of the chart?
   ![Screenshot from 2022-12-21 13-17-21](https://user-images.githubusercontent.com/67288224/209004320-a7c1f03e-c78a-4ae9-b383-6879fd605c45.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1365513438

   @bruinend thank you, yes there are two separate features that allow edge thickness adjustments. Just wanted to ensure that the footer feature gives you similar results. I found and refactored some code which may have caused this issue. Here's the PR https://github.com/apache/age-viewer/pull/89 . You can try to check and see if this works for you prior to this PR being merged.
   To checkout the PR:
   -- clone the repository in a new directory --
   -- fetch the PR -- 
   1. git fetch origin pull/89/head
   2. git checkout -b edge_pr FETCH_HEAD
   
   -- run application as usual --
   
   If you have time to try this and do try this please report back on the results. If this doesn't solve the issue I'll continue by creating some tests to try to reproduce this bug. Thank you!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1319615054

   But the id column is there see printscreen. They are big integers. 
   I am not using a csv to create the Graph but python code where I read an excel. The Id column is always automatically created in the Postgres database. You can also see that in the relation what id's the edge connects. (start_id - end_id). look at the red arrows.
   
   ![image](https://user-images.githubusercontent.com/116341150/202639035-f97c41c5-5fa1-47fd-ba35-eae19bc81e48.png)
   
   
   
    
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1329802834

   @bruinend
   The queries in your code look correct.
   The image being used here for the viewer application hasn't been updated in over a year. I checked it out here https://hub.docker.com/r/bitnine/agviewer. This is a very old version. 
   
   The first steps would be to clone the current repository, checkout main branch, and run the viewer application as described in the README. This is the latest code for the viewer application. You can run the backend (DB and AGE) separately using the docker image here https://github.com/apache/age. Please report back if this same bug exists with the viewer application. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1332099495

   @marodins 
   hi I cloned the code and activated it quering my current database setup.
   I still have exactly the same problem: there is an EDGE between EP19 and SR4. in the printscreen you can see i am using the latest AG viewer as the Graph selecter is in the printscreen. (Didn't have that one in the old version)
   
   Thanks for the help! Hope you can find the error in the code
   
   ![image](https://user-images.githubusercontent.com/116341150/204801314-57b4e767-c977-41ff-9397-ba9576a7a040.png)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1317567985

   This is likely because the "ID" field is not properly initialized. All node IDs should be integers.
   https://age.apache.org/age-manual/master/intro/agload.html#explanation-about-the-csv-format


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1319756883

   Made another printscreen with the id's yellow: these are the ID's you mean and this is correct in the database. Also the EDGE connecting the id's is in the database but the Graph view doesn't show it. If you select the EDGE type IS_USING and play with the thickness you see the EDGE popping up in the GRAPH. So in my opionion it is cleary an AG viewer code problem?
   
   ![image](https://user-images.githubusercontent.com/116341150/202669734-d4ec538f-6c51-4b3a-9a82-3f9ac8d56247.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] TahminaBegum commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
TahminaBegum commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1326126891

   I'm also struggling with **the same issue.**
   Some relations are not properly viewed in the AG viewer. Is there any expert who can suggest how to solve it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] bruinend commented on issue #66: Some relations are not showing in AG viewer

Posted by GitBox <gi...@apache.org>.
bruinend commented on issue #66:
URL: https://github.com/apache/age-viewer/issues/66#issuecomment-1327400977

   Hi
   This is how i build the connection with python:
   
   import age
   import pandas as pd
   from age.gen.AgtypeParser import *
   
   GRAPH_NAME = "metadata_ndh_graph_TEST4"
   DSN = "host=age port=5432 dbname=metadata_ndh user=root password=root"
   
   ag = age.connect(graph=GRAPH_NAME, dsn=DSN)
   ag.setGraph(GRAPH_NAME)
   
   Then i create the objects (i read data from an excel sheet and build the code).
   After the objects are created i create the links which are also defined in the excel sheet using the node_id attributes.
   
   The id attribute of the nodes are created in the database when creating the Node with the python script.
   
   This is python code to create node:
   
   for sheet in worksheets:
       if sheet != "link":        
           Metadata = pd.read_excel('KgMetaDataTemplatesv0.2_Joined.xlsx', sheet_name=sheet)        
           string = "CREATE (n:" + sheet + " {name: %s , node_id:%s , description: %s, status:%s}) RETURN n"
           for i, j in Metadata.iterrows():
               if j[0] in existing_node_ids: continue
               elif j[1] in existing_node_names:
                   print('Existing name found: ' + str(j[1]))
                   continue
               else:
                   cursor = ag.execCypher(string, params=(j[1],j[0],j[2],j[3]))
                   if showcreation == 1:
                       for row in cursor:
                           print("CREATED: ", row[0])
                   else: continue
           ag.commit()
   
   This is python code to create link (Edge):
   
   for i, j in Metadata_links.iterrows():
       if j[7] != "na":
           label = j[6] + ' , ' + j[7]
       else:
           label = j[6]
       if str(j[2]) == "IS_CONNECTED_TO":
           weight = 10
       elif str(j[2]) == "IS_EXECUTED_ON":
           weight = 5
       elif str(j[2]) == "IS_USING":
           weight = 3
       else: weight = 1
       if j[8] != "na":
           sequence = str(j[8])
           string = "MATCH (a: " + str(j[1]) +  "{node_id: '" + str(j[0]) + "'}), (b: " + str(j[4]) + " {node_id: '" + str(j[3]) + "'}) CREATE (a)-[r:" + str(j[2]) + " {weight: " + str(weight) + ", tag: '" + str(label) + "', sequence: '" + sequence + "'}]->(b)"        
       else:
           string = "MATCH (a: " + str(j[1]) +  "{node_id: '" + str(j[0]) + "'}), (b: " + str(j[4]) + " {node_id: '" + str(j[3]) + "'}) CREATE (a)-[r:" + str(j[2]) + " {weight: " + str(weight) + ", tag: '" + str(label) + "'}]->(b)"
       #print(string)
       cursor = ag.execCypher(string)
       #print (cursor)
       for row in cursor:
           print("CREATED: ", row[0])
       
   
   ag.commit()
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org