W3C home > Mailing lists > Public > public-cwm-bugs@w3.org > October 2006

Bug? SPARQL query comma-joined object variables

From: Yoshio Fukushige <fukushige.yoshio@jp.panasonic.com>
Date: Tue, 03 Oct 2006 20:11:08 +0900
To: public-cwm-bugs@w3.org
Cc: fukushige.yoshio@jp.panasonic.com
Message-Id: <20061003194423.834A.FUKUSHIGE.YOSHIO@jp.panasonic.com>

Hi,

With the data triples in file <gomi.n3>
--
@prefix : <#> .
:s :p :o1, :o2.
--

and a SPARQL query
--
PREFIX  : <gomi.n3#>

SELECT ?x ?y
WHERE{
 :s :p ?x, ?y.
}
--

cwm (1.1.0rc2) breaks (on cygwin).

But with 
--
PREFIX  : <gomi.n3#>

SELECT ?x ?y
WHERE{
 :s :p ?x.
 :s :p ?y.
}
--
or
--
PREFIX  : <gomi.n3#>

SELECT ?x ?y
WHERE{
 :s :p ?x; :p ?y.
}
--

it's OK and spit
(A)
--
     @prefix : <http://www.w3.org/2000/10/swap/sparqlCwm#> .
     @prefix gomi: <#> .
    {
        gomi:o1     :bound "x",
                    "y" .

        }     a :Result .
    {
        gomi:o1     :bound "x" .
        gomi:o2     :bound "y" .

        }     a :Result .
    {
        gomi:o1     :bound "y" .
        gomi:o2     :bound "x" .

        }     a :Result .
    {
        gomi:o2     :bound "x",
                    "y" .

        }     a :Result .
--

I'm afraid it's a bug.

Here's what I got as the error message

--
#Processed by Id: cwm.py,v 1.177 2005/08/28 22:53:56 syosi Exp
        #    using base file:/cygdrive/c/home/MEI/NEDO2006/local-test/member/fuku/sparql-test/gomi.n3
loaded from file  0.196000099182
        ['_O_QCOMMA_E____QObjectList_E__C', ('http://www.w3.org/2000/10/swap/grammar/sparql#GT_COMMA', u','), ('andExtra', ('objectList', [('Var', y)]), [])]
Traceback (most recent call last):
  File "/usr/local/cwm-1.1.0rc2/cwm", line 715, in ?
    doCommand()
  File "/usr/local/cwm-1.1.0rc2/cwm", line 534, in doCommand
    filterContext = _store.load(_uri, why=r, referer="", contentType="x-application/sparql")
  File "/usr/local/cwm-1.1.0rc2/swap/llyn.py", line 1329, in load
    F = webAccess.load(store, uri, openFormula, asIfFrom, contentType, flags, referer, why)
  File "/usr/local/cwm-1.1.0rc2/swap/webAccess.py", line 166, in load
    F = p.parse(sparql_parser.start).close()
  File "/usr/local/cwm-1.1.0rc2/swap/sparql/sparql_parser.py", line 100, in parse
    self.onFinish()
  File "/usr/local/cwm-1.1.0rc2/swap/sparql/sparql_parser.py", line 112, in onFinish
    prod = self.sink.prod(self.productions.pop())
  File "/usr/local/cwm-1.1.0rc2/swap/sparql2cwm.py", line 388, in prod
    return getattr(self, 'on_' + abbr(production[0]))(production)
  File "/usr/local/cwm-1.1.0rc2/swap/sparql2cwm.py", line 1409, in on__O_QCOMMA_E____QObjectList_E__C
    raise RuntimeError(`p`)
RuntimeError: ['_O_QCOMMA_E____QObjectList_E__C', ('http://www.w3.org/2000/10/swap/grammar/sparql#GT_COMMA', u','), ('andExtra', ('objectList', [('Var', y)]), [
])]
--

And I'm not completely sure if it's OK
to have only one variable bound in the result (A) above.
(and always with "x" bound but not "y")

In contrast SPARQLer [1] returns a result 
where the two variables got always bound,
although there are cases where the two variables are bound to a single resource (:o1 or :o2).

[1] http://sparql.org/sparql.html

Best,
Yoshio

-- 
Yoshio Fukushige <fukushige.yoshio@jp.panasonic.com>
Network Development Center,
Matsushita Electric Industrial Co., Ltd.
Received on Tuesday, 3 October 2006 11:10:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:00 UTC