Can two nodes have the same predicate, the same facts key, but different facts value?


(Yg2018) #1

I want to know if two nodes in the Dgraph library can have two identical predicates, but they can be distinguished according to the same facts key, but different facts values?

(Daniel Mai) #2

Two different nodes (i.e., subjects) can have the same predicate/object with different facet values (I believe you’re asking about facets). They’re distinct.


_:first  <name> "Daniel" (nickname=Dan) .
_:second <name> "Daniel" (nickname=Danny) .

(Yg2018) #4

trip_at_the_same_time: uid .
<0x1> < name > “alice”@en .
<0x7531> < name > “Bob”@en .

<0x1> <trip_at_the_same_time> <0x7531> (time=“2019”) .
<0x1> <trip_at_the_same_time> <0x7531> (time=“2018”) .

can dgraph have two differnt edges like above?

(Haitao) #5

I have already tried, dgraph can not support your demand.The facet value will be overwrite by the last mutation.

(Manish R Jain) #6

You need to create two different data points for the two trips.