{
  "ql": "nql1",
  "validation": "Language syntax and tree validation only. Example selectors and values do not establish field availability, access, or execution support.",
  "examples": [
    {
      "text": "class:Crack",
      "canonical": "class:Crack",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "class"
          ],
          "op": "eq",
          "value": {
            "kind": "text",
            "value": "Crack"
          }
        }
      }
    },
    {
      "text": "task.state:queued AND task.stage:review",
      "canonical": "task.state:queued AND task.stage:review",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "and",
          "children": [
            {
              "kind": "compare",
              "field": [
                "task",
                "state"
              ],
              "op": "eq",
              "value": {
                "kind": "text",
                "value": "queued"
              }
            },
            {
              "kind": "compare",
              "field": [
                "task",
                "stage"
              ],
              "op": "eq",
              "value": {
                "kind": "text",
                "value": "review"
              }
            }
          ]
        }
      }
    },
    {
      "text": "label(class:Crack AND reviewState:accepted)",
      "canonical": "label(class:Crack AND reviewState:accepted)",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "relation",
          "relation": "label",
          "expression": {
            "kind": "and",
            "children": [
              {
                "kind": "compare",
                "field": [
                  "class"
                ],
                "op": "eq",
                "value": {
                  "kind": "text",
                  "value": "Crack"
                }
              },
              {
                "kind": "compare",
                "field": [
                  "reviewState"
                ],
                "op": "eq",
                "value": {
                  "kind": "text",
                  "value": "accepted"
                }
              }
            ]
          }
        }
      }
    },
    {
      "text": "label.class:Crack AND label.reviewState:accepted",
      "canonical": "label.class:Crack AND label.reviewState:accepted",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "and",
          "children": [
            {
              "kind": "compare",
              "field": [
                "label",
                "class"
              ],
              "op": "eq",
              "value": {
                "kind": "text",
                "value": "Crack"
              }
            },
            {
              "kind": "compare",
              "field": [
                "label",
                "reviewState"
              ],
              "op": "eq",
              "value": {
                "kind": "text",
                "value": "accepted"
              }
            }
          ]
        }
      }
    },
    {
      "text": "source(study.protocol:\"weld-ct-v2\" AND registered:[2026-09-01 TO *])",
      "canonical": "source(study.protocol:weld-ct-v2 AND registered:[2026-09-01 TO *])",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "relation",
          "relation": "source",
          "expression": {
            "kind": "and",
            "children": [
              {
                "kind": "compare",
                "field": [
                  "study",
                  "protocol"
                ],
                "op": "eq",
                "value": {
                  "kind": "text",
                  "value": "weld-ct-v2"
                }
              },
              {
                "kind": "range",
                "field": [
                  "registered"
                ],
                "lower": {
                  "value": {
                    "kind": "date",
                    "value": "2026-09-01"
                  },
                  "inclusive": true
                },
                "upper": null
              }
            ]
          }
        }
      }
    },
    {
      "text": "tags:ANY(crack, porosity)",
      "canonical": "tags:ANY(crack, porosity)",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "set",
          "field": [
            "tags"
          ],
          "quantifier": "any",
          "values": [
            {
              "kind": "text",
              "value": "crack"
            },
            {
              "kind": "text",
              "value": "porosity"
            }
          ]
        }
      }
    },
    {
      "text": "tags:ALL(crack, porosity)",
      "canonical": "tags:ALL(crack, porosity)",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "set",
          "field": [
            "tags"
          ],
          "quantifier": "all",
          "values": [
            {
              "kind": "text",
              "value": "crack"
            },
            {
              "kind": "text",
              "value": "porosity"
            }
          ]
        }
      }
    },
    {
      "text": "has:meta.partNumber",
      "canonical": "has:meta.partNumber",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "has",
          "field": [
            "meta",
            "partNumber"
          ]
        }
      }
    },
    {
      "text": "NOT has:meta.partNumber",
      "canonical": "NOT has:meta.partNumber",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "not",
          "expression": {
            "kind": "has",
            "field": [
              "meta",
              "partNumber"
            ]
          }
        }
      }
    },
    {
      "text": "meta.partNumber:!=blade",
      "canonical": "meta.partNumber:!=blade",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "meta",
            "partNumber"
          ],
          "op": "ne",
          "value": {
            "kind": "text",
            "value": "blade"
          }
        }
      }
    },
    {
      "text": "NOT meta.partNumber:blade",
      "canonical": "NOT meta.partNumber:blade",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "not",
          "expression": {
            "kind": "compare",
            "field": [
              "meta",
              "partNumber"
            ],
            "op": "eq",
            "value": {
              "kind": "text",
              "value": "blade"
            }
          }
        }
      }
    },
    {
      "text": "meta[\"Inspection protocol\"]:\"weld-ct-v2\"",
      "canonical": "meta[\"Inspection protocol\"]:weld-ct-v2",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "meta",
            "Inspection protocol"
          ],
          "op": "eq",
          "value": {
            "kind": "text",
            "value": "weld-ct-v2"
          }
        }
      }
    },
    {
      "text": "meta[\"machine.name\"]:\"scanner-01\"",
      "canonical": "meta[\"machine.name\"]:scanner-01",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "meta",
            "machine.name"
          ],
          "op": "eq",
          "value": {
            "kind": "text",
            "value": "scanner-01"
          }
        }
      }
    },
    {
      "text": "study.uid:\"1.2.840.10008\"",
      "canonical": "study.uid:\"1.2.840.10008\"",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "study",
            "uid"
          ],
          "op": "eq",
          "value": {
            "kind": "text",
            "value": "1.2.840.10008"
          }
        }
      }
    },
    {
      "text": "size:>=0.12 AND size:<10",
      "canonical": "size:>=0.12 AND size:<10",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "and",
          "children": [
            {
              "kind": "compare",
              "field": [
                "size"
              ],
              "op": "gte",
              "value": {
                "kind": "number",
                "value": "0.12"
              }
            },
            {
              "kind": "compare",
              "field": [
                "size"
              ],
              "op": "lt",
              "value": {
                "kind": "number",
                "value": "10"
              }
            }
          ]
        }
      }
    },
    {
      "text": "measurement:12345678901234567890.10",
      "canonical": "measurement:12345678901234567890.1",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "measurement"
          ],
          "op": "eq",
          "value": {
            "kind": "number",
            "value": "12345678901234567890.1"
          }
        }
      }
    },
    {
      "text": "registered:[2026-09-01 TO 2026-09-30]",
      "canonical": "registered:[2026-09-01 TO 2026-09-30]",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "range",
          "field": [
            "registered"
          ],
          "lower": {
            "value": {
              "kind": "date",
              "value": "2026-09-01"
            },
            "inclusive": true
          },
          "upper": {
            "value": {
              "kind": "date",
              "value": "2026-09-30"
            },
            "inclusive": true
          }
        }
      }
    },
    {
      "text": "registered:[now-7d/d TO now/d]",
      "canonical": "registered:[now-7d/d TO now/d]",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "range",
          "field": [
            "registered"
          ],
          "lower": {
            "value": {
              "kind": "relativeDate",
              "offset": {
                "amount": -7,
                "unit": "d"
              },
              "roundToDay": true
            },
            "inclusive": true
          },
          "upper": {
            "value": {
              "kind": "relativeDate",
              "offset": null,
              "roundToDay": true
            },
            "inclusive": true
          }
        }
      }
    },
    {
      "text": "task.waited:>48h",
      "canonical": "task.waited:>48h",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "task",
            "waited"
          ],
          "op": "gt",
          "value": {
            "kind": "duration",
            "amount": 48,
            "unit": "h"
          }
        }
      }
    },
    {
      "text": "asset.name:blade*",
      "canonical": "asset.name:blade*",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "prefix",
          "field": [
            "asset",
            "name"
          ],
          "value": "blade"
        }
      }
    },
    {
      "text": "asset.name~\"blade\"",
      "canonical": "asset.name~\"blade\"",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "contains",
          "field": [
            "asset",
            "name"
          ],
          "value": "blade"
        }
      }
    },
    {
      "text": "(class:Crack OR class:Pore) AND NOT reviewState:rejected",
      "canonical": "(class:Crack OR class:Pore) AND NOT reviewState:rejected",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "and",
          "children": [
            {
              "kind": "or",
              "children": [
                {
                  "kind": "compare",
                  "field": [
                    "class"
                  ],
                  "op": "eq",
                  "value": {
                    "kind": "text",
                    "value": "Crack"
                  }
                },
                {
                  "kind": "compare",
                  "field": [
                    "class"
                  ],
                  "op": "eq",
                  "value": {
                    "kind": "text",
                    "value": "Pore"
                  }
                }
              ]
            },
            {
              "kind": "not",
              "expression": {
                "kind": "compare",
                "field": [
                  "reviewState"
                ],
                "op": "eq",
                "value": {
                  "kind": "text",
                  "value": "rejected"
                }
              }
            }
          ]
        }
      }
    },
    {
      "text": "meta.note:\"contains \\\"quoted\\\" text\"",
      "canonical": "meta.note:\"contains \\\"quoted\\\" text\"",
      "query": {
        "ql": "nql1",
        "expression": {
          "kind": "compare",
          "field": [
            "meta",
            "note"
          ],
          "op": "eq",
          "value": {
            "kind": "text",
            "value": "contains \"quoted\" text"
          }
        }
      }
    }
  ]
}
