Re: Querying reified statements

Geoff Chappell wrote:
> 
> I've been experimenting recently with a query language that takes queries of
> the form:
> 
>     select  ?age where {?x ?y {age JohnSmith ?age}}
> 
> which behind the scenes results in a query:
> 
>     select ?age where {?x ?y ?z} and {rdf:type ?z rdf:Statement} and
> {rdf:subject ?z JohnSmith}
>                 and {rdf:predicate ?z age} and {rdf:object ?z ?age}
> 
> Similarly, inner triples are assumed to refer to reified statements in
> insert, delete, infer, and other commands. Additional nesting of triples is
> allowed (i.e. he says she says such and such).  This seems to be a pretty
> natural representation and works well in practice.


That's a nice way of expressing it!  

However, I have problems with what the query should be mapped into.  For
example in the Stanford API, 
using the following example:

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"   
xmlns:DC="http://purl.org/metadata/dublin_core/"     
xmlns:DS="http://www.w3.org/Schemas/DS-Schema/"> 
<Description about="http://www.bar.com/some.doc" bagID="Statement_001">
  <DC:Creator>John Smith</DC:Creator>
</Description>
<Description about="#Statement_001">
  <DS:CreatedOn>1998-02-06T14:00Z</DS:CreatedOn>
  <DS:CreatedBy>Jane Cooper</DS:CreatedBy>
</Description>
</RDF>

the expanded query (looking for triples with the predicates rdf:type,
rdf:subject etc) wouldn't work as those triples don't exist (because in
the Stanford implementation Statement is a subclass of Resource and can
be referred to directly).

(please correct me if I'm wrong, Sergey Melnik!)

However, with the following example, with explicit reification, such a
query would work (and a query looking for the reified statement directly
would not work).

<?xml version="1.0"?>
<RDF xmlns:DC='http://purl.org/metadata/dublin_core#'   
xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Description ID="example">
  <subject resource="http://www.foo.com/bar.html" />
  <predicate resource="http://purl.org/metadata/dublin_core#author" />
  <object>Janne Saarela</object>
  <type
resource="http://w3.org/TR/1999/PR-rdf-syntax-19990105#Statement" />
</Description>
</RDF>

Will a query engine have to perform both kinds of query on the model?
That doesn't seem very satisfactory!

Regards,

David Allsopp

-- 
Dr David Allsopp
DERA Malvern

Received on Wednesday, 13 December 2000 11:10:56 UTC