sparq: Skill for Claude Code

.claude/skills/sparql-formal-semantics/SKILL.md

sparql-formal-semantics is a skill for Claude Code from sparq-org/sparq. It costs 104 tokens per session (1,098 once invoked), scanned A, original, MIT.

A reference for the formal meaning of a defined part of SPARQL, a query language for data stored as linked subject–predicate–object statements. It explains how patterns, joins, optional parts, unions, filters, and query results are represented mathematically.

In plain words
What is it for?
Use it when writing operator specifications, checking the paper's supported SPARQL features, or drafting formal semantics for queries.
Why use it?
It helps prevent inaccurate descriptions of the SPARQL fragment used in the ZKP-SPARQL paper. It also records which language constructs and blank-node rules are in scope.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is sparq-org/sparq's own configuration. It tells Claude Code how to work on sparq itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sparq configures →

Part of the sparq plugin — 55 skills, 20 agents, 2 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to sparq-org/sparq. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sparq-org/sparq/main/.claude/skills/sparql-formal-semantics/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sparq-org/sparq

Made for: Claude Code.

Or install sparq, the plugin that ships this one along with the rest of its 55 skills, 20 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sparql-formal-semantics

README.md
[![agentmods](https://agentmods.dev/badge/skills/sparq-org/sparq/sparql-formal-semantics/github.svg)](https://agentmods.dev/skills/sparq-org/sparq/sparql-formal-semantics)
Your own site
<a href="https://agentmods.dev/skills/sparq-org/sparq/sparql-formal-semantics"><img src="https://agentmods.dev/badge/skills/sparq-org/sparq/sparql-formal-semantics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sparql-formal-semantics

Your own site · 80×15
<a href="https://agentmods.dev/skills/sparq-org/sparq/sparql-formal-semantics"><img src="https://agentmods.dev/badge/skills/sparq-org/sparq/sparql-formal-semantics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,098 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.01098
Opus 5 $0.00052 $0.00549
Sonnet 5 $0.00021 $0.00220
Haiku 4.5 $0.00010 $0.00110

Measured 12d ago against content hash 7ceaaec34531, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

sparql-formal-semantics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/sparql-formal-semantics/SKILL.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SPARQL formal semantics cheat-sheet

A working reference for the formal semantics layer Jesse's paper sits on. Citations matter — every claim here should be traceable to either the W3C SPARQL 1.1 rec or to the Pérez–Arenas–Gutiérrez (PAG) paper.

Algebra at a glance

PAG models a SPARQL graph pattern as expressions built from:

  • Triple patterns (s, p, o) where each position is a term or variable.
  • Basic graph patterns (BGPs) as sets of triple patterns.
  • AndP1, P2 — join (compatibility on shared variables).
  • OptP1, P2 — left outer join (OPTIONAL).
  • UnionP1, P2 — set union of solution mappings.
  • FilterP, R — selection by a built-in expression.

Solutions are partial functions μ : V → Term (called solution mappings). The semantics eval(G, P) of pattern P over graph G is a multiset of solution mappings.

Compatibility

Two solution mappings μ1, μ2 are compatible iff they agree on every variable in dom(μ1) ∩ dom(μ2). The join μ1 ⨝ μ2 is defined when they're compatible and equals μ1 ∪ μ2.

This single notion unifies BGP joining, AND, and the inner part of OPTIONAL.

Standard equivalences

Useful when re-shaping queries before circuit compilation:

  • (P1 AND P2) AND P3 ≡ P1 AND (P2 AND P3) (associativity).
  • P1 AND P2 ≡ P2 AND P1 (commutativity, multiset).
  • (P1 UNION P2) AND P3 ≡ (P1 AND P3) UNION (P2 AND P3) (distributivity).
  • OPTIONAL is not associative or commutative — be careful.

RDF graph model

For the paper's purposes, an RDF graph is a finite multiset of triples. Triples have:

  • IRIs, literals (with optional language tag, optional datatype IRI), and blank nodes.
  • Blank nodes are existential — they have local scope.

Blank-node canonicalisation

Two living standards:

  • URDNA2015 — the original RDF Dataset Canonicalisation algorithm; widely deployed.
  • URDNA2024 — the W3C-track successor; addresses some hash collisions and edge cases.

For the paper, pick one and document it. The choice flows through to circuit-side encoding, signature schemes that sign canonical N-Quads, and the Lean model.

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 110 lines · 104 tokens per session scan A 7ceaaec34531

Subscribe to this mod's changes

sparql-formal-semantics is a skill published in the GitHub repository sparq-org/sparq (12 stars, last pushed today), licensed MIT. It adds 104 tokens to every session and 1,098 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for…

K-Dense-AI/scientific-agent-skills · 66 tokens

pyhealth

Build clinical/healthcare deep-learning pipelines with PyHealth — loading EHR/signal/imaging datasets (MIMIC-III/IV, eICU, OMOP, SleepEDF, ChestXray14, EHRShot), defining tasks (mortality, readmission, length-of-stay, drug recommendation, sleep staging, ICD coding, EEG events), instantiating models (Transformer…

K-Dense-AI/scientific-agent-skills · 216 tokens

torchdrug

Build and troubleshoot TorchDrug 0.2.1 workflows for molecular graphs, property prediction, self-supervised pretraining, molecule generation, retrosynthesis, protein representation learning, and knowledge graph reasoning. Use when code imports torchdrug or needs its datasets, models, tasks, or Engine.

K-Dense-AI/scientific-agent-skills · 61 tokens

deepspot-m

Generate transcriptome-wide virtual spatial transcriptomics from H&E histology with DeepSpot-M. Use when you need spatial gene expression in log1p-CPM for 224x224 tiles at about 20x, want to query protein-coding genes by symbol instead of a fixed panel, or want to run prediction across a whole slide after tiling with…

K-Dense-AI/scientific-agent-skills · 80 tokens

nemo-mbridge-perf-expert-parallel-overlap

Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlapmoeexpertparallelcomm, delaywgradcompute, and flex dispatcher backends such as DeepEP and HybridEP.

NVIDIA/skills · 56 tokens

pick-a-pii-model

Select an on-device OpenMed PII model from the committed registry by language, runtime format, and size budget, then require recall validation before deployment. Use when an agent must choose a local PII detector for CPU, Apple Silicon, or a mobile export without relying on live model discovery.

maziyarpanahi/openmed · 64 tokens