Sendo language

Sendo is a minimized and modernized query language created for heterogeneous IoT devices edge interactions by any IO and any programming language.

There are four concepts defined for Sendo language to be used. Requests, Property, Ontology, and value. These concepts are making the syntax of this language together. By putting them in a row, the query of Sendo language will simply appear.

REQUEST PROPERTY ONTOLOGY VALUE 

Requests

Requests are the base meaning of the query and are a job sent for a device to be executed. There are three types of requests in Sendo language:

  • SEND
  • GET
  • DO

By SEND request, You are calling opponent to send data and by GET request you are sending data to the opponent and by DO, you are requesting something to do from the opponent.

Properties

Properties are the main classification of data in Sendo language and are divided into three main parts:

  • OBJECT
  • DATA
  • SKILL

Sendo language is driven from object-oriented world, First of all an object should be defined and then a data or a skill can be added to that object. For example there a sensor in a home. sensor is the OBJECT and it's location, name, model are its DATA and something like sense is its SKILL.

Ontologies

Ontology is the technique of defining things and getting their meanings. In Sendo language ontologies are defined by dots. An ontology can be defined as:

PARENT_OBJECT_NAME.CHILD_OBJECT_NAME...CHILD_OBJECT_NAME.PROPERTY_NAME

For example sensor.sense is meaning the sense (data or skill) of sensor (object). Or monitor.button.color is meaning the color (data) of button (child object) of monitor (parent object).

Examples

Things are getting easy by using examples, Here are some examples of using Sendo query language:

sendo > SEND DATA monitor.button.color
sendo > GET SKILL sensor.sense
sendo > DO SKILL sensor.sense
sendo > SEND DATA sensor.temprature

Protocol

There is a computer application protocol for sending queries of Sendo language between devices that makes easy transferring any kind of data and skill (code). This protocol is quite easy it's like HTTP protocol to implement. The parts of a Sendo request are divided by a Carriage return. The first line is the query string, Following lines, are header information of request while an empty line occurred and then the body of request that is a file, data or skill. For example:

GET DATA sensor.temprature
TOKEN: SJP3j21sjapjdKS2
BODY-TYPE: json
BODY-SIZE: 13

{"temp": 34}

As you can see transferring is made easy by protocols. Now here is an example for DO request that some controls can be sent to the opponent:

DO SKILL sensor.sense
TOKEN: SJP3j21sjapjdKS2
BODY-TYPE: json
BODY-SIZE: 19

{"sensivity": 0.37}

Request can have no headers and bodies like:

SEND DATA robot-314.name

Architecture

Application architecture of Sendo langue is very flexible and more easy to develop. There is a main server called Sendo-server inside the machine running and developers can connect it by using TCP sockets. these sockets can be implemented as third-party libraries for all languages. For example, Sendo has a javascript library that connects to Sendo-server and executes the queries. Developer should get the request from io by implementing their own streams and giving them Sendo library to execute them.

An example is provided for javascript library and a sensor machine:

var Sendo = require('sendo');
var wifi = require('wifi');
var io = new wifi.inputstream();
var sendo = new Sendo.Connector("localhost", 8569);

io.on("request", function(request) {
sendo.query(request, function(response) {
console.log(response.toString());
});
});

Implementation

Sendo can be implemented in different ways, but the first implementation is an open-source compiler called Sendo compiler that is written in c++.

Sendo language - 2018 Mar 06