I figured out a way to do it using just regular properties and queries - the key is to encode each number that you want as a property within the respective page, using an #ask query with the 'count' format to get that value. So, on Discourse DB each opinion item discusses one or more topics; if I want to create a graph showing the popularity of different topics among the opinion items, I first have to have each topic store the number of opinion items that address it. Since every topic on Discourse DB uses the "Topic" template, I was able to do that by just creating the property "Has number of opinion items", of type Number, then adding the following to the "Topic" template:

[[Has number of opinion items::{{#ask:[[Addresses topic::{{PAGENAME}}]][[Category:Items]]|format=count}}]]

I wasn't sure that this would work, but thankfully it did.

Then I created a page that queries this set of values and displays it in different formats, which you can see here:

http://discoursedb.org/wiki/Topic_breakdown

I don't know how useful the data visualizations actually are in this specific case, though they do suggest some interesting possibilities. It's probably worth adding a tutorial for this approach somewhere to the help documents, like probably to the documentation for the Googlebar and Googlepie formats.

-Yaron


On Mon, Nov 24, 2008 at 12:20 PM, <zehetner@molgen.mpg.de> wrote:
Hi Patrick,
Oh well I didn't read your response before sending mine.

Just to add:
In case of nary properties the described method works only for single parts of
the property by adding the 'nary=number_of_the_desired_part' parameter (which is
for such nary properties mandatory) to the original query and modifying the
query in the template accordingly (e.g. [[{{{propertyname}}}::?;?;{{{1}}};?]]

Yes the next version of SQFT (hopefully sometimes later this week) should work
with SMW 1.4

Gu

Quoting Patrick Nagel <mail@patrick-nagel.net>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Brian,
>
> Brian Fox wrote:
> > However, as much as I like visualizations, my main problem is an apparent
> > lack of functionality in the #ask function. I would like to be able query
> a
> > specific property and get back each value of the property along with the
> > number of pages that have each value. This might be solved with code
> > similar to the Drilldown extension as it returns that information for
> every
> > property that has a filter and is used by pages in a specific category.
>
> There is an extension (building on SMW) called Semantic Query Form Tool [1]
> that can do what you need. It doesn't work with SMW 1.4 currently though,
> but
> I'm sure the creator will update it soon.
> I agree though, that it would be much better if this functionality could be
> part of SMW or Semantic Result Formats (if only for easier updating,
> maintenance and all - from a user's point of view).
>
> Have a look at this mailing list thread:
> http://www.nabble.com/Count-of-property-values-td19834861.html#a19835536 -
> Gu,
> the author of the extension, explained to me how to use it there.
>
> Patrick.
>
> [1]: http://www.mediawiki.org/wiki/Extension:SemanticQueryFormTool
>
> - --
> Key ID: 0x86E346D4            http://patrick-nagel.net/key.asc
> Fingerprint: 7745 E1BE FA8B FBAD 76AB 2BFC C981 E686 86E3 46D4
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkkqyN4ACgkQyYHmhobjRtTMmgCgxBRLYGnMCl4pO7lE67Gaa9cr
> sO0AmgPdgU2D3xCe2SonEOWTqdxrmFeh
> =HsXS
> -----END PGP SIGNATURE-----
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user