[Nepomuk] Resource clouds

Sebastian Trüg trueg at kde.org
Tue Dec 13 13:59:31 UTC 2011


Sorry for the late reply. Sadly grouping is not possible with the C++
API. But it might be added I suppose...

On 10/18/2011 02:36 PM, Marco Martin wrote:
> Hi all,
> 
> a thing i'm experimenting with for the resource browser of active is being 
> able to have informations from nepomuk as "clouds" of attributes, so apart the 
> tag cloud (easy, built in ;) i need a similar thing for other properties as 
> well, so results of the form property/occurrences
> 
> i did some experiments and did manage only in pure Sparql so far (see below)..
> 
> would those be possible in the c++ api? also because i would like to 
> arbitrarly mix them to have things like
> "cardinalities of ratings per activity"
> or
> "cardinalities of tags of things in a certain date interval"
> and in Sparql can become very messy quite quickly ;)
> 
> 
> #how many resources of each type
> 
> SELECT ?o count(*) as ?count
> WHERE {?s rdf:type ?o} 
> group by ?o
> 
> 
> 
> 
> #how many resources of each rating
> 
> SELECT ?rating count(*) as ?count
> WHERE {?s 
> <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#numericRating> 
> ?rating} 
> group by ?rating
> 
> 
> 
> 
> #how many resources of each type, related to the activity 
> nepomuk:/res/47d7281f-dd5c-4162-8026-5bc069f91945
> 
> select distinct ?t count(*) as ?count
> where { <nepomuk:/res/47d7281f-dd5c-4162-8026-5bc069f91945> 
> <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated> ?r .
> ?r rdf:type ?t .
> ?r <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#userVisible> ?v1 
> .
> FILTER(?v1>0) . }
> group by ?t
> 
> 
> 
> #how many resources per activity
> 
> select distinct ?a count(*) as ?count
> where { ?a 
> <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#isRelated> ?r 
> . ?a rdf:type kext:Activity
> } group by ?a
> 
> --
> Marco Martin
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
> 


More information about the Active mailing list