Tag Archives: rdfa

“A better sense of place” – using geo-tools in consultations for searching and sharing (developer playtime)

I’ve recently spent some time playing with the idea of associating Citizen Space consultations with a geographic location.

We already do this to some extent. Consultations can be associated with one or more local wards or areas, so that visitors to Citizen Space can enter their postcode and see a list of consultations related to the area they live in. This is great for helping people find out what’s going on near them, but I’ve been itching to take this geographic information further. In particular:

1) It would be nice to show this information visually, for example on a map. This is particularly useful if a policy relates to a specific object (eg a building, road junction or monument), or an area that doesn’t correspond to pre-defined ward boundaries (eg a bus route, catchment area or park)

2) We love Open Data. If we’re storing data about a consultation, it’s always nice to make it available in a standard format so that other websites and applications can make use of it. We already do this using RDFa for many of our consultation details (see Tom’s blog post for a good run-down of RDFa and the Semantic Web), but currently we’re not sharing any geographic information with the rest of the world.

So how could this work? A sneak peak of Citizen Space pre-release features:

I’ve added some extra fields so that you can enter longitude and latitude coordinates when setting up a consultation. Alternatively, if you want to specify a shape (such as the footprint of a building), a line (such as a bus route), or an outline (such as the boundaries of a catchment area), you can upload a KML file to your consultation. If you have a GIS team or supplier, they should be able to provide this data in the right format.

Screenshot showing fields for adding longitude, latitude and uploading a KML file

When visitors view the consultation record, they’ll see an interactive map marked with the information you specified:

Map showing a single point

Map showing a single point

Map showing an outline

Map showing the outline of an area

While it’s instructive to show a map of the consultation area to Citizen Space visitors, this location data becomes even more interesting if we let third-party users and developers get their hands on it. In my prototype code, I’ve included three ways of sharing the data:

Method 1: KML
If you look at those screenshots you’ll see that there’s a link to a KML feed underneath the map. If you uploaded your own KML file, it will link straight to that file. If you entered coordinates, it will generate a new KML file just containing the point you specified.

KML is a very simple way to share mapping data with other online applications. It can be done using sites such Google Maps and Microsoft Virtual Earth without any programming knowledge. Lets say you’re consulting about a proposed cycle path, and have uploaded a KML file plotting the complete route of the path. A local parents’ group might use the KML data to overlay your route over their existing map of schools, parks and youth centres, to show how child safety could be improved by the construction of the path.

Method 2: GeoRSS
Citizen Space currently provides RSS feeds that let users subscribe to all the latest consultations, or consultations that meet certain search criteria. These feeds are also used by third-party sites to embed up-to-date consultation information, or to aggregate consultations from multiple sources into a single list.

If we have geographic coordinates associated with a consultation, it’s very easy to publish this information as part of the RSS feed, using the emerging GeoRSS standard. Apps that understand and are interested in the location data can use it in much the same way as the KML data above. Apps and users who are not interested in location data won’t see any difference to their feeds.

Method 3: RDFa
We’ve already mentioned how useful RDFa is for sharing consultation information between different websites and applications. Well, it turns out the RDFa specification includes the ability to link your document to a place, using the “based_near” tag. If you’ve entered latitude and longitude information when setting up your consultation, this extra bit of RDFa will be published along with the rest of the consultation record. Sadly I haven’t found many examples of applications that currently use the based_near feature of RDFa, but here are a couple of ideas I’ve been thinking about:

  • A visual version of the Citizen Space aggregator, that can display consultations from many different sources on the same map.
  • A mobile app that alerts you when you’re near an object or place that’s being consulted on.

This new code isn’t in Citizen Space at the time of publishing this post, but will likely be included in a future release.

If anyone else has ideas for making use of location-based consultation data, please drop me a line. The more good ideas we get, the more likely it is that this feature will make it into a future Citizen Space release.

I’d also be keen to hear of formats we could use to share the data other than KML, GeoRSS or RDFa. Has anyone used GeoJSON for example?

Opening up the Citizen Space consultation Aggregator

Earlier this year we launched our consultation Aggregator, and put a demonstration site online. This combines all our clients’ consultations running on Delib’s Citizen Space software into a single, searchable hub. We were very pleased with this demo, and its purpose was twofold:

  1. To showcase the capabilities of the Aggregator.
  2. To display a complete list of our Citizen Space clients in one place.

The astute reader will probably notice that our Aggregator demo, as currently deployed, is of much more benefit to Delib than it is to the wider community! As one of the developers behind the Aggregator, this makes me a bit sad, as I know that it can do a lot more than this, both technically and socially.

The Aggregator is not limited to aggregating Citizen Space consultations. It will just as happily include consultations published by third-party consultation systems. The only requirement is that they publish their list of consultations as an RSS feed, and that each consultation uses RDFa to specify its start and end dates. Since RDFa markup (including start and end dates) has been a requirement of UK central government consultations since January 2010, there is no reason why any consultations should be published without it these days.

A list of consultations that all happen to run on Citizen Space is, in the grand scheme of things, rather an arbitrary division! Helpful for Delib sales maybe, but I’m not a sales person and I’d like to do something bigger!

As far as the public is concerned, it would make a lot more sense to have a searchable database of ALL consultation activity in their country or local area, regardless of the software used to publish the consultations.

How can we fix it?
We would like to start building an aggregated database of all UK public consultations that support the RSS and RDFa web standards. In theory, this should be ALL consultations, but in practice we know that not all software supports these standards yet.

Its purpose would be threefold:

  1. To showcase the capabilities of the Aggregator (sorry but we’re quite proud of it!)
  2. To showcase the awesome power of web standards and linked data in helping different (even competing!) software systems talk to each other.
  3. To provide a useful, up-to date listing of public consultation activity in the UK.

If you would like to nominate a council or public sector organisation to join our gang, please get in touch and send us a link to the consultation RSS feed (this is the feed linking to the actual consultation records, not a news feed, blog feed or anything else), and we’ll start building our fledgling consultation cooperative!

What is RDF? What is the Semantic Web? Should I be using them?

There’s a lot of talk on the internet these days about the Semantic Web, Linked Data, RDF and even RDFa. In particular, the term Semantic Web has been bandied about left right and centre for years now.

At Delib we’ve been including RDFa in our Citizen Space product for the best part of two years, to meet the Government’s criteria for consultation.

But what IS the Semantic Web?
Wikipedia defines the Semantic Web thusly:

“The Semantic Web is an evolving development of the World Wide Web in which the meaning (semantics) of information and services on the web is defined, making it possible for the web to ‘understand’ and satisfy the requests of people and machines to use the web content.”

Cool. But that still doesn’t mean much to me.
Me either. W3C describes the Semantic Web better, but I tend to find concepts easier to understand through examples rather than words.

Say a local authority is running a consultation about Libraries. If you were to visit that page, you could tell quite a few things about the consultation very quickly as you read it:

Barnet Library Consultation Screen Shot
Now suppose you want to find all consultations that are currently being run about Libraries in the UK. First, you’ll need to find the consultation website for every local authority and government body. Then you’ll need to search each one for consultations about Libraries.

Right. I hear you think “Computer! A computer could/should do this” …Now imagine you’re a computer. As a human you can understand the layout, the terminology and the meaning of the words you are seeing. Unfortunately a computer cannot. This is where the Semantic Web and in this specific case, RDFa comes in…

This is how a computer sees the page you are looking at:

What’s that then?
The sections of code highlighted in yellow indicate to a computer what pieces of text correspond to what. From this, any Application that can parse RDFa can see that this page contains a Consultation, that its title is “Library Strategy Consultation” and a whole lot more besides.

All good so far, what now?
If every site that holds consultations included this RDFa data, then somebody could create a single Web App that would pull together the information from these separate sources, forming a Linked Data Set, through which a user could search all consultations in one place.

Oh so the computer could do the searching for me then?
Correct! Here at Delib we have created an app that does just that: the Citizen Space Aggregator. Here’s what you get when you search for “Library” on it:

Unfortunately we don’t have every council and government body on here yet, but if you run consultations with RDFa on them, please get in touch and we’ll add you!

Ok but you haven’t described RDF yet.
RDF is a Resource Description Framework. It is the standard set of specifications and formats through which web sites and web services can share Data with each other. RDFa (Resource Description Framework – in – attributes) is just a single implementation of this Framework, where the Data is made available to other sites and services through attributes in a HTML page.

Summarise for me!
The Aggregator takes a selection of Consultation sources, made available on the Semantic Web through RDFa, and turns them into Linked Data ready for the public to browse and search in one place!