writing-hashql-jexpr

Compose HashQL queries using J-Expr syntax with data constructors and type constructs.

1.6k|123|Updated Jul 15, 2019
One-click install
npx skills add https://github.com/hashintel/hash --skill writing-hashql-jexpr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hashql-jexpr
Source: https://github.com/hashintel/hash/tree/main/.claude/skills/writing-hashql-jexpr
Command: npx skills add https://github.com/hashintel/hash --skill writing-hashql-jexpr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides HashQL J-Expr syntax for writing queries, including paths, function calls, and data constructors.

Core Features & Use Cases

  • Expression types: string paths, arrays for function calls, and objects with # keys
  • Path syntax, namespacing, and labeled arguments
  • Data constructors: #literal, #struct, #list, #tuple, #dict, #type
  • Common patterns for let bindings, functions, and conditionals

Quick Start

Try crafting a simple J-Expr such as a let-binding with a numeric literal and a subsequent addition.

Frequently Asked Questions about writing-hashql-jexpr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write HashQL queries using J-Expr syntax?

J-Expr syntax in HashQL uses string paths, arrays for function calls, and objects with # keys to compose queries. Paths support namespacing and labeled arguments, while data constructors like #literal, #struct, #list, #tuple, and #dict enable entity filtering and data definition across namespaced paths.

What are HashQL data constructors and how do I use them?

HashQL data constructors (#literal, #struct, #tuple, #list, #dict, #type) define structured data within J-Expr queries. They enable strict JSON-based representation with labeled arguments, supporting entity creation, filtering, and type embedding via the #type DSL for function calls and parser references.

Can I use let bindings, functions, and conditionals in HashQL J-Expr?

Yes, J-Expr supports control and type constructs including let bindings, fn function definitions, if conditionals, type declarations, newtype definitions, and use statements. These compose with paths and data constructors to build complex entity queries and transformations.

How do I structure labeled arguments and namespaced paths in HashQL queries?

J-Expr path syntax handles namespacing through object structures with # keys and supports labeled arguments via objects passed to function calls. This enables precise data filtering and entity selection across hierarchical data structures with explicit type and value specification.

What's the difference between J-Expr arrays and objects in HashQL query composition?

In J-Expr, arrays represent function calls with positional arguments, while objects with # keys define data constructors and labeled argument structures. This dual representation enables both functional composition and structured data definition within a single JSON-based query format.