From: trueskew <tru...@gm...> - 2010-07-16 16:24:14
|
This is the second time I've asked this, although the first time was (even more?) confusing without a working example. I know I could do this if I made each property value a category, but that's obviously a tedious thing to have maintain and add to. Still, for me the feature is worth it. Is this just not possible with property values, or so easy that it's not worth replying to? Do I need to start learning PHP if I want this parameterized search feature? -----Original Message----- From: trueskew [mailto:tru...@gm...] Sent: Wednesday, July 14, 2010 5:24 PM To: 'Semantic MediaWiki Users' Subject: RunQuery and Allowed Property Values Inventory: ------------- - Property: Has BuildMaterial with allowed values Wood, Metal, Plastic, Ceramic, Marble, Concrete - Property: Has BuildLocation with allowed values Attic, 3rd Floor, 2nd Floor, 1st Floor, Basement - Property: Has BuildCost with allowed values $, $$, $$$, $$$$, $$$$ - Category / Template / Form: BuidClassifier - Fill in and store BuildClassifier pages. Each may have multiple values for BuildMaterial and BuildLocation, and 1 value for BuildCost - Template / Form: BuildQuerier - Used with RunQuery to find BuildClassifier pages that match selected property values scratchpad: ------------- I've got the above and some test pages on http://scratchpad.referata.com/wiki/Category:BuildClassifier and I have my RunQuery form here: http://scratchpad.referata.com/wiki/Special:RunQuery/BuildQuerier (There were some error messages yesterday associated with RunQuery that Yaron fixed. Today I'm getting this on every page (mine and others): Notice: Undefined property: Title::$isApprovable in /home/yaron57/public_html/w/extensions/ApprovedRevs/ApprovedRevs_body.php on line 56 but it seems to be working) Problem: ------------- My goal for the RunQuery form is to be able to check off build materials and/or build locations and get back 2 lists. The first list is an AND list. For example, if WOOD and METAL are selected for BuildMaterial and ATTIC is selected for BuildLocation, all pages that include all 3 are listed (even if the pages include additional materials or locations). The second list is an OR list (... WOOD or METAL or ATTIC or any combniation). Unfortunately my queries are wrong and don't do what I'm after. Here's the AND version (which matches the OR version at this time): {{#ask: [[Category:BuildClassifier]] {{#if:{{{BuildMaterial|}}} | [[Has BuildMaterial::{{{BuildMaterial|}}}]] }} {{#if:{{{BuildLocation|}}} | [[Has BuildLocation::{{{BuildLocation|}}}]] }} |mainlabel={{PAGENAME}} |?Has BuildMaterial=Build Material |?Has BuildLocation=Build Location |?Has BuildCost=Build Cost |format=table }} I don't know how to achieve what I'm after. If anyone knows the solution, please le me know. And feel free to edit the template (http://scratchpad.referata.com/w/index.php?title=Template:BuildQuerier&acti on=edit) if you like. Thanks for reading. - skew |