Specifying total relation match
This is an interesting question! As relations currently go, I think we do something like:
to specify that we do not want
$r
to have additional roleplayers. I'm not sure if this is the best way to do things (i.e. relation tuples are treated as partial by default), but it makes sense to me that relations and structs should have the same semantics for partial and total matches.8 Replies
@Joshua @christoph.dorn Actually, the above query doesn't work because
$z
can resolve to $x
or $y
so we need to do something like:
But this doesn't work because the inner negations cannot access the outermost variables. I get:
That's an existing but
bug*
not sure we'll try to resolve it in 2.x
Yes I feel we discussed it before
Do we still think that, pending a fix, it is the best way to handle partial vs total relation matching?
errr
probably!
yea i think so
Should we then treat structs in the same way?
Im not sure - we wanted to have them 'unambiguous' to start with, so if the user writes:
Where we can use the fields to determine the unique struct-value type (we won't allow ambiguity - you cant define two different structs with the same field names)
maybe something to revisit
here's a faster way to write this query btw (minus small differences if the same roleplayer appears multiple times) :
note 3.0 syntax would require you to write:
(which actually reads nicer imo)
Ah good catch!