From: Yaron K. <ya...@gm...> - 2009-07-24 16:30:31
|
Unfortunately, there's no book about Semantic MediaWiki, but it would be nice if there were, or at least some sort of online, printable, sequential manual... I feel like we're just now reaching the point where the whole system is stable enough that you could publish such a thing without it becoming out-of-date in two months. -Yaron On Thu, Jul 23, 2009 at 2:51 PM, Scott Reed <sr...@av...> wrote: > Thanks, Patrick. While I was hoping for a simpler syntax for getting a > property value without a fullblown query, but #vardefine and #var is a > useful addition to my toolkit. I see I need to review the extensions. > > *Can anyone recommend a book on these technologies, especially one > including Semantic MediaWiki?* > > Patrick Nagel [7/22/2009 11:50 PM] wrote: > > Hi Scott, > > On 2009-07-23 11:06, Scott Reed wrote: > > Jut starting out with this technology, the only way I have figured out > > to get the value of a property in the current page is > > {{#show:{{PAGENAME}}| ?propertyname}}. This seems fairly baroque. Is > > there simpler way? > > I don't think there is a simpler way. You will have to get used to all the > curly brackets when using SMW - or MediaWiki in general ;) > > You can make use of the VariablesExtension [1] and store the query (or its > result? I'd like to know which one, but in the end it doesn't really matter) in > a variable, which is helpful when you need the same query multiple times within > a page. It looks like this: > > {{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} > (silent) or > {{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} > }} (with output) > > Further down in the page you can write > > {{ #var: some_variable_name }} > > I found this to be very helpful in complex "output templates", helps to avoid a > lot of "code" duplication. > > Patrick. > > [1]: http://www.mediawiki.org/wiki/Extension:VariablesExtension > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > |