[ First Steps | Handbook | The Nabu Ontology ]

Search the Archive

Once Nabu logs your conversations, you probably want to search them at some point (otherwise archiving would not make that much sense). For querying the archive, Nabu uses the SPARQL query language. SPARQL is a language for querying RDF stores, similar to SQL. Being powerful and versatile, it allows arbitrary complex queries (Unfortunately it's also quite complex for everyday use, so a GUI for the most common queries would be desirable).

Example: You want to search for all messages containing "Nabu". use the following command (it's splitted over multiple lines for readability, but must be sent in one message):

PREFIX nabu: <>
WHERE { ?msg nabu:body ?body . FILTER REGEX(?body, "Nabu", "i") }

('QUERY SPARQL' is the Nabu command used to send SPARQL queries. 'PREFIX nabu: ... REGEX(?body, "Nabu")' is the actual query in SPARQL format). The query returns all messages ?msg that have a body ?body matching the regular expression "Nabu". A bit too complex for a simple string search? Well, for this specific case, searching a string in message bodies, a shortcut exists:


executes the same query with much less typing. This is the only shortcut though; for anything more complex SPARQL is the way to go.

Nabu will return the messages matching the query as RDF/XML. For instance, Nabu might return one message, containing "Me thinks, Nabu rocks big time!":

210 <rdf:RDF
  <nabu:Message rdf:about=

   <nabu:body>Me thinks, Nabu rocks big time!</nabu:body>

   <nabu:previousMessageInRoom rdf:resource=
   <nabu:inRoom rdf:resource=
   <nabu:sender rdf:resource=
   <nabu:receivers rdf:resource=

Note: Nabu returns only RDF data that is accessible by you. By default, this includes all messages you have sent yourself or received from others. Normally you won't see messages exchanged between other users. If a user decides so, he can grant you access to a conversation log (for example, co-workers might decide to share the log of an online meeting with other team members). Read in the 'Log Sharing and Privacy Settings' section for more detailed information on privacy settings.

Another example:

Return a list of all messages sent by schwarz@… since the beginning of the year:

PREFIX nabu: <> SELECT ?msg ?date  WHERE { ?msg nabu:datetime ?date . ?msg nabu:sender <>. FILTER (xsd:dateTime(?date) >= xsd:dateTime("2005-01-01")) 

Read about the Nabu ontology to learn more about the data structures Nabu uses for logging.

[ First Steps | Handbook | The Nabu Ontology ]

Last modified 12 years ago Last modified on 08/04/05 10:11:51