Search the web
Sign In
New User? Sign Up
jena-dev · Jena Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Bug Report (probably query rewriting)   Message List  
Reply | Forward Message #25717 of 42043 |
Hi,

I discovered a bug in the Jena ARQ engine.

RDF Document:
-------------
<?xml version='1.0' encoding='UTF-8'?>

<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:foaf='http://xmlns.com/foaf/0.1/'
xmlns:own='http://mytests/' >

<rdf:Description rdf:about='http://mytests/a'>
<own:tv>0</own:tv>
<own:tv>1</own:tv>
<own:false>0</own:false>
<own:true>1</own:true>
</rdf:Description>
</rdf:RDF>


Query 1:
--------
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX own: <http://mytests/>

SELECT ?X1 ?Y1 ?A0 ?A1 ?B0 ?B1
WHERE
{
own:a own:true ?B0 .
OPTIONAL {
{
own:a own:true ?X1 .
own:a own:true ?Y1 .
own:a own:false ?A0 .
own:a own:true ?A1 .
own:a own:false ?B0 .
own:a own:true ?B1 .
}
UNION
{
own:a own:false ?X1 .
own:a own:false ?Y1 .
own:a own:false ?A0 .
own:a own:true ?A1 .
own:a own:false ?B0 .
own:a own:true ?B1 .
}
}
}


Query 2:
--------
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX own: <http://mytests/>

SELECT ?X1 ?Y1 ?A0 ?A1 ?B0 ?B1
WHERE
{
own:a own:true ?B0 .
OPTIONAL {
{
own:a own:tv ?X1 .
own:a own:true ?A1 .
own:a own:false ?A0 .
}
OPTIONAL {
{
own:a own:tv ?X1 .
own:a own:tv ?Y1 .
own:a own:true ?B1 .
own:a own:false ?B0 .
}
{ { own:a own:true ?Y1 . } UNION { own:a own:false ?X1 . } }
{ { own:a own:true ?X1 . } UNION { own:a own:false ?Y1 . } }
}
}
}


In both expressions, the expressions encapsulated in the inner /outer/
optional expression evaluate to the same result, namely:

-------------------------------------
| X1 | Y1 | A0 | A1 | B0 | B1 |
=====================================
| "1" | "1" | "0" | "1" | "0" | "1" |
| "0" | "0" | "0" | "1" | "0" | "1" |
-------------------------------------

In both cases, this is the expected result. When now adding the outer
OPT-expression, namely

> own:a own:true ?B0 . OPTIONAL {
> ...
> }

the first query still works fine (Result: ?B0 -> 1), whereas the
second one produces a wrong result:

-----------------------------------
| X1 | Y1 | A0 | A1 | B0 | B1 |
===================================
| "1" | | "0" | "1" | "1" | |
| "0" | | "0" | "1" | "1" | |
-----------------------------------

Also checked the query with the JRDF SPARQL implementation. This
implementation gives the same (correct) result in both cases.

Kind Regards
Michael







Fri Oct 13, 2006 2:34 am

myrddral_de
Offline Offline
Send Email Send Email

Forward
Message #25717 of 42043 |
Expand Messages Author Sort by Date

Hi, I discovered a bug in the Jena ARQ engine. ... <?xml version='1.0' encoding='UTF-8'?> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' ...
Michael
myrddral_de
Offline Send Email
Oct 13, 2006
2:40 am

Hi Michael, Andy will certainly give an authoritative answer, but here is what I think is happening. ... I think both you and JRDF have it wrong, and the ARQ...
Richard Cyganiak
cygri
Offline Send Email
Oct 13, 2006
8:11 am

... Michael, Thanks for the detailed and complete report. ... I think Richard is right (not that I can give an authoritative answer). I'd be glad to hear...
Seaborne, Andy
andyseaborne
Offline Send Email
Oct 13, 2006
9:14 am

Hi again, ... you both are probably right. The funny thing is that my example comes from verifying Theorem 3 (SPARQL with AND, UNION and ALT is in PSPACE) in...
Michael
myrddral_de
Offline Send Email
Oct 13, 2006
2:22 pm

... Subject: Re: [jena-dev] Bug Report (probably query rewriting) Date: Sun, 15 Oct 2006 02:01:34 +1000 From: Andrew Newman <andrewfnewman@...> To:...
Seaborne, Andy
andyseaborne
Offline Send Email
Oct 15, 2006
4:08 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help