Re: [arc-dev] Bug with GRAPH and OPTIONAL
From: Mario Volke
Subject: Re: [arc-dev] Bug with GRAPH and OPTIONAL
Date: Wed, 17 Dec 2008 18:21:18 +0100
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
It leads to simmilar effects, I've already tried it.<br>
<br>
Unfortunately a query like the following one is also not possible:<br>
<br>
PREFIX foaf: <a class="moz-txt-link-rfc2396E" href="http://xmlns.com/foaf/0.1/"><http://xmlns.com/foaf/0.1/></a><br>
<br>
SELECT ?s ?name WHERE {<br>
GRAPH <urn:identity> {<br>
OPTIONAL { ?s foaf:givenname ?name }<br>
}<br>
}<br>
<br>
I'm getting the following error:<br>
Error: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'LEFT JOIN origo_triple T_0_0_0_0_0_0 ON ( ((T_0_0_0_0_0_0.p =
802) /* <a class="moz-txt-link-freetext" href="http://x">http://x</a>' at line 9 via ARC2_StoreSelectQueryHandler<br>
<br>
I simply want to load a lot of different objects, but I don't know if
they are set.<br>
And I want to do this in one select-statement. So I don't see an
alternative.<br>
<br>
<br>
<br>
Benjamin Nowack schrieb:
<blockquote cite="mid:PM-GA.20081217180931.6EC7D.1.1D@semsol.com"
type="cite">
<pre wrap="">
Hi Mario,
Thanks for the bug report. OPTIONALS in combination with non-optional
restrictions are hard to translate to SQL and not fully supported.
It *might* work when you replace the GRAPH with a FROM, but it may
lead to similar (non-correct) SQL.
Benji
--
Benjamin Nowack
<a class="moz-txt-link-freetext" href="http://bnode.org/">http://bnode.org/</a>
On 17.12.2008 10:13:51, Mario Volke wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">I think I've found a critical bug in the sparql implementation of ARC2.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">I've done the following queries:
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">PREFIX foaf: <a class="moz-txt-link-rfc2396E" href="http://xmlns.com/foaf/0.1/"><http://xmlns.com/foaf/0.1/></a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">INSERT INTO <urn:identity> {
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-rfc2396E" href="http://www.example.com"><http://www.example.com></a> rdf:type foaf:Person .
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-rfc2396E" href="http://www.example.com"><http://www.example.com></a> foaf:givenname "Anna" .
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">consider the graph uri in the following statement!!!
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">PREFIX foaf: <a class="moz-txt-link-rfc2396E" href="http://xmlns.com/foaf/0.1/"><http://xmlns.com/foaf/0.1/></a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">INSERT INTO <urn:identy> {
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-rfc2396E" href="http://www.example.com"><http://www.example.com></a> foaf:givenname "Max" .
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">PREFIX foaf: <a class="moz-txt-link-rfc2396E" href="http://xmlns.com/foaf/0.1/"><http://xmlns.com/foaf/0.1/></a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">SELECT ?s ?name WHERE {
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">GRAPH <urn:identity> {
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">?s rdf:type foaf:Person .
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">OPTIONAL { ?s foaf:givenname ?name }
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">the last select query gives me the following result:
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">s
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">name
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-freetext" href="http://www.example.com">http://www.example.com</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">Max
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-freetext" href="http://www.example.com">http://www.example.com</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">Anna
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">This is obviously wrong because Max is not in the graph <urn:identity>!!!
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<style type="text/css" media="all">
div#signatur {
margin-top:3em;
padding-top:1em;
border-top:1px solid #EEE;
font-family:Verdana, Arial, sans-serif;
line-height:1em;
font-size:1em;
color:#555;
background-color:transparent;
}
div#signatur a {
color:#555;
background-color:transparent;
text-decoration:none;
}
div#signatur a:hover {
color:#FFF;
text-decoration:underline;
}
div#signatur h1 {
font-size:1.2em;
font-weight:bold;
}
div#signatur h1 span {
font-weight:normal;
font-size:0.8em;
font-style:italic;
}
</style>
<div id="signatur">
<h1> webholics<br>
<span>development + design</span> </h1>
<br>
Mario Volke<br>
<br>
<a href="http://www.webholics.de">www.webholics.de</a><br>
<a href="http://www.webholics.de/kontakt/">mario.volke@webholics.de</a><br>
</div>
</div>
</body>
</html>
""" ;
ns1:returnPath "<mario.volke@webholics.de>" ;
ns1:xOriginalTo "arc-dev@semsol.org" ;
ns1:deliveredTo "web11p1@p15192371.pureserver.info" ;
ns1:received """from p5b305b10.dip.t-dialin.net ([91.48.91.16] helo=[192.168.2.2]); authenticated
by wp108.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-MD5:128)
id 1LD059-0005xF-7G; Wed, 17 Dec 2008 18:21:11 +0100""" ;
ns1:messageID "<4949350E.4080305@webholics.de>" ;
ns1:date "Wed, 17 Dec 2008 18:21:18 +0100" ;
ns1:from "Mario Volke <mario.volke@webholics.de>" ;
ns1:organization "webholics - development & design" ;
ns1:userAgent "Thunderbird 2.0.0.18 (Windows/20081105)" ;
ns1:mIMEVersion "1.0" ;
ns1:to "arc-dev <arc-dev@semsol.org>" ;
ns1:subject "Re: [arc-dev] Bug with GRAPH and OPTIONAL" ;
ns1:references "<4948C2CF.4060109@webholics.de> <PM-GA.20081217180931.6EC7D.1.1D@semsol.com>" ;
ns1:inReplyTo "<PM-GA.20081217180931.6EC7D.1.1D@semsol.com>" ;
ns1:contentType "text/html; charset=ISO-8859-1" ;
ns1:contentTransferEncoding "7bit" ;
ns1:xBounceKey "webpack.hosteurope.de;mario.volke@webholics.de;1229534471;23de5281;" ;
ns1:xSpamCheckerVersion """SpamAssassin 2.64 (2004-01-11) on
p15192371.pureserver.info""" ;
ns1:xSpamLevel "" ;
ns1:xSpamStatus """No, hits=-0.5 required=5.0 tests=AWL,BAYES_01,HTML_60_70,
HTML_MESSAGE,HTML_TITLE_EMPTY,MIME_HTML_ONLY autolearn=no version=2.64