SPARQLBot Manual

This page explains how to use SPARQLBot and also how you can create your own, custom commands.

Access Options

IRC

In order to use SPARQLBot from IRC, log into freenode and join the #sparqlbot channel. You can now address the bot by prefixing your commands with "sparqlbot", e.g. "sparqlbot, help", or "sparqlbot, where is Berlin". You can also privately talk with SPARQLBot by starting a conversation using the /msg command, e.g. "/msg sparqlbot help". In private sessions, you don't have to add the "sparqlbot" prefix.

Web/HTML

To use SPARQLBot via a simple HTML form, just go to the "Console" and enter a command in the input field. Then hit "Ask SPARQLBot" and the response will be shown inline below the form.

HTTP API

The site provides a simple HTTP API which you can use to call SPARQLBot from remote scripts. The API expects a URL-encoded command as input parameter.

Command Syntax

SPARQLBot uses a simple placeholder syntax to extract variable names from a received command. Placeholders are identified with ${var_name}. If "Where is Berlin" is for example passed to the "Where is ${region}" handler, SPARQLBot will create a variable "region" and set its value to "Berlin". In other words, in order to make SPARQLBot execute a certain command, your input has to match the command pattern.

"What (is|are) ${something}" will match "What is RDF", and also "What are microformats".

Command authors have to make sure that command patterns are distinct enough to not overlap with other commands. The first matching command will be picked by the bot.

Finding a command

The available commands can be filtered by tag, for example to find basic operations for loading, refreshing, or deleting data sources. Or commands that use DBPedia.

Creating commands

You can create your own SPARQLBot commands or improve existing commands if they are not write-protected. To do so, log in with your OpenID and return to the command editor. You can now specify an input pattern in the "Command" field, a SPARQL Script and a result template in the other two fields. The screenshot below shows an example script that retrieves publications from the DBLP SPARQL endpoint.

SPARQLBot command editor Once your command is ready for testing, save it and switch to the "Activate" tab. Here you can add a small description, tags, and whether other users can edit your command or not. Hit "Save changes" and your command will be available to others.

SPARQLBot command editor Now you can use any of the available access methods to let SPARQLBot run your command.

Related Links


back to top