SMW notes: Difference between revisions

715 bytes removed ,  19 April 2011
Undo revision 3647 by Osejisycym (talk)
No edit summary
(Undo revision 3647 by Osejisycym (talk))
 
Line 1: Line 1:
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://akekuqegify.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
----
=[http://akekuqegify.co.cc CLICK HERE]=
----
</div>
Some tips and tricks for using Semantic Mediawiki from SMW mailing list, various web sites, etc.
Some tips and tricks for using Semantic Mediawiki from SMW mailing list, various web sites, etc.


Line 67: Line 59:
a page. It looks like this:
a page. It looks like this:


  &lt;nowiki&gt;{{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }}
  <nowiki>{{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }}
(silent) or
(silent) or
  {{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} (with output)&lt;/nowiki&gt;
  {{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} (with output)</nowiki>


Further down in the page you can write
Further down in the page you can write


  &lt;nowiki&gt;{{ #var: some_variable_name }}&lt;/nowiki&gt;
  <nowiki>{{ #var: some_variable_name }}</nowiki>


=== Specific searches ===
=== Specific searches ===


   &lt;nowiki&gt;
   <nowiki>
   &lt;inputbox&gt;
   <inputbox>
   type=search
   type=search
   width=30
   width=30
Line 85: Line 77:
   bgcolor=#cee0f2
   bgcolor=#cee0f2
   break=no
   break=no
   &lt;/inputbox&gt;
   </inputbox>
   &lt;/nowiki&gt;
   </nowiki>


(requires the Input Box extension)
(requires the Input Box extension)
Line 108: Line 100:
== SMW tricks ==
== SMW tricks ==


&lt;nowiki&gt;[[Went past deadline::{{#expr:{{{End date|}}}&gt;{{{Deadline|}}} }}]]&lt;/nowiki&gt;
<nowiki>[[Went past deadline::{{#expr:{{{End date|}}}>{{{Deadline|}}} }}]]</nowiki>


=== Remote data ===
=== Remote data ===
Line 124: Line 116:
=== Hiding set data ===
=== Hiding set data ===


   &lt;nowiki&gt;[[propertyA::{{{propertyA|}}}|]]&lt;/nowiki&gt;
   <nowiki>[[propertyA::{{{propertyA|}}}|]]</nowiki>


By adding the | after the enclosing }}}, the property value will not show.
By adding the | after the enclosing }}}, the property value will not show.
Line 130: Line 122:
For multi value properties:
For multi value properties:


   &lt;nowiki&gt;{{#arraymap:{{{Eating disorders behaviors|}}}|,|x|[[Eating disorders behaviors::x|:x]]}}&lt;/nowiki&gt;
   <nowiki>{{#arraymap:{{{Eating disorders behaviors|}}}|,|x|[[Eating disorders behaviors::x|]]}}</nowiki>


(why not just use #set?)
(why not just use #set?)
Line 138: Line 130:
(from Markus Kr?tzsch)
(from Markus Kr?tzsch)


* make a new property &quot;has checked&quot; of type page,
* make a new property "has checked" of type page,
* make and a new page &quot;main page news editor&quot; (or whatever) and protect this page just like your main page,
* make and a new page "main page news editor" (or whatever) and protect this page just like your main page,
* add an entry &lt;nowiki&gt;[[has checked::some page]]&lt;/nowiki&gt; on &quot;main page news editor&quot; for every page that the editor has found to be okay to make it on the main page news feed,
* add an entry <nowiki>[[has checked::some page]]</nowiki> on "main page news editor" for every page that the editor has found to be okay to make it on the main page news feed,
* extend your #ask query on the main page with the condition &lt;nowiki&gt;[[-has
* extend your #ask query on the main page with the condition <nowiki>[[-has
checked::main page news editor]]&lt;/nowiki&gt;.
checked::main page news editor]]</nowiki>.


... Note that you can also have a group of editors with separate (protected)
... Note that you can also have a group of editors with separate (protected)
pages. You can also work with categories of editors for different topics etc.
pages. You can also work with categories of editors for different topics etc.
Of course, this is no longer a spam protection since categories are not
Of course, this is no longer a spam protection since categories are not
protected either, but you can use another level of &quot;has checked&quot; to have a
protected either, but you can use another level of "has checked" to have a
master editor who checks other editors to grant them trust. All of this
master editor who checks other editors to grant them trust. All of this
readily works with subqueries+inverses. Applying similar methods but without
readily works with subqueries+inverses. Applying similar methods but without
Line 221: Line 213:
extension don't work in MW higher of 1.10.
extension don't work in MW higher of 1.10.


Alternatively I'm using the [http://enlloc.net/hkp/w/index.php/Plantilla:International &lt;nowiki&gt;{{international}}nowiki&gt; template]. It is useful
Alternatively I'm using the [http://enlloc.net/hkp/w/index.php/Plantilla:International <nowiki>{{international}}nowiki> template]. It is useful
for pages and templates but not for forms because it need a
for pages and templates but not for forms because it need a
&lt;nowiki&gt;{{SUBPAGENAME}}&lt;/nowiki&gt; with language code (/ca, /es, /en, /fr, /pt, ...).
<nowiki>{{SUBPAGENAME}}</nowiki> with language code (/ca, /es, /en, /fr, /pt, ...).


I'm using [http://enlloc.net/hkp/w/index.php/Plantilla:Entrada_Wlog my own code in templates] to show or hide a &quot;translation
I'm using [http://enlloc.net/hkp/w/index.php/Plantilla:Entrada_Wlog my own code in templates] to show or hide a "translation
button&quot; depending if the translation page exist or not:
button" depending if the translation page exist or not:


   &lt;nowiki&gt;{{#ifeq:{{SUBPAGENAME}}|es|
   <nowiki>{{#ifeq:{{SUBPAGENAME}}|es|
  {{exists | page={{NAMESPACE}}:{{BASEPAGENAME}}/ca | then= | else=
  {{exists | page={{NAMESPACE}}:{{BASEPAGENAME}}/ca | then= | else=
  &lt;p style=&quot;margin-top:2em; color: rgb(100, 100, 100)&quot;&gt;'''Traducci?n'''&lt;br&gt;[[Categoria:Per traduir al Castell?]]
  <p style="margin-top:2em; color: rgb(100, 100, 100)">'''Traducci?n'''<br>[[Categoria:Per traduir al Castell?]]
  &lt;small&gt;Esta p?gina a?n no est? en catal?n. Quieres colaborar a traducirla?&lt;/small&gt;&lt;/p&gt;
  <small>Esta p?gina a?n no est? en catal?n. Quieres colaborar a traducirla?</small></p>
  {{#formlink:Entrada Wlog traduir ca|Traducir al catal?n|button|
  {{#formlink:Entrada Wlog traduir ca|Traducir al catal?n|button|
  preload={{FULLPAGENAME}}&amp;Gesti? traduccions[p?gina
  preload={{FULLPAGENAME}}&Gesti? traduccions[p?gina
  original]={{BASEPAGENAME}}&amp;Entrada Wlog[llengua entrada]=es&amp;namespace=Wlog }}
  original]={{BASEPAGENAME}}&Entrada Wlog[llengua entrada]=es&namespace=Wlog }}
  }}
  }}
  }}&lt;/nowiki&gt;
  }}</nowiki>


Right now I have not solution for having only one form for all
Right now I have not solution for having only one form for all
Anonymous user