Thanks - but I am having some trouble - I think because of how I have to
establish whether there is an answer.

I don't have access to the parameter {{{Answer}}} to test if it exists - the
primary template for the semantic form only holds the 'Question' part of the
FAQ. Since there are potentially many answers to the question they are
asserted in a different semantic template(Template:Answer) which won't be
called if no answers have been provided. So I need to establish whether an
answer is set via a query in the Question template page(the second of
Markus's suggestions).

The semantic template page includes at the bottom the query:

{{#ask: [[{{PAGENAME}}]] 
|?Answer
|format=template
|template=NullTest
}}

I test for whether ?Answer has a value in  Template:NullTest. If it does I
print out some stuff, otherwise assert that the page lacks an answer

Template:NullTest
{{#if: {{{1}}} |   has an answer |  [[Lacks::Answer|]] }}

where {{{1}}} is the parameter value for an answer if it exists. However the
[[Lacks::Answer]] doesn't work - it outputs the word 'Answer' but doesn't
assert the semantics. I don't know if this is because of trying to do this
in the semantic template or something I've overlooked.

Any ideas very welcome.

                                        Alex


Markus Krötzsch-2 wrote:
> 
> On Mittwoch, 10. Dezember 2008, AlexLeBek wrote:
>> Hi,
>>
>> I would like to return pages from an inline query where a property has
>> *not* been set. 
> 
> This is not possible in SMW. If you use templates, however, you can 
> automatically set a property that indicates this lack of information, and 
> which can then be queried. For example, I have been using a string
> property 
> "lacks" and a template which assigns various values to this whenever a 
> relevant field was not set. One can use #if functions for checking if a
> value 
> was given.
> 
> If you do not use templates for creating annotations, you could still have
> a 
> (not quite as efficient) template at the page bottom which checks the
> presence 
> of the property value using a query. The template then again can set an 
> according "lacks" property or category.
> 
> These are the only solutions I see.
> 
> Cheers,
> 
> Markus
> 
>> In this case it is for managing an FAQ facility where
>> questions can be posed and answered by others. I would like to draw
>> attention to questions which still have no answers (perhaps using a minus
>> sign?):
>>
>> {{#ask: [[Category:FAQ]] [[Answer:: - ]]
>>
>> |?Question
>>
>> }}
>>
>> Is there a way to achieve this?
>>
>>                  Thanks
>>                                         Alex
> 
> 
> -- 
> Markus Krötzsch
> Semantic MediaWiki    http://semantic-mediawiki.org
> http://korrekt.org    [EMAIL PROTECTED]
> 
> 
>  
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Semediawiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Semantic-search---is-it-possible-to-return-pages-where-a-property-has-*not*-been-set--tp20932477p20936344.html
Sent from the Semantic Mediawiki - Development mailing list archive at 
Nabble.com.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to