cli

Execute SPARQL queries and load RDF files via command line.

8|1|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/sparq-org/sparq --skill cli-sparq-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli
Source: https://github.com/sparq-org/sparq/tree/main/skills/cli
Command: npx skills add https://github.com/sparq-org/sparq --skill cli-sparq-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a command-line interface to interact with the Sparq RDF/SPARQL engine, enabling users to load RDF files, run SPARQL queries, build/query memory-mapped indexes, and perform various operations on datasets.

Core Features & Use Cases

  • RDF File Loading: Load Turtle, N-Triples, N-Quads, and TriG files into the Sparq engine.
  • SPARQL Query Execution: Run SPARQL queries against loaded RDF data.
  • Memory-Mapped Indexing: Build and query memory-mapped indexes for large datasets.
  • Reasoning: Materialize RDFS/OWL-RL/N3 reasoning closures.
  • Data Ingestion: Stream and ingest large RDF dumps.
  • Benchmarking: Benchmark query performance.
  • Use Case: Imagine you have a large dataset of RDF triples and you want to query and analyze the data using SPARQL. This Skill allows you to do so via the command line, providing flexibility and control over your data processing tasks.

Quick Start

Build and run the Sparq CLI to query an RDF file:

cargo run --release -p sparq-cli -- query data.ttl turtle 'SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10'

Frequently Asked Questions about cli

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

FAQPage Schema
How do I run SPARQL queries against RDF files from the command line?

To run SPARQL queries against RDF files from the command line, use the Sparq CLI to execute commands like 'cargo run --release -p sparq-cli -- query data.ttl turtle' with your SPARQL query string. It directly processes Turtle, N-Triples, N-Quads, and TriG files.

Can I build memory-mapped indexes for large RDF datasets using a command-line tool?

Yes, you can build memory-mapped indexes for large RDF datasets using the Sparq command-line interface. This feature allows efficient indexing and querying of massive RDF triples directly from the terminal, optimizing memory usage during data analysis.

What RDF file formats are supported for loading via the command line?

The supported RDF file formats for loading via the command line include Turtle, N-Triples, N-Quads, and TriG. The Sparq CLI parses these formats to load RDF triples into the engine for immediate SPARQL query execution.

Does the Sparq CLI support RDFS and OWL-RL reasoning for RDF data?

Yes, the Sparq CLI supports RDFS and OWL-RL reasoning for RDF data. It can materialize RDFS, OWL-RL, and N3 reasoning closures directly from the command line, expanding the inferred triples within your loaded datasets.

What is the best way to benchmark SPARQL query performance for RDF triples?

The best way to benchmark SPARQL query performance for RDF triples is using the Sparq CLI's built-in benchmarking feature. It measures query execution times against loaded RDF datasets and memory-mapped indexes directly from the command line.

How do I stream and ingest large RDF dumps without loading everything into memory?

To stream and ingest large RDF dumps efficiently, use the Sparq CLI's data ingestion capabilities. This command-line tool processes large RDF files sequentially, preventing memory overload while building memory-mapped indexes for subsequent SPARQL querying.