Versioned triple store

Gregory Williams greg at evilfunhouse.com
Mon Sep 19 15:54:25 CEST 2011


On Sep 19, 2011, at 6:44 AM, Toby Inkster wrote:

> I've put together an experimental versioned triple store.
> 
> 	svn checkout svn://ontologi.es/perlmods/RDF-Trine-Store-Tardis
> 
> Each triple is stored with the datetime that it was added (and possibly
> removed). You can then query its state at any given datetime.
> 
> In SPARQL you ought to be able to query particular datetimes like this:
> 
> 	# Select people who changed their name between two dates.
> 	PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> 	SELECT ?person ?oldname ?newname
> 	WHERE {
> 		GRAPH <tempus:2010-01-01> {
> 			?person foaf:name ?oldname .
> 		}
> 		GRAPH <tempus:2011-01-01> {
> 			?person foaf:name ?newname .
> 		}
> 		FILTER(?oldname != ?newname)
> 	}
> 
> No, tempus isn't an officially registered URI scheme.
> 
> Note that it's a triple store, not a quad store, and will issue
> warnings if you try to store quads. (Though you can retrieve quads, and
> the context provides the datetime the statement was added.)
> 
> Take a look and see what you think. Tell me if you find a way to break
> it. (I imagine it's quite easy.)

Looks interesting! This reminds me of something I hacked up with RDF::Query several years ago using named graphs for temporal querying:

http://tw.rpi.edu/2007/11/tsparql-poster.pdf

where a query like:

SELECT ?name WHERE {
	TIME [ time:inside "2007"^^xsd:dateTime ] {
		[] a foaf:Person ;
			foaf:name ?name ;
			whois:place "Tokyo, Japan" .
	}
}

got compiled down to a named graph query with date constraints placed on the metadata about the named graph.

.greg



More information about the Dev mailing list