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

Remove graph attributes from gexf output (not supported by networkx). #68 #69

Merged
merged 1 commit into from Feb 22, 2019

Conversation

Projects
None yet
3 participants
@greebie
Copy link
Collaborator

greebie commented Feb 21, 2019

GitHub issue(s):

#68

What does this Pull Request do?

Removes the graph attributes from the gexf output.
Graph attributes are analyses about the entire graph (e.g. average density)
and are not supported in gexf.

How should this be tested?

The best way to test this is to:
- Output ./graphpass -qg {CollectionId}-gephi.graphml on an existing graphml from auk to {CollectionId}-gephi.gexf
- Add file to data folder to an AUK-NOTEBOOKS instance.
- Change coll_id to {CollectionId}
- Run the first two windows + the last (network analysis) window. It should produce a graph.

Additional Notes:

The following perl command will fix the problem with existing gexf files. This is a better option than try to redo files upstream.

perl -0777 -i.original -pe 's/\s+<attributes class="graph">\s+<\/attributes>//' {CollectionId}-gephi.gexf

(I tried to use sed, but multi-line find and replace got more complicated than I wanted it to be.)

Interested parties

@ianmilligan1 @ruebot

Thanks in advance for your help with the Archives Unleashed Project!

@greebie

This comment has been minimized.

Copy link
Collaborator Author

greebie commented Feb 21, 2019

@ruebot I think @ianmilligan1 is fine to review this. I just wanted to flag this as something that has some upstream issues.

I do not think it's urgent, because we are pointing people to gephi and not networkx for graph analysis. But notice the bash command if you want to just fix all the gexfs.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 21, 2019

Codecov Report

Merging #69 into master will increase coverage by 0.76%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   51.17%   51.94%   +0.76%     
==========================================
  Files           9        9              
  Lines        1149     1132      -17     
==========================================
  Hits          588      588              
+ Misses        561      544      -17
Impacted Files Coverage Δ
src/main/gexf.c 6.72% <ø> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96aded8...c72e8ac. Read the comment docs.

@ruebot

This comment has been minimized.

Copy link
Member

ruebot commented Feb 21, 2019

Cool. Thanks for providing a backwards fix. That's super helpful 😃

Once this is merged, feel free to tag a release, or if you want me to, I can do it. I'll throw it on the production instance when it's good to go.

@ianmilligan1
Copy link
Member

ianmilligan1 left a comment

Tested and the ensuing file both works on Gephi and in @greebie's networkx section of the prototype notebooks.

@ruebot ruebot merged commit ddbb38a into master Feb 22, 2019

3 checks passed

codecov/patch Coverage not affected when comparing 96aded8...c72e8ac
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ruebot ruebot deleted the issue-68 branch Feb 22, 2019

@ruebot

This comment has been minimized.

Copy link
Member

ruebot commented Feb 22, 2019

Deployed to production, and updated existing files:

$ find . -iname "*.gexf" -type f -exec perl -0777 -i.original -pe 's/\s+<attributes class="graph">\s+<\/attributes>//' {} \;

Should be good to go with this example:

$ diff 10188-gephi.gexf 10188-gephi.bak 
13a14,15
>   <attributes class="graph">
>   </attributes>
@greebie

This comment has been minimized.

Copy link
Collaborator Author

greebie commented Feb 22, 2019

🥇 Thanks for sharing the general bash script.

@ianmilligan1

This comment has been minimized.

Copy link
Member

ianmilligan1 commented Feb 22, 2019

Hazzah, awesome - thanks both (@greebie @ruebot)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment