Maybe you can try something like this:
MATCH (n:item)-->(:item) with id(n) as maxId order by id(n) desc limit 1
WITH maxId // retrieve maxId on node with outgoing relationships
UNWIND range(1,10000*3) as x // change this number (3) if needed
WHERE id(n) = toInteger(rand()*maxId) // get node with an id from 0 to maxId
RETURN distinct p
That is, I cycle 10000 times multiplied by 3 and I search for an id between 0 and
I multiplied by 3 because I'm not sure if the current random id match a path
p=(n:item)-[r]->(m:item) or something else. Because of this, I put
limit 10000 to make sure I find no more than 10000.
You could change this
3 based on your dataset.
Of course, if this number is relatively too small, less than 10,000 nodes could be extracted.