eql-engine
v0.0.9
Published
E-Learnig query language interpreter
Downloads
8
Readme
eql-engine
E-Learnig query language interpreter
Usage
For node.js
// npm install eql-engine
var eql = require('eql-engine');
var query = eql.parse("select all:some text");
// do something with query
Parsed queries
SELECT
basic
// select all:Lorem ipsum
{
"command": "select",
"where": {
"predicate": {
"key": "all",
"operator": "=",
"value": "Lorem ipsum"
}
}
}
advanced
// select all:Lorem ipsum other:dolor sit amet
{
"command": "select",
"where": {
"predicate": {
"key": "all",
"operator": "=",
"value": "Lorem ipsum other"
}
}
}
// select all:Lorem ipsum && other!:dolor sit amet
{
"command": "select",
"where": {
"predicate": {
"key": "all",
"operator": "=",
"value": "Lorem ipsum"
},
"and": {
"predicate": {
"key": "other",
"operator": "!=",
"value": "dolor sit amet"
}
}
}
}
// select all:Lorem ipsum || other:dolor sit amet
{
"command": "select",
"where": {
"predicate": {
"key": "all",
"operator": "=",
"value": "Lorem ipsum"
},
"or": {
"predicate": {
"key": "other",
"operator": "=",
"value": "dolor sit amet"
}
}
}
}
// select all%Lorem ipsum || other:dolor sit amet
{
"command": "select",
"where": {
"predicate": {
"key": "all",
"operator": "contains",
"value": "Lorem ipsum"
},
"or": {
"predicate": {
"key": "other",
"operator": "=",
"value": "dolor sit amet"
}
}
}
}
Licencia
Copyright(c) 2014 Dirección de Tecnología Educativa de Buenos Aires (Dte-ba)
Distrubuido bajo la licencia GNU GPL v3