javascript-wasm

A JavaScript and TypeScript interface for storing and querying RDF data in the browser or Node.js. RDF is a way to represent information as linked statements, and SPARQL is a query language for that data.

In plain words
What is it for?
Use it to read Turtle, N-Triples, N-Quads, or TriG data; run SPARQL queries; return RDF results; count or stream matches; and apply data updates.
Why use it?
It lets applications load linked-data files, ask structured questions, stream large result sets, and apply changes without relying on a separate server.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sparq-org/sparq/javascript-wasm
Any agent
npx skills add sparq-org/sparq --skill javascript-wasm
Clone the repo
git clone --depth 1 https://github.com/sparq-org/sparq

Made for: Claude Code, Codex.

Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 15,283 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00131 $0.15283
Opus 5 $0.00066 $0.07641
Sonnet 5 $0.00026 $0.03057
Haiku 4.5 $0.00013 $0.01528

Measured 2d ago against content hash e52d411ea4ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

javascript-wasm scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Remote-`@context` JSON-LD (`Store.loadJsonLdWithContexts`) needs the `jsonld-contexts` bundle feature ([SONNET-4.6] sq-yz27r, #3251).** Plain `'jsonld'` ingest drives `oxjsonld` with **no** `LoadDocumentCallback`, so
skills/javascript-wasm/SKILL.md · 494 lines

How it starts

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

sparq from JavaScript / WebAssembly

sparq is a Rust RDF triplestore + SPARQL engine compiled to WebAssembly. The npm package @jeswr/sparq wraps it in an idiomatic RDF/JS surface (SparqStore, Map-like Bindings, spec terms via @rdfjs/types); it runs unchanged in Node >= 18 and the browser. There is also a thin raw wasm class (Store) if you want SPARQL-JSON strings with no JS-side term materialisation. The bundle size is tracked live on the benchmarks dashboard under the Core metrics (wasm_bundle_bytes).

Use SparqStore (the high-level wrapper) by default — it covers SELECT/ASK (query/queryBindings/queryBoolean) and CONSTRUCT/DESCRIBE (queryQuads, returning RDF/JS Quads). Drop to the raw Store only to skip term materialisation entirely (SPARQL-JSON / N-Triples strings) or for query-plan introspection.

Quickstart

import { SparqStore, DataFactory as DF } from '@jeswr/sparq';

// init() runs lazily on first construction.
const store = await SparqStore.fromString(`
  @prefix ex: <http://ex/> .
  ex:alice ex:name "Alice" ; ex:knows ex:bob .
  ex:bob   ex:name "Bob"@en .
`, 'turtle'); // 'turtle' (default) | 'ntriples' | 'nquads' | 'trig' | 'jsonld'

// SELECT -> asynchronous RDF/JS ResultStream<Bindings>
const bindings = await store.queryBindings(
  'PREFIX ex: <http://ex/> SELECT ?s ?name WHERE { ?s ex:name ?name }',
);
await new Promise((resolve, reject) => {
  bindings.on('error', reject);
  bindings.on('end', resolve);
  bindings.on('data', (row) => {
    console.log(row.get('s').value, '->', row.get('name').value);
  });
});

// ASK -> boolean (native early-exit at first solution)
store.queryBoolean('PREFIX ex: <http://ex/> ASK { ex:alice ex:knows ex:bob }'); // true

// count without materialising rows
store.count('PREFIX ex: <http://ex/> SELECT ?s WHERE { ?s ex:name ?o }'); // 2

store.free(); // release wasm memory (or: `using store = await SparqStore.fromString(...)`)

Read the full file on GitHub · 494 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. 2d ago First seen · 494 lines · 131 tokens per session scan A e52d411ea4ff

Subscribe to this mod's changes

javascript-wasm is a skill published in the GitHub repository sparq-org/sparq (10 stars, last pushed 2d ago), licensed MIT. It adds 131 tokens to every session and 15,283 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.