Substitute
Binds a value to a SPARQL variable with an inline VALUES block, keeping the variable projected and the query valid instead of removing it.
Instructions
Gives one variable of a SPARQL query or update a value without removing the variable: an inline VALUES block restricting it to the term is joined into every group of the query, so the query stays valid, a SELECT still projects the variable and every result row still carries it. Subqueries that do not project the variable keep their own copy (it is renamed there). The query must not assign the variable itself (AS or VALUES). A URI is written as , a literal escaped; a blank node is rejected. Substitute is Values over a one-row table; use Values for several variables or rows. For example, Substitute("SELECT ?city ?label WHERE { ?city rdfs:label ?label }", "city", URI("http://ex.org/C")) produces "SELECT ?city ?label WHERE { VALUES (?city) { (http://ex.org/C) } ?city rdfs:label ?label }".
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"var": "<var>",
"binding": "<binding>"
},
"name": "Substitute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| var | Yes | The variable to substitute in the query (e.g., '?x'). | |
| query | Yes | The SPARQL query string with variable placeholders. | |
| binding | Yes | A dictionary containing the value and type to substitute for the variable. |