Skip to content
Newer
Older
100644 476 lines (372 sloc) 14.5 KB
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
1 # YZ
2c78ce5 @vdim [Doc] Fixed SYNTAX.md
authored
2 ## Simple collection
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
3 For demostration features of the YZ we will use some examples. First example is
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
4 collection with string values. Let's define this collection something like this
5 (we use [Clojure] (http://clojure.org/) language):
6268cf2 @vdim [Doc] Minor changes of docs.
authored
6
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
7 ```clojure
8 (def names ["Bob" "Alice" "" "Marry" "Kris" "David" "Alexander"])
9 ```
703fa59 @vdim [Doc] Inited description syntax.
authored
10
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
11 In order to test and usage our examples you can use the collq function from the
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
12 [yz-factory namespace] (https://github.com/vdim/yz/blob/master/src/ru/petrsu/nest/yz/yz_factory.clj)
13 something like this:
703fa59 @vdim [Doc] Inited description syntax.
authored
14
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
15 ```clojure
16 (collq "yourquery" names)
17 ```
703fa59 @vdim [Doc] Inited description syntax.
authored
18
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
19 We will hold the following notation: first will be query and second - result of query after "=>":
703fa59 @vdim [Doc] Inited description syntax.
authored
20
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
21 some-query
22 => some-result
e475a1b @vdim [Doc] Minor fixing.
authored
23
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
24 Note: for more details about usage existing implementation of the YZ
714e902 @vdim [Doc] Added instruction for using the collq function.
authored
25 see [here] (https://github.com/vdim/yz/blob/master/doc/USAGE.md) or follow to
26 [this] (https://github.com/vdim/yz/blob/master/doc/TESTINGCOLLQ.md) instruction.
703fa59 @vdim [Doc] Inited description syntax.
authored
27
28
d3d3e6f @vdim [Doc] Described filtering.
authored
29 ### Selection
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
30 In order to get data from your model you can specify name of class of objects which you
a6826f0 @vdim [Doc] Minor changes of SYNTAX.md.
authored
31 want to get. If you want all strings you just query:
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
32
33 string
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
34
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
35 and this query returns all strings from collection names:
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
36
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
37 => (["Bob"] ["Alice"] [""] ["Marry"] ["Kris"] ["David"] ["Alexander"])
703fa59 @vdim [Doc] Inited description syntax.
authored
38
7e3b2ae @vdim [Doc] Described filtering
authored
39 ### Projection
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
40 In case you want to get some property of objects you must specify it in square brackets:
703fa59 @vdim [Doc] Inited description syntax.
authored
41
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
42 string[empty]
43 => ([false] [false] [true] [false] [false] [false] [false])
703fa59 @vdim [Doc] Inited description syntax.
authored
44
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
45 Note that access to properties depends on implementation of your ElementManager
46 (in our case it is element manager for simple collections).
a6826f0 @vdim [Doc] Minor changes of SYNTAX.md.
authored
47 For more details about current implementation of the YZ see [here] (https://github.com/vdim/yz/blob/master/doc/IMPLEMENTATION.md).
48
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
49 For several properties you must enumerate it through whitespace(s):
703fa59 @vdim [Doc] Inited description syntax.
authored
50
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
51 string[empty class]
52 => ([false java.lang.String] [false java.lang.String]
4a6f2c8 @vdim [Doc] Fixed typos and errors into description of syntax.
authored
53 [true java.lang.String] [false java.lang.String]
54 [false java.lang.String] [false java.lang.String]
55 [false java.lang.String])
703fa59 @vdim [Doc] Inited description syntax.
authored
56
7e3b2ae @vdim [Doc] Described filtering
authored
57 In order to get self object in list with properties you can refer to self
58 object due to symbol "&":
59
60 string[& empty]
61 => (["Bob" false] ["Alice" false] ["" true] ["Marry" false]
62 ["Kris" false] ["David" false] ["Alexander" false])
63
344ecd2 @vdim [Doc] Described basic features of the YZ.
authored
64
d3d3e6f @vdim [Doc] Described filtering.
authored
65 ### Filtering
66 In order to filter your collection due to some condition through some property
67 you should specify your predicate after name of class before symbol "#" in parenthesis. You
68 should specify property in left part of expression then you should specify binary operation and
a5b44cd @vdim [Doc] Minor changes.
authored
69 at last right part of expression:
d3d3e6f @vdim [Doc] Described filtering.
authored
70
7054baa @vdim [Doc] Fixed query.
authored
71 string#(empty = false)
d3d3e6f @vdim [Doc] Described filtering.
authored
72 => (["Bob"] ["Alice"] ["Marry"] ["Kris"] ["David"] ["Alexander"])
73
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
74 If there is possibility for definition self object directly in text
75 (it is rightly for string or numbers at list),
76 you can refer to self object due to symbol "&" in left side of predicate:
d3d3e6f @vdim [Doc] Described filtering.
authored
77
78 string#(& = "Bob")
79 => (["Bob"])
80
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
81 YZ supports the following operations:
a5b44cd @vdim [Doc] Minor changes.
authored
82
7e3b2ae @vdim [Doc] Described filtering
authored
83 * equality (=, equals to = function of Clojure or .equals method of Java):
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
84 <pre><code>
d3d3e6f @vdim [Doc] Described filtering.
authored
85 string#(& = "Bob")
86 => (["Bob"])
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
87 </code></pre>
d3d3e6f @vdim [Doc] Described filtering.
authored
88
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
89 * identical (==, equals to identical? function of Clojure or == operation of Java):
f38622f @vdim [Doc] Fixed block with clojure code.
authored
90
7e3b2ae @vdim [Doc] Described filtering
authored
91 ```clojure
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
92 (collq "long#(& = 1)" [1 2])
7e3b2ae @vdim [Doc] Described filtering
authored
93 => ([1])
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
94 (collq "long#(& == 1)" [1 2])
7e3b2ae @vdim [Doc] Described filtering
authored
95 => ([1])
96 (collq "integer#(& = 1)" [(Integer. 1) (Integer. 2)])
97 => ([1])
98 (collq "integer#(& == 1)" [(Integer. 1) (Integer. 2)])
99 => ()
100 ```
101
d3d3e6f @vdim [Doc] Described filtering.
authored
102 * >, <, >=, <= (rightly for numbers):
103
104 ```clojure
105 (collq "integer#(& > 10)" [199 4 6 10 34])
7e3b2ae @vdim [Doc] Described filtering
authored
106 => ([34] [199])
d3d3e6f @vdim [Doc] Described filtering.
authored
107 ```
108
7e3b2ae @vdim [Doc] Described filtering
authored
109 * negation (!= and syntax sugar not=):
110 <pre><code>
111 string#(& != "Bob")
112 => (["Alice"] [""] ["Marry"] ["Kris"] ["David"] ["Alexander"])
113 </code></pre>
114
d3d3e6f @vdim [Doc] Described filtering.
authored
115 * regex (rightly for strings):
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
116 <pre><code>
d3d3e6f @vdim [Doc] Described filtering.
authored
117 string#(& ~ "^.a.*")
118 => (["Marry"] ["David"])
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
119 </code></pre>
d3d3e6f @vdim [Doc] Described filtering.
authored
120
39c3bdb @vdim [Doc] Fixed grammar typos.
authored
121 * logical operation (&& and || and syntax sugar "and" and "or" respectively):
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
122 <pre><code>
d3d3e6f @vdim [Doc] Described filtering.
authored
123 string#(& = "Bob" || & = "Marry")
124 => (["Bob"] ["Marry"])
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
125 </code></pre>
d3d3e6f @vdim [Doc] Described filtering.
authored
126
7e3b2ae @vdim [Doc] Described filtering
authored
127 * RCP (Reduced Complicate Predicates, this technique allows to reduce text of
128 your predicates which is adjusted to same property):
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
129 <pre><code>
d3d3e6f @vdim [Doc] Described filtering.
authored
130 string#(& = ("Bob" || "Marry"))
131 => (["Bob"] ["Marry"])
c3c6603 @vdim [Doc] Fixed block with codes into list.
authored
132 </code></pre>
d3d3e6f @vdim [Doc] Described filtering.
authored
133
7e3b2ae @vdim [Doc] Described filtering
authored
134 * overriding binary operation in case RCP is used:
a8bb0ac @vdim [Doc] Minor changes.
authored
135 <pre><code>
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
136 string#(& = ("Bob" || "Mike" || ~"^.a.*"))
d3d3e6f @vdim [Doc] Described filtering.
authored
137 => (["Bob"] ["Marry"] ["David"])
a8bb0ac @vdim [Doc] Minor changes.
authored
138 </code></pre>
d3d3e6f @vdim [Doc] Described filtering.
authored
139
140
7e3b2ae @vdim [Doc] Described filtering
authored
141 The right side of predicate may contains:
142
143 * Strings
144 <pre><code>
145 string#(& = "Bob")
146 => (["Bob"])
147 </code></pre>
148
149 * Numbers (integer, real, negative):
150
151 ```clojure
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
152 (collq "long#(& = 1)" [1 2])
7e3b2ae @vdim [Doc] Described filtering
authored
153 => ([1])
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
154 (collq "long#(& = -1)" [1 -1 2])
7e3b2ae @vdim [Doc] Described filtering
authored
155 => ([-1])
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
156 (collq "long#(& = 1)" [1 2])
7e3b2ae @vdim [Doc] Described filtering
authored
157 => ([1])
158 (collq "long#(& = -1.1)" [-1 -2 -3 -1.1])
159 => ([-1.1])
160 ```
161
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
162 * Keywords (nil, true, false):
163
164 <pre><code>
165 string#(empty = false)
166 => (["Bob"] ["Alice"] ["Marry"] ["Kris"] ["David"] ["Alexander"])
167 string#(empty = true)
168 => ([""])
169 string#(empty = nil)
170 => (["Bob"] ["Alice"] [""] ["Marry"] ["Kris"] ["David"] ["Alexander"])
171 </code></pre>
172
f76d023 @vdim [Doc] Inited sorting section.
authored
173 ### Sorting
174 In order to sort your result you should use symbols "" and "" for
39c3bdb @vdim [Doc] Fixed grammar typos.
authored
175 sorting by ascending and by descenting respectively:
f76d023 @vdim [Doc] Inited sorting section.
authored
176
177 ↑string
178 => ([""] ["Alexander"] ["Alice"] ["Bob"] ["David"] ["Kris"] ["Marry"])
179 ↓string
180 => (["Marry"] ["Kris"] ["David"] ["Bob"] ["Alice"] ["Alexander"] [""])
181
682c8ef @vdim [Doc] Updated the sorting section.
authored
182 If you select property and want to sort by it you should specify sorting for
f76d023 @vdim [Doc] Inited sorting section.
authored
183 properties:
184
185 string[↑empty]
186 => ([false] [false] [false] [false] [false] [false] [true])
187 string[↓empty]
188 => ([true] [false] [false] [false] [false] [false] [false])
189
682c8ef @vdim [Doc] Updated the sorting section.
authored
190 If you select several properties and specify sorting for each property then
191 result will be sorted by first property firstly, second property secondly and so on:
192
193
194 string[↓empty ↓&]
195 => ([true ""] [false "Marry"] [false "Kris"] [false "David"]
196 [false "Bob"] [false "Alice"] [false "Alexander"])
197 string[↓& ↓empty]
198 => (["Marry" false] ["Kris" false] ["David" false] ["Bob" false]
199 ["Alice" false] ["Alexander" false] ["" true])
200
201
f76d023 @vdim [Doc] Inited sorting section.
authored
202 If you want to sort by some property, but don't select it, you should specify
203 sorting into braces before name of your class:
204
205 {↑empty}string
206 => (["Bob"] ["Alice"] ["Marry"] ["Kris"] ["David"] ["Alexander"] [""])
207 {↓empty}string
208 => ([""] ["Bob"] ["Alice"] ["Marry"] ["Kris"] ["David"] ["Alexander"])
209
682c8ef @vdim [Doc] Updated the sorting section.
authored
210 You can specify several properties for sorting:
211
212 {↓& ↓empty}string
213 => (["Marry"] ["Kris"] ["David"] ["Bob"] ["Alice"] ["Alexander"] [""])
214 {↑& ↓empty}string
215 => ([""] ["Alexander"] ["Alice"] ["Bob"] ["David"] ["Kris"] ["Marry"])
216 {↓empty ↑&}string
217 => ([""] ["Alexander"] ["Alice"] ["Bob"] ["David"] ["Kris"] ["Marry"])
218 {↓empty ↓&}string
219 => ([""] ["Marry"] ["Kris"] ["David"] ["Bob"] ["Alice"] ["Alexander"])
220
5957d5e @vdim [Doc] Added section about calling function.
authored
221 Also there are printed version for "" and "" symbols: "d:" and "a:"
682c8ef @vdim [Doc] Updated the sorting section.
authored
222 correspondingly:
223
224 a:string
225 => ([""] ["Alexander"] ["Alice"] ["Bob"] ["David"] ["Kris"] ["Marry"])
226 d:string
227 => (["Marry"] ["Kris"] ["David"] ["Bob"] ["Alice"] ["Alexander"] [""])
228
5957d5e @vdim [Doc] Added section about calling function.
authored
229 Note that sorting requires that your objects (or property) must implements Comparable interface.
682c8ef @vdim [Doc] Updated the sorting section.
authored
230
5957d5e @vdim [Doc] Added section about calling function.
authored
231
232 ### Calling user function
233 YZ allows to call user function:
234
235 @(count `string')
236 => ([7])
237
238 Notes:
239
240 * Languages and calling mechanism are defined by concrete implementation of the YZ.
241 * Parameters:
242 * result of query
243 * strings
244 * numbers
245 * result of calling another function
7c0ecb9 @vdim [Doc] Improved SYNTAX document.
authored
246
247
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
248 ### Removing duplicates:
249 Use symbol ¹ or u: for removing duplicates from result of query:
250
251 ```clojure
252 (collq "long" [1 2 1])
253 => ([1 2 1])
254 (collq "¹long" [1 2 1])
255 => ([1 2])
256 (collq "u:long" [1 2 1])
257 => ([1 2])
258 ```
259
2c78ce5 @vdim [Doc] Fixed SYNTAX.md
authored
260 ## More complex model
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
261 So far we test simple flat collection. Let's consider more complex model
262 (we choose classic example about university):
263 <img src="https://github.com/vdim/yz/raw/master/doc/uni_model.png" alt="UML class diagram for university model"/>
264
2c78ce5 @vdim [Doc] Fixed SYNTAX.md
authored
265 We implement it (see source code [here](https://github.com/vdim/yz/blob/master/test/src/university/model))
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
266 and create some [example] (https://github.com/vdim/yz/blob/master/test/src/ru/petrsu/nest/yz/queries/uni_bd.clj)
267 which is represented on figure below in UML object diagram notation:
268 <img src="https://github.com/vdim/yz/raw/master/doc/uni_model_object.png"
269 alt="Example of university model in UML object diagram notation"/>
270
271 In order to use this university model and next queries you can follow
2c78ce5 @vdim [Doc] Fixed SYNTAX.md
authored
272 [this] (https://github.com/vdim/yz/blob/master/doc/TESTINGUNIMODEL.md) instruction.
273
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
274
2c78ce5 @vdim [Doc] Fixed SYNTAX.md
authored
275 ### Joining
e45c776 @vdim [Doc] Minor changes.
authored
276 In order to select linked objects you should use brackets. For example, if you want to
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
277 get all courses and its faculty you should query:
278
279 course (faculty)
280
281 This query returns the following result:
282
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
283 => ([#<Course Algebra> #<Faculty Marry>]
284 [#<Course Geometry> #<Faculty David>]
285 [#<Course Russian> #<Faculty Brian>]
286 [#<Course German> #<Faculty Brian>])}
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
287
288 Note that so far we work with flat collection and get result as flat rows. But now
e45c776 @vdim [Doc] Minor changes.
authored
289 a hierarchical result may be interesting:
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
290
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
291 => [[#<Course Algebra>
292 [[#<Faculty Marry> []]]
293 #<Course Geometry>
294 [[#<Faculty David> []]]
295 #<Course Russian>
296 [[#<Faculty Brian> []]]
297 #<Course German>
298 [[#<Faculty Brian> []]]]],
c55b014 @vdim [Doc] Inited "Joining" section into the SYNTAX document.
authored
299
1373ee6 @vdim [Doc] Improved joining section.
authored
300 In case you define the following query
301
302 course (faculty (student))
303
304 you get all courses, its faculty and for each faculty his/her students:
305
d001bfb @vdim [Doc] Fixed blocks with code.
authored
306 [[#<Course Algebra>
1373ee6 @vdim [Doc] Improved joining section.
authored
307 [[#<Faculty Marry>
308 [[#<Student John> [] #<Student Alexander> [] #<Student Nik> []]]]]
309 #<Course Geometry>
310 [[#<Faculty David> [[#<Student John> [] #<Student Nik> []]]]]
311 #<Course Russian>
312 [[#<Faculty Brian>
313 [[#<Student John>
314 []
315 #<Student Bob>
316 []
317 #<Student John>
318 []
319 #<Student Bob>
320 []]]]]
321 #<Course German>
322 [[#<Faculty Brian>
323 [[#<Student John>
324 []
325 #<Student Bob>
326 []
327 #<Student John>
328 []
329 #<Student Bob>
330 []]]]]]]
331
d001bfb @vdim [Doc] Fixed blocks with code.
authored
332 ([#<Course Algebra> #<Faculty Marry> #<Student John>]
333 [#<Course Algebra> #<Faculty Marry> #<Student Alexander>]
334 [#<Course Algebra> #<Faculty Marry> #<Student Nik>]
335 [#<Course Geometry> #<Faculty David> #<Student John>]
336 [#<Course Geometry> #<Faculty David> #<Student Nik>]
337 [#<Course Russian> #<Faculty Brian> #<Student John>]
338 [#<Course Russian> #<Faculty Brian> #<Student Bob>]
339 [#<Course Russian> #<Faculty Brian> #<Student John>]
340 [#<Course Russian> #<Faculty Brian> #<Student Bob>]
341 [#<Course German> #<Faculty Brian> #<Student John>]
342 [#<Course German> #<Faculty Brian> #<Student Bob>]
343 [#<Course German> #<Faculty Brian> #<Student John>]
344 [#<Course German> #<Faculty Brian> #<Student Bob>])
1373ee6 @vdim [Doc] Improved joining section.
authored
345
346
347 In case you want to get all courses and its faculty and students, you can define the
348 following query:
349
350 course (faculty, student)
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
351 => [[#<Course Algebra>
352 [[#<Faculty Marry> []]
353 [#<Student John> [] #<Student Alexander> [] #<Student Nik> []]]
354 #<Course Geometry>
355 [[#<Faculty David> []] [#<Student John> [] #<Student Nik> []]]
356 #<Course Russian>
357 [[#<Faculty Brian> []] [#<Student John> [] #<Student Bob> []]]
358 #<Course German>
359 [[#<Faculty Brian> []] [#<Student John> [] #<Student Bob> []]]]]
360
361 => ([#<Course Algebra> #<Faculty Marry>]
362 [#<Course Algebra> #<Student John>]
363 [#<Course Algebra> #<Student Alexander>]
364 [#<Course Algebra> #<Student Nik>]
365 [#<Course Geometry> #<Faculty David>]
366 [#<Course Geometry> #<Student John>]
367 [#<Course Geometry> #<Student Nik>]
368 [#<Course Russian> #<Faculty Brian>]
369 [#<Course Russian> #<Student John>]
370 [#<Course Russian> #<Student Bob>]
371 [#<Course German> #<Faculty Brian>]
372 [#<Course German> #<Student John>]
373 [#<Course German> #<Student Bob>])
374
375 You can apply for each entity in query action which was describe above
376 (sorting, filtering, projection, removing duplicates):
1373ee6 @vdim [Doc] Improved joining section.
authored
377
378 course (faculty#(name="Brian"))
379
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
380 The above query returns all courses and its faculties which have name "Brian":
1373ee6 @vdim [Doc] Improved joining section.
authored
381
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
382 => ([#<Course Algebra>]
383 [#<Course Geometry>]
384 [#<Course Russian> #<Faculty Brian>]
385 [#<Course German> #<Faculty Brian>])
1373ee6 @vdim [Doc] Improved joining section.
authored
386
387 In case you want to get courses which is taught with Brian, you can try:
388
389 course#(faculty.name="Brian")
9fda564 @vdim [Doc] Added "union" and "subquery" sections.
authored
390 => ([#<Course Russian>] [#<Course German>])
391
392
393 ### Union
394 In case you want to get results of several queries in single query, you
395 can use "," for union results
396
397 course, faculty
398 => ([#<Course Algebra>]
399 [#<Course Geometry>]
400 [#<Course Russian>]
401 [#<Course German>]
402 [#<Faculty Marry>]
403 [#<Faculty David>]
404 [#<Faculty Brian>]
405 [#<Faculty Bob>])
406
407 course, @(count `course')
408 => ([#<Course Algebra>]
409 [#<Course Geometry>]
410 [#<Course Russian>]
411 [#<Course German>]
412 [4])
413
414 @(count `course'), @(count `faculty'), @(count `student')
415 => ([4] [4] [4])
416
417 ### Subquery in right side of predicates
418 You can use YZ query in the right side of predicate of another YZ query.
419 For example you want to get students which have same name of his/her faculties:
420
421 student#(name=faculty.name)
422 => ()
423
424 Result is empty, because there is not such student. But if you want find
425 students which have same name from all university faculties, you can try:
426
427 student#(name=Ŷfaculty.name)
428 => ([#<Student Bob>])
429
430 Modificator Ŷ denotes all existing faculties (not only linked with current student). As you can note,
431 subquery returns collection and two previous queries check collection by "at least one" option. In case
432 you want check collection by "all" option, you can use modificator ∀. Examples:
433
434 student#(name != Ŷfaculty.name)
435 => ([#<Student Alexander>] [#<Student Nik>] [#<Student John>] [#<Student Bob>])
436 student#(name != Ŷ∀faculty.name)
437 => ([#<Student Alexander>] [#<Student Nik>] [#<Student John>])
438 student#(name != ∀faculty.name)
439 => ([#<Student Alexander>] [#<Student Nik>] [#<Student John>] [#<Student Bob>])
1373ee6 @vdim [Doc] Improved joining section.
authored
440
5c9d6ca @vdim [Doc] Added table with typed and not-typed symbols.
authored
441
442 ## Table with typed and not typed symbols
443
444 <table>
445 <tr>
446 <td>Not typed</td>
447 <td>Typed</td>
448 <td>Note</td>
449 </tr>
450 <tr>
451 <td>↑</td>
452 <td>a:</td>
453 <td>Sort by ascending.</td>
454 </tr>
455 <tr>
456 <td>↓</td>
457 <td>d:</td>
458 <td>Sort by descending.</td>
459 </tr>
460 <tr>
461 <td>∀</td>
462 <td>all:</td>
463 <td>Check all elements from collection.</td>
464 </tr>
465 <tr>
466 <td>Ŷ</td>
467 <td>A:</td>
468 <td>Select all elements (not only linked with current object).</td>
469 </tr>
470 <tr>
471 <td>¹</td>
472 <td>u:</td>
473 <td>Remove duplicates.</td>
474 </tr>
475 </table>
Something went wrong with that request. Please try again.