1 | ALQL is agi.blue's query language. |
2 | |
3 | ALQL supports different types of statements. One is triples of information (page / key / value), where $... indicates a variable: |
4 | |
5 | food / is / $x |
6 | |
7 | This means that on the page http://agi.blue/?q=food, the system looks for an entry with key "is" and an unknown value which is stored as $x. |
8 | |
9 | Variables can also be in the first or second slot; only 3 variables in one line is not supported. |
10 | |
11 | $y / weighs / a lot |
12 | musicians / $x / music |
13 | |
14 | Another type of statement is a simple return instruction: |
15 | |
16 | return $x |
17 | return $x, $y |
18 | |
19 | When there are multiple solutions for a triple, a random value is chosen. |
20 | |
21 | Java-style comments are supported (// ... and /* ... */). |
22 | |
23 | Example for a full script: |
24 | |
25 | word types / is plural of / $x // get singular of "word types" |
26 | $y / is a / $x // get an example of a word type |
27 | return $y // return the found value |
28 | |
29 | Query input form: |
30 | http://agi.blue/query |
31 | |
32 | Direct link to execution (example): |
33 | http://agi.blue/bot/query?query=food+/+is+/+$x%0dreturn+$x |
34 | |
35 | |
36 | CHAPTER 2 (Locking) |
37 | --------- |
38 | |
39 | This is a new feature currently being implemented. |
40 | |
41 | We should be able to lock things in agi.blue since the main database is extremely volatile (anyone can add any information at any time). |
42 | |
43 | Locking means creating a database slice where certain things can't be deleted, and other things can't be added. For example, recall this example query: |
44 | |
45 | word types / is plural of / $x |
46 | $y / is a / $x |
47 | return $y |
48 | |
49 | if we want to make sure the query still yields the same results tomorrow, we lock the relevant triples: |
50 | |
51 | lock { word types / is plural of / * } |
52 | lock { * / is plural of / word type } |
53 | lock { * / is a / word type } |
54 | |
55 | That precludes existing word types from being deleted and new word types from being added. Same for the meta-information. |
56 | |
57 | The locking will apply only to one "reality slice" of the database (which is a subsection or view of the world). If you want to do experiments in a different subworld, create or move to another slice. |
58 | |
59 | The syntax for lock statements is "lock { a / b / c }" where any of a, b or c can be "*" to indicate any value. Dollar variables are not supported here. |
60 | |
61 | |
62 | CHAPTER 3 (Pages) |
63 | --------- |
64 | |
65 | You can look for pages: |
66 | |
67 | page { private $x } |
68 | |
69 | which will find pages called "private party", "private meeting at the club" etc. |
70 | |
71 | |
72 | CHAPTER 4 (Slice selection) |
73 | --------- |
74 | |
75 | You can select a slice for parts of the script: |
76 | |
77 | slice "Suggested deletions" { |
78 | page { delete slice $x } |
79 | } |
80 | return $x |
81 | |
82 | This finds a page named "delete slice ..." in the "Suggested deletions" slice. |
83 | |
84 | It doesn't matter if the return statement is in the slice block or outside of it. |
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024274 |
Snippet name: | ALQL Help |
Eternal ID of this version: | #1024274/17 |
Text MD5: | b89720dc1965ffef1cad059f9c7860e4 |
Author: | stefan |
Category: | javax / agi.blue |
Type: | Document |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-03 17:01:06 |
Source code size: | 2783 bytes / 84 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 443 / 112 |
Version history: | 16 change(s) |
Referenced in: | [show references] |