Category Archives: SemWeb

http://www.w3.org/2001/sw/
skos:broader http://danbri.org/words/?author=2/skos.rdf#c9 Web Technology

SPARQL Conversions XSLT

To help develop and test my new Sparqlette service, I hacked a couple of XSLTs that might come in handy here and there…

SPARQL to RSS (lastest version: 0.3)
As its name implies, this XSLT turns a SPARQL Query Results XML Format document (Variable Binding Results) into an RSS channel, making it possible to subscribe to the results of an (almost) standard SPARQL query without using CONSTRUCT. As can be expected, not all query results work, as the RSS specification mandates certain elements. Thus, the value of the channel’s rss:link property is taken from an XSLT parameter named _uri, the variable bindings to use for rss:link and rss:title in each item is determined via some crude heuristics, and only items that have a URI for the chosen rss:link binding are created.

Variable selection heuristics for rss:link / rss:title:

  1. If there’s a variable named rsslink or rsstitle respectively, the bindings for that variable is used for all items.
  2. Otherwise, the first variable that has a binding to a URI is used for rss:link, and the first variable that has a binding to a literal is used for rss:title

For rss:link I wanted to add another option between the two, that would locate a variable that only has bindings to URIs, but I couldn’t get it working with a single XPath expression, so I gave up.
Example RSS (view Sparqlette input parameters).

SPARQL to SPARQL (latest version: 0.1)
This XSLT simply converts documents in the syntax of any of the currently two SPARQL Query Results XML Format draft specifications, W3C Working Draft 21 December 2004 and $Revision: 1.29 $ of $Date: 2005/05/03 09:58:04 $, into the syntax of the latest version, currently the latter. I promise to do my best to stay up to date…

Note: This entry — as all entries in the Release category — will serve as a changelog (you can subscribe to its RSS feed if you want to make sure you don’t miss out on any updates).

The Gargonza Experiment

Only a few weeks after SPARQLing Days I’m now finally ready to report some progress…

2005-05-07: Updated to version 0.3, see changelog below.

SPARQL

As is now common knowledge, one outcome of the great gathering in Tuscany is The Gargonza Experiment, which attempts to create a set of showcases for the Resource Description Framework (RDF) and the SPARQL Query Language for RDF. Already the “community theatre” has gained a bit of steam and an increasing number of followers, and I’m sure there’ll be more to come as people get the stuff they started working on completed. To keep up-to-date, I suggest y’all subscribe to Planet RDF or at least to the Gargonza Experiment category that Danny Ayers — my gracious host for a few days following the main event — is maintaining.

image-101: Gargonza

To assist in that goal, I’ve made a subset of my photo description database available for SPARQL queries via Sparqlette — A SPARQL demo query service. The subset currently contains only descriptions of the photos taken during SPARQLing Days, and not all photos have been through my annotation process, there are still some foaf:depicts triples to be made…

Continue reading The Gargonza Experiment

Sparqling Days

Just like Leigh and Danny — among several other smart people — I’ve been lucky enough to get invited to Sparqling Days, 2 days of likely intense hacking on querying RDF with SPARQL, orchestrated by @semantics.

Unfortunately, several people, among them Leigh whom I have still to meet over beer, can’t make it, but there’s at least one bonus, I finally get to meet Danny Ayers, the man of steel and father of Sparql-the-cat.

I’m sure this will turn out to be quite a nice trip, from what I hear Italy is a very nice country, and the team hacking session will likely help advance the state of RDF query and provide implementations of nice demo applications.

42

According to The Hitchhiker’s Guide to the Galaxy (which is still on my to-read list), “42” is The Answer to Life, the Universe, and Everything. However, I think there may be an exception when it comes to the question about httpRange-14, a long debated issue in web circles (see also http-range-14 no comment).

Earlier today, the Semantic Web Best Practices and Deployment Working Group sent word to the TAG, that it has resolved that an http URI without a hash MAY be used to identify an RDF property. Thus, we may have a partial answer to httpRange-14, one that isn’t “42”, but one that doesn’t answer other questions (not including “Life, the Universe, and Everything”).

I think the conclusion by the SWBPD WG is sound — while in an ideal world it could be useful to know just by looking at a URI whether it identified a document or something else, it isn’t strictly necessary. Sure, it might help a human out now and then, but in the long run, the machines will be doing the analyzing part, and according to the TAG’s finding on what URIs identify, URIs are opaque. It all comes down to semantics assigned by humans.

At the same time, it is often practical and useful to use fragment identifiers for RDF vocabulary terms, so wording that uses “MAY” is perfect in my book — even if it doesn’t answer or solve everything…

Redland Smushing

Some time — actually more than a year — ago i wrote a smusher for Redland that works by rewriting nodes based on identity inference.

To begin with, it handled only IFP’s, owl:InverseFunctionalProperty, but the other day I needed it to be able to handle FP’s, owl:FunctionalProperty, as well.

A classic example of an IFP is foaf:homepage — only one resource can have some specific URI as its homepage, which is handy for identity reasoning across the Web. Just as useful is the somewhat recently added property foaf:primaryTopic, which is an FP — if a page is described in more than one place, each with a seemingly different primary topic, it can be inferred that the two “topics” are actually just one, handy when identifying movies, since almost all movies have a page describing it at the Internet Movie Data Base.

The smusher is written in C, isn’t heavily commented, has been used elsewhere without problems, and works by finding IFP’s and FP’s in the model it is smushing or by being passed a specific property to smush on — a nasty way of testing is to pass it rdf:type

Building it should be somewhat straight forward, but the accompanying Makefile might help out here and there.

Note: This entry — as all entries in the Release category — will serve as a changelog (you can subscribe to its RSS feed if you want to make sure you don’t miss out on any updates).

The current version is 0.21 (released 2005-03-27).

Changes since 0.20:
  • Reworked rewriting process to avoid database deadlocks.