Hello

I have a Virtuoso server serving a triplestore, which I'm querying with
ARQ. I was using version 2.8.1 and the following query was working fine:

SELECT <bif:year>(?date) <bif:month>(?date) count(distinct ?document)
{
        ?document a :Document;
                 :documentDateOfCreation ?date;
                 :documentType ?docType.
        FILTER ( ?docType = "exam results"^^xsd:string )
}
group by <bif:year>(?date) <bif:month>(?date)

(for those wondering, <bif:year> and <bif:month> are a built-in functions
provided by Virtuoso).

However, when I switched to 2.8.8, I suddenly started to get this error
message:

> Non-group key variable in SELECT: ?date in expression <bif:year>(?date)

Which seems to me to be a parsing bug (as ARQ doesn't seem to understand
the whole <bif:year>(?date) as the grouping expression... I can't use LET
or BIND expressions, as Virtuoso doesn't recognize them; Also, one should
note the strange <bif:function-name> notation; Virtuoso would recognize
this expression without <> and would not require the prefix to be declared,
however ARQ won't let it go, unless you write it the way I did.

I can circumvent the problem with aliases and subquery:

SELECT ?year ?month count(distinct ?document)
{{
SELECT (<bif:year>(?date) as ?year) (<bif:month>(?date) as ?month) ?document
 {
        ?document a :Document;
                 :documentDateOfCreation ?date;
                 :documentType ?docType.
        FILTER ( ?docType = "exam results"^^xsd:string )
}
}}
group by ?year ?month


Am I doing something wrong, or is it really a bug?

Thanks

--
diogo patrĂ£o

Reply via email to