Hi Benjamin,
I have good news and bad news. The good news is that you can do "SQL-style nullable foreign keys" using CQL's attributes - see the built-in "OuterJoin" example for details. CQL's foreign keys cannot be null in the sense of SQL; they are so-called labeled nulls with a different semantics. In this semantics, if X exists, and f : X -> Y is a foreign key, then f(X) must exist, leading to chains such as e -> f(e) -> f(f(e)) -> ... that must be 'broken' somehow.
The bad news is that first-order logic, and hence CQL, cannot constrain a binary relation to have no cycles using a finite number of formulae -- because as you observe, with one formula, you can only express 'has no cycles <= N' for some number N. This phenomenon is related to the fact that there is no relational algebra query to transitively close a graph's edge relation.
There's a few different strategies for encoding acyclic graphs in CQL. Is that what you have, or are you trying to control the cycles rather than prohibit them?
Regarding your particular constraint, I think
worksIn = worksIn.manager
would do it.
> --
> You received this message because you are subscribed to the Google Groups "Categorical Data" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
categoricalda...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/categoricaldata/84d4bd6f-4a56-49d3-b982-ffed18466d29%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.