I finally managed.<br><br>select ?r where { ?r nao:lastModified ?m1, ?m2. FILTER( ?m1 != ?m2 ). }<br><br>I made this into a more generic query -<br><br>select ?r ?p where { ?p nrl:maxCardinality "1"^^xsd:int . ?r ?p ?o1,?o2 . FILTER( ?o1 != ?o2 ) . }<br>
<br>It's now there in the nepomukcleaner<br><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 1:38 PM, Ivan Čukić <span dir="ltr"><<a href="mailto:ivan.cukic@kde.org" target="_blank">ivan.cukic@kde.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Maybe something like this (can't test, not at home, so the syntax is probably borked as well)</div>
<div><br></div><div>select ?resource, count(*) as ?count</div><div>where { ... }</div><div>group by ?resource</div>

<div>having ?count > 1</div><div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On 30 November 2012 06:10, Vishesh Handa <span dir="ltr"><<a href="mailto:me@vhanda.in" target="_blank">me@vhanda.in</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hey guys<br><br>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).<br>


<br>I was trying - "select distinct ?r (select count(?m) where { ?r nao:lastModified ?m . }) as ?mc where { ?r ?p ?o . FILTER( ?mc > 1 ) . }"<br>
<br>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.<br>



<br>Does anyone know of a simpler way of doing this?<span><font color="#888888"><br><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>
</font></span><br></div></div>_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>While you were hanging yourself on someone else's words<br>Dying to believe in what you heard<br>I was staring straight into the shining sun<br>

</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>
</div>