DerwenAI / kglab

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, NetworkX, RAPIDS, RDFlib, pySHACL, PyVis, morph-kgc, pslpython, pyarrow, etc.
https://derwen.ai/docs/kgl/
MIT License
581 stars 66 forks source link

Community structure question #200

Closed fils closed 2 years ago

fils commented 3 years ago

So I am trying to replicate: https://derwen.ai/docs/kgl/ex6_1/

Using https://s3.amazonaws.com/ufokn.public/hydroshare_graph.nt

With https://gist.github.com/fils/3b0edcc33dc37a0290b44ac0d0f58fd9

and yet... I fail. Any guidance on what I might be doing wrong or why my source graph doesn't work for this is appreciated!

Mec-iS commented 2 years ago

Hi, thanks for using kglab. I made your code to work by installing the packages in this order:

! pip install cairocffi
! pip install igraph
! pip install leidenalg
! pip install kglab
import kglab
import igraph as ig
import leidenalg as la
from networkx.algorithms import bipartite

cairocffi should be installed before igraph as the latter needs the former when the Python wheel is build by the package manager.

Here the result I got using your code: Screenshot from 2021-11-29 15-28-21