Random walks are quite easy to implement with Grakn using the ConceptAPI. One possible method has pseudocode like this:
Start at a Thing that you want to walk from, query for that thing so that you have a concept for it in your application. Let’s say that concept has local variable name
Randomly pick whether you want to walk to :
(1) a relation (if the current thing plays a role),
(2) a roleplayer (if you’re currently at a relation),
(3) an attribute,
(4) owners (if you’re at an attribute)
Now we have a kind of connection that we’re looking for as the next step in the walk, so make a call to the concept API to get the relevant neighbours, either:
From the list of neighbours you now have, randomly pick one as the next step in the walk.
Repeat the process on this neighbour to find the next step.
I hope this helps!