SMW queries and SocialEntity:385: Difference between pages

(Difference between pages)
No edit summary
 
No edit summary
Tag: 2017 source edit
 
Line 1: Line 1:
Here you can see some examples for simple queries using the  metadata of a wiki page. You can add these queries to any wiki page.
{
 
    "wikipageid": 590,
==Creating page lists==
    "namespace": 0,
 
    "titletext": "Reference:BlueSpiceSocial",
=== Show pages in a particular namespace ===
    "description": "",
<syntaxhighlight lang="text">
    "parentid": 0,
{{#ask:
    "id": 385,
[[:+]]  <!-- find all pages in the main namespace -->
    "ownerid": 6,
[[Modification date::+]]<!-- necessary to filter deleted pages -->
    "type": "wikipage",
|format=ul
    "archived": false,
|limit=4
    "tags": [
}}
        "Reference:BlueSpiceSocial"
</syntaxhighlight>Output example in list style format:<br />{{#ask:
    ],
[[:+]][[Modification date::+]]
    "resolved": false
|format=ul
}
|limit=4
}}
 
 
'''Notes:'''
 
 
<code><nowiki>[[:+]]</nowiki></code>                      shows pages from the ''Main'' namespace.
 
<code><nowiki>[[Myspace:+]]</nowiki></code>      shows pages from the namespace ''Myspace''.
 
<code><nowiki>[[:+||Help:+]]</nowiki></code>  shows pages from both the ''Main'' namespace and the namespace ''Help''  (=OR argument)
 
===Output in category style===
<syntaxhighlight lang="text">
{{#ask:
[[:+]][[Modification date::+]]
|format=category
|limit=12
}}
</syntaxhighlight>Output example:{{#ask:
[[:+]][[Modification date::+]]
|format=category
|limit=12
}}
 
===Show pages from a category===
<syntaxhighlight lang="text">
{{#ask:
[[Category:Administration]]
| limit=4
| searchlabel=
| format=ol
}}
</syntaxhighlight>
{{#ask:
[[Category:Administration]]
| limit=4
| searchlabel=
| format=ol
}}
 
===Pages that start with the same page name string===
<syntaxhighlight lang="text">
{{#ask:  
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=ol
}}
</syntaxhighlight>List of pages in the ''Main '' namespace and in the namespace ''Manual'' that begin with "Visu".
{{#ask:  
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=ol
}}
 
==Results format: Table==
 
===Format "broadtable"===
<syntaxhighlight lang="text">
{{#ask:  
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=broadtable
}}
</syntaxhighlight>
 
{{#ask:
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=broadtable
}}
 
 
===Format "datatable"===
<syntaxhighlight lang="text">
{{#ask:  
[[~Visu*]][[:+||Handbuch:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=table
| class=datatable
}}
</syntaxhighlight>
 
{{Messagebox|boxtype=important|Note text=The format declaration  <pre>|format=datatable </pre> currently does not work with the BlueSpice skin. Instead, use the following syntax:
<pre>
|format=table
|class=datatable
</pre>}}
 
{{#ask:  
[[~Visu*]][[:+||Manual:+]]
[[Modification date::+]]<!-- necessary to filter deleted pages -->
| limit=5
| searchlabel=
| format=table
| class=datatable
}}
 
{{Box Links-en|Topic1=[https://www.semantic-mediawiki.org/wiki/Help:Inline_queries SMW "ask" queries]|Topic2=[https://www.semantic-mediawiki.org/wiki/Help:Result_formats SMW result formats]}}<br />
 
[[Category:Organization]]
[[de:SMW-Abfragen]]
[[en:{{FULLPAGENAME}}]]

Latest revision as of 16:56, 20 May 2022



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions