whatisgithub

What is sq?

ktk/sq — explained in plain English

Analysis updated 2026-05-18

11RustAudience · developerComplexity · 3/5Setup · easy

In one sentence

A fast Rust command line tool for querying SPARQL databases, with saved endpoints, prefixes, and query shortcuts, built to be easy for both humans and AI agents to use.

Mindmap

mindmap
  root((repo))
    What it does
      Queries SPARQL endpoints
      Saves config and prefixes
      Fast native startup
    Tech stack
      Rust
      SPARQL
      TOML config
    Use cases
      Terminal queries
      Agent tool calls
      Piped data output
    Features
      Built in shortcuts
      Safe update mode
    Audience
      Developers
      Data engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Query a SPARQL endpoint repeatedly without retyping the server address and prefixes each time.

USE CASE 2

Pipe SPARQL query results into standard Unix tools as TSV, CSV, or JSON.

USE CASE 3

Let an AI agent run SPARQL queries directly instead of assembling raw curl requests.

USE CASE 4

Inspect a linked data graph quickly using built in commands like listing classes or graphs.

What is it built with?

RustSPARQLTOML

How does it compare?

ktk/sq2arons/agent-gitalexdevflow/lsq
Stars111111
LanguageRustRustRust
Setup difficultyeasyeasyeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
No license information is stated in the README.

So what is it?

sq is a small command line tool for querying SPARQL endpoints. SPARQL is a query language used to ask questions of data stored as linked facts, similar to how SQL is used for regular databases, and an endpoint is a server that answers those queries. The tool was built because people who work with the same SPARQL endpoint from the command line tend to retype the same server address, prefixes, and options every time. sq lets you save all of that in a configuration file so the common case becomes a short command. A second goal is making SPARQL easier for AI agents to use. Instead of an agent having to build a raw curl command and manage request details itself, it can call sq directly with just the query text. sq is written in Rust as a small native program rather than running on a virtual machine like Java, so it starts almost instantly and runs quickly. You can write a query directly on the command line, read one from a file, or pipe it in from another program. Output can be a readable colored table in the terminal, or plain formats like TSV, CSV, JSON, or XML when the output is being sent to another tool, which makes it easy to combine sq with everyday Unix commands. It also includes several built in shortcuts for common tasks, such as listing the graphs in a dataset, counting instances of a class, or showing everything connected to a specific item, so you do not have to write that SPARQL by hand each time. Updates to the data, such as inserting or deleting information, must go through an explicit update command, and by default sq blocks broad or destructive operations like wiping an entire graph unless you specifically force it. Configuration includes setting a default endpoint plus named alternate endpoints, adding project specific prefixes on top of a built in standard set, and saving frequently used queries under short names you can run later. This project is aimed at people who already work with SPARQL and linked data and want a faster, more convenient way to query it from a terminal or from automated tooling.

Copy-paste prompts

Prompt 1
Help me write a .sq.toml config file with a default endpoint and custom prefixes for sq.
Prompt 2
Show me how to use sq to list all the classes and their counts in my SPARQL dataset.
Prompt 3
Explain the difference between sq's read mode and sq update, and how --force works.
Prompt 4
Write an sq alias for a query that lists all people with their names, sorted alphabetically.

Frequently asked questions

What is sq?

A fast Rust command line tool for querying SPARQL databases, with saved endpoints, prefixes, and query shortcuts, built to be easy for both humans and AI agents to use.

What language is sq written in?

Mainly Rust. The stack also includes Rust, SPARQL, TOML.

What license does sq use?

No license information is stated in the README.

How hard is sq to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sq for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.