πUse the Query Language
A comprehensive breakdown of how to use the query language
Last updated
A comprehensive breakdown of how to use the query language
Last updated
The Query Language is an intuitive way to build complex multi-omic queries without having to memorize your entire graph schema.
A query is made up of concepts and relationships. A concept is surrounded by parentheses ()
, for example, to match against the concept Gene
use (Gene)
.
While using the Query Language, a look-ahead menu shows possible outbound and inbound relationships from a starting concept. Each data graph on the BioBox platform is unique. This means all options that you see in this menu are tailored to the relationships and concepts uniquely found in your custom graph.
In this example we will walk through the building a query that will identify genes upregulated in differential expression datasets where the experimental group was diagnosed with endometrium adenocarcinoma. This natural language question translates to the query
To start writing the query, type "Gene". This will activate the lookahead menu, which shows available outbound and inbound relationships. The lookahead displays the relationship, its directionality, and the associated concept.
Starting with "Gene" some of the relationship - concepts combinations in this example graph include
You can scroll through the menu or continue typing until you find the relationship you are looking for.
The relationship and concept can be selected from the menu or you can type it out manually. The spelling and case must be exact.
These queries can also be constructed using natural language, learn more here.
Concepts and relationships can be further filtered using data property filters. When writing a query, all of the data properties associated with a concept or relationship can be used to further refine the data that will be returned.
Within a concept, data property filters can be included following the concept label within brace brackets {}
. Data property filters have the format [key][op][value]
where key
is the name of the property and op
is any of
=~
<=
>=
!=
=
>
<
For numeric properties, the filter value is a number, for example { a=1 }
. For string properties, the value must be wrapped in quotations, for example { uuid="x" }
. For boolean properties, the filter value is either of true
or false
, for example { x=false }
.
Data filter properties are separated by the logical operators &
(and) and |
(or). For example, a complete concept and filter: (Gene { start>1000 & strand=1 })
. This example is also valid on its own as a query may only specify one concept.
A relationship is specified by connecting concepts with the format <-[label]<-
, ->[label]->
, or -[label]-
For example, -> participates in ->
. The autocomplete will assume arrows format.
Putting this all together, a complete minimal example is:
Statements can also specify a NOT
path filter at the end of the statement. This is a path based filter and must include at least one variable and at least one relationship.
A valid NOT
filter is:
The following query is invalid because there are no variables used in the NOT
filter:
The following query is invalid because the NOT
filter only specifies a single concept and not a complete relationship:
A statement is a relationship plus optionally a NOT
filter. Multiple statements can be combined using +
, and at least one variable must be chained through per statement:
Once you have launched your query it is time to explore your results. Learn more about exploring and understanding your results here.