Share

OpenLink Virtuoso (Open-Source Edition)

Tracker: Bugs

7 Problems with implicitly named graphs and optionals - ID: 2791254
Last Update: Comment added ( kjetilk )

I'm seeing a somewhat strange problem, typically corner case, yet quite
important to us right now.

We have seen quite a few times that if we have a WHERE clause with

?graph a <http://msone.computas.no/graphs#InstanceGraph> .
GRAPH ?graph {

but no FROM NAMED clause, it gives us no hits. I've been unsure if it
should work, so I showed it to some folks in the Bristol meeting (actually,
what I showed was the query in bug #2787186. Now, I've tried to narrow it
down some more, and I have now narrowed it down to this query:

SELECT ?url
FROM <http://msone.computas.no/graphs>
FROM NAMED <http://msone.computas.no/graphs/instance/nfi>
WHERE { ?graph a <http://msone.computas.no/graphs#InstanceGraph> .
GRAPH ?graph {
?resource <http://www.computas.com/mediasone#streamURL> ?url .
OPTIONAL { ?resource <http://xmlns.computas.com/sublima#popularity> ?pop
. }
FILTER ( ?url = <rtsp://ruby3.computas.no/2_40093.mp4> )
}
}

As it stands, it will give a solution on
http://msonetest.computas.no:8890/sparql .

However, if I remove the FROM NAMED clause, it doesn't give any solutions.
And that is the critical bit. The folks think it should, and there is a
pretty strong use case for it, one may simply not know the URIs of the
graphs, only other properties of them. Which is the case for us, we know
only the type of the graph.

Then, if I remove the OPTIONAL, it will again give a solution. So, there
seems to be a problem related to this.

Actually, I just found an even more minimal example, this query:

SELECT *
FROM <http://msone.computas.no/graphs>
WHERE { ?graph a <http://msone.computas.no/graphs#InstanceGraph> .
GRAPH ?graph {
?resource <http://www.computas.com/mediasone#streamURL>
<rtsp://ruby3.computas.no/2_40093.mp4>
OPTIONAL { ?resource <http://xmlns.computas.com/sublima#popularity> ?pop
. }

}
}

appears to have no solutions, while again, removing the OPTIONAL returns
the correct solution.

So, it seems to be a bug here. I also wonder if it could be related to bug
#2787193.


Kjetil Kjernsmo ( kjetilk ) - 2009-05-13 15:17

7

Closed

Fixed

IvAn Mikhailov

RDF - SPARQL

None

Public


Comments ( 4 )

Date: 2009-08-12 13:38
Sender: kjetilk

Indeed it works, so I'm closing this bug.


Date: 2009-07-02 10:32
Sender: kjetilk

Hmmm, it appears to persist in the 20090701 snapshot.


Date: 2009-07-02 09:46
Sender: iv-an-ru

I guess that this is fixed by latest patch for OPTIONALs, at least I can't
find any suspicious in the generated SQL text.


Date: 2009-05-13 15:18
Sender: kjetilk

Taking the liberty of bumping the priority. :-)


Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Open 2009-08-12 13:38 kjetilk
resolution_id None 2009-08-12 13:38 kjetilk
allow_comments 1 2009-08-12 13:38 kjetilk
close_date - 2009-08-12 13:38 kjetilk
category_id None 2009-07-02 09:46 iv-an-ru
assigned_to nobody 2009-06-08 14:23 iodbc
priority 5 2009-05-13 15:18 kjetilk