The problem is how to calculate the distance between two nodes (concepts) in a Triple Store (RDF) using sparql queries without know the type of edges. Essencially, is to use Dijkstras_algorithm to find the shorter path between two concepts in a Triple Store.
It is possible if we know the type of egde: Calculate length of path between nodes?
One other solution is to use classes distances(do not work if concepts are not extended from the main classes): Measuring distances among classes in RDF/OWL graphs
Example:
Find the shorter distance between http://bioinformatics.ua.pt/coeus/resource/uniprot_P01008 and http://bioinformatics.ua.pt/coeus/resource/go_GO:0005576