How to use Shortest Path Queries in query python

i can show uid 0xbb, 0xb6, 0xb9 in this case


but I can not show in Shortest Path Queries

how to show in Shortest Path Queries

Hi @Mickey248,
I can see the shortest path for the documented example.

Can you please share the JSON output from your query?

yeah, it is good. but now I need to show name in node pink how to show

Hi @Mickey248,
The pink nodes appear in the _path_ section of the response. This section only contains uids and no attribute information is provided. Hence the pink nodes have no name.
The _path_ response is provided for the convenience of the client. The uids in the _path_ response can be looked up by client for additional attribute information. I understand this does not help in putting a name to the pink nodes. AFAIK, this is a constraint right now.

ok. thank you very much. In the future. it can to show? yes or no?

It is ok for v20.07.2.


Is there something different?

Hi @Mickey248
Could you please try this query? It tries to collect additional names, and I am able to see the names of additional nodes.

{

 A as var(func: eq(name, "Alice"))
 M as var(func: eq(name, "Mallory"))

 path as shortest(from: uid(A), to: uid(M), numpaths: 2) {
  friend
 }
 path(func: uid(path)) {
   name
   f as friend
 }
 mfriends(func: uid(f)) @recurse{
  name
  friend
 }
}

Output:
image

This is a bit of a hack. It may add additional nodes to the view.