Page 1 of 1

Set theory in selectors

PostPosted: Mon Sep 12, 2011 3:11 pm
by actifsource
Writing actifsource templates you define one selector per context. A selector lets you navigate through your model starting from a resource of your meta model and following any relation.

In some complex cases you might need to combine the results from different paths using the set theory. At the moment we have implemented three different commands:

union (OR)
All elements reached through A.b orC.d.

A.b union C.d


AS_Union.png
AS_Union.png (2.64 KiB) Viewed 33971 times


intersect (AND)
Only elements which are reached through A.b and C.d.

A.b intersect C.d


AS_Intersect.png
AS_Intersect.png (2.57 KiB) Viewed 33971 times


except (AND NOT)
All elements which are reached through A.b without the ones reached through C.d.

A.b except C.d


AS_Except.png
AS_Except.png (1.53 KiB) Viewed 33971 times


String type system
Note that the result of any set action is always strongly typed. The returned type is the most common type of all involved types. If there is no inheritance hierarchy between the types the result is at least of type Resource or NamedResource.

Screenshot of an example using reverse navigation, type cast an the intersect command

AS_SetTheory.png
AS_SetTheory.png (30.66 KiB) Viewed 33975 times

Re: Set theory in selectors

PostPosted: Fri Oct 11, 2013 5:00 pm
by actifsource
There is a new else operator now for sets which behaves like expected:

else.png
else.png (32.75 KiB) Viewed 32943 times