{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://service.metason.net/ar/schemas/action.json",
    "title": "AR Action",
    "description": "AR Action used in ARchi VR version 3.2, see https://archi.metason.net",
    "defs": {
        "item": {
            "type": "object",
            "default": {
                "id": "_",
                "type": "_",
                "subtype": "_"
            },
            "examples": [
                {
                    "id": "_",
                    "type": "_",
                    "subtype": "_"
                },
                {
                    "id": "_",
                    "type": "_",
                    "subtype": "_",
                    "attributes": "color:#FF0000; wxdxh: 0.5x0.5x0.5;"
                },
                {
                    "id": "_",
                    "type": "_",
                    "subtype": "_",
                    "asset": "https://service.metason.net/ar/extension/images/play.png",
                    "attributes": "color:#FF0000; wxdxh: 0.5x0.5x0.5;",
                    "content": "on:press=function('UI.service','open')"
                },
                {
                    "id": "_",
                    "type": "3D Object",
                    "subtype": "Table",
                    "asset": "https://archi.metason.net/catalog/3D/A-Table.usdz",
                    "attributes": "wxdxh: 2.35x0.88x0.71;scale: 0.01;"
                }
            ],
            "properties": {
                "//": {
                    "type": "string",
                    "description": "comment",
                    "default": ""
                },
                "id": {
                    "type": "string",
                    "description": "UUID, universal unique identifier, hint: use reverse DNS convention",
                    "default": "",
                    "examples": [
                        "com.company.archi._._",
                        "my._"
                    ]
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "Spot",
                        "Route",
                        "Zone",
                        "Geometry",
                        "Building",
                        "Interior",
                        "Equipment",
                        "Commodity",
                        "Data",
                        "3D Object",
                        "Avatar",
                        "Overlay"
                    ],
                    "description": "main type of item"
                },
                "name": {
                    "type": "string",
                    "description": "name displayed as title"
                },
                "content": {
                    "type": "string",
                    "description": "optional: inline text/html, URL content for enhancing item, or event listener",
                    "examples": [
                        "simple message text",
                        "<h1>Title</h1>Inline <b>rich-formated</b> <br>multi-line text.",
                        "https://www._.com/image.png",
                        "on:tap=function('hello','say')",
                        "on:press=function('data.boolVal2','toggle');function('net.metason.archi.switch2','setValue:', 'data.boolVal2');",
                        "on:drag=function('net.metason.archi.knob','setValue:', 'event.value')"
                    ]
                },
                "vertices": {
                    "type": "array",
                    "description": "list of [x y z] vertices",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "number"
                        },
                        "minItems": 3,
                        "maxItems": 3
                    },
                    "examples": [
                        [
                            [
                                0,
                                0,
                                0
                            ]
                        ],
                        [
                            [
                                0,
                                0,
                                0
                            ],
                            [
                                0,
                                0,
                                1
                            ]
                        ],
                        [
                            [
                                1,
                                0,
                                1
                            ],
                            [
                                -1,
                                0,
                                1
                            ],
                            [
                                -1,
                                0,
                                -1
                            ],
                            [
                                1,
                                0,
                                -1
                            ]
                        ],
                        [
                            [
                                0.5,
                                0,
                                0.5
                            ],
                            [
                                -0.5,
                                0,
                                0.5
                            ],
                            [
                                -0.5,
                                0,
                                -0.5
                            ],
                            [
                                0.5,
                                0,
                                -0.5
                            ]
                        ]
                    ]
                },
                "isLocked": {
                    "type": "boolean",
                    "description": "if locked, then move & rotate interaction is disabled",
                    "default": false
                },
                "assetData": {
                    "type": "string",
                    "description": "deprecated, replaced with 'asset'",
                    "deprecated": true
                },
                "assetMeta": {
                    "type": "string",
                    "description": "deprecated, replaced with 'attributes'",
                    "deprecated": true
                },
                "asset": {
                    "type": "string",
                    "description": "URL (img, 3D) or embedded (html) text",
                    "examples": [
                        "https://www._.com/_.usdz",
                        "https://www._.com/_.png",
                        "https://www._.com/do?city=$0&country=$1",
                        "simple text",
                        "<h1>Title</h1>Inline <b>rich-formated</b> <br>multi-line text."
                    ]
                },
                "attributes": {
                    "type": "string",
                    "description": "attributes for visualized asset",
                    "examples": [
                        "color:blue; bgcolor:#FF0000AA;",
                        "wxdxh:0.4x0.0x0.4;billboard:1;color:yellow;",
                        "scale:1.0",
                        "wxdxh:0.2x0.2x0.18;color:#0000FF;value:0.25;min:-0.75;max:0.75;",
                        "wxdxh:0.16x0.04x0.16;shape:round;color:#FFFF00;bgcolor:#999999;ratio:0.7;value:true;"
                    ]
                },
                "setup": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to an action for setup of children and/or behaviour by dispatched tasks",
                    "examples": [
                        "https://www._.com/_.json",
                        "https://www._.com/do?city=$0&country=$1"
                    ]
                },
                "children": {
                    "type": "string",
                    "description": "comma-sperated list of item IDs (defined in setup action)"
                }
            },
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Spot"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Spot item | https://service.metason.net/ar/docu/elements.html#spot-item",
                                "enum": [
                                    "Info",
                                    "Question",
                                    "Warning",
                                    "Task",
                                    "Open Task",
                                    "Done Task",
                                    "Pointer",
                                    "Text",
                                    "Panel"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Route"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Route item | https://service.metason.net/ar/docu/elements.html#route-item",
                                "enum": [
                                    "Distance",
                                    "Pointer",
                                    "Direction",
                                    "Radius",
                                    "Link",
                                    "Polylink",
                                    "Line",
                                    "Polyline"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Zone"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Zone item | https://service.metason.net/ar/docu/elements.html#zone-item",
                                "enum": [
                                    "Carpet",
                                    "Keep Free",
                                    "Entry",
                                    "Gangway",
                                    "Lane",
                                    "Lawn",
                                    "Pool",
                                    "Parking",
                                    "Damaged Area",
                                    "Named Area",
                                    "Object Footprint"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Geometry"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Geometry item | https://service.metason.net/ar/docu/elements.html#geometry-item",
                                "enum": [
                                    "Arrow",
                                    "Box",
                                    "Capsule",
                                    "Circle",
                                    "Cone",
                                    "Cube",
                                    "Cylinder",
                                    "Group",
                                    "Line",
                                    "Polyline",
                                    "Octahedron",
                                    "Plane",
                                    "Prism",
                                    "Pyramid",
                                    "Sphere",
                                    "Star",
                                    "Torus",
                                    "Triangle",
                                    "Tube",
                                    "Light"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Building"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Building item | https://service.metason.net/ar/docu/elements.html#building-item",
                                "enum": [
                                    "Column",
                                    "Round Column",
                                    "Platform",
                                    "Rail",
                                    "Stairs",
                                    "Wall",
                                    "Glass Partition",
                                    "undefined"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Interior"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Interior item | https://service.metason.net/ar/docu/elements.html#interior-item",
                                "enum": [
                                    "Chair",
                                    "Couch",
                                    "Desk",
                                    "Table",
                                    "Bed",
                                    "Shelf",
                                    "Cabinet",
                                    "Kitchen",
                                    "Curtain",
                                    "Lamp",
                                    "Floor Lamp",
                                    "undefined"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Data"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "ssubtype of Data item | https://service.metason.net/ar/docu/elements.html#data-item",
                                "enum": [
                                    "Label",
                                    "Lamp",
                                    "Level",
                                    "Needle",
                                    "Arc",
                                    "Switch",
                                    "Slider",
                                    "Knob"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Overlay"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "subtype of Overlay item | https://service.metason.net/ar/docu/elements.html#overlay-item",
                                "enum": [
                                    "Label",
                                    "Text",
                                    "Image",
                                    "Video",
                                    "Indicator",
                                    "BBoxLabel",
                                    "Toggle",
                                    "WebView"
                                ]
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "3D Object"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "sub type of item"
                            }
                        }
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "Avatar"
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "subtype": {
                                "description": "sub type of Avatar item | not yet implemented"
                            }
                        }
                    }
                }
            ],
            "required": [
                "id",
                "type",
                "subtype"
            ]
        },
        "task": {
            "type": "object",
            "default": {
                "do": ""
            },
            "properties": {
                "//": {
                    "type": "string",
                    "description": "comment",
                    "default": ""
                },
                "dispatch": {
                    "type": "string",
                    "description": "define when task will be executed",
                    "enum": [
                        "on:start",
                        "on:command",
                        "on:call",
                        "as:once",
                        "on:change",
                        "as:changed",
                        "on:load",
                        "as:always",
                        "as:repeated",
                        "as:stated",
                        "as:steady",
                        "as:activated",
                        "as:altered",
                        "on:enter",
                        "as:broadcast",
                        "on:leave",
                        "on:stop"
                    ]
                },
                "on": {
                    "type": "string",
                    "description": "on event to trigger rule",
                    "enum": [
                        "start",
                        "call",
                        "command",
                        "change",
                        "enter",
                        "message",
                        "leave",
                        "load",
                        "stop"
                    ]
                },
                "as": {
                    "type": "string",
                    "description": "as triggered by changes in time or in condition",
                    "enum": [
                        "once",
                        "always",
                        "repeated",
                        "stated",
                        "steady",
                        "activated",
                        "altered"
                    ]
                },
                "in": {
                    "type": "string",
                    "description": "delay of task in seconds",
                    "pattern": "^([0-9]*[.])?[0-9]+$"
                },
                "if": {
                    "type": "string",
                    "description": "expression evaluating to true or false  | https://service.metason.net/ar/docu/functions.html",
                    "examples": [
                        "subtype == 'Single Room'",
                        "walls.@count > 2",
                        "ANY items.subtype == 'Damaged Area'",
                        "items[0].name BEGINSWITH 'Be'",
                        "data.var1 > 5.0",
                        "data.var2 == 'hello'",
                        "time.runtime > 10.0"
                    ]
                },
                "do": {
                    "type": "string",
                    "description": "declare what should be done",
                    "default": "add",
                    "enum": [
                        "add",
                        "remove",
                        "lock",
                        "unlock",
                        "pulsate",
                        "depulsate",
                        "billboard",
                        "unbillboard",
                        "highlight",
                        "dehighlight",
                        "hide",
                        "unhide",
                        "move",
                        "turn",
                        "spin",
                        "translate",
                        "rotate",
                        "scale",
                        "position",
                        "resize",
                        "animate",
                        "stop",
                        "occlude",
                        "tint",
                        "change",
                        "classify",
                        "select",
                        "install",
                        "open",
                        "filter",
                        "enable",
                        "disable",
                        "skip",
                        "snapshot",
                        "screenshot",
                        "illuminate",
                        "raycast",
                        "play",
                        "say",
                        "stream",
                        "pause",
                        "execute",
                        "request",
                        "service",
                        "workflow",
                        "fetch",
                        "prompt",
                        "confirm",
                        "clear",
                        "set",
                        "assign",
                        "eval",
                        "concat",
                        "setValue",
                        "customize",
                        "inspect",
                        "save",
                        "saveto",
                        "avoid save",
                        "detect",
                        "redetect",
                        "custom",
                        "halt",
                        "exit"
                    ]
                },
                "id": {
                    "type": "string",
                    "description": "identifier to reference item or UI element",
                    "examples": [
                        "com.company.archi._",
                        "my._",
                        "UI.catalog._",
                        "UI.service._",
                        "UI.service.switch._",
                        "UI.service.slider._",
                        "UI.service.stepper._"
                    ]
                },
                "unit": {
                    "type": "string",
                    "description": "identifier to reference system unit",
                    "examples": [
                        "UI",
                        "3D",
                        "data",
                        "tasks",
                        "cache",
                        "temp",
                        "3D"
                    ]
                },
                "color": {
                    "type": "string",
                    "description": "HTML-like color specification by name, #RGB, or #RGBA",
                    "examples": [
                        "red",
                        "#0000FF",
                        "#00FF00B"
                    ]
                },
                "bgcolor": {
                    "type": "string",
                    "description": "HTML-like specification of background color by name, #RGB, or #RGBA",
                    "examples": [
                        "red",
                        "#0000FF",
                        "#00FF00B"
                    ]
                },
                "at": {
                    "type": "string",
                    "description": "position to place item, hint: y-axis points upwards in right-handed coordinate system",
                    "pattern": "^([-]?[0-9]*[.])?[0-9]+[ ]([-]?[0-9]*[.])?[0-9]+[ ]([-]?[0-9]*[.])?[0-9]+$",
                    "examples": [
                        "0.0 1.0 0.0",
                        "0.5 1.0 -1.0"
                    ]
                },
                "ahead": {
                    "type": "string",
                    "description": "place item ahead of user, hint: z-axis points towards user, therefore use neg. value",
                    "pattern": "^([-]?[0-9]*[.])?[0-9]+[ ][-]?([0-9]*[.])?[0-9]+[ ][-]?([0-9]*[.])?[0-9]+$",
                    "default": "0.0 0.0 -1.5",
                    "examples": [
                        "0.0 0.0 -1.5",
                        "0.0 1.5 -1.0"
                    ]
                },
                "to": {
                    "type": "string",
                    "description": "absolute value or vector",
                    "examples": [
                        "-90",
                        "2.5",
                        "1.0 0.0 -1.0"
                    ]
                },
                "by": {
                    "type": "string",
                    "description": "relative value or vector",
                    "examples": [
                        "-90",
                        "2.5",
                        "1.0 0.0 -1.0"
                    ]
                },
                "onto": {
                    "type": "string",
                    "description": "place item onto, used in do:add",
                    "default": "Floor",
                    "examples": [
                        "Floor",
                        "Wall",
                        "Ceiling",
                        "Item",
                        "Item-Type",
                        "Item-Type-Subtype",
                        "_id"
                    ]
                },
                "type": {
                    "type": "string",
                    "description": "classify item, redefine type, subtype, ..."
                },
                "subtype": {
                    "type": "string",
                    "description": "subtype of item"
                },
                "name": {
                    "type": "string",
                    "description": "set item name"
                },
                "node": {
                    "type": "string",
                    "description": "set name od 3D namess"
                },
                "system": {
                    "type": "string",
                    "description": "what to enable/disable",
                    "enum": [
                        "Sonification",
                        "Voice Guide",
                        "Occlusion",
                        "Depth Map",
                        "ML"
                    ]
                },
                "text": {
                    "type": "string",
                    "description": "text that should be displayed in do:promp or be said by TTS system in do:say"
                },
                "snd": {
                    "type": "string",
                    "description": "system sound ID that should be played in do:play"
                },
                "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL",
                    "examples": [
                        "https://www.metason.net/_",
                        "https://www._.com/do?city=$0&country=$1"
                    ]
                },
                "volume": {
                    "type": "string",
                    "description": "volume 0.0 - 1.0, hint: currently not working"
                },
                "op": {
                    "type": "string",
                    "description": "operation as sequence of functions | https://service.metason.net/ar/docu/functions.html",
                    "examples": [
                        "function('say', 'hello')",
                        "function('_id', 'delete'); function('data._var2', 'set:', 'hello');",
                        "function('data.val == 5', 'ifthen:', 'function(`___`, `___`)')",
                        "function('data.val == 5', 'ifthenelse::', 'function(`___`, `___`)', 'function(`___`, `___`)')"
                    ]
                },
                "parameters": {
                    "type": "string",
                    "description": "assign parameters for use in do:fetch request",
                    "examples": [
                        "$0 = time.hms",
                        "$0 = location.city; $1 = location.countryCode"
                    ]
                },
                "map": {
                    "type": "string",
                    "description": "assign JSON results from do:fetch request to data variables",
                    "examples": [
                        "data.var = result.key",
                        "data.var1 = result.key1; data.var2 = result.key2;"
                    ]
                },
                "upload": {
                    "type": "string",
                    "description": "define multi-part POST data transfer",
                    "examples": [
                        "POST:LOC",
                        "POST:USER",
                        "POST:SPACE",
                        "POST:SVG",
                        "POST:WEB3D",
                        "POST:OBJ",
                        "POST:PHOTO",
                        "POST:CAM",
                        "POST:SCREEN",
                        "POST:CONTEXT",
                        "POST:DETECTION",
                        "POST:SCENE",
                        "POST:HITS",
                        "POST:DEPTH",
                        "POST:MAP",
                        "POST:CAM, POST:CONTEXT"
                    ]
                },
                "title": {
                    "type": "string",
                    "description": "title of UI popup"
                },
                "button": {
                    "type": "string",
                    "description": "button text in do:promp UI popup, default is 'Continue'"
                },
                "img": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to image (PNG, JPG, GIF) to display in do:promp UI popup",
                    "examples": [
                        "https://www.metason.net/_.png",
                        "https://www._.com/do?time="
                    ]
                },
                "dialog": {
                    "type": "string",
                    "description": "dialog text of do:confirm UI popup"
                },
                "then": {
                    "type": "string",
                    "description": "operation as sequene of functions, if do:confirm is answered YES | https://service.metason.net/ar/docu/functions.html",
                    "examples": [
                        "function('say', 'hello')",
                        "function('_id', 'delete'); function('data._var2', 'set:', 'hello');"
                    ]
                },
                "else": {
                    "type": "string",
                    "description": "operation as sequene of functions, if do:confirm is answered NO | https://service.metason.net/ar/docu/functions.html",
                    "examples": [
                        "function('say', 'hello')",
                        "function('_id', 'delete'); function('data._var2', 'set:', 'hello');"
                    ]
                },
                "yes": {
                    "type": "string",
                    "description": "text of yes button in do:confirm UI popup, default 'Yes'"
                },
                "no": {
                    "type": "string",
                    "description": "text of no button in do:confirm UI popup, default 'No'"
                },
                "field": {
                    "type": "string",
                    "description": "name of item field",
                    "examples": [
                        "type",
                        "subtype",
                        "name",
                        "attributes",
                        "asset",
                        "content"
                    ]
                },
                "values": {
                    "type": "string",
                    "description": "list of values separated by ;",
                    "examples": [
                        "value1;value2;value3"
                    ]
                },
                "labels": {
                    "type": "string",
                    "description": "list of menu labels separated by ;",
                    "examples": [
                        "Label1;Label2;Labels3"
                    ]
                },
                "data": {
                    "type": "string",
                    "description": "key, name of data field",
                    "examples": [
                        "data._",
                        "data.key"
                    ]
                },
                "value": {
                    "type": "string",
                    "description": "value as string"
                },
                "key": {
                    "type": "string",
                    "description": "key to filter data fields in do:inspect or key for animation parameter",
                    "default": "",
                    "examples": [
                        "",
                        "data",
                        "user",
                        "location",
                        "time",
                        "dev",
                        "items",
                        "walls",
                        "items",
                        "3D",
                        "position.x",
                        "eulerAngles.y",
                        "scale.z"
                    ]
                },
                "timing": {
                    "type": "string",
                    "description": "animation curve",
                    "default": "linear",
                    "examples": [
                        "linear",
                        "easeIn",
                        "easeOut",
                        "easeInOut"
                    ]
                },
                "expression": {
                    "type": "string",
                    "description": "expression evaluated in do:eval or do:setValue",
                    "examples": [
                        "data.key",
                        "data.key + 2",
                        "function('_id', 'proximity')",
                        "function('data.val == 5', 'ifthenelse::', '1', '2')"
                    ]
                },
                "with": {
                    "type": "string",
                    "description": "expression evaluated in do:concat",
                    "examples": [
                        "text",
                        "function('_id', 'delete'); function('data._var2', 'set:', 'hello');"
                    ]
                },
                "from": {
                    "type": "string",
                    "description": "start value in do:animate",
                    "pattern": "^([-]?[0-9]*[.])?[0-9]+$"
                },
                "for": {
                    "type": "string",
                    "description": "duration in seconds",
                    "pattern": "^([0-9]*[.])?[0-9]+$"
                },
                "each": {
                    "type": "string",
                    "description": "interval time in seconds",
                    "pattern": "^([0-9]*[.])?[0-9]+$"
                },
                "reset": {
                    "type": "string",
                    "description": "reset after in seconds",
                    "pattern": "^([0-9]*[.])?[0-9]+$"
                },
                "repeat": {
                    "type": "string",
                    "description": "iteration count in do:animate",
                    "examples": [
                        "2",
                        "10",
                        "INFINITE"
                    ]
                },
                "reverse": {
                    "type": "string",
                    "description": "go reverse in repeated do:animate",
                    "enum": [
                        "true",
                        "false"
                    ]
                },
                "state": {
                    "type": "string",
                    "enum": [
                        "floor",
                        "wall"
                    ],
                    "description": "capturing state to skip"
                },
                "category": {
                    "type": "string",
                    "enum": [
                        "Building",
                        "Interior",
                        "Equipment",
                        "Commodity"
                    ],
                    "description": "product category, used for filtering in catalog selector"
                },
                "imgURL": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to product image, image size: 128x128 pixels"
                },
                "modelURL": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL for requesting model data: 3D, image, or action (in JSON)"
                },
                "tags": {
                    "type": "string",
                    "description": "tags which descibe product features, used for filterig"
                },
                "desc": {
                    "type": "string",
                    "description": "description of extension in do:install"
                },
                "orga": {
                    "type": "string",
                    "description": "organisation or company providing the extension in do:install"
                },
                "organisation": {
                    "type": "string",
                    "description": "organisation or company the user/creator is related to"
                },
                "creator": {
                    "type": "string",
                    "description": "name of user/creator"
                },
                "startwith": {
                    "type": "string",
                    "enum": [
                        "Rooms",
                        "Curations",
                        "Sites",
                        "Nearby",
                        "Map",
                        "AR View"
                    ],
                    "description": "default name of creator"
                },
                "logoURL": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to extension logo (image size: 128x128 pixels) in do:install"
                },
                "preCondition": {
                    "type": "string",
                    "description": "condition as expression for extension in do:install",
                    "examples": [
                        "subtype == 'Single Room'",
                        "walls.@count > 2",
                        "ANY items.subtype == 'Damaged Area'",
                        "items[0].name BEGINSWITH 'Be'",
                        "data.var1 > 5.0",
                        "data.var2 == 'hello'",
                        "time.runtime > 10.0"
                    ]
                },
                "term": {
                    "type": "string",
                    "description": "search term in do:filter"
                },
                "width": {
                    "type": "string",
                    "description": "image width in meters"
                },
                "height": {
                    "type": "string",
                    "description": "image height in meters"
                },
                "wxdxh": {
                    "type": "string",
                    "description": "width x depth x height in meter of catalog element in do:install",
                    "anyOf": [
                        {
                            "pattern": "^([0-9]*[.])?[0-9]+[x]([0-9]*[.])?[0-9]+[x]([0-9]*[.])?[0-9]+$"
                        },
                        {
                            "maxLength": 0
                        }
                    ]
                },
                "scale": {
                    "type": "string",
                    "description": "scaling factor to adjust size of 3D model of catalog element in do:install",
                    "anyOf": [
                        {
                            "pattern": "^([0-9]*[.])?[0-9]+$"
                        },
                        {
                            "maxLength": 0
                        }
                    ]
                },
                "var": {
                    "type": "string",
                    "default": "data.key",
                    "description": "bind UI element to data variable in do:install"
                },
                "primary": {
                    "type": "string",
                    "description": "primary light source in do:illuminate",
                    "examples": [
                        "above",
                        "camera",
                        "none"
                    ]
                },
                "ref": {
                    "type": "string",
                    "defaul": "min:0.0,max:5.0",
                    "description": "reference attributes for UI element in do:install",
                    "examples": [
                        "min:-10; max:10",
                        "min:0; max:5; step:0.5"
                    ]
                },
                "code": {
                    "type": "string",
                    "description": "id for calling custom code (for SW developers only)"
                }
            },
            "oneOf": [
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "add"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "id",
                                "at"
                            ]
                        },
                        {
                            "required": [
                                "id",
                                "ahead"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "move",
                                "turn",
                                "spin",
                                "translate",
                                "rotate",
                                "scale"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "id",
                                "to"
                            ]
                        },
                        {
                            "required": [
                                "id",
                                "by"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "tint",
                                "color"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "id",
                                "color"
                            ]
                        },
                        {
                            "required": [
                                "id",
                                "bgcolor"
                            ]
                        },
                        {
                            "required": [
                                "id",
                                "color",
                                "bgcolor"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "remove",
                                "lock",
                                "unlock",
                                "position",
                                "resize",
                                "pulsate",
                                "depulsate",
                                "billboard",
                                "unbillboard",
                                "highlight",
                                "dehighlight",
                                "hide",
                                "unhide",
                                "change",
                                "classify",
                                "filter",
                                "open",
                                "raycast",
                                "occlude",
                                "service",
                                "workflow",
                                "halt"
                            ]
                        }
                    },
                    "required": [
                        "id"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "illuminate"
                            ]
                        }
                    },
                    "required": [
                        "primary"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "clear"
                            ]
                        }
                    },
                    "required": [
                        "unit"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "enable",
                                "disable"
                            ]
                        }
                    },
                    "required": [
                        "system"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "say"
                            ]
                        }
                    },
                    "required": [
                        "text"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "play"
                            ]
                        }
                    },
                    "required": [
                        "snd"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "stream",
                                "request"
                            ]
                        }
                    },
                    "required": [
                        "url"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "execute"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "op"
                            ]
                        },
                        {
                            "required": [
                                "code"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "detect"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "img",
                                "width",
                                "height"
                            ]
                        },
                        {
                            "required": [
                                "object"
                            ]
                        },
                        {
                            "required": [
                                "body"
                            ]
                        },
                        {
                            "required": [
                                "code"
                            ]
                        },
                        {
                            "required": [
                                "text"
                            ]
                        },
                        {
                            "required": [
                                "feature"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "redetect"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "id"
                            ]
                        },
                        {
                            "required": [
                                "feature"
                            ]
                        }
                    ]
                },{
                    "properties": {
                        "do": {
                            "enum": [
                                "fetch"
                            ]
                        }
                    },
                    "required": [
                        "url",
                        "map"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "prompt"
                            ]
                        }
                    },
                    "required": [
                        "title",
                        "text"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "confirm"
                            ]
                        }
                    },
                    "required": [
                        "dialog",
                        "then"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "select"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "title",
                                "id",
                                "field",
                                "values"
                            ]
                        },
                        {
                            "required": [
                                "title",
                                "id",
                                "field",
                                "values",
                                "labels"
                            ]
                        },
                        {
                            "required": [
                                "title",
                                "data",
                                "values"
                            ]
                        },
                        {
                            "required": [
                                "title",
                                "data",
                                "values",
                                "labels"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "assign"
                            ]
                        }
                    },
                    "required": [
                        "data",
                        "value"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "set"
                            ]
                        }
                    },
                    "required": [
                        "data",
                        "to"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "eval"
                            ]
                        }
                    },
                    "required": [
                        "expression",
                        "data"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "setValue"
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "expression"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "concat"
                            ]
                        }
                    },
                    "required": [
                        "data",
                        "with"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "animate"
                            ]
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "id",
                                "key",
                                "from",
                                "to",
                                "for"
                            ]
                        },
                        {
                            "required": [
                                "id",
                                "key",
                                "from",
                                "to",
                                "for",
                                "timing"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "stop"
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "key"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "install"
                            ]
                        }
                    },
                    "required": [
                        "id"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "skip"
                            ]
                        }
                    },
                    "required": [
                        "state"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "custom"
                            ]
                        }
                    },
                    "required": [
                        "code"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "customize"
                            ]
                        }
                    },
                    "anyOf": [
                        "creator",
                        "organisation",
                        "startwith"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "classify"
                            ]
                        }
                    },
                    "required": [
                        "id"
                    ],
                    "anyOf": [
                        "type",
                        "subtype",
                        "name",
                        "attributes",
                        "content",
                        "asset",
                        "setup",
                        "children"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "saveto"
                            ]
                        }
                    },
                    "required": [
                        "upload"
                    ]
                },
                {
                    "properties": {
                        "do": {
                            "enum": [
                                "snapshot",
                                "screenshot",
                                "pause",
                                "inspect",
                                "save",
                                "avoid save",
                                "exit"
                            ]
                        }
                    }
                }
            ],
            "required": [
                "do"
            ],
            "additionalProperties": false
        }
    },
    "type": "object",
    "properties": {
        "$schema": {
            "type": "string",
            "format": "uri",
            "description": "URL to JSON schema of declarative AR for ARchi VR",
            "default": "https://service.metason.net/ar/schemas/action.json"
        },
        "//": {
            "type": "string",
            "description": "comment",
            "default": ""
        },
        "items": {
            "type": "array",
            "description": "items that might be added to AR scene",
            "items": {
                "$ref": "#/defs/item"
            },
            "examples": [
                [
                    {
                        "id": "_",
                        "type": "_",
                        "subtype": "_"
                    }
                ],
                [
                    {
                        "id": "_",
                        "type": "_",
                        "subtype": "_",
                        "attrributes": "color:#FF0000; wxdxh: 0.5x0.5x0.5;"
                    }
                ],
                [
                    {
                        "id": "_",
                        "type": "_",
                        "subtype": "_",
                        "asset": "https://service.metason.net/ar/extension/images/play.png",
                        "attrributes": "color:#FF0000; wxdxh: 0.5x0.5x0.5;",
                        "content": "on:press=function('UI.service','open')"
                    }
                ]
            ]
        },
        "tasks": {
            "type": "array",
            "description": "tasks to be executed",
            "items": {
                "$ref": "#/defs/task"
            },
            "examples": [
                [
                    {
                        "do": ""
                    }
                ],
                [
                    {
                        "do": "",
                        "id": ""
                    }
                ]
            ]
        }
    },
    "additionalProperties": false
}
