Hello Peter, Yes this is a bug and I hope to fix it soon.
Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.com On Sun, 2008-11-23 at 21:06 -0800, Peter Ansell wrote: > Hi all, > > I am not an expert of the semantics of how OPTIONAL works in SPARQL but I am > a little surprised at some results I am getting. I am executing the following > queries on a copy of the database which is normally at > http://go.bio2rdf.org/sparql although it is down at the moment. > > No results query: > > SELECT * WHERE { GRAPH <http://bio2rdf.org/go> { OPTIONAL { > <http://go.bio2rdf.org/go:0032283> > <http://www.w3.org/2000/01/rdf-schema#label> ?label . } OPTIONAL { > <http://go.bio2rdf.org/go:0032283> <http://purl.org/dc/elements/1.1/title> > ?title . } OPTIONAL { <http://go.bio2rdf.org/go:0032283> > <http://owl.bio2rdf.org/go#name> ?goName } } } > > Results query: > > SELECT * WHERE { GRAPH <http://bio2rdf.org/go> { OPTIONAL { > <http://go.bio2rdf.org/go:0032283> <http://owl.bio2rdf.org/go#name> ?goName } > } } > > The only difference between the queries is that I take out two of the > optional statements and it returns the result which should have matched in > the first one... Or am I doing something wrong? > > For reference, I am trying to efficiently seek a label for a given item > without knowing beforehand which predicate will be there, as the subject URI > is generated from a query on the bio2rdf software which in turn generates the > SPARQL query (I am actually using a CONSTRUCT internally but the behaviour is > the same as the SELECT) > > Cheers, > > Peter > > > > Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now > http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Virtuoso-users mailing list > Virtuoso-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/virtuoso-users