-1

I've encountered an issue while using Gephi, specifically related to importing nodes. Currently, the labels appear in the IDs column, and the label column remains empty. I'm seeking assistance to resolve this matter.

I have tried many methods to fix this issue. however, none works and below you can see you it currently looks like.

Wrong ID column

Yannis P.
  • 2,745
  • 1
  • 24
  • 39
  • Are you importing a CSV or other spreadsheet to Gephi? Not 100% sure what's the reason but if you are using some spreadsheet format for your nodes, you should should define which columns should be mapped where in the Gephi workspace. If you don't have a column named ID, then one will be created for you. You might then have already had a column in your imported data, which you call ID, but it contains labels for your nodes. – Yannis P. Aug 27 '23 at 12:38
  • Thank you, Yannis for your kind response. I was able to configure the cause of the issue. When importing nodes and then importing edge, I had to choose the "append to existing workplace". However, I had another issue now, a part of nodes have ids and other have no ids (please see https://imgur.com/a/489Nrb9 ) Also, as you can see from that picture, the Targets have been also included there; although in the nodes CVS file, it also includes IDs and Labels. – Aljarah A. Aug 27 '23 at 19:45
  • Not quite sure but since you mentioned targets, the nodes not having an ID can be the nodes corresponding to the targets of your edges. Import first *all* nodes including all possible sources and all possible targets and then import the edges. – Yannis P. Aug 27 '23 at 21:16
  • Thank you, Yannis for your great help. When adding nodes first, I can see IDs and labels in a correct format. However, when adding edges, all targets and sources are added below my current nodes. It seems very strange. Again, I really appreciate your willingess to help. Best Ahmad – Aljarah A. Aug 28 '23 at 22:50
  • Most probably some source node or target node IDs in the CSV file with the edges, do not correspond to a valid node ID in the CSV file with the nodes. For example you seem to be having a edge wih target "consumer personality". You have to create a node with some ID and a label "consumer personality"! Otherwise, Gephi does what you show us in the picture from you comment above. If you will need some more help please either show all nodes and edges here or write [here](https://www.facebook.com/groups/gephi) – Yannis P. Aug 29 '23 at 17:54
  • Thanks, Yannis, This is a sample of my edge https://imgur.com/a/Mv3BkG2 and I created nodes for that sample https://imgur.com/a/Q8Ma1pJ . As you can see in nodes section, all targets and sources show there in one column first and then followed by ID and Labels. Best – Aljarah A. Aug 30 '23 at 09:04
  • @YannisP. this is a video of what happening: https://imgur.com/a/LO4CF9i – Aljarah A. Aug 31 '23 at 14:26

1 Answers1

0

Your error comes from the fact that you are not using a separate field id for each node, a field that should be added before any other fields. Gephi is automatically an id for your nodes and tries to map the edges to the existing ids. As this seems to fail, Gephi appends at the nodes tables the ids it cannot find basically every node in your edge list.

An improved approach should use thhe following spreadsheet for the nodes:

id  label
1   social media 
2   mobile money technology 
3   social media equity
4   justice for employees
5   five-factor model
6   the global belief in a just world
7   justice for the self
8   consumer personality
9   empowerment 
10  brand advocacy
11  stimulus-organism-response theory
12  hotel satisfaction
13  mobile money agent
14  africa
15  continuous usage

and the next one for the edges:

Source  Target
8   8
8   5
8   1
8   3
2   14
2   15
2   9
2   13
2   2
2   11
10  12
10  4
10  7
10  10
10  6

Here is how the Data Laboratory looks.

Nodes

Nodes

Edges

Edges

I improvised a bit but I hope this will work for you. It seems imho close to what you wanted to achieve.

A very good and detailed tutorial for importing CSVs for nodes and edges can be found here.

NOTE: In the import you are showing in your comments, you seem to connect eg consumer personality to itself. Gephi does not allow it right now and will pop up a message after the imports, saying that 3 self-loops were removed.

Yannis P.
  • 2,745
  • 1
  • 24
  • 39