What happens if the edge property doesn't exist for certain kind of edge while traversing?

Consider a query like this

return the k-hop neighbors count.

CREATE QUERY khop(VERTEX<MyNode> start_node, INT depth) for graph graph500{

    int i = 0; 

    Start = {start_node};

    WHILE (i < depth) DO

        Start = SELECT v FROM Start:u - (:e)->:v where v.some_property == 1

        i = i + 1;

   END;

   PRINT Start.size();

}

What if some_property only exists in one Edge table. What value would I get for other kind of edges? I tried is null predicate but it errors saying that some_property is not nullable.

regards,

Amos

Hi Amos, using v.some_property in WHERE clause will infer that only the vertex types with ‘some_property’ is valid, all other types will be filtered out.

If you would like to keep types without ‘some_property’, you can do 'where v.some_property == 1 OR v.type != “the_vertex_type” '.

Thanks. Does it also apply to edge properties? `e.some_property == 1"

Hi Amos,

You are correct, the same type inference logic happens on edge properties.

Best,

Renchu