ldh-AddResultSetChart
Creates a chart resource from an existing SPARQL SELECT query in a LinkedDataHub document, mapping category and series variables for table, bar, line, scatter, or timeline visualizations.
Instructions
Writes a chart of SPARQL SELECT query results to a LinkedDataHub document. The chart is a resource the document holds, not one of its content blocks: to show it in the content mode, place it with ldh-AddObjectBlock, the chart's URI as its value - so give the chart a fragment identifier.
A chart shows values: the query's bindings themselves, as a table or a plot, the way a spreadsheet would.
It is the fit for aggregates and measurements - totals, counts, sums per shop or per month. A resource in
a chart is a bare cell, with no image, label or links of its own: to show resources themselves (things,
people, places), use ldh-AddView, whose modes render each one as itself.
A query that returns a row per resource, with the resource's URI among its variables, is a list of
resources and belongs in a view, however many values from related resources it joins in (a thing with
its shop, price and date of purchase; a message with its sender). A chart of it shows each resource as
its address. Chart only what is not one row per resource: totals, counts, sums by shop or by month.
This tool:
- Creates an ldh:ResultSetChart resource linked to an existing sp:Select query resource
- Configures chart type and variable mappings for visualization
- Posts the new chart resource to the target document
- Supports optional title, description, and fragment identifier
Possible chart types include:
- https://w3id.org/atomgraph/client#Table: Table visualization of results
- https://w3id.org/atomgraph/client#BarChart: Bar chart visualization
- https://w3id.org/atomgraph/client#LineChart: Line chart visualization
- https://w3id.org/atomgraph/client#ScatterChart: Scatter chart visualization
- https://w3id.org/atomgraph/client#Timeline: Timeline visualization
Note: The query parameter must be a URI of an existing sp:Select resource, not a SPARQL query string.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": {
"url": "<url>",
"query": "<query>",
"title": "<title>",
"chart_type": "<chart_type>",
"category_var_name": "<category_var_name>",
"series_var_name": "<series_var_name>"
},
"name": "ldh-AddResultSetChart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URI of the document to write the chart to. | |
| query | Yes | URI of an existing sp:Select query resource to visualize (not a SPARQL query string). | |
| title | Yes | Title of the chart. | |
| fragment | No | Optional fragment identifier for the chart URI (e.g., 'my-chart' creates #my-chart). | |
| chart_type | Yes | URI of the chart type (e.g., https://w3id.org/atomgraph/client#BarChart). | |
| description | No | Optional description of the chart. | |
| series_var_name | Yes | Name of the SPARQL variable used as series/value (without leading '?'), or an array of names for several series. | |
| category_var_name | Yes | Name of the SPARQL variable used as category (without leading '?'). |