hi,

i'm having troubles getting a seamingly complicated sparql query to
work.

what i'm trying to do is to calculate the font-size of the members of
a tagCloud on the fly using sparql.

what i need for the final calculation is

1. the uri of a tag
2. the count (how often is this tag used)
3. the min (the minimal occurrence of a tag)
4. the max (the maximal occurrnce of a tag)

(nice to have would be a Math.log function)

i'm trying to do this along the lines of the first answer from here [1]

so to achieve this i basically need the following result

URI                        COUNT  MAX  MIN
http://my.org/concepts/a   4      4    1
http://my.org/concepts/b   2      4    1
http://my.org/concepts/c   1      4    1

with my current query [2] the min and max are not working as expected
and honestly i'm running out of ideas...
i also tried to CONSTRUCT and intermediate subquery but did come very far...


any pointer
greatly appreciated
wkr http://www.turnguard.com/turnguard

p.s.:

virtuoso-t -?

Virtuoso Open Source Edition (multi threaded)
Version 6.1.4.3127-pthreads as of Jan 23 2012
Compiled for Linux (i686-suse-linux-gnu)
Copyright (C) 1998-2011 OpenLink Software


[1] 
http://stackoverflow.com/questions/3717314/what-is-the-formula-to-calculate-the-font-size-for-tags-in-a-tagcloud
[2]
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX sioc:<http://rdfs.org/sioc/ns#>

SELECT ?topic ?count (MIN(?count) AS ?min) (MAX(?count) AS ?max)
WHERE {
 {
  SELECT ?topic (COUNT(?topic) AS ?count) WHERE {
   ?s sioc:topic ?topic .
  } GROUP BY ?topic
 }
} ORDER BY DESC(?count)




--
| Jürgen Jakobitsch,
| Software Developer
| Semantic Web Company GmbH
| Mariahilfer Straße 70 / Neubaugasse 1, Top 8
| A - 1070 Wien, Austria
| Mob +43 676 62 12 710 | Fax +43.1.402 12 35 - 22

COMPANY INFORMATION
| http://www.semantic-web.at/

PERSONAL INFORMATION
| web       : http://www.turnguard.com
| foaf      : http://www.turnguard.com/turnguard
| skype     : jakobitsch-punkt
| xmlns:tg  = "http://www.turnguard.com/turnguard#";

Reply via email to