Difference between revisions of "Ask"

From its-wiki.no
Jump to: navigation, search
(Title::Explanation of Semantic MediaWiki ask function)
(Title::Explanation of Semantic MediaWiki ask function)
Line 1: Line 1:
 
=[[Title::Explanation of Semantic MediaWiki ask function]]=
 
=[[Title::Explanation of Semantic MediaWiki ask function]]=
 +
{{TOCright}}
 
see also [[Test-Ask]] for invers properties, e.g. <nowiki> [[-Has mother::Michael]] </nowiki>
 
see also [[Test-Ask]] for invers properties, e.g. <nowiki> [[-Has mother::Michael]] </nowiki>
  

Revision as of 21:19, 8 July 2017

Explanation of Semantic MediaWiki ask function

see also Test-Ask for invers properties, e.g. [[-Has mother::Michael]]

help page

http://semantic-mediawiki.org/wiki/Help:Selecting_pages, including " ::>, ::! "

output to vcard

Warning: exports all users on this wiki ... further results

for errors, see Josef_Noll

Example

 {{#ask:[[Category:User]]
 |?=search for users#
 |?User
 |?Date
 |?Title
 |format=broadtable
 |limit=5
 |offset=1
 |link=all
 |sort=User count
 |order=descending
 |headers=plain
 |mainlabel=search for users
 |intro=results
 |outro=done
 |searchlabel=… further results
 |default=no results found
 |class=sortable wikitable smwtable
 }}

<!--- ask with OR connection, as used in Template:User --->
{{#ask: [[Supervisor::{{SUBJECTPAGENAME}}]] OR [[Lecturer::{{SUBJECTPAGENAME}}]] OR 
[[User::{{SUBJECTPAGENAME}}]] OR [[{{SUBJECTPAGENAME}}]]

ommit main label: | mainlabel=- |

{{#show: Berlin | ?population }} 

Tips and Tricks

Recommendation from Neill: I always hide the raw page name as much as possible and use aliases so queries return more user friendly links.

{{#set:Page Link=[[{{FULLPAGENAME}}|{{{Page Title|}}}]]}} where Page Title is usually a field in the form. Sometimes I prepend with a section ID {{#set:Page Link=[[{{FULLPAGENAME}}|{{{Section ID|}}}-{{{Page Title|}}}]]}}

Then in the queries I return Page Link and use mainlabel=- to suppress the raw page name field.

{{#ask: |?Page Link .. .. |mainlabel=- }}

Note:

  • <section id="main"> <!-- main page content goes in here --> </section>
  • define Page Link as a Special:Property

email list

Example is taking for project IoTSec, here only science people

Bernt A. Bremdal <bernt@xalience.com>, Christian Johansen <cristi@ifi.uio.no>, Christian Resell <chrifres@ifi.uio.no>, Danica Radovanovic <danica@basicinternet.org>, Dieter Hirdes <dieter.hirdes@ncesmart.com>, Elahe Fazeldehkordi <elahe.fazeldehkordi@its.uio.no>, Getinet Ayele Eshete <getina15@student.uia.no>, György Kálmán <gyorgy.kalman@its.uio.no>, Habtamu Abie <habtamu.abie@nr.no>, Hamed Arshad <hamedar@ifi.uio.no>, Hanne Cecilie Geirbo <hannege@ifi.uio.no>, Hans Jørgen Furre Nygårdshaug <hans.nyg@gmail.com>, Heidi Tuiskula <heidi.tuiskula@smartinnovationnorway.com>, Håkon Duus <hakondu@ncesmart.com>, Ivar Rummelhoff <Ivar.Rummelhoff@nr.no>, Jayaprakash Rajasekharan <jayaprakash.rajasekharan@ncesmart.com>, Johanna Johansen <johanna@johansenresearch.info>, Josef Noll <josef.noll@its.uio.no>, Kaniz Fatema Tuly <kftuly@yahoo.com>, Kim Jonatan Wessel Bjørneset <kjbjorne@ifi.uio.no>, Kristin Vinje <>, Linn Eirin Paulsen <rocklinn@gmail.com>, Maghsoud Morshedi <morshedi.m@gmail.com>, Maunya Doroudi Moghadam <maunyad@its.uio.no>, Ming-Chang (Leo) Lee <mingchang1109@gmail.com>, Naji Ahmed Kadah <naji87@gmail.com>, Olaf Owe <olaf@ifi.uio.no>, Ole Gabrielsen <ole.gabrielsen@ncesmart.com>, Paal Engelstad <paal.engelstad@ffi.no>, Pallavi Kaliyar <>, Peder Aursand <Peder.Aursand@nr.no>, Rabie Belahcen <rabiebelahcen@gmail.com>, Rune Winther <rune.winther@multiconsult.no>, Seraj Fayyad <serajf@ifi.uio.no>, Shukun Tokas <shukunt@ifi.uio.no>, Sigurd Eskeland <Sigurd.Eskeland@nr.no>, Stein Gjessing <stein.gjessing@ifi.uio.no>, Stian Løvold <>, Svetlana Boudko <>, Syead Nusrat Nur <syeadnn@ifi.uio.no>, Toktam Ramezani <tk.ramezani@gmail.com>, Toktam Ramezanifarkhani <tk.ramezani@gmail.com>, Yan Zhang <yanzhang@simula.no>, Åsmund Skomedal <asmund.skomedal@nr.no>, Øivind Berg <oivind.berg@ncesmart.com>

Example

ongoing projects, based on [[Category:Project]] [[Due_date::> {{#expr:{{#time: Y|now}}}}]]

recent pages


pages from 2013


recent pages in slideshow

Note: format=slideshow is supported in this version, and shown in:

recent pages, random

[[modification date::+]] shows only pages that exist (not deleted ones)

  1. FEV PL
  2. SRI Privacy Trust
  3. List of Action Items
  4. NorwegianCounties.png
  5. Martin Flate
  6. ... further results

The part "{{{ns}}}" of the query was not understood. Results might not be as expected.

Variables