This posting is a continuation of the previous posting. We are discussing RDF, the “triples” language that is serving as a cornerstone of the Semantic Web effort.
In the previous two postings, we looked at RDF, which is an excellent example of solid software technology: It serves an important purpose. It is easy to use. And, even if you don’t write any RDF yourself, it is easy to understand what it does, and therefore, how it will impact your life.
RDF, in its simple, quiet way, allows us to interconnect any resources that exist on the Web, and at the same time, make use of standardized terminologies. This provides a highly flexible and semantically expressive way of building the new Semantic Web.
SPARQL: what is it?
RDF is great stuff, but it’s only half the story. If knowledge on the emerging Semantic Web is going to be glued together into RDF triples, how will that information be searched? It doesn’t do any good to have a book that will solve all your problems if you can’t read it or search through it.
SPARQL stands for Protocol And RDF Query Language, with an S tossed into the beginning so we can say it as “sparkle”. Interestingly, when something is called a “query” language, we start thinking in terms of SQL, that largely declarative relational language that is the core of almost all successful relational database management systems. Indeed, as we will see in a later blog posting about XQuery, the language for searching XML-based data, SQL, has served as the model for SPARQL.
A blast from the past.
There’s something about triples that we should look at before moving on. It has to do with the fact that triples are also known as “assertions”, and that assertions can be chained together to make “inferences”. Here are two triples/assertions, specified very informally: THE BALL is ORANGE. ORANGE is an UGLY COLOR. The inference we can make is THE BALL is an UGLY COLOR.
Or, getting back to the Web and RDF, below are two triples specified in RDF; the first one comes from the previous posting of this blog.
This first one can be interpreted as the webpage at awesite.org/index.html was created by Buzz.
Here is the second one RDF triple:
This one can be interpreted as Buzz is the guy described at yetanotherurl.org/professor.
We can chain them together to deduce that the guy who built the page at awebsite.org/index.html is Buzz the professor.
This is an inference.
The point is that if you take a bunch of RDF statements and chain them together, you get what looks a lot like an object-oriented graph of related objects, somewhat like you see in Java. In a sense, RDF takes an object representation and breaks in down into triples. There’s really nothing new in RDF, other than the fact that any part of an RDF assertion (triple) can be something found on the Web.
Back to SPARQL.
So, what is SPARQL? It is a language that can be used to traverse graphs that consist of RDF triples that are chained together into an object network.
We will look at some SPARQL code in the next posting.