
he Semantic Web is a grand vision for increasing the power of the web through better expression and management of
context. Semantic Web developers are building a framework to open up and connect organized information, which
takes
advantage of many popular developments on the web, such as the success of
Wikipedia,
Creative Commons-licensed publishing on sites like
Flickr, and various blogs. A portion of this framework is the
Linking Open Data (LOD) community initiative (seeded by the W3C Semantic Web Education and Outreach group).
A goal of LOD is to weave together separate collections of open data using deep linking and RDF (Resource Description Framework) representations.
The hallmark of LOD is to make it easy for web developers to create and process compatible data. Utilizing LOD calls for a broad war chest of tools and techniques that cover the diverse expertise of Web developers. One popular tool for processing data on the web is XSLT (Extensible Stylesheet Language Transformations), building on the growth of XML as a data format on the web. XSLT is not a general-purpose programming language—so it is limited in its uses—including LOD processing. However, XSLT is very useful to handle auxiliary roles in such processing that involves transforming XML.
This article explores specialized areas for the use of XSLT 1.0 in LOD processing. The focus is on XSLT 1.0 (XSLT 2.0 does offer more for LOD processing, but it is far more complex and much less used by the community). XSLT 1.0 has more processors than 2.0 and the EXSLT set of community extensions, which has strong support in Firefox 3.0, provides facilities that bring it close to the power of XSLT 2.0.
XSLT in the Browser
Mainstream web browsers, such as Internet Explorer and Firefox, are the most obvious places for deploying LOD
processing using XSLT. However, due to security reasons, using LOD processing increases your limitations, which are
already hampered by using XSLT. Listing 1 is an example of
XSLT that tries to process a page from DBPedia, which is an LOD wrapper for Wikipedia and other data sources.
Save this code as documenttest.xslt and try loading it into a browser; you will see a security
error. For example, using the FireFox 3.0 beta the result is a blank page. And if you check the Error Console (in the
Tools menu) you will see an error such as:
Security Error: Content at file:///temp/lod-xslt/documenttest.xslt may not load data from
http://dbpedia.org/page/XSL_Transformations.
This error occurs because you cannot use the document() function to access a resource at a
different URI scheme or host from the base URI of the XSLT. This same restriction applies to xsl:import and
xsl:include, and you cannot get around it using ordinary Javascript. To get the full power of
XSLT in Firefox—and in any browser that takes security seriously enough—you need to deploy the XSLT
through an extension (this article does not focus on this deployment issue). Luckily there are a couple of handy
add-ons you can use to run XSLT with many fewer restrictions.
For the purpose of this article, the author worked with the XSLT engine in Firefox 3.0, which is an excellent place for tools to process LOD because Firefox is known for power and conformance. It is also a pervasive toolkit and you can expect anything developed for Firefox to be ready for a wide variety of users. Firefox 3.0 is still in beta, and should be complete by late 2008. It offers many important improvements for XSLT processing, among other things.