<div>Hi,</div><div><br></div>Sebastian explain this a couple of days ago here :). Count is available in API using CreateCountQuery<div><br></div><div><a href="http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1Query_1_1Query.html#ad3c79b80b619cab4841e8faa203fb3daad550c1ac98e41005749758fab9aded3f">http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1Query_1_1Query.html#ad3c79b80b619cab4841e8faa203fb3daad550c1ac98e41005749758fab9aded3f</a></div>

<div><br></div><div>So basically you must construct the query using the API and then add the CreateCountQuery flag.<br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 2:36 PM, Marco Martin <span dir="ltr"><<a href="mailto:notmart@gmail.com">notmart@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
a thing i'm experimenting with for the resource browser of active is being<br>
able to have informations from nepomuk as "clouds" of attributes, so apart the<br>
tag cloud (easy, built in ;) i need a similar thing for other properties as<br>
well, so results of the form property/occurrences<br>
<br>
i did some experiments and did manage only in pure Sparql so far (see below)..<br>
<br>
would those be possible in the c++ api? also because i would like to<br>
arbitrarly mix them to have things like<br>
"cardinalities of ratings per activity"<br>
or<br>
"cardinalities of tags of things in a certain date interval"<br>
and in Sparql can become very messy quite quickly ;)<br>
<br>
<br>
#how many resources of each type<br>
<br>
SELECT ?o count(*) as ?count<br>
WHERE {?s rdf:type ?o}<br>
group by ?o<br>
<br>
<br>
<br>
<br>
#how many resources of each rating<br>
<br>
SELECT ?rating count(*) as ?count<br>
WHERE {?s<br>
<<a href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#numericRating" target="_blank">http://www.semanticdesktop.org/ontologies/2007/08/15/nao#numericRating</a>><br>
?rating}<br>
group by ?rating<br>
<br>
<br>
<br>
<br>
#how many resources of each type, related to the activity<br>
nepomuk:/res/47d7281f-dd5c-4162-8026-5bc069f91945<br>
<br>
select distinct ?t count(*) as ?count<br>
where { <nepomuk:/res/47d7281f-dd5c-4162-8026-5bc069f91945><br>
<<a href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated" target="_blank">http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated</a>> ?r .<br>
?r rdf:type ?t .<br>
?r <<a href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#userVisible" target="_blank">http://www.semanticdesktop.org/ontologies/2007/08/15/nao#userVisible</a>> ?v1<br>
.<br>
FILTER(?v1>0) . }<br>
group by ?t<br>
<br>
<br>
<br>
#how many resources per activity<br>
<br>
select distinct ?a count(*) as ?count<br>
where { ?a<br>
<<a href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated" target="_blank">http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated</a>> ?r<br>
. ?a rdf:type kext:Activity<br>
} group by ?a<br>
<font color="#888888"><br>
--<br>
Marco Martin<br>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">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>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best wishes,<div>Ignacio</div><div><br></div><br>
</div>