---
name: "tinysparql-query"
section: "1"
platform: "linux"
package: "tinysparql"
version: "3.12.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/tinysparql-query"
---

# tinysparql-query(1)

Query to SPARQL endpoints.

## NAME

tinysparql-query - Query to SPARQL endpoints.

## SYNOPSIS

```
tinysparql query [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>]
    (-f | --file) <file>] [(-u | --update)] [-a <parameter>:<value>]... [SPARQL]
```

## DESCRIPTION

This command allows running queries or updates on a SPARQL endpoint.

When the caller runs a query, the query is in the SPARQL language. This can be done two ways. Either by providing a *file* with the query or by providing a string with the *sparql* query.

The *file* argument can be either a local path or a URI. It also does not have to be an absolute path.

## OPTIONS

- **-b, --dbus-service=\<***service\_name***\>**

  Connects to a SPARQL endpoint at a D-Bus name.

- **-d, --database-path=\<***database\_path***\>**

  Connects to a database by location in the filesystem.

- **-r, --remote-service=\<***url***\>**

  Connects to a HTTP SPARQL endpoint.

- **-f, --file=\<***file***\>**

  Use a *file* with SPARQL content to query or update.

- **-u, --update**

  This has to be used with **--query**. This tells "tinysparql query" to use the SPARQL update extensions so it knows it isn’t a regular data lookup request. So if your query is intended to change data in the database, this option is needed.

- **-a, --arg=\<***parameter***\>:\<***value***\>**

  Provides an argument for a parameter declared in the SPARQL query string. This may be used with **--file**, **--query** or **--update**. Multiple arguments may be provided for multiple parameters. Argument values are provided as a colon separated string containing 3 values: name, type and value. The name is the same as used in the query string, the value is the desired value, and the type is a single-character string defining the type:

  • **i**: The value will describe an integer

  • **d**: The value will describe a floating point number

  • **b**: The value will describe a boolean

  • **s**: The value will describe a plain string

## EXAMPLES

Querying a D-Bus endpoint

```
$ tinysparql query --dbus-service org.example.Endpoint "SELECT ('Hello World' AS ?str) {}"
```

Updating a database directly from a query in a file

```
$ tinysparql query --database /tmp/db/ --update --file ./update.rq
```

Using **--arg** to provide a arguments to query parameters

```
$ tinysparql query -b org.example.Endpoint \
    -a name:s:"John" -a age:i:42 -a available:b:true \
    "SELECT (~name AS ?name) (~age AS ?age) (~available AS ?avail) { }"
```

## SEE ALSO

[**tinysparql-endpoint**(1)](/tinysparql-endpoint/1.md).

https://gnome.pages.gitlab.gnome.org/tinysparql/tutorial.html.
