leifeld / dna

Discourse Network Analyzer (DNA)
126 stars 41 forks source link

Gephi and DNA: Compatibility flaws? #269

Closed ShitamSapud closed 1 year ago

ShitamSapud commented 1 year ago

Hello, anyone have solution/ way-around to make the files exported by DNA working on Gephi?

I know there is Vizone but Gephi is aesthetically speaking much better imho.

GML files: Issue{message=Attribute type not found for attribute 'd0'. Set to default string., level=SEVERE} SEVERE
Issue{message=Attribute type not found for attribute 'e0'. Set to default string., level=SEVERE} SEVERE
Issue{message=Attribute type not found for attribute 'prop'. Set to default string., level=SEVERE} SEVERE
Issue{message=Graph attributes 'prop' ignored as not supported by Gephi, level=WARNING} WARNING

It does not export other attribute than the two selected one. For one-mode network, I cannot check if it has been imported correctly.

When importing CSV files, same, it misses important values.

Is there any existing solution to actually obtain from DNA a basic csv files with all the attributes, that maybe we can thereafter manipulate?

For instance: each of my statement are composed of: Author; Organisation; Type of Organisation ; Concept; Agreement; Year; Political Affiliation. However, when I export into csv, it seems that only the selected variables (usually organization and concept) are exported, not the rest. Is there a way to actually have a csv files from my DNA database with all the attributes, to hence import properly on Gephi?

Kindly,

leifeld commented 1 year ago

Gephi is not supported. That may change in the future. But there are more important changes before I can get to that, so I wouldn't expect Gephi support soon. What are the layouts in Gephi that visone does not support? If I see a tangible benefit, maybe I will give it a higher priority.

Did you try to import a graphml file into Gephi? That may not work because the network export produces the visone flavour of graphml, which has additional attributes attached. I don't know much about the Gephi support format. But if you know Java, I would be happy to accept a pull request. DNA is open-source software, and I am happy for the open-source community to help out. I can give you some points on where you need to look for the visone export code, and maybe you can write an export filter for Gephi then.

Indeed, the network CSV files don't contain the attributes. I should write a separate CSV export function for the attributes. If it helps, you can go to the attribute manager, use the mouse and shift key to highlight all cells of the attribute table, press Ctrl-C to copy the table contents, and then paste them in a spreadsheet software like Excel. Not the best solution, but perhaps better than nothing for the moment.

If you can work with R, you can also use the rDNA package. The dna_network function can be used to create network matrices, and the dna_getAttributes function can be used to retrieve a data frame with the attributes. From R, you should be able to export anything you need for further analysis.

ShitamSapud commented 1 year ago

Hello Leifeld! Thank you for your fast reply!

I will take the challenge to use rDNA.

However I am already facing an issue when trying to install rDNA:

Error: Failed to install 'unknown package' from GitHub: cannot open URL 'https://api.github.com/repos/leifeld/dna/contents/rDNA/DESCRIPTION?ref=v3.0.10'

Prior to this issue, everything has been working fine, any advices?

Thank you again for your help

leifeld commented 1 year ago

Indeed, I recently changed the directory structure in the GitHub repository and forgot to update the README on the landing page. I have changed the URL now. Can you copy the new code and try again? Apologies.

ShitamSapud commented 1 year ago

Yes it works, I can take the challenge to use R now, thank you!

leifeld commented 1 year ago

Excellent, thanks for letting me know!