Vazaar 0.4 (aka Sacabambaspis) released

Hi everybody,

a new version of vazaar have been released for testing purposes. Although it’s stable you can consider it as proof of concept.

This version is a redesign of the previous one. While the old one was developed in C, the new one is being developed with Python. Also, I’ve been studying a new approach. Instead of work with tags and tagging operations, the new version is powered by the semantic web vision, ideas and tools.

I’d like to highlight RDFLib, a RDF library containing an RDF triple store and RDF/XML parser/serializer which deals with the logic of the application.

Go to the Download page to get it. Check the screenshot page as well.

Development is carried out at Lauchpad.

Now that I understand how a semantic model works I have more and better ideas to implement.

Next version will be released, hopefully, before this year ends.

Enjoy it.



~~ · ~~


Dynamic SPARQL queries and Datatypes

After some headaches I’ve found how to write dynamic SPARQL queries by passing parameters. For example, to query graph about resources collected last hour this code could be a first approach:

#!/usr/bin/env python
# Dynamic query (example code)

from datetime import datetime
import rdflib
from namespaces import XSD

def last_day():
    """ get date """
    now = datetime.now()
    date = now – timedelta(hours=24)

    return date

def get_date_filtered_query():
    """ build query """
    period = last_day()
    mydate = Literal(period, datatype=URIRef(XSD))

    query = """
        PREFIX rdf: <http ://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX nie: <http ://www.semanticdesktop.org/ontologies/nie/>
        PREFIX nfo: <http ://www.semanticdesktop.org/ontologies/nfo/>
        PREFIX nao: <http ://www.semanticdesktop.org/ontologies/nao/>
        PREFIX pimo: <http ://www.semanticdesktop.org/ontologies/pimo/>
        PREFIX xsd: </http><http ://www.w3.org/2001/XMLSchema#>
        SELECT ?id
        WHERE
        {
            ?id rdf:type ?type .
            ?id nao:created ?date .
            FILTER (?type != pimo:Collection) .
            FILTER (xsd:dateTime(?date) >= xsd:dateTime("%s")) .
        }
        ORDER BY DESC(?date)
        """ % mydate

    return query

# query graph
query = get_date_filtered_query()
result = graph.query(query)

for id in result.selected:
    print id</http>

Read the rest of this entry »



~~ · ~~


Querying remote ontologies from integrated SPARQL editor

Querying remote ontologies Checking others parts of the Vazaar GUI, I’ve realized that I can query remote ontologies and vocabularies with a simple SPARQL sentence. In the screenshot you can see how I query for the comments of all NAO entities.

Just for the record, it would be nice to save user queries and integrate them within Vazaar. And, of course, to export result data to a file (eg.: in a CSV file) ready to import to a any spreadsheet program like OpenOffice Calc.



~~ · ~~


GUI improvements

After a long weekend coding and trying new design ideas finally I think I got a nice GUI. At least for the StartHere module:

Screenshot for last development version (commit 316)

There are still too much glitches in the GUI but I’m trying to fix them as I go. But for now, I feel satisfied. Queries against the model are working as expected.

After clicking in any stats button you get a nice visual for your resources. In next commits, you will be able of choosing one the two kinds of views: ListViews and IconViews. By default, the IconView is preferred.

More ideas are coming like content filtering, properties tagcloud, timeline widget, etc…

At this moment, you can only add new resources by copy&paste operations. An improved dialog for this operation is in the way. Resources can be selected for be deleted. If the selected resource is a collection, all resources which belong to this collection will be deleted. There is no actions popup menu yet but it’s planned.

I’m thinking if a Trash resource is worth. NEPOMUK brings especial classes for this cuestion. I need check twice these. Anyway, it wouldn’t be very difficult.

Read the rest of this entry »



~~ · ~~


About Vazaar 0.4 Beta development

After months of improving my skills with Python and PyGTK and reading documents about semantic web and its integration with Desktops Interfaces (like GNOME or KDE) a lot of improvements have been made in Vazaar. This is an overview of the current state of development.

The presentation layer, the GUI, is more difficult to develop than I’ve ever thought. Althought the concept is simple: given any kind of data, transform them into triples (subject, predicate, object) and operate with them, the time consumed to create an infrastructure around the program has been very high.

As resources can be added at any time, I had to develop a system of queues (qIn and qOut). Furthermore, I had to deal with very high responsiveness times. It’s very annoying when the GUI gets frozen because the kernel is working in other stuff. So I had to implement threads (one thread for the kernel and another thread for the GUI). Along the way, I’ve found a lot of code (see source code in Launchpad) which has helped me to carry on.

In some way, I would like to forget these kind of glitches when I’m developing a Desktop application (not a kernel module). Maybe I’ve learnt something about gtk threads but nothing interesting for this project. Never mind…

I’m still reading some documents and asking about how to create a data model around NEPOMUK. By using the semantic web paradigm things change a lot. There are no database records or tables. Instead there are thousands (or hundreds of thousands) of triples.

But it looks easiest than I thought, at the moment.

Everything is a resource (even collections). A resource has a unique identifier (UUID objects according to RFC 4122). Every resource belong to a unique Nepomuk class. They are a small subset of classes with their properties. Examples of Nepomuk classes are:

  • nfo:Feed
  • nfo:Website
  • nfo:RemoteDataObject
  • nfo:Image
  • nfo:Audio
  • nfo:Clipboard (this class doesn’t belong to NFO but I need it until I find a smart solution for copypaste operations).

Read the rest of this entry »



~~ · ~~