Difference between revisions of "Dynamic Page Generation"

From AIRWiki
Jump to: navigation, search
m
Line 2: Line 2:
  
 
For the complete documentation for inline queries see: http://semantic-mediawiki.org/wiki/Help:Inline_queries   
 
For the complete documentation for inline queries see: http://semantic-mediawiki.org/wiki/Help:Inline_queries   
 +
  
 
In this page you can find some examples of ad hoc queries that may be useful in this wiki.
 
In this page you can find some examples of ad hoc queries that may be useful in this wiki.
  
== All the Projects suggested by a given Tutor ==
 
  
  <nowiki>{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]]|?prjTitle = |format=ul}}</nowiki>
+
== All the Projects tutored by a given Tutor ==
 +
 
 +
specify all the conditions to be satisfied, followed by options separated by "|":
 +
 
 +
  <nowiki>{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]]|format=ul}}</nowiki>
  
You can see the result [[User:RiccardoTasso#Tutored_projects|here]]
+
This way the result will be displayed in "ul" format (a dotted list).
 +
You can see the result of the query [[User:RiccardoTasso#Tutored_projects|here]].
  
 
Note: <nowiki>{{PAGENAME}}</nowiki> is a variable which identifies the title of the current page.  
 
Note: <nowiki>{{PAGENAME}}</nowiki> is a variable which identifies the title of the current page.  
 
Putting this query inside a user's page, all projects tutored by that user will be shown as results.
 
Putting this query inside a user's page, all projects tutored by that user will be shown as results.
 +
 +
 +
To display just a link to the results, you can add an option specifying a limit of 0, and a searchlabel for the name of the link:
 +
 +
<nowiki>{{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]]| limit=0 | searchlabel=projects tutored by Riccardo Tasso}}</nowiki>
 +
 +
This way, a link to a dynamic page containing the results of the query will be created, with the name you choose in the "searchlabel" option: {{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]]| limit=0 | searchlabel=projects tutored by Riccardo Tasso}}
 +
 +
 +
To show more details about the results, you can add the properties you want to be displayed.
 +
For example, to display the student, research topic, the student and the start and end dates of a projects:
 +
 +
<nowiki>{{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]] | ?prjStudent = | ?HasResTopic = | ?PrjStarts = | PrjEnds  = | limit = 0 | searchlabel = projects tutored by Riccardo Tasso}}</nowiki>
 +
 +
The query generates this link: {{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]] | ?prjStudent = | ?HasResTopic = | ?PrjStarts = | PrjEnds  = | limit = 0 | searchlabel = projects tutored by Riccardo Tasso}}
  
 
== All master thesis proposals in a research area ==
 
== All master thesis proposals in a research area ==
Line 27: Line 47:
  
  
 +
An apposite template has been created for the visualization of project proposals
 
To show the results in the template [[Template:ProjectProposalViz|ProjectProposalViz]]:
 
To show the results in the template [[Template:ProjectProposalViz|ProjectProposalViz]]:
  
Line 49: Line 70:
  
 
You can see the result of this query [[Master_Level_Theses#Social_Software_and_Semantic_Web|here]].
 
You can see the result of this query [[Master_Level_Theses#Social_Software_and_Semantic_Web|here]].
 +
  
 
== All finished projects in a research topic, ordered by end date ==
 
== All finished projects in a research topic, ordered by end date ==

Revision as of 17:21, 9 October 2009

Semantic queries can be used to automatically generate lists and tables of items satisfying some requirements.

For the complete documentation for inline queries see: http://semantic-mediawiki.org/wiki/Help:Inline_queries


In this page you can find some examples of ad hoc queries that may be useful in this wiki.


All the Projects tutored by a given Tutor

specify all the conditions to be satisfied, followed by options separated by "|":

{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]]|format=ul}}

This way the result will be displayed in "ul" format (a dotted list). You can see the result of the query here.

Note: {{PAGENAME}} is a variable which identifies the title of the current page. Putting this query inside a user's page, all projects tutored by that user will be shown as results.


To display just a link to the results, you can add an option specifying a limit of 0, and a searchlabel for the name of the link:

{{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]]| limit=0 | searchlabel=projects tutored by Riccardo Tasso}}

This way, a link to a dynamic page containing the results of the query will be created, with the name you choose in the "searchlabel" option: projects tutored by Riccardo Tasso


To show more details about the results, you can add the properties you want to be displayed. For example, to display the student, research topic, the student and the start and end dates of a projects:

{{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]] | ?prjStudent = | ?HasResTopic = | ?PrjStarts = | PrjEnds  = | limit = 0 | searchlabel = projects tutored by Riccardo Tasso}}

The query generates this link: projects tutored by Riccardo Tasso

All master thesis proposals in a research area

To generate the results in a list, showing the research topic of each proposal:

{{#ask: [[Category:ProjectProposal]] 
[[PrjLevel::Bs]]
[[PrjType::Thesis]]
[[PrjResArea::Social Software and Semantic Web]] |
?PrjResTopic |
format=list
}}


An apposite template has been created for the visualization of project proposals To show the results in the template ProjectProposalViz:

{{#ask: [[Category:ProjectProposal]] 
[[PrjLevel::Bs]]
[[PrjType::Thesis]]
[[PrjResArea::Social Software and Semantic Web]] |
?PrjTitle |
?PrjImage |
?PrjDescription |
?PrjTutor |
?PrjStarts |
?PrjStudMin |
?PrjStudMax |
?PrjCFUMin |
?PrjCFUMax |
?PrjResArea |
?PrjResTopic |
format = template |
template = Template:ProjectProposalViz
}}

You can see the result of this query here.


All finished projects in a research topic, ordered by end date

{{#ask: [[Category:Project]][[prjResTopic::Folksonomies]][[prjStatus::Closed]]|?prjTitle = |sort=prjEnd|order=desc|format=ul}}

See the result here.