ORM Techniqueshttps://www.ormfoundation.org:443/forums/84.aspxThis forum is for discussing how to use ORM to model various scenarios.enCommunityServer 2007.1 (Build: 20917.1142)Re: Modeling intransitivityhttps://www.ormfoundation.org:443/forums/thread/2550.aspxThu, 07 Apr 2011 09:16:25 GMT9d039735-a311-4a8d-9c49-a0bb2572af9e:2550JackStoneS0https://www.ormfoundation.org:443/forums/thread/2550.aspxhttps://www.ormfoundation.org:443/forums/commentrss.aspx?SectionID=84&PostID=2550That clarifies a lot. Thank you!Re: Modeling intransitivityhttps://www.ormfoundation.org:443/forums/thread/2548.aspxWed, 06 Apr 2011 17:23:00 GMT9d039735-a311-4a8d-9c49-a0bb2572af9e:2548Terry Halpin0https://www.ormfoundation.org:443/forums/thread/2548.aspxhttps://www.ormfoundation.org:443/forums/commentrss.aspx?SectionID=84&PostID=2548<p>Hi Jack</p><p>You are correct in that an intransitivity constraint is too weak to block the data example you cite. Many years ago, Peter Ritson and I formalized a stronger version of intransitivity, which we called an intransitive-jump constraint (ITJ), which would handle such cases. This is designed to block jumps over one or more nodes, so includes intransitivity as a special case (jumping over one node only). This is discussed on page 3-19 of Peter's PhD thesis. </p><p>In DatalogLB, you can enforce it by first recursively deriving the isAncestorOf predicate as the transitive closure of the base isParentOf predicate, thus </p><p> isAncestorOf(x,y) <- isParentOf(x,y) ; isParentOf(x,z), isAncestorOf(z,y). </p><p>and then applying the following further constraint </p><p> isParentOf(x,y), isAncestorOf(y,z) -> !isParentOf(x,z).</p><p> Here "<-", ";", "," and "!" denote "if", "or", "and" and "not" respectively.</p><p>You can also encode it in SQL using recursive union, but it's much longer and there you also need to add checks for nulls.</p><p>When I added ring constraints to ORM many years ago, some people complained that the graphical language was too rich, so I didn't include a graphical version of the intransitive jump constraint. However, in practice I've found that most cases of intransitivity are also cases of jump intransitivity, so I'm now considering adding that constraint explicitly to the ORM graphical notation.</p><p>Cheers</p><p>Terry</p>Modeling intransitivityhttps://www.ormfoundation.org:443/forums/thread/2546.aspxWed, 06 Apr 2011 02:42:03 GMT9d039735-a311-4a8d-9c49-a0bb2572af9e:2546JackStoneS0https://www.ormfoundation.org:443/forums/thread/2546.aspxhttps://www.ormfoundation.org:443/forums/commentrss.aspx?SectionID=84&PostID=2546In the BBB, the definition of intransitivity is the following: (see p284)<br />
R is intransitive, iff for all x,y,z xRy & yRz -> ~xRz. <br />
<br />
An example of an intransitive relation is 'is a parent of'.<br />
<br />
Now, given the following model:<br />
<br />
Person(.firstname) is a parent of Person<br />
With a spanning uniqueness constraint on the fact type<br />
And an intransitive constraint on the middle of the fact type<br />
<br />
I would say that the following population is allowed in the model:<br />
Ann Bill<br />
Bill Colin<br />
Colin Dirk<br />
Ann Dirk<br />
Is there a way to specify the model so that the last entry is disallowed?