Can't find structure to import data

Get help with your data
cm4004
Posts:6
Joined:29 Mar 2018 17:40
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Can't find structure to import data

Post by cm4004 » 29 Mar 2018 17:55

Hello,

I would like to import data for a set of creatives and their participation at some events (I have listed an example below). However, I also need include some attributes, i.e. gender, nationality for the creatives and some attributes for the events, i.e. location, time. In addition, I would like to record the type of relationship that this creative has with another one, i.e. friend, professional, partner. However, the other person might not participate in the same event. I have been playing an around with different ways to structure the data, so that I can import into Gelphi, but all attempts have been fruitless. Any suggestions would be really welcomed.

Many thanks,
Christian

nameA, genderA, nationalityA, residence (country)A, residence (city)A, nameB, genderB, nationalityB, residence (country)B, residence (city)B, relation, event, date, event-space, country, city The part marked in bold is only for personA.
Christo, male, Bulgaria, United States, New York, Jeanne-Claude, female, Morocco, United States, New York, Friend, Monday Night Letters, 1964-11-07, Cafe Au Go Go, United States, New York

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by eduramiba » 02 Apr 2018 12:24

Hi,
What have you tried?

In a simple edges table import, you can include a 'kind' column to indicate the type of relationship.
https://seinecle.github.io/gephi-tutori ... hi-en.html

cm4004
Posts:6
Joined:29 Mar 2018 17:40
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by cm4004 » 06 Apr 2018 18:08

Hi Eduramiba,

Thank you. I have tried different versions, for instance, rows with nodesA on the one side and columns with nodesB on the other, but then I don't understand how I can reference common events. I have also tried nodesA as rows and events as columns, but then I don't know how I can add additional attributes to the relationship.

Based on the data that I have, how would you structure an txt or csv file? Could you please provide an example?

Many thanks,
Christian

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by eduramiba » 07 Apr 2018 11:24

Just add any extra attribute you need:

source,target,label,attr1,attr2
nodeA,nodeB,relationship,somethingextra,somethingextra2

You can create a spreadsheet with excel and import it directly as xls(x), too.

Just make sure your first 2 columns are named exactly source and target, they refer to node's ids.

cm4004
Posts:6
Joined:29 Mar 2018 17:40
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by cm4004 » 07 Apr 2018 12:10

Thanks, but I still don’t get it. Could send you an excel spreadsheet with an example of the data?

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by eduramiba » 07 Apr 2018 16:19

This for example
Attachments
edges_example.xlsx
(12.23KiB)Downloaded 1336 times

cm4004
Posts:6
Joined:29 Mar 2018 17:40
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by cm4004 » 08 Apr 2018 13:10

Thanks a lot. I have attached a file with an example. The first rows relate to the person and its attributes, followed by the event that the person attended. This is followed by some information on other relationships of that person. Does that make sense to you? How would you structure these data, so that they can be imported.

Many thanks!!!!!!!!!
Attachments
test.xlsx
(10.95KiB)Downloaded 1321 times

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by eduramiba » 08 Apr 2018 13:31

You have several potential relationships per row.
First you will need to choose what relationships you want to visualize.

Once you select your types of nodes (person, city...), you will create a nodes spreadsheet, which will contain at least one node id per row (in column named Id), and then any other attributes you need such as label or type of node.
Then you will need to process your data so each row contains a source and a target (each being a node id) present in the nodes spreadsheet.

Finally, import both nodes and edges file, and during import report choose to merge their data in the same workspace.

That will probable create a k-partite network (person to city, person to person...). If that's the case, then I advise you to install the multimode networks plugin and follow this guide: https://seinecle.github.io/gephi-tutori ... ph-en.html

cm4004
Posts:6
Joined:29 Mar 2018 17:40
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by cm4004 » 09 Apr 2018 14:35

Many thanks for your additional comments. May I ask a few more questions:

"You have several potential relationships per row. First you will need to choose what relationships you want to visualize."

I think the issue here is that I do not just want to visualise relationships, but also be able to infer relationships. For instance, does the quality of the relationship (friend, partner, business) matter as to be included in one of these events?

Anyhow, my central issue are the events and the people attending these events. However, while these people attend an event, let's say in NYC, they might be based in London or in Madrid. So, that is something that I need to be able to show as well.

"Once you select your types of nodes (person, city...), you will create a nodes spreadsheet, which will contain at least one node id per row (in column named Id), and then any other attributes you need such as label or type of node.
Then you will need to process your data so each row contains a source and a target (each being a node id) present in the nodes spreadsheet."

Sorry, but that is the tricky part for me. How do I need to organise the data. Based on the excel file, would you be able to provide an example? Let's say, person (attributes; gender; country, city) + event (attributes; date, title, location).

"Finally, import both nodes and edges file, and during import report choose to merge their data in the same workspace."

Again, it would be really helpful to have an example.

That will probable create a k-partite network (person to city, person to person...). If that's the case, then I advise you to install the multimode networks plugin and follow this guide: https://seinecle.github.io/gephi-tutori ... ph-en.html

Okay, thanks a lot. Will have a look at that tool.

Many thanks for your help.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't find structure to import data

Post by eduramiba » 09 Apr 2018 16:14


Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable