• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Any Wiki gurus? Need help with search.

lozina

Lifer
I'm working with a wiki site that uses infobox templates, which have various properties, so we'd use it like:

{{infobox test | propery1=ding | property2=bam}}

Now, I would really love to be able to construct a ask query where I query for values of these infobox entries.

Something like:\

{{#ask: [[Category:whatever]] [[property1::ding]]}}

this should automatically pull me a link to that page using the infobox example above since it's property1 value is ding.

But that syntax is not working, only if I explicitly put [[property1::ding]] somewhere on the page itself does it work, but I dont want to do that manual work on every page.

Any suggestions?


It's weird, if I do this:
{{infobox test
|property1=10
|property2=Black
}}

then the query:
{{#ask: [[propery1::10]]}}

works, it finds the article.

but the query:
{{#ask: [[propery2::Black]]}}

Does not work and I dont understand why, I checked and double-checked the spellings and everything
 
Last edited:
I think I figured out what I was doing wrong... in my template I should have created printed the properties within one of those named square bracket tabs, so when I was thinking that doing:

|property2=Black

when I call my template would create a property named 'property2' for semantic search I was wrong.

In my template I just printed out the value by itself such as: {{{property2}}}

but if I wrap the template's printout within a named property bracket like:
[[property2::{{{property2}}}]]

then it works as I expected.

but it's weird why did the property1 search work fine without having to do this? maybe something to do with numbers being inherently handled automatically?

this stuff is confusing...
 
I don't know a huge amount about Semantic MediaWiki, but I may be able to partially clarify why that didn't work as you expected.

Suppose for the moment you have two templates, Template1 and Template2. As it happens, both can take a "width" parameter to control how big their container div is. Therefore a page using both templates might look like this:

Code:
{{Template1|width=100}}

{{Template2|width=200}}

If SMW tried to just take the template parameters and run with them, it would get an ambiguous (and meaningless) result.

As for why one template Just Worked and the other didn't, it may be something that the template is doing without you knowing it, or it could indeed be some extra magic built in for handling numbers. If you are comfortable posting the templates themselves (or a link), that would make things easier. But honestly I doubt you're going to get much better on this forum than the kind of idle speculation I've provided above.
 
Back
Top