http://l10n.ro/index.php?title=Ajutor:What_can_i_do_with_the_query_interface%3F&feed=atom&action=historyAjutor:What can i do with the query interface? - Revizia istoricului2024-03-28T20:52:56ZIstoricul versiunilor pentru această pagină din wikiMediaWiki 1.28.0http://l10n.ro/index.php?title=Ajutor:What_can_i_do_with_the_query_interface%3F&diff=3071&oldid=prevReptila la 19 noiembrie 2009 06:542009-11-19T06:54:37Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='ro'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Versiunea anterioară</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Versiunea de la data 19 noiembrie 2009 06:54</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l97" >Linia 97:</td>
<td colspan="2" class="diff-lineno">Linia 97:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:De_actualizat|{{PAGENAME}}]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:De_actualizat|{{PAGENAME}}]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Categorie:Articole_de_redenumit|{{PAGENAME}}]]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:Articole_de_tradus|{{PAGENAME}}]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:Articole_de_tradus|{{PAGENAME}}]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:Ajutor|{{PAGENAME}}]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Categorie:Ajutor|{{PAGENAME}}]]</div></td></tr>
</table>Reptilahttp://l10n.ro/index.php?title=Ajutor:What_can_i_do_with_the_query_interface%3F&diff=3070&oldid=prevReptila la 19 noiembrie 2009 06:542009-11-19T06:54:12Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='ro'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Versiunea anterioară</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Versiunea de la data 19 noiembrie 2009 06:54</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l95" >Linia 95:</td>
<td colspan="2" class="diff-lineno">Linia 95:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The above image shows an example of disjunction. This query would return all articles that are either in the category book OR in the category movie. If you add one category Movie and one category book, conjunction is applied and the query would return only articles that are in both categories (for example “1984” by George Orwell, since this is a book as well as a movie).</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The above image shows an example of disjunction. This query would return all articles that are either in the category book OR in the category movie. If you add one category Movie and one category book, conjunction is applied and the query would return only articles that are in both categories (for example “1984” by George Orwell, since this is a book as well as a movie).</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Categorie:De_actualizat|{{PAGENAME}}]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Categorie:Articole_de_tradus|{{PAGENAME}}]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Categorie:Ajutor|{{PAGENAME}}]]</ins></div></td></tr>
</table>Reptilahttp://l10n.ro/index.php?title=Ajutor:What_can_i_do_with_the_query_interface%3F&diff=32&oldid=prev127.0.0.1: What can i do with the query interface?2007-11-14T23:25:48Z<p>What can i do with the query interface?</p>
<p><b>Pagină nouă</b></p><div>;Question<br />
:[[Question:=What can i do with the query interface]]?<br />
<br />
;Answer<br />
:[[description:=Use the QI to search the wiki, generate useful lists and tables containing facts from the knowledgebase.]]<br />
[[DiscourseState:=QueryInterface:view| ]]<br />
<br />
==Overview of the query interface==<br />
<br />
The query interface is a special page and can therefore be accessed on the page “Special:Specialpages”. When accessing this page, you can see the Query Interface (QI) in its initial state.<br />
<br />
[[Image:QI_InitialView.jpg|thumb|300px|Initial view of the query interface]]<br />
<br />
<br />
On the very bottom, there is the menu bar with the three main functions:<br />
*Preview query: A full preview of the current query, also considering the layout settings on bottom<br />
*Copy to clipboard: This button will copy the ask query to the clipboard. This will always work for Microsoft Internet Explorer Browsers. If you use Firefox, there might be a security question coming up. Depending on your local security settings, the “copy to clipboard” functionality will not be available at all.<br />
*Reset Query: This button will reset the current query and all its sub- and superqueries<br />
<br />
On top of the query interface to the left, you can see the query tree with a breadcrumbs navigation and the tree graph. The breadcrumbs navigation shows where you are in the structure of your current query. The tree shows the structure of the query and allows you to navigate through it by clicking the single items.<br />
<br />
[[Image:QI_QueryTree.jpg|frame|none|Query Tree of the main part of the query]]<br />
<br />
[[Image:QI_QueryTreeSub.jpg|frame|none|Query tree of a subquery]]<br />
<br />
In the middle of the QI, there is the main part of the interface where you can add further restrictions to your query. Right niext to this area, the context sensitive help is shown. For further information about context sensitive help, see [[Help:What_is_context_sensitive_help?]]<br />
Below the main area, you can see the table column preview. Most query results in SMW are shown in tables. This little window will give you an instant preview of which columns will appear in the result table of the current query.<br />
At the bottom, there is the query layout manager (QLM). The QLM supports you by defining the output format of your query, since there are many different possibilities.<br />
<br />
===Creating a sample query with the QI===<br />
This section of the user documentation will give a step by step example for creating a query with the QI. The example query used in this case is as follows:<br />
<br />
:''“Give me the number of inhabitants for every European Union capital”''<br />
<br />
First of all, we have to define what we look for and according to this choose a category. Of course, this choice always depends on the content and structure of the wiki. In this example, we will say that capitals are in the category “city”. The first step therefore is that we ask for this category. In every input field of the QI you can use auto completion in order to find appropriate inputs.<br />
<br />
[[Image:QI_Step1.jpg|frame|none|Step 1: Add category]]<br />
<br />
After clicking “OK”, the category will appear in the query tree. For every capital, we want to have the number of inhabitants, which is a property. The next step therefore is to add this property to the query.<br />
<br />
[[Image:QI_Step2.jpg|frame|none|Step 2: Add property]]<br />
<br />
As we would like to have the number of inhabitants printed out in the result table, we have to check “Show in result table”. Please be reminded that only properties in the main part of the query can be printed. Properties of subqueries can not be printed, therefore this checkbox will not appear. As value we enter “*” for all values, but this field can as well stay empty which would have the same effect.<br />
<br />
As stated in our query, we want only those cities that are capitals of countries which belong to the European Union. The word “which” is always a hint on a subquery. Therefore we have to create a subquery here.<br />
<br />
[[Image:QI_Step3.jpg|frame|none|Step 3: Add property with subquery]]<br />
<br />
To add a subquery, simple check the “Insert subquery” box next to the input field. Subqueries are only possible with properties that refer to another wiki page. If a property has for example Integer or Date as a type, subqueries are not possible.<br />
<br />
[[Image:QI_Step4.jpg|frame|none|Step 4: Query tree of the main query]]<br />
<br />
Now, the subquery can be edited. This happens by clicking “Subquery 1” in the tree view. You will then see a new empty tree which represents the contents of the subquery.<br />
This subquery will search for all Countries that are part of the European Union. Therefore, we will have to add the category “Country” and the property “is part of” with the value “European Union”.<br />
<br />
[[Image:QI_Step5.jpg|frame|none|Step 5: Query tree of a subquery]]<br />
<br />
By clicking on “Main” on top of the treeview, you can navigate back to the main part of the query. Before finishing the query, some layout parameters will be set. As a format, we choose table. The main label is the heading of the first table column. We will call this one city. Finally, we want our results sorted by the number of inhabitants in an descending order. <br />
<br />
[[Image:QI_Step6.jpg|frame|none|Step 6: Query Interface with the final query]]<br />
<br />
By clicking on “Preview results”, the results of the current query can be checked. In this case, there are only two cities in the database which are Berlin and Rome. The query is now finished and can be copied to the clipboard for further use in other articles.<br />
<br />
[[Image:QI_Step7.jpg|frame|none|Step 7: Preview of query results]]<br />
<br />
===The query layout manager===<br />
This section will give a short overview of the query layout manager and the meaning of the single options.<br />
<br />
{| class="prettytable" border="1" style="border-collapse:collapse;" cellpadding="5"<br />
! Layout option || Allowed values || What it does<br />
|-<br />
| Format || Table, bullet list, numbered list, list, count, timeline || Defines the output format of the query. Count means that only the number of results is displayed<br />
|-<br />
| Sort by || All columns that are shown in the result || Defines which column of the result table should be used to sort the results<br />
|-<br />
| Order || Ascending, descending ||Ascending or descending order<br />
|-<br />
| Link || Subject, all, none || Defines which parts of the result should be linked. Subject means only the first column is linked to the corresponding article.<br />
|-<br />
| Limit || Number || The maximum number of results shown. If there are more results, a link for a full result list will be provided automatically<br />
|-<br />
| Headers || Show, don’t show || Defines if the headers of the table are shown<br />
|-<br />
| Intro || Text || Text that appears before the results are displayed<br />
|-<br />
| Mainlabel || Text || Label of the first column of the result table<br />
|-<br />
| Default || Text || Text that will appear if there are no results<br />
|}<br />
<br />
===Advanced usage: conjunction and disjunction===<br />
Whenever you add a category, instance or property they are connected by conjunction. This means that all entered restrictions have to be true in order to appear in the result table. However, sometimes it is necessary to use a disjunction. This can be done by using the green plus sign next to an input field.<br />
<br />
[[Image:QI_Dis.jpg|frame|none|Using disjunction on a category]]<br />
<br />
The above image shows an example of disjunction. This query would return all articles that are either in the category book OR in the category movie. If you add one category Movie and one category book, conjunction is applied and the query would return only articles that are in both categories (for example “1984” by George Orwell, since this is a book as well as a movie).</div>127.0.0.1