Commit d5d14455 authored by Marco Mariani's avatar Marco Mariani

docs: added complex_queries, developers, gid_storage, naming_conventions

parent e85c91a2
...@@ -222,8 +222,112 @@ JSON Schemas and Grammar ...@@ -222,8 +222,112 @@ JSON Schemas and Grammar
Below you can find schemas for constructing complex queries Below you can find schemas for constructing complex queries
* `Complex Queries JSON Schema <http://www.j-io.org/jio-Complex.Queries.JSON.Schema>`_ * Complex Queries JSON Schema:
* `Simple Queries JSON Schema <http://www.j-io.org/jio-Simple.Queries.JSON.Schema>`_
* `Complex Queries Grammar <http://www.j-io.org/jio-Complex.Queries.Grammar>`_ .. code-block:: javascript
{
"id": "ComplexQuery",
"properties": {
"type": {
"type": "string",
"format": "complex",
"default": "complex",
"description": "The type is used to recognize the query type."
},
"operator": {
"type": "string",
"format": "(AND|OR|NOT)",
"required": true,
"description": "Can be 'AND', 'OR' or 'NOT'."
},
"query_list": {
"type": "array",
"items": {
"type": "object"
},
"required": true,
"default": [],
"description": "query_list is a list of queries which can be in serialized format of in object format."
}
}
}
* Simple Queries JSON Schema:
.. code-block:: javascript
{
"id": "SimpleQuery",
"properties": {
"type": {
"type": "string",
"format": "simple",
"default": "simple",
"description": "The type is used to recognize the query type."
},
"operator": {
"type": "string",
"default": "=",
"format": "(>=?|<=?|!?=)",
"description": "The operator used to compare."
},
"id": {
"type": "string",
"default": "",
"description": "The column id."
},
"value": {
"type": "string",
"default": "",
"description": "The value we want to search."
}
}
}
* Complex Queries Grammar::
search_text
: and_expression
| and_expression search_text
| and_expression OR search_text
and_expression
: boolean_expression
| boolean_expression AND and_expression
boolean_expression
: NOT expression
| expression
expression
: ( search_text )
| COLUMN expression
| value
value
: OPERATOR string
| string
string
: WORD
| STRING
terminal:
OR -> /OR[ ]/
AND -> /AND[ ]/
NOT -> /NOT[ ]/
COLUMN -> /[^><= :\(\)"][^ :\(\)"]*:/
STRING -> /"(\\.|[^\\"])*"/
WORD -> /[^><= :\(\)"][^ :\(\)"]*/
OPERATOR -> /(>=?|<=?|!?=)/
LEFT_PARENTHESE -> /\(/
RIGHT_PARENTHESE -> /\)/
ignore: " "
...@@ -21,7 +21,7 @@ plus the storages and dependencies you need and you will be good to go. ...@@ -21,7 +21,7 @@ plus the storages and dependencies you need and you will be good to go.
Naming Conventions Naming Conventions
------------------ ------------------
All the code follows this `Javascript Naming Conventions <http://www.j-io.org/Javascript-Naming_Conventions>`_. All the code follows this :ref:`Javascript Naming Conventions <naming-conventions>`.
How to design your own jIO Storage Library How to design your own jIO Storage Library
------------------------------------------ ------------------------------------------
......
...@@ -97,7 +97,7 @@ metadata can contain several values. Example: ...@@ -97,7 +97,7 @@ metadata can contain several values. Example:
// or // or
"key": ["value1", "value2"], "key": ["value1", "value2"],
// or // or
"key": {"attribute name": "attribute value", "content": "value'}, "key": {"attribute name": "attribute value", "content": "value"},
// or // or
"key": [ "key": [
{"scheme": "DCTERMS.URI", "content": "http://foo.com/bar"}, {"scheme": "DCTERMS.URI", "content": "http://foo.com/bar"},
......
...@@ -19,6 +19,7 @@ Contents: ...@@ -19,6 +19,7 @@ Contents:
complex_queries complex_queries
metadata metadata
developers developers
naming_conventions
authors authors
license license
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment