<commit_before>---
layout: documentation
title: Query Language
---
<h1>The Bazel Query Reference</h1>


<ul clas="toc">
  <li><a href="#examples">Examples</a></li>
  <li><a href="#tokens">Tokens: The Lexical Syntax</a></li>
  <li><a href="#concepts">Bazel Query Language Concepts</a></li>
  <li><a href="#expressions">Expressions: Syntax and Semantics of the Grammar</a></li>
  <li><a href="#functions">Functions</a></li>
  <li><a href="#output-formats">Output Formats</a></li>
</ul>

<p>
  When you use <code>bazel query</code> to analyze build
  dependencies, you use a little language, the <em>Bazel Query<commit_msg>Fix query page table of contents.<commit_after>---
layout: documentation
title: Query Language
---
<h1>The Bazel Query Reference</h1>


<ul class="toc">
  <li><a href="#examples">Examples</a></li>
  <li><a href="#tokens">Tokens: The Lexical Syntax</a></li>
  <li><a href="#concepts">Bazel Query Language Concepts</a></li>
  <li><a href="#expressions">Expressions: Syntax and Semantics of the Grammar</a></li>
  <li><a href="#functions">Functions</a></li>
  <li><a href="#output-formats">Output Formats</a></li>
</ul>

<p>
  When you use <code>bazel query</code> to analyze build
  dependencies, you use a little language, the <em>Bazel Query
{'fraction_non_alphanumeric': 0.1942902458366376, 'fraction_numerical': 0.0031720856463124504, 'mean_word_length': 5.278606965174129, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590532', 'n_tokens_mistral': 448, 'n_tokens_neox': 434, 'n_words': 116}