Hello,
I am encountering [[SMW::off]] ... [[SMW::on]] in my query results and I'm
trying to understand if it's my query at fault, or whether it's how I am using
#ask, or something else. I wonder if I should just rip the code out of
(SMW_QueryPrinter.php) that generates these two unusual *links*.
-------------------------------------------------
>From expandTemplates, operating upon page "Category:AB-49 Expert witness
services, other":

{{#vardefineecho:industries|{{#ask:[[:Category:+]] [[:{{FULLPAGENAME}}]]
|?Industry#|format=template|template=Temp|mainlabel=-}}}}

which then is fed into
{{#ask: [[Business:+]] [[Industry::{{#var:industries}}]]}}

The "template:Temp" is...
:{{#multireplace:{{{1}}}|/, Category:/={{#!:||}}}}

which yields: (this is the vardefineecho...)
[[SMW::off]]
:Category:11. Agriculture, Forestry, Fishing & Hunting||21. Mining||22.
Utilities||23. Construction||31. Manufacturing||42. Wholesale Trade||45. Retail
Trade||48. Transportation & Warehousing||51. Information||52. Finance &
Insurance||53. Real Estate & Rental & Leasing||54. Professional, Scientific &
Technical Services||55. Management of Companies & Enterprises||56.
Administrative Support & Waste Management Services||61. Educational
Services||62. Health Care & Social Assistance||71. Arts, Entertainment &
Recreation||72. Accommodation & Food Services||81. Other Commercial
Services||92. Public Administration[[SMW::on]]

Here are some details:
1. MediaWiki 1.15.1 & Semantic MediaWiki (Version 1.5g-SVN)
2. Service-related categories each have a multivalued Industry property (of type
Page).
3. Industry-related categories are referenced by said Industry property.
4. Companies each have an Industry property (of type Page).
5. Ultimately I want a list of all companies in all industries associated with a
given service.
6. Subqueries don't work, eg
{{#ask:
[[Business:+]][[Industry::<q>[[:Category:+]][[:{{FULLPAGENAME}}]]|?Industry|main
label=-</q>]]}} because subqueries don't allow any options such as |?Industry
and |mainlabel.

The easiest solution, to me, is to specify
{{#ask:
[[Business:+]][[Industry::<q>[[:Category:+]][[:{{FULLPAGENAME}}]]|?Industry|main
label=-|sep=OR</q>]]}}
where the disjunction operator is specified as the *separator* between result
items. But it appears that the 'sep' parameter is ineffective when results are
the values of a property of a page or set of pages.

Further, oddly there is a x0Dx0A between [[SMW::off]] and the returned result
text, which I'm having a devil of a time removing via regex, so I get SMW errors
when executing {{#ask: [[Business:+]] [[Industry::{{#var:industries}}]]}}.

So I'm wondering if it's right to:
1. rip out the two links in the  SMW_QueryPrinter.php  code & rip out whereever
the x0Dx0A chars are being inserted
2. fix subqueries so that the sep parameter can be used to specify a disjunction
of links
3. fix result formats to detect that a single column is to be formatted,
formatting then applicable to each value

Thanks very much for your comments
John


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to