#ask Problem

From semantic-mediawiki.org

I have a Problem using the #ask-Command. My query is: {{#ask:[[1. Januar::+]]}}. It works for the year-attributes like {{#ask:[[1901::+]]}}, but not for the "day of the month"-Attributes. What can I do? Red Rooster (talk) 21:18, 27 December 2012 (CET)

21:18, 27 December 2012

"1 January" or "1901" is usually a value of some property of type "Date", rather than, as you're assuming here, the property itself. I'd recommend the following steps:

  • Choose a name for the date-type property that you want to use, for instance "Has date".
  • On the page of that property (in this hypothetical case, "Property:Has date"), declare it as being one of type "Date".
  • Then, on the pages where you need it, create the annotation, for example [[Has date::1901]] (the bit that comes before the colons is the property "Has date"; what comes after is the value of this property).
  • A query for pages that share the value "1901" for this property would look like {{#ask: [[Has date::1901]] }}.

For advice on the use of SMW and any problems that you might encounter, it's best to turn to the mailing lists. The talk pages for this site relate to the documentation for SMW.

13:39, 17 January 2013