W3C home > Mailing lists > Public > www-rdf-interest@w3.org > December 2000

Re: Querying reified statements

From: Libby Miller <Libby.Miller@bristol.ac.uk>
Date: Wed, 13 Dec 2000 12:46:00 +0000 (GMT)
To: David Allsopp <dallsopp@signal.dera.gov.uk>
cc: www-rdf-interest@w3.org
Message-ID: <Pine.GSO.4.21.0012131230410.7882-100000@mail.ilrt.bris.ac.uk>


On Wed, 13 Dec 2000, David Allsopp wrote:

> 
> But if I wanted a query along the lines of "What do people say John
> Smith's age is?" I would need something like:
> 
>   select ?a where (?x rdf:type Statement)(?x rdf:subject JohnSmith)(?x
> rdf:predicate age)(?x rdf:object ?a)
> 
> which even for this trivial example is getting complex.  I'd like a way
> of 'drilling down' through reification, possibly through multiple layers
> (A says that B says that John Smith is 42...).

Hi David,

You're right, this is a real nuisance, especially since queries like
this also tend to be inefficient, because rdf:type statement,
rdf:subject will be very common if you're dealing with a lot of reified
statements.

> 
> Perhaps the solution is to 'flatten' an RDF model containing reified
> statements (applying filters according to the origin of the statements
> or other criteria) to generate a model without any reifications, which
> can be queried easily.  

I was trying to think around this problem, but I haven't bee able to
work out how it can be done. If we have

[bag1]-- 1 -- [Statement1]
			--- subject
			--- predicate
			--- object

there's no obvious way to flatten it, because without reifying the
statement there's no way to refer to the statement rather than its
constituents. So it looks as if you can't connect parts of the model
together unambiguously.

I'd be very interested in any ideas you have about how to tackle this.

On the plus side though, it does mean that you can have very general
queries about a resource if you have lots of reified statements in a
database, because e.g.

   select ?z, ?a where (?x rdf:type Statement)(?x rdf:subject
JohnSmith)(?x rdf:predicate ?z)(?x rdf:object ?a)

will get you all the predicate-object pairs with JohnSmith as the
subject.

cheers,


Libby
Received on Wednesday, 13 December 2000 07:47:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:47 GMT