My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BasicHTMLViewer  
Description of the an HTML viewer which uses XSLT to create a navigable view over an API instance
Updated Oct 8, 2010 by jeni.ten...@gmail.com

Introduction

A linked data API offers, out of the box, a number of formats that are useful to developers. But a human-friendly interface is also useful, both to provide something that people might actually use in and of itself and to provide a way in for developers to construct the URIs that they need for accessing the data.

Configuration

One of the standard formatters provided by the linked data API is an XSLT formatter. This enables you to write XSLT stylesheets that transform the simple XML format that's usually generated by the API into any other format. We've provided a starting point for these stylesheets at http://code.google.com/p/linked-data-api/source/browse/trunk/examples/xslt/result.xsl.

To use this directly as the default within a particular API configuration, the API configuration should include:

:API api:defaultFormatter :HtmlFormatter .

:HtmlFormatter
  a api:XsltFormatter ;
  api:name "html" ;
  api:mimeType "text/html" , "application/xhtml+xml" ;
  api:stylesheet "xslt/result.xsl" .

It is also possible to import this stylesheet into one written specifically for a particular API, and override it to produce custom views.

Page Layout

The following screenshot shows an example basic search result page, in this case over the linked data API over the schools data from data.gov.uk.

The main panel gives the results of the search, while navigational aids are given on the right.

The bottom of the page is shown in the following screenshot:

This includes navigational links through the pages for the current search, links to the different formats of the information, and a search form for carrying out more detailed searches.

Filtering

The results of a search can be filtered in two ways. The first is obviously through the form at the bottom of the page. These support filtering using arbitrary strings. For numbers and dates, there is the facility to search based on minimum and maximum values.

It is also possible to search using the icons to the side of any property. For example, looking at:

Clicking on the search icon by the religious character property will add a filter to only look at schools with the religious character of 'Church of England'. In the resulting list, the school looks like:

The icon changes; clicking on it will remove the filter from the search.

The filters that apply to the current view are summarised on the right hand side of the page, as shown here:

Clicking on the icon to the right of the filter removes it.

Maps

When a view includes easting and northing information, the page will automatically include a map for each item. For example, see the following screenshot:

It will also include a summary map of all the items listed within the page (which is not necessarily all the items that are matched by the search). The following screenshot shows an example:

Sorting

Items can be sorted in a flexible way using the sort pane, shown in the following screenshot:

The properties that are currently being sorted by are given at the top of the pane, in order, with the icons indicating whether the search is in ascending or descending order. Other sorts can be added by clicking on the arrow buttons to the side of each property. Individual sorts can be removed by clicking on the cross next to their name, or all sorting removed by clicking on the cross at the top right of the box.


Sign in to add a comment
Powered by Google Project Hosting