Smwplussandbox/Query for data

F red always has much work to do and finds it very handy to overview his tasks in well-arranged tables. For this, he wants to create a table that not only contains all relevant information, but also gets automatically updated everytime something has changed or was created. You can help him to create the table by using one of SMW+/Halo's basic features: the Query Interface.

= Open the QueryInterface =
 * 1) Select from the Articles and data-menu the menu item QueryInterface
 * Queryinterface_menu.png
 * 1) The QueryInterface opens.
 * TUT firstannotation10.png

Result: the QueryInterface is open and you can start building your query.

= Build the query =
 * 1) Click Add category. Like in the Data Toolbar you can press +  +  to use autocompletion.
 * 2) Enter Smwplussandbox/Task
 * 3) Click Add.
 * 4) Below the section Result preview you should now see all articles ("instances") that contain the category tag "Smwplussandbox/Task". You will also notice your new task "Update screenshots":
 * TUT firstannotation11.png
 * 1) In order to restrict the results to Freds tasks, you click on Add property
 * 2) Enter Smwplussandbox/Assigned to
 * 3) Activate the checkbox Show in results to list the property values in the result preview
 * 4) Activate the checkbox Value must be set to get only results that have explicitly this property
 * 5) Activate the radiobutton Specific value
 * 6) Enter User:Fred in the field property value
 * 7) Click Add. Your screen should look similar to this:
 * TUT firstannotation12.png
 * 1) Open again the Result preview to verify that it contains only tasks that belong to Fred.

Result: You have created a query for all tasks that belong to a Fred.

You can add more properties (e.g. End date, description...) if you like and do this via trial and error in the Query Interface until you are satisfied with the results. And if you have the Semantic Result Formats extension installed, you can also use timelines, 3d-bars, pie-charts, maps etc. to visualize the data.

= Embed a query into an article =
 * 1) Open the article that you have created in Lesson 1: Create articles.
 * 2) Open the article in the WYSIWYG editor by clicking on the "Edit"-tab.
 * Edittab.png
 * 1) Place the cursor somewhere in the text of the article.
 * 2) Click on the "Query Interface" icon to open the Query Interface.
 * WWqueryinterface.png
 * 1) The Query Interface must be visible as an overlay in the WYSIWYG editor.
 * TUT firstannotation10.png
 * 1) Click Add category. Like in the Semantic Toolbar you can press +  +  to use autocompletion.
 * 2) Enter Smwplussandbox/Task
 * 3) Click Add.
 * 4) Below the section Result preview you should now see all articles ("instances") that are assigned to the category "Task". You will also notice your new task "Update screenshots":
 * TUT firstannotation11.png
 * 1) Click on the button "Insert Query" (located at the bottom of the overlay) to embed the query result into the article.

Result: the query result is embedded into your article.

= Next Lesson =

Part of bundle::Smwplussandbox