OpO FAST Triple Store, Web Server, and JSON Database
TQL
OpO

A TQL query is composed of one or more clauses. Each clause has a verb that identifies the type of clause. In addition most clauses has a value. Values vary depending on the clause and my be a single integer as in the case of a LIMIT or they could be a JSON document in the case of an INSERT.

# friendly TQL SELECT { "id": $REF, "top": $ } WHERE EQ(firstname 'Pete') FILTER NOT(GTE(age 21))
INSERT or UPDATE

An INSERT or UPDATE inserts or updates a JSON document so the value for the is the content to insert or update.

insert { "name": "Pete", "age": 63 }
SELECT

A SELECT clause describes the content and format of the expected returned JSON. The value should be an almost valid JSON. The exceptions being paths and keywords which are strings without quotes.

If no other operation verb such as INSERT, UPDATE, or DELETE is provided a SELECT of the complete JSON is assumed.

In the select value or return template all tokens (strings without quotes) that are not JSON reserved are assumed to be either paths or special keys if they begin with a $.

SELECT { "primaryName": name, "realAge": age, "id": $ref, "source": "sample" }
DELETE

A DELETE deletes JSON documents from the database. It takes no arguments.

WHERE EQ(name 'Pete') DELETE
WHERE and FILTER

WHERE and FILTER values are encoded using a function call like approach but like GraphQL the commas are optional. Single quotes or double quotes can be used to deliminate strings which a path to an element is not quoted.

WHERE OR( EQ(name 'Pete') EQ(name 'Makie'))
LIMIT

A LIMIT clause expects an integer value which limits the number of JSON records impacted by the TQL query.

LIMIT 3
CURSOR

A CURSOR clause expects an object with a single key that is the name of a previous SELECT indicating a new query should be made and stored.

CURSOR some-stored-id 7