Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

84
LINES

< > BotCompany Repo | #1024274 // ALQL Help

Document

ALQL is agi.blue's query language.

ALQL supports different types of statements. One is triples of information (page / key / value), where $... indicates a variable:

  food / is / $x
  
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.
  
Variables can also be in the first or second slot; only 3 variables in one line is not supported.

  $y / weighs / a lot
  musicians / $x / music

Another type of statement is a simple return instruction:

  return $x
  return $x, $y
  
When there are multiple solutions for a triple, a random value is chosen.

Java-style comments are supported (// ... and /* ... */).

Example for a full script:

  word types / is plural of / $x   // get singular of "word types"
  $y / is a / $x                   // get an example of a word type
  return $y                        // return the found value

Query input form:
  http://agi.blue/query
  
Direct link to execution (example):
  http://agi.blue/bot/query?query=food+/+is+/+$x%0dreturn+$x
  

CHAPTER 2 (Locking)
---------

This is a new feature currently being implemented.

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).

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:

  word types / is plural of / $x
  $y / is a / $x
  return $y

if we want to make sure the query still yields the same results tomorrow, we lock the relevant triples:

  lock { word types / is plural of / * }
  lock { * / is plural of / word type }
  lock { * / is a / word type }

That precludes existing word types from being deleted and new word types from being added. Same for the meta-information.

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.

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.


CHAPTER 3 (Pages)
---------

You can look for pages:

  page { private $x }
  
which will find pages called "private party", "private meeting at the club" etc.


CHAPTER 4 (Slice selection)
---------

You can select a slice for parts of the script:

  slice "Suggested deletions" {
    page { delete slice $x }
  }
  return $x
  
This finds a page named "delete slice ..." in the "Suggested deletions" slice.

It doesn't matter if the return statement is in the slice block or outside of it.

download  show line numbers   

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: 329 / 87
Version history: 16 change(s)
Referenced in: [show references]