Examples/Queries/Subobject to display table rows

From semantic-mediawiki.org
< Category:Examples
Examples/QueriesExamples/Queries/Subobject to display table rows

This page shows an example on how to query for data stored in a subobject and to display the results in a table.

NoteNote:


{{#ask:
 [[-Has subobject::{{PAGENAME}}]] 
 | mainlabel=-
 | ?Assignment
 | ?Assignee
 | ?AddedDate = Added
 | ?Status
 | ?DueDate = Due
 | index=0
 | link=all
 | format=broadtable
 | headers=plain
 | class=sortable wikitable smwtable
 | default=no project / task found
}}
AssignmentAssigneeAddedStatusDue
Task 03MS12 March 2015Overdue14 December 2015
Task 02MZ10 March 2015As planned31 March 2018
Task 01MZ10 March 2015Open31 March 2016
Task 03MS10 March 2015Overdue26 November 2015

The subobject corresponding to the first line in the results table above:

{{#subobject:
|Assignment=Task 01
|Assignee=MZ
|AddedDate=2015/03/10
|Status=open
|DueDate=2016/03/31
|Notes=Task 02
|Project=IT-Project/ZI TEST 01
}}

See also[edit]