Return specific nodes in the query result

You are using “has” func in the first level. This query returns any node who has the predicate “name”.

The part

type@filter(eq(name,"TemperatureObservation")){
    }

is doing nothing. It is isolated.

The nested query in the result edge is returning what you want.

If you wanna use this query anyway. Add the @cascade directive

e.g

{
  yo(func:has(name))  @cascade { 
	 name   		 
type@filter(eq(name,"TemperatureObservation")) { 
# If the node doesn't have this nested connection. It will return empty.
# So, remove it if you need tho.
    uid
    }
    result@filter(eq(floatValue, 6.0)){
      name
      floatValue
    }
  }
}
1 Like