Thank you for patch. It helped and now I can see my query is incorrect :) I
need to retreieve not only entities but the quantity of objects too. May be
it is not a good idea to use one query for that... Here is my current query:

prefix events:    <http://www.semanticweb.org/ontologies/2010/1/Events.owl#>
SELECT DISTINCT ?event count(distinct ?event)
FROM <http://www.semanticweb.org/ontologies/2010/1/EventsContent.owl#> WHERE
{
?event ?property ?value .
?event events:startDateTime ?startDateTime .
FILTER (xsd:dateTime(?startDateTime) <=
xsd:dateTime("2010-04-11T15:04:58+07:00"))
}
OFFSET 0
LIMIT 10

count parameter always equals to 1. Looks like grouping is applied by
default...

2010/4/11 Ivan Mikhailov <[email protected]>

> Hello Alexander,
>
> > I have no experience in building Virtuoso from sources. Furthemore I
> > need both Cloud Edition and Open Source Edition (for Windows). So I
> > think I will wait for next snapshot.
>
> In this case, you may use workaround functions from the attached script.
> Loading 100411datetime_cast_workaround.sql will eliminate the effect of
> the bug.
>
> After the upgrade of the server to the next version, the workaround will
> no longer be needed. To stay on safe side re. future upgrades it will be
> better to restore the access to built-in versions of these cast
> procedures by running 100411datetime_cast_restore.sql (note that this
> script will shutdown the server).
>
> Best Regards,
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
> > 2010/4/11 Ivan Mikhailov <[email protected]>
> >         Hello Alexander,
> >
> >         That's my bug. To fix, please apply the attached patch to
> >         libsrc/Wi
> >         directory of Virtuoso sources.
> >
> >         Best Regards,
> >
> >         Ivan Mikhailov
> >         OpenLink Software
> >         http://virtuoso.openlinksw.com
> >
> >
> >         On Sun, 2010-04-11 at 15:14 +0700, Alexander Sidorov wrote:
> >         > Hello!
> >         >
> >         > At the moment I'm implementing pagination for my SPARQL
> >         queries and I
> >         > can't find out how to retrieve records count. By "count" I
> >         mean
> >         > records number that were retrieved if I didn't use OFFSET
> >         and LIMIT
> >         > clauses.
> >         >
> >         > Here is my sample query:
> >         >
> >         > prefix events:
> >         > <http://www.semanticweb.org/ontologies/2010/1/Events.owl#>
> >         > SELECT DISTINCT ?event, count(*)
> >         > FROM
> >         <http://www.semanticweb.org/ontologies/2010/1/EventsContent.owl#
> >
> >         > WHERE
> >         > {
> >         > ?event ?property ?value .
> >         > ?event events:startDateTime ?startDateTime .
> >         > FILTER (xsd:dateTime(?startDateTime) >=
> >         > xsd:dateTime("2010-04-11T15:04:58+07:00"))
> >         > }
> >         > ORDER BY ASC (xsd:dateTime(?startDateTime))
> >         > OFFSET 0
> >         > LIMIT 10
> >         >
> >         > In this case count returns value as if no filtering were
> >         applied.
> >
> >
> >
> >
>

Reply via email to