RDF Query Languages

I am thinking about writing a RSS aggregator. Not that it is original or has never been done, but just as an exercise to play with a RDF database and so far I am still not convinced of the way to go!

As a query language, I really like Versa, but RDQL seems like having much more traction and I have given it a closer look.

What I don’t like about it is that it seems to bring the RDF data model to its end: after you’ve used it, you don’t see triples any longer but tables of resources.

To take an example from the RDQL tutorial:

SELECT ?resource, ?givenName
WHERE (?resource, <http://www.w3.org/2001/vcard-rdf/3.0#N>, ?z) ,
      (?z, <http://www.w3.org/2001/vcard-rdf/3.0#Given>, ?givenName)

Returns:

resource                         | givenName
============================================
<http://somewhere/JohnSmith/>    | "John"
<http://somewhere/RebeccaSmith/> | "Rebecca"
<http://somewhere/SarahJones/>   | "Sarah"
<http://somewhere/MattJones/>    | "Matthew"

Where are the triples gone?

What does the strenght of other query languages in other domains such as SQL or XPath is that their data models are the same in input as in output: the result of a SQL select statement is basically like a table and I can do sub queries on this result or insert it into a table, the result of an XPath query is (or can be) a nodeset which I can output as XML and on which I can perform a new XPath query.

By contrast, the result of a RDQL query seems to be a bunch of resoures that I can’t really use as triples.

Why is that a problem?

Let’s say I want to create a RSS channel with RSS items meeting a condition. With XPath I can just write “//rss:item[my condition]” and I have a nodeset with the complete definition of these items. With RDQL, I can write a query that will give me these items as resources but I haven’t seen how I could get these items with their descriptions as triples ready to be serialized back as RSS.

What I’d really like, is a query language which would let me do with RDF graphs what I am doing in XPath!

Share and Enjoy:
  • Identi.ca
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Add to favorites

websemantique.org

Vendredi dernier, nous avons officiellement lançé la communauté websemantique.org

C’est un engagement que nous (Charles Népote, Karl Dubost et moi-même) avions pris lors de la table ronde “Web sémantique et partage des connaissances des rencontres d’Autrans 2004.

So far so good, l’accueil a été pour le moment aussi favorable que celui rencontré à Autrans. Nous avons reçu plusieurs messages d’encouragement, 25 personnes se sont abonnées à notre liste de discussion pendant le week end et plusieurs personnes ont pointé le bout du nez sur notre canal IRC.

Sans être phénoménal, le trafic du site est honorable pour un week end et, facteur encourageant, les visiteurs semblent répartir équitablement entre ceux qui viennent de XMLfr, ceux qui viennent du carnet web de Karl et ceux qui viennent des wikis de Charles.

Share and Enjoy:
  • Identi.ca
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Add to favorites

RDDL 2.0

Jonathan Borden has announced a version 2.0 of RDDL.

I am (or have been?) a great believer and promoter of RDDL, but I am disapointed by this version. I think that RDDL 1.0 was better than RDDL 2.0 and have sent a mail to explain why.

If you look at this example (from examplotron):

<rddl:resource
  id="xsd-schema"
  xlink:arcrole="http://www.rddl.org/purposes#schema-validation"
  xlink:role="http://www.w3.org/2001/XMLSchema"
  xlink:title="W3C XMLSchema for examplotron"
  xlink:href="examplotron.xsd"
  xlink:type="simple"xlink:show="none"
  xlink:embed="none">
<div class="resource">
<h4>W3C XML Schema for examplotron</h4>
<p>This W3C XML Schema (Proposed Recommendation, 16 March 2001)
<a href="examplotron.xsd">schema</a> describes the examplotron
vocabulary and can be imported in W3C XML Schema to validate examplotron schemas.</p>
</div>
</rddl:resource>

A link is expressed between the full description of the schema (including the whole <div/> element) and the schema.

With the new proposal you would end up with something such as:

<div class="resource">
<h4>W3C XML Schema for examplotron</h4>
<p>This W3C XML Schema (Proposed Recommendation, 16 March 2001)
<a href="examplotron.xsd"
   rddl:nature="http://www.w3.org/2001/XMLSchema"
   rddl:purpose="http://www.rddl.org/purposes#schema-validation">schema</a>
describes the examplotron
vocabulary and can be imported in W3C XML Schema to validate examplotron schemas.</p>
</div>

And the link is now between the schema and the much less significant piece of text “schema”.

And there is no way to keep the expressive power of RDDL 1.0 because the content model of the XHTML <a/> element doesn’t allow it!

The argument beyond this modification is that the syntax is simpler. That might be, but I think that it’s just not working. Yet another example of a vocabulary that should be as simple as possible but not simpler!

The other thing I don’t like is that they have used the same namespace which means that all the existing RDDL document implicitely point to the description of a vocabulary which is very different from their content.

Share and Enjoy:
  • Identi.ca
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Add to favorites

Syncato

Why Syncato?

Because Syncato isn’t only a weblog system, but also a real XML publication system, or if you prefer, a XML database used as a weblog system. And because this XML database can be queried with XPath which lets us fully take advantage of its XML nature. And finally because all that has been done the right way, following the principles of the web (REST architecture, use of HTTP GET, PUT and DELETE, RSS syndication, …) and using Python which is my language of choice.

Why this weblog?

To have a good reason to use Syncato :-) … And also because I wanted to have a channel where I could publish stories that are not appropriate for my usual channels (XMLfr, XML.com, xmlhack).

Share and Enjoy:
  • Identi.ca
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Add to favorites

Syncato

Pourquoi Syncato?

Parce que Syncato n’est pas seulement un système de weblog, mais aussi un véritable système de publication XML, une véritable base de données XML habillée en système de weblog. Parce que cette base de données peut être interrogée au moyen de requètes XPath ce qui permet d’en tirer pleinement partie. Parce que tout cela est fait en respectant les standards et principes du Web : architecture REST, utilisation des requêtes HTTP GET, PUT et DELETE, syndication RSS, … Et parce que Syncato est écrit en Python, mon langage de prédilection.

Pourquoi ce carnet web?

Pour pouvoir utiliser Syncato :-) … Et aussi parce que cela faisait longtemps que j’avais envie de céder à cette mode et me ménager un canal pour publier des articles moins structurés que ceux que je publie sur mes canaux de prédilection (XMLfr, XML.com, xmlhack.com, …) ou ne correspondant pas à leurs thèmes.

Share and Enjoy:
  • Identi.ca
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Add to favorites