The shiny RDF robot of power

RDFAuthor Tutorial 2: Queries

This tutorial explains how to query RDF data using RDFAuthor. You should read the first tutorial to familiarise yourself with basic model creation.

Here we are going to construct (and perform) a simple query to find the names and mailboxes of people in an rdfweb database. Hopefully you'll get the idea...

  1. Open RDFAuthor

    Ok, hopefully you know how to do this, otherwise we're in trouble. Notice that the toolbar has two additions from the previous version, both featuring question marks.

    The question mark with a blob (grouped with other editing mode tools) allows one to select unknown nodes. (Note: In future versions you will be able to select arcs as well)

    The other question mark icon (at the extreme right of the toolbar) opens the query panel; we'll see this below.

  2. Creating the Model

    My example query is going to find the names (foaf:name) and email addresses (foaf:mbox) for each person (foaf:Person) in a database. I'll begin by creating the basic model.

  3. Marking Objects as 'Unknown'

    Now we mark the objects that we want information on. These are the nodes at the end of the 'name' and 'mbox' arcs. We won't bother with the 'Person' node since this will just return generated ids - 'Person' nodes are used in foaf to hang properties off; their ids aren't significant.

    To mark the two nodes just select the 'add query items' mode and click on the nodes. They'll gain yellow rectangles to indicate that they are now query items. Incidently, it doesn't matter if query items already have ids - this is ignored by the query.

  4. Making a Query

    Now we are ready to perform the query. Open the query panel (rightmost icon in the toolbar). This opens up a 'drawer' connected to the window.

    The query source selected is actually the one we want, so don't change it.

    Note: The URLs included in fact describe a source - they don't contain the data which is returned (in general). This is a experimental so don't worry about it too much.

    Ok, let's do the query (click on the big 'do query' button). The panel indicates that the query is being performed.

    Note: If you try to perform a new query when the previous one hasn't finished the application will warn you that this will stop the old one.

    This may take a while, depending on the data queried and the query itself. Once the query has finished you'll hear a 'ping'.

  5. Dealing with Results

    Now we have some results (hopefully - if not it will tell you, and the result table won't change).

    Selecting a result row will insert the data into the model.

    Easy, huh?


Damian Steer
Last modified: Thu Nov 08 21:25:10 GMT 2001