sparqling-cleanup

Standardize SPARQL query syntax while verifying algebraic equivalence with Apache Jena ARQ.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/danbri/forgetmenot --skill sparqling-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sparqling-cleanup
Source: https://github.com/danbri/forgetmenot/tree/main/skills/sparqling-cleanup
Command: npx skills add https://github.com/danbri/forgetmenot --skill sparqling-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires java, curl, python3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill addresses the issue of inconsistent, unreadable, or messy SPARQL queries by providing a rigorous methodology to reformat them into a clean house style while mathematically guaranteeing that the query's logic remains identical.

Core Features & Use Cases

  • Algebraic Equivalence Checking: Uses Apache Jena ARQ to prove that your cleaned query produces the exact same results as the original.
  • Standardization Rules: Provides a clear set of rules for keyword casing, indentation, and prefix management to ensure team-wide consistency.
  • Use Case: When refactoring complex SPARQL queries for a public API, use this skill to ensure your cleanup doesn't accidentally alter the data output or break downstream applications.

Quick Start

Use the sparqling-cleanup skill to verify that the cleaned query in after.rq is equivalent to the original query in before.rq using the public parliament endpoint.

Frequently Asked Questions about sparqling-cleanup

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

FAQPage Schema
How do I standardize SPARQL query formatting without changing the query results?

You can standardize SPARQL query syntax safely by applying consistent formatting rules and verifying algebraic equivalence using Apache Jena ARQ to guarantee the cleaned query returns identical results to the original.

How does algebraic verification work for SPARQL refactoring?

Algebraic verification for SPARQL refactoring uses Apache Jena ARQ to parse queries, compile them into algebra, and compare result sets against a live SPARQL endpoint to mathematically prove functional equivalence.

Do I need Apache Jena ARQ to verify SPARQL query equivalence?

Yes, Apache Jena ARQ is required to verify SPARQL query equivalence. The skill depends on it for query parsing, algebra compilation, and result-set comparison against live SPARQL endpoints to mathematically guarantee no logic changes.

What's the best way to clean up messy SPARQL queries for a public API?

The best way to clean up messy SPARQL queries for a public API is to standardize syntax and prefix management, then use algebraic verification to ensure your refactoring does not accidentally alter data output or break downstream applications.

Why does my refactored SPARQL query return different RDF data results?

A refactored SPARQL query might return different RDF data results if standardization changed the query logic. This skill prevents that by using Apache Jena ARQ to verify strict algebraic equivalence against the original query before deployment.