[Nepomuk] Complex SPARQL Query

Ivan Čukić ivan.cukic at kde.org
Fri Nov 30 08:08:31 UTC 2012


Hi,

Maybe something like this (can't test, not at home, so the syntax is
probably borked as well)

select ?resource, count(*) as ?count
where { ... }
group by ?resource
having ?count > 1




On 30 November 2012 06:10, Vishesh Handa <me at vhanda.in> wrote:

> Hey guys
>
> I'm trying to write a sparql query to list all the resources which have
> more than 1 value for nao:lastModified (cause of buggy code).
>
> I was trying - "select distinct ?r (select count(?m) where { ?r
> nao:lastModified ?m . }) as ?mc where { ?r ?p ?o . FILTER( ?mc > 1 ) . }"
>
> But virtuoso refuses to let me use the ?mc variable in the where clause. I
> can do a - "select distinct ?r (select count(?m) where { ?r
> nao:lastModified ?m . }) as ?mc where { ?r ?p ?o . } ORDER BY DESC(?mc)
> LIMIT 10". Check the results, modify them, and re-run the query, but it's
> terribly slow. Running this query takes over a minute.
>
> Does anyone know of a simpler way of doing this?
>
> --
> Vishesh Handa
>
>
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
>
>


-- 
While you were hanging yourself on someone else's words
Dying to believe in what you heard
I was staring straight into the shining sun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121130/e0539830/attachment-0001.html>


More information about the Nepomuk mailing list