----- Original Message ----

> From: Kjetil Kjernsmo <kjetil.kjern...@computas.com>
> To: virtuoso-users@lists.sourceforge.net
> Cc: Kingsley Idehen <kide...@openlinksw.com>
> Sent: Monday, 5 January, 2009 10:26:51 PM
> Subject: Re: [Virtuoso-users] DESCRIBEing a URI white implicitly naming the 
> graph
> 
> Hi Kingsley and thanks for the response!
> 
> On Monday 29 December 2008 22:19:01 Kingsley Idehen wrote:
> > If possible, you can just rebuild the RDF_QUAD table with a different
> > primary key, and once done the overhead associated with not specifying a
> > graph IRI in the FROM clause re. Virtuoso goes away courtesy of the
> > column order (and associated re-indexing) in the revised primary key.
> > The command for altering the primary key is:
> > alter table db..RDF_QUAD modify primary key (S,P,O,G) ;
> 
> I must admit that I do not appreciate the full depth of what you are saying 
> here. I have done a little more research though, and before diving further 
> into your suggestion, I'd like to raise another point.
> 
> DESCRIBE isn't well specified, and I hope to join DAWG NG to share my 
> experiences. Let us nevertheless see if we can agree on what is the most 
> intuitive result. 
> 
> For example, I'd expect the result of this query:
> 
> PREFIX ms:  
> DESCRIBE ?uri 
> FROM 
> WHERE {
>   ?g a .
>   GRAPH ?g    
>   {
>     ?uri    ms:coverArt    .
>   }
> }
> 
> To return the same as this query:
> 
> 
> PREFIX ms:  
> CONSTRUCT { ?uri     ?p        ?s ;
>     ms:coverArt    .
> }    
> FROM 
> WHERE {
>   ?g a .
>   GRAPH ?g    
> {
>     ?uri     ?p        ?s ;
>         ms:coverArt    .
>   }
> }
> 
> The latter query returns what I'd expect from them both, whereas the former 
> has no result (I've set the default graph both as above, and with a protocol 
> query parameter). Again, this can be tested live at 
> http://msone.computas.no:8890/sparql

Although it returns no results right now, the queries won't always be identical 
because the CONSTRUCT requires at least two triples in the ?g graph before it 
will return results and the DESCRIBE requires only one triple (the ms:coverArt 
one), so in some circumstances they are semantically different.

For what it is worth I have never seen the need to put in an empty "FROM" so I 
am not sure why you have to do it as sparql will deal with all triples outside 
of GRAPH{} blocks as if they match against the default graph in the absence of 
any FROM's, although you can fake the change in default graph with Virtuoso 
instructions like default-graph-uri.

Cheers,

Peter



      Stay connected to the people that matter most with a smarter inbox. Take 
a look http://au.docs.yahoo.com/mail/smarterinbox

Reply via email to