Discussion Forum

Calculate the shortest path between two nodes of the ontology

It is possible to calculate the shortest path between two nodes of the ontology for example between two nodes with BASE TYPE: ENTITY_TYPE. In the example “social_network” I tried the following and got the following error:

match $x id V77904; get;
{$x label office sub entity;}

match $x id V73832; get;
{$x label public-user sub entity;}

compute path from V77904, to V73832;
UNKNOWN: java.lang.ClassCastException: ai.grakn.kb.internal.concept.EntityTypeImpl cannot be cast to ai.grakn.concept.Thing. Please check server logs for the stack trace.

compute path returns paths between instances of data.
Computing path between schema concept types (which is what you’re attempting to do) is not currently supported.

Feel free issue a feature request for it :slight_smile: