Docs | BioBox Platform
GuideAPIRelease NotesLog In
  • Welcome to BioBox!
  • Framework
    • Overview
    • Why Graph?
    • Core Concepts
  • Data Packages
    • Data Packages
    • External Ontologies
      • Gene Ontology
      • Tissue
      • Disease
      • Cell Ontology
      • Phenotype
  • How To
    • 🧭Configure your Knowledge Graph Schema
      • πŸ—‚οΈFormat Internal Data For Uploading
      • ‴️Upload Internal Data
    • βš–οΈCreate Prioritization Graph Models
      • πŸ—’οΈGenerate Reports
      • πŸ›£οΈPathway Enrichment
    • πŸ—ΊοΈUse the Graph Explorer
      • βš™οΈRunning Graph Algorithms
      • πŸ’ΎSave Graph Explorer Sessions
    • πŸ”—Use the Query Language
      • Customize the data table returned with your query
      • 🧭Explore and understand your results
      • πŸ“ŠVisualize data returned in Query Language
      • ✏️Modify Queries using the Query Editor
    • Ask questions with Natural Language (GraphRAG)
      • Use Agent Orion to generate a query with Natural Language
      • Use Agent Iris to converse with your data
  • πŸ“ŠVisualize data on the Legacy Platform
    • πŸ“„Create a Genomic Sequencing Dashboard (Legacy Platform)
    • 🍭Create a Stacked Lollipop Plot (Legacy Platform)
    • ↕️Upload raw data (Legacy Platform)
    • πŸ“«Invite Users to Your Organization
  • Release Notes
Powered by GitBook
On this page
  • How to Construct a Query
  • Adding Data Properties
  1. How To

Use the Query Language

A comprehensive breakdown of how to use the query language

PreviousSave Graph Explorer SessionsNextCustomize the data table returned with your query

Last updated 5 months ago

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.

How to Construct a Query

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

(Gene)<- upregulates <-(DifferentialExpressionDataset)-> experimental group includes ->(TumorSample)-> pathologically confirmed to be ->(Disease{displayName="endometrium adenocarcinoma"})

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.

Adding Data Properties

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:

(Gene { start>1000 & strand=1 })-> participates in ->(Pathway)

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:

(s:Sample)-> pathologically confirmed to be ->(Disease) NOT (s:Sample)-> has variant ->(FivePrimeUTR)

The following query is invalid because there are no variables used in the NOT filter:

(s:Sample)-> pathologically confirmed to be ->(Disease) NOT (Sample)-> has variant ->(FivePrimeUTR)

The following query is invalid because the NOT filter only specifies a single concept and not a complete relationship:

(s:Sample)-> pathologically confirmed to be ->(Disease) NOT (s:Sample)

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:

(Sample)-> expresses ->(g:Gene)-> participates in ->(Pathway { displayName="Deubiquitination

These queries can also be constructed using natural language, .

Once you have launched your query it is time to explore your results. Learn more about exploring and

πŸ”—
learn more here
understanding your results here.
BioBox Query Language