Simple Core Atlas

Syntax

Expressing an Atlas object in the common Bach encoding form:
{
   parents: ["info"], 
   objtype:"op",
   arg: {
     name: "Joe", 
     pos: [4.5, 6.7, 2.3], 
     meaning_of_life: 42
   }
}
    
In above example "parents" is list attribute containing one string value "info".
Arg is mapping attribute containing 3 attributes:
"name" is string attribute with value "Joe",
"pos" is list attribute with 3 float values [4.5, 6.7, 2.3]
and "meaning_of_life" is integer attribute with value 42.

Above example also "specifies" Bach encoding for most purposes. List is enclosed with [], mapping is enclosed with {} and string is enclosed with "".

Core operations

Operation consist of operation name as value to "parents" attribute and argument to it as value to "arg" attribute. "parents" is used as attribute name because full Atlas implements inheritance. See tree creation example later for entity example.

Operation example:

{
    parents: ["operation_name"],
    objtype:"op",
    arg: some object here
}
    
Object given in argument can be either some other operation or entity. Entity example:
{
    id: "tree23",
    objtype:"obj",
    parents: ["tree"],
    pos: [1.2, 5.6, 1.0]
}
    
Id of entity is "tree23", class of entity is "tree" and position is [1.2, 5.6, 1.0] = [x,y,z]

Get operation

To fetch some object from server, use get operation and give it id of object as argument. Example:
{
    parents: ["get"],
    objtype:"op",
    arg: {id: "tree34"}
}
    
For example of what server returns see Info operation.

Set operation

To set values in object use set operation and into arg put id of object and new values for attributes. Example:
{
    parents: ["set"],
    objtype:"op",
    arg: {id: "joe56", name: "Michael"}
}
    

Create operation

To create new object use create operation and into arg put object. Usually server assigns id, but if it's dumb server you need to give id also. Example:
{
    parents: ["create"],
    objtype:"op",
    arg: {parents:["tree"], pos: [1.2, 5.6, 1.0]}
}
    

Delete operation

To delete object in server, use delete operation and give id of object being deleted as argument. Example:
{
    parents: ["delete"],
    objtype:"op",
    arg: {id: "tree34"}
}
    

Info operation

Info operation is returned by server either as reply to get operation or informing you that somebody (might be you) made changes in server.

Reply to "get" operation example:

{
    parents: ["info"],
    objtype:"op",
    arg: {id: "tree34", parents:["tree"], pos: [1.2, 5.6, 1.0]}
}
Reply to "set" operation example:
{
    parents: ["info"],
    objtype:"op",
    arg: {
        parents: ["set"],
        objtype:"op",
        arg: {id: "joe56", name: "Michael"}
    }
}
Reply to "create" operation example:
{
    parents: ["info"],
    objtype:"op",
    arg: {
        parents: ["create"], 
        objtype:"op",
        arg: {id: "tree34", parents:["tree"], pos: [1.2, 5.6, 1.0]}
    }
}
Reply to "delete" operation example:
{
    parents: ["info"],
    objtype:"op",
    arg: {
        parents: ["delete"], 
        objtype:"op",
        arg: {id: "tree34"}
    }
}

Thanks for feedback goes to Lee, Elefth, Cyanide, Phil, Demitar, Kosh, Novalis, James, Malcolm, Bryce, UncleFluffy and ZephyrAlfredo.
Aloril
Last modified: Wed Nov 6 14:03:04 EET 2002