Inkling: Downloads and Usecases

Downloads

BNF

javadoc

readme

Demos

Installation

How to make queries

Known Bugs

Squish-dev archives

Contact: Libby Miller <libby.miller@bristol.ac.uk>
Date: 2001-07-26
Latest Version (0.70):

Full version, right out of CVS (sorry no anonymous access available)
http://swordfish.rdfweb.org/rdfquery/rdfquery.tar.gz
http://swordfish.rdfweb.org/rdfquery/rdfquery.zip

How to create...:

Create a codepiction database

This demonstrator uses the Postgres backend database to store RDF files which describe images with people in them. It's based on an idea by danbri. It uses queries like this one:
find me all the images with the person identified by the email address libby.miller@bristol.ac.uk:

SELECT ?thumb, ?name, ?dd, ?mbox, ?uri WHERE 
   (foaf::depiction ?x ?uri) 
   (foaf::depiction ?z ?uri) 
   (foaf::mbox ?x mailto:libby.miller@bristol.ac.uk)  
   (foaf::mbox ?z ?mbox) 
   (foaf::name ?z ?name) 
   (foaf::thumbnail ?uri ?thumb) 
   (dc::description ?uri ?dd) 
 USING foaf for http://xmlns.com/foaf/0.1/ "+
 dc for http://purl.org/dc/elements/1.1/

Have a look at Photo metadata: the co-depiction experiment to read more about it.

Installation summary: install Postgres and Jakarta-Tomcat;
create a database called 'codepict' in Postgres using inklingsqlschema.psql.
Drop the codepiction war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
Download scutter.sh to the top level of Jakarta-Tomcat.
Download the list of RDF urls. Type 'sh scutter.sh' in the Jakarta-Tomcat top level directory to load the data into the database;
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/inkling/codepict/codepict.jsp to search for images.

Longer/DIY version:

    Install postgres

  1. install postgres http://www.postgresql.org.
    You could use a different SQL database instead, such as mySQL - but you'll need a driver in your classpath for it. One is included for postgres.
    Make sure you set the permissions so that you an access the database from the machine you will be querying it from.
  2. start the postmaster on localhost 5432.
  3. create a database called 'codepict' by typing
    './createdb codepict'
    in the postgres bin directory
  4. use inklingsqlschema.psql like this
    './psql codepict < inklingsqlschema.psql'
  5. test that a database has been created
    './psql codepict'
    '\d'
    This will display the tables in the database codepict. There should be one called triples and another called resources.
  6. Download Inkling

  7. download Inkling SquishQL software
  8. type 'tar -zxvf rdfquery.tar.gz'
  9. type 'cd inkling-0.7'
  10. type 'sh build.sh'
  11. Add data to the database

  12. You can use the list of urls from Codepiction. Download it into the rdf directory (call it scutterplan.rdf). Download scutter.sh to the top level of Jakarta-Tomcat, and then type './scutter.sh' (or 'sh scutter.sh'). It defaults to using http://xmlns.com/foaf/0.1/mbox as the identifier for individuals - you might like to use http://xmlns.com/foaf/0.1/homepage or http://xmlns.com/foaf/0.1/mbox_sha1sum for less spammable services. See http://xmlns.com/foaf/0.1/ for more information.

    This will add the data into your database, provided you have set up Postgres correctly and so that it is acessible from the machine you are querying it from, started the postmaster on localhost 5432, have created a database called codepict and have generated the correct tables using inklingsqlschema.psql.
  13. Download and test Jakarta-Tomcat (e.g. http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4/bin/)
  14. Copy the files in /lib in the Inkling distrbution in common/lib in the Jakarta-Tomcat distribution.
  15. Drop the codepiction war file in the webapps directory in Jakarta-Tomcat.
  16. start the Jakarta-Tomcat server: (type './bin/startup.sh')
  17. go to the url: http://localhost:8080/inkling/codepict/codepict.jsp to search for images. The url http://localhost:8080/inkling/rweb/imgmeta.jsp can help you generate files.

Create a small schemas database

Installation summary: install Postgres and Jakarta-Tomcat;
create a database called 'eor' in Postgres using inklingsqlschema.psql.
Drop the schemas war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
Download the list of RDF schema urls and call it 'scutterplan.rdf'.
Download scutter.sh to the top level of Jakarta-Tomcat.
type 'scutter.sh'
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/inkling/schemas/ to seach for schema classes and properties.

Create an RSS 1.0 searcher

The example used here is content from the RDF Interest Group irc channel blogger, the 'chump', which produces an RSS 1.0 channel every day.

Installation summary: install Postgres and Jakarta-Tomcat;
create a database called 'rdfig' in Postgres using inklingsqlschema.psql.
Drop the RDFIG war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
Download the list of RSS 1.0 files such as this one from the RDFIG chump and call it 'scutterplan.rdf'. Download scutter.sh to the top level of Jakarta-Tomcat, and then type 'sh scutter.sh' in the Jakarta-Tomcat top level directory to load the data into the database;
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/iinkling/rdfig/ to seach for RSS items.

Create a tiny in-memory demo

This tiny demo shows how you might make an in-memory query and format the results.

Installation summary: to create something similar, download and install Jakarta-Tomcat;
Drop the earl war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/inkling/earl/.

Create a tiny portal

This tiny demo shows how you might create an RSS-based portal using Inkling.

RSS 1.0 is a simple, extensible XML/RDF format, originally for syndication of news stories. In its simplest form, it consists of a list of links in a container (a 'channel') with an associated logo, name, description, and url. RSS 1.0, unlike earlier versions, is extensible - you can Add 'modules' to describe different types of object: webpages (Dublin Core); events (events module). A portal-like interface can be built be displaying the RSS feeds from different sources, as the Sosig-grapevine system does.

The first thing you need to do is build a list of the RSS feeds you are interested in, like this one, for example. This is a very simple list of RSS feeds classified according to their subject. Then you can get a list of feeds you want to display by asking a SquishQL query like this one:
Get me the RSS urls and titles where the subject matches the string 'economics'

	select ?feedUrl, ?title  
	where 
	(dc::subject ?feedUrl ?subject)
	(rss::title ?feedUrl ?title)
	and ?subject ~ 'economics'
	using rss for http://purl.org/rss/1.0/
	dc for http://purl.org/dc/elements/1.1

This technique is very useful if you would like to personalize the feed display according to subject. You could also personalize it according to the user id of a person, using a similar technique. Then you need to display the content of the RSS feeds themselves. The code for a JSP which does this is here.

This is the query it asks:
For each channel found, print the title and the url of each item

	select ?item, ?ti, ?li 
	where 
	(rss::items 
	    http://chewbacca.ilrt.bris.ac.uk/events/events.xml ?seq)
	(?contains ?seq ?item)
	(rss::title ?item ?ti) 
	(rss::link ?item ?li) 
	using rss for http://purl.org/rss/1.0/

RSS 1.0 can be extended by adding modules, such as the events module. This means that simple RSS readers (like a Perl regex) can still display a RSS feed, because they ignore the parts they don't understand. More complex displayers can do interesting things with the new information. Some examples showing display in a calendar format are here and here.

Inkling can do this by adding to the query. The query immediately below is the original query to get the RSS feed item titles, and links. The query below that asks for their startdate, enddate and location as well.

	select ?item, ?title, ?link 
	where 
	(rss::items 
	  http://chewbacca.ilrt.bris.ac.uk/events/events.xml ?seq)
	(?contains ?seq ?item) 
	(rss::title ?item ?title) 
	(rss::link ?item ?link)
	using rss for http://purl.org/rss/1.0/
	select ?title, ?link, ?start, ?end, ?location 
	where 
	(rss::items 
	  http://chewbacca.ilrt.bris.ac.uk/events/events.xml ?seq)
	(?contains ?seq ?item) 
	(rss::title ?item ?title) 
	(rss::link ?item ?link)
	(ev::startdate ?item ?start) 
	(ev::enddate ?item ?end) 
	(ev::location ?item ?location) 
	using rss for http://purl.org/rss/1.0/ 
	ev for http://purl.org/rss/1.0/modules/event/

Installation summary: to create something similar to this, download and install Jakarta-Tomcat;
Drop the RSS war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/inkling/rss/.

Create a calendar viewer using RSS 1.0+events channels

This RSS+events calendar viewer is an in-memory demonstrator.

Installation summary: to create something similar, download and install Jakarta-Tomcat;
Drop the RSS calendar war file in the webapps directory in Jakarta-Tomcat.
Download and build Inkling (sh build.sh), and copy the jars in lib into the common/lib directory in Jakarta-Tomcat.
start the Jakarta-Tomcat server by typing 'sh bin/startup.sh'.
Go to the url: http://localhost:8080/inkling/rsscal/.

You can display a single RSS events module, or use a configuration file such as this one.

The demo uses the following queries:
get the month's events

        SELECT ?event, ?desc, ?datee, ?dates
         WHERE
        (rss::title ?event ?desc)
        (ical::startdate ?event ?dates)
        (ical::enddate ?event ?datee)
        and ?dates ~ '2002-07'
        USING ical FOR http://purl.org/rss/1.0/modules/event/
        foaf FOR http://xmlns.com/foaf/0.1/
        rdfs FOR http://www.w3.org/2000/01/rdf-schema#
         rss for http://purl.org/rss/1.0/

get the day's events

        SELECT ?event, ?desc, ?datee, ?dates
         WHERE
        (rss::title ?event ?desc)
        (ical::startdate ?event ?dates)
        (ical::enddate ?event ?datee)
        and ?dates ~ '2002-07-27'
        USING ical FOR http://purl.org/rss/1.0/modules/event/
        foaf FOR http://xmlns.com/foaf/0.1/
        rdfs FOR http://www.w3.org/2000/01/rdf-schema#
         rss for http://purl.org/rss/1.0/

dates are treated as strings. For the day query you could instead have an exact match

and ?dates eq '2002-07-27'

or a different name for partial match

and ?dates like '2002-07-27'

or avoiding any constraints

        SELECT ?event, ?desc, ?datee, ?dates
         WHERE
        (rss::title ?event ?desc)
        (ical::startdate ?event '2002-07-27')
        (ical::enddate ?event ?datee)
        USING ical FOR http://purl.org/rss/1.0/modules/event/
        foaf FOR http://xmlns.com/foaf/0.1/
        rdfs FOR http://www.w3.org/2000/01/rdf-schema#
         rss for http://purl.org/rss/1.0/

However for the month query you need the ~ or 'like' constraint - otherwise you have to loop through the entire month day by day.
Note that you probably want something different for certain events - not when they start (or the equally easy query of when they end) but what is going on at the moment, which would have to be pre-calculated.

Create an RDFWeb database

RDFWeb friend of a friend database is a linked information system about people. There are several implementations available, and also a writeup by Edd Dumbill. Danbri did the earliest implementation in Perl. I did this one in Java a while later. Edd has an irc foafbot which uses Redland and has cool signing and provenance aspects. Leigh Dodds wrote the cool Foaf-a-matic, a javascript tool to help you generate foaf files.

My implementation at least is very simple. It uses queries like this:

	select ?name 
	where 
	(http://xmlns.com/foaf/0.1/mbox 
	   ?x mailto:libby.miller@bristol.ac.uk)
	(http://xmlns.com/foaf/0.1/name ?x ?name)
	select ?image
	where 
	(http://xmlns.com/foaf/0.1/mbox 
	   ?x mailto:libby.miller@bristol.ac.uk)
	(http://xmlns.com/foaf/0.1/img ?x ?image)
	select ?uri 
	where 
	(http://purl.org/dc/elements/1.1/creator ?uri ?per) 
	(http://xmlns.com/foaf/0.1/mbox ?per
	   mailto:libby.miller@bristol.ac.uk)
	select ?title 
	where 
	(http://purl.org/dc/elements/1.1/title ?uri ?title)
	select ?descripton 
	where 
	(http://purl.org/dc/elements/1.1/description  
	    ?uri ?description)

The main problem is simply that you can't guarantee the structure of the data, and so you have to make several queries rather than one to ensure you get all the information (e.g. some created things might have titles and not descriptions; some people may have names but no images; or more than one name, and so on). This can mean implementatons can be quite slow.

A simple RDF calendar agent

It's been annoying me for some time that people keep expecting me to store all of my calendar data in one place and assume that I can just copy and paste it in, or want to spend time doing that. So for example my work wants me to store my calendar data in a proprietory format that I can't sync with my palm, and which I can't share with my partner or my friends.

It strikes me also that this is really a general problem with events data - it's not just a problem with technologies used - whether they sync with a palm pilot or not for example - it's more about keeping data in a place where it's most easy for the people that need to edit it to do so - and separating out those storage requirements from the question of who needs to read that data.

I think this is how it should be done and I think someone can do it better than me (it looks like Mozilla is getting pretty close - see their newsgroup on calendaring, and it can hold your pgp/gpg passphrase for you).
Basically you distribute calendar data around the web in RDF and encrypt it for your requred audience. Then you pull it down to a personal webserver (or other client code) which you trust to decrypt it for you, merge it and display it usefully. That's what I tried to do with this (GPLed) software, which does something similar to this online demo but which can decrypt files for you (if you trust it to do so - I'd advise *not* using your actual passphrase while playing with this software. I don't think there's anything stupidly wrong with it, but I'm far from being an expert.) There's also a little Palm to RSS+events converter in Perl (requires requires the Palm perl module). The overall idea is something like Morbus' Amphetadesk, but for events data, and nowhere near as shiny....


RDF hacking