Sorry, I should correct myself there, the template should have an ask in it with "Is a country::+" and "Has country code::{{{1}}}" or something for the template to retrieve the correct country.

On Fri, Mar 27, 2009 at 12:33 PM, Brendan Crosser-McGay <verifex@gmail.com> wrote:
Each country uses country codes, but then your data points are using the same property to determine which country code they are referencing, you should probably use a different property then "has country code" for the DataPoints, but that being said, you do have the "is a country" property that would allow you too distinguish between DataPoints and countries--Hopefully that is good enough for all the purposes you need.

Besides all that, you're asking data points what country name they are referencing, something which isn't a property of the DataPoints.  You need to make a result template that would then be referenced in the ask query.  The template needs to have a query asking the pages with "Is a country::+" and "has country code::+" and then with just the Is A Country property being displayed.

http://semantic-mediawiki.org/wiki/Help:Template_format#Using_templates_for_custom_formatting

-Brendan


On Fri, Mar 27, 2009 at 2:58 AM, Dan Bolser <dan.bolser@gmail.com> wrote:
Hi,

I have several 'DataPoint' pages, each of which '[[Has country
code::x]]' and '[[Has item code::y]]'. I use these codes to uniquely
link a DataPoint page to a Country page and an Item page.

For an Item, I would like to list its associated Countries.

For an Item, I can list all the associated country codes (through its
associated DataPoints):

http://prodstat.referata.com/wiki/Sandbox
{{#ask
: [[has item code::367]] [[has country code::+]] |? Has country code }}


However, I want to list the Countries associated with an item. i.e.
All the Countries for the above list of country codes.

Can anyone help me do this? I can't seem to get the subquery syntax right.


Thanks very much for any help,
Dan.

------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user