.. highlight:: none
.. _storm-ref-intro:
Storm Reference - Introduction
==============================
**Storm** is the query language used to interact with data in a Cortex. Storm allows you to ask about, retrieve, annotate, add, modify, and delete data from a Cortex. Most Synapse users (e.g., those conducting analysis on the data) will access Storm via the Synapse **cmdr** command-line interface (CLI) (see :ref:`syn-tools-cmdr`), using the :ref:`syn-storm` command to invoke a Storm query:
``cli> storm
``
This section covers the following important Storm background concepts:
- `Storm Background`_
- `Basic Storm Operations`_
- `Lift, Filter, and Pivot Criteria`_
- `Advanced Storm Operations`_
- `Storm Operating Concepts`_
- `Operation Chaining`_
- `Storm as a Pipeline`_
- `Node Consumption`_
.. _storm-bkgd:
Storm Background
----------------
In designing Storm, we needed it to be flexible and powerful enough to allow interaction with large amounts of data and a wide range of disparate data types. However, we also needed Storm to be intuitive and efficient so it would be accessible to a wide range of users. We wrote Storm specifically to be used by analysts and other users from a variety of knowledge domains who are not necessarily programmers and who would not want to use what felt like a "programming language".
Wherever possible, we masked Storm’s underlying programmatic complexity. The intent is for Storm to act more like a "data language", allowing users to:
- **Reference data and query parameters in an intuitive form.** Through features such as type safety, property normalization, and syntax and query optimization, Storm takes a "do what I mean" approach. To the extent possible, Storm removes the burden of translating or standardizing data from the user.
- **Use a simple yet powerful syntax to run Storm queries.** To avoid feeling like a programming language (or even a traditional database query language), Storm avoids the use of operator-like functions and parameters. Instead, Storm:
- Leverages intuitive keyboard symbols for efficient querying.
- Uses a natural language-like syntax so using Storm feels more like "asking a question" than "constructing a data query".
Analysts still need to learn the Storm "language" - forms (:ref:`data-form`) and tags (:ref:`data-tag`) are Storm's "words", and the Storm syntax allows you to construct "sentences". That said, the intent is for Storm to function more like "how do I ask this question of the data?" and not "how do I write a program to get the data I need?"
Finally – and most importantly – **giving analysts direct access to Storm to allow them to create arbitrary queries provides them with an extraordinarily powerful analytical tool.** Analysts are not constrained by working with a set of predefined queries provided to them through a GUI or an API. Instead, they can follow their analysis wherever it takes them, creating queries as needed and working with the data in whatever manner is most appropriate to their research.
.. _storm-ops-basic:
Basic Storm Operations
----------------------
Storm allows users to perform all of the standard operations used to interact with a Cortex:
- **Lift:** – retrieve data based on specified criteria. (:ref:`storm-ref-lift`)
- **Filter:** – take a set of lifted nodes and refine your results by including or excluding a subset of nodes based on specified criteria. (:ref:`storm-ref-filter`)
- **Pivot:** – take a set of lifted nodes and identify other nodes that share one or more properties or property values with the lifted set. (:ref:`storm-ref-pivot`)
- **Data modification:** – add, modify, annotate, and delete nodes from a Cortex. (:ref:`storm-ref-data-mod`)
Most operations (other than those used solely to lift or add data) require an existing data set on which to operate. This data set is typically the output of a previous Storm operation whose results are the nodes you want to modify or otherwise work with.
In addition to these operations, the Storm query language supports an extensible set of commands (:ref:`storm-ref-cmd`). Commands such as :ref:`storm-limit`, :ref:`storm-graph`, or :ref:`storm-uniq` support specific functionality to further extend the power of Storm. Available commands can be displayed with ``storm help``.
Storm also supports powerful features such as the use of **variables** (:ref:`storm-adv-vars`) in queries and the ability to issue **subqueries** (:ref:`storm-adv-subquery`) within Storm itself.
Lift, Filter, and Pivot Criteria
++++++++++++++++++++++++++++++++
The main operations carried out with Storm are lifting, filtering, and pivoting. When conducting these operations, you need to be able to clearly specify the data you are interested in – your selection criteria. In most cases, the criteria you specify will be based on one or more of the following:
- A **property** (primary or secondary) on a node.
- A specific **value** for a property (*