sparql-query-files

Executes SPARQL 1.1 queries against local RDF and Turtle files using Comunica.

Updated May 12, 2026
One-click install
npx skills add https://github.com/angelo-v/pi-kit --skill sparql-query-files-angelo-v
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sparql-query-files
Source: https://github.com/angelo-v/pi-kit/tree/main/packages/linked-data/skills/sparql-query-files
Command: npx skills add https://github.com/angelo-v/pi-kit --skill sparql-query-files-angelo-v

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Querying local knowledge graphs, ontologies, and vocabularies requires knowing the right file paths, graph structure, and SPARQL syntax upfront. This Skill removes that guesswork by enforcing a discover-first workflow that locates RDF files, inspects their schema, and runs semantically correct SPARQL queries. ## Core Features & Use Cases - Guided Query Workflow: Discovers existing SPARQL queries and RDF files (.ttl, .rdf, .n3, .jsonld, .nt, .nq, .trig) before writing anything, then inspects types and predicates via a schema overview. - Full SPARQL 1.1 Support: Executes SELECT, ASK, CONSTRUCT, and DESCRIBE queries against local files using the Comunica engine. - Ready-Made Patterns: Ships a reference of standard prefixes and common query patterns for SKOS concepts, class hierarchies, and label searches. - Use Case: Given a folder of Turtle files describing a SKOS taxonomy, ask the agent to list all top-level concepts with their labels — it will discover the files, inspect the graph, and run the correct query. ## Quick Start Ask the agent to list all SKOS concepts and their labels from the Turtle files in this workspace.

Frequently Asked Questions about sparql-query-files

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

FAQPage Schema
How do I query local Turtle files with SPARQL?▼

Use the Comunica engine to run SPARQL 1.1 queries directly against local .ttl files without a triplestore. First discover the available RDF files, inspect their schema for types and predicates, then execute SELECT, ASK, CONSTRUCT, or DESCRIBE queries against them.

How to list all SKOS concepts in a knowledge graph?▼

Run a SPARQL query matching resources of type skos:Concept with their skos:prefLabel values, ordered by label. Standard patterns for broader/narrower hierarchies and top concepts without a broader term are included in the reference file.

What RDF file formats does Comunica support for querying?▼

Comunica can query local files in Turtle (.ttl), RDF/XML (.rdf), Notation3 (.n3), JSON-LD (.jsonld), N-Triples (.nt), N-Quads (.nq), and TriG (.trig) formats. Always discover the actual files in the workspace rather than guessing paths.

Why should I avoid FILTER with string matching in SPARQL queries?▼

String matching on URIs with FILTER and CONTAINS is fragile and bypasses the graph semantics. Prefer traversing named individuals and typed relationships; use text filters on labels only as a last resort when no semantic path exists.

Can I reuse existing SPARQL queries instead of writing new ones?▼

Yes, the workflow starts by discovering existing SPARQL query files in the workspace so you can reuse or adapt them. This avoids duplicating queries and keeps prefix declarations and patterns consistent.