I need to get the relation between any two given entities in DBpedia or in any knowledge graph (entities relatedness), i.e. how they are related to each other.
Something like what RelFinder does but I don't need the visualisation part.
RelFinder makes some consecutive SPARQL queries and returns the relation between two entities.
For example, if you give it "Barack Obama" and "George W. Bush" it returns all the connections between the two entities up to two levels (two entities in between).
I've tried to extract the code that does that from RelFinder but I couldn't.
I appreciate if someone has a code that can get the relatedness between two entities.
Thanks