agentsclimarketplace

Query representation validation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/query-representation-validation

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill query-representation-validation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when after parsing a MassQL query string into an abstract syntax tree or intermediate representation, before executing it against mass spectrometry data files (mzML, mzXML, etc.). Validation is essential when the query contains complex MS-specific patterns (e.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.9 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

query-representation-validation

Summary

Validate that a parsed mass spectrometry query has been correctly transformed into a structured representation (AST or canonical object) that faithfully captures the user's intent while conforming to MassQL design principles. This ensures the parse tree is both semantically sound and executable against MS data repositories.

When to use

After parsing a MassQL query string into an abstract syntax tree or intermediate representation, before executing it against mass spectrometry data files (mzML, mzXML, etc.). Validation is essential when the query contains complex MS-specific patterns (e.g., isotope filters, intensity ratios, retention time windows, mass tolerance constraints) that must be unambiguously represented for scalable queries across single spectra or entire repositories.

When NOT to use

  • The query string has not yet been parsed into a structured representation—use parsing/tokenization first.
  • The input is raw MS data (mzML, mzXML files) rather than a query object—use data loading and query execution instead.
  • Validation is being applied without reference to the MassQL grammar or design principles—validation requires the formal specification.

Inputs

  • MassQL query string (text)
  • Abstract syntax tree (AST) or intermediate query object representation
  • MassQL grammar specification

Outputs

  • Validated query representation (JSON or Python object)
  • Validation report or error log (identifying missing fields, ambiguities, or constraint violations)
  • Canonical parse tree suitable for downstream execution

How to apply

Validate the parse tree against three orthogonal MassQL design criteria: (1) Expressiveness—confirm that the parsed representation captures all specified mass spectrometry patterns (e.g., MS1MZ filters with tolerance, MS2DATA references, intensity match ratios) without loss or ambiguity; (2) Precision—verify that each constraint (mass tolerance in ppm, intensity percentages, retention time bounds) is explicitly represented with no ambiguity in how they should be applied; (3) Scalability—ensure the canonical representation (JSON or Python object) is independent of corpus size and can be applied uniformly to a single spectrum or a repository query. Return the validated parse tree in a standardized format (e.g., JSON with typed fields for mass, retention time, intensity) and confirm all user-specified clauses are present and correctly ordered in the AST.

Related tools

Examples

from massql import msql_engine; results_df = msql_engine.process_query('QUERY MS2DATA WHERE MS1MZ=100 WITH TOLERANCEMZ=0.1', 'input.mzML')

Evaluation signals

  • All MS-specific clauses (MS1MZ, MS2DATA, TOLERANCEMZ, INTENSITYPERCENT, INTENSITYMATCH, INTENSITYMATCHREFERENCE, MS2PREC, etc.) present in the input query are represented in the output parse tree with no omissions.
  • Numeric constraints (mass tolerance in ppm or Da, intensity thresholds as percentages, retention time windows) are parsed with correct data types and value ranges (e.g., TOLERANCEMZ ≥ 0).
  • Logical operators (AND, OR) and clause ordering are preserved in the canonical representation, ensuring query semantics are not altered.
  • The validated query can be successfully serialized to JSON or Python pickle format without loss of information.
  • Execution of the validated query against a test mzML file produces non-empty results when the query semantically matches the data (e.g., a query for MS1MZ=100 with TOLERANCEMZ=0.1 matches peaks within [99.9, 100.1] m/z).

Limitations

  • Validation does not guarantee that the query will return results—it only ensures the representation is syntactically and semantically sound. Data matching depends on whether the specified MS patterns actually exist in the queried file.
  • The README and workflow do not provide explicit error handling or recovery strategies for partially valid queries (e.g., a query with one correct clause and one malformed clause).
  • No changelog or versioning information is documented, so validation rules may change across MassQL versions without explicit notification.

Evidence

  • [other] Validation against MassQL design principles: "Validate the parse tree against MassQL design principles: expressiveness (captures complex MS patterns), scalability (handles single spectrum to repository queries), and readability (natural MS"
  • [other] Parse tree output format: "Return the parse tree in a canonical format (e.g., JSON or pickled Python object) for downstream query execution or analysis."
  • [readme] MassQL design principles from README: "Expressiveness - Capture complex mass spectrometry patterns that the community would like to look for. Precision - Exactly prescribe how to find data without ambiguity. Scalable - Easily facilitating"
  • [other] Query parsing workflow step: "Construct a parser (e.g., using recursive descent or parser generator such as ANTLR or PLY) that consumes tokens and produces a structured abstract syntax tree (AST) or query object representation."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.