Jump to: navigation, search

Changes


HowTo:Relate Objects

9 bytes added, 09:30, 5 December 2019
== Connect objects via Reference ==
If you want one or multiple objects an object to refer to a single target object each(1:n relation), a [[Reference]] is what you need. You can either ask an object about the one it refers to, or ask a target object about all objects referring to it via a reference. This is useful, if you want to connect objects but there is no necessity for '''both''' "sides" to be connected to multiple other objects.
In this case, an object's property contains a link to the target object (respectively, its UID).
== Connect objects via Relation ==
If you want to connect one source object to multiple other target objects, but it should also be possible for a target object to be connected to multiple source objects(n:m relation), you require a [[Relation]].
Essentially, every individual relation connection is a {{{UBIK}}} object referring both to the source object and the target object (we say, '''left''' and '''right''' target). This allows us to have many such connections for the same left ''and'' right object, whereas a reference property would just enable many connections for the target object (right). For simplicity, let's call the left object '''A''' and the right object '''B'''. '''A''' is related to '''B'''.
In order for two objects to be related, the following requirements must be met:
1,606
edits