Difference between revisions of "Dynamic Page Generation"
DavidLaniado (Talk | contribs) m (→All master thesis proposals in a research area) |
DavidLaniado (Talk | contribs) m (→All master thesis proposals in a research area) |
||
Line 96: | Line 96: | ||
| format=list | | format=list | ||
}} | }} | ||
+ | |||
To generate a table in a dynamic page, showing the values of all the properties: | To generate a table in a dynamic page, showing the values of all the properties: | ||
Line 124: | Line 125: | ||
[[PrjResArea::Social Software and Semantic Web]] | | [[PrjResArea::Social Software and Semantic Web]] | | ||
?PrjTitle = | | ?PrjTitle = | | ||
− | |||
?PrjDescription = | | ?PrjDescription = | | ||
?PrjTutor = | | ?PrjTutor = | |
Revision as of 12:16, 10 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.
Contents
Examples of inline queries
All the Projects tutored by a given Tutor
Specify all the conditions to be satisfied[1], inside the #ask function:
{{#ask: [[Category:Project]][[prjTutor::User:LeonardoDaVinci]] }}
The result of this query is: Flying machine
Results in a list
Various parameters can be added in the command, each introduced by a "|". To display the results in a list, you can set the format option to "ul":
{{ #ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]] | format = ul }}
You can see the result of this 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.
Results in an external link
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, like this: projects tutored by Riccardo Tasso.
The results are displayed in a table (the default format).
Showing more attributes
To show more details about the results, you can add the properties you want to be displayed. For example, to display the students, research topic, and the start and end dates of a projects:
{{#ask: [[Category:Project]][[prjTutor::User:RiccardoTasso]] | ?prjStudent = Students | ?PrjResTopic = Research Topic | ?PrjStart = Start | ?PrjEnd = End | 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 }}
Result: A firefox extension for semantic annotations (topic: Semantic Annotations), Annotation aggregators from social applications (topic: Semantic Annotations), Extending a search engine with semantic information (topic: Semantic Search), Mining wikipedia categories (topic: Semantic Tagging), Social Network Data Extraction from Online Communities (topic: Social Network Analysis), Use case design and implementation for semantic annotations (topic: Semantic Annotations), Wikipedia Page Social Network (topic: Social Network Analysis)
To generate a table in a dynamic page, showing the values of all the properties:
{{#ask: [[Category:ProjectProposal]] [[PrjLevel::Bs]] [[PrjType::Thesis]] [[PrjResArea::Social Software and Semantic Web]] | ?PrjTitle = | ?PrjImage = | ?PrjDescription = | ?PrjTutor = | ?PrjStarts = | ?PrjStudMin = | ?PrjStudMax = | ?PrjCFUMin = | ?PrjCFUMax = | ?PrjResArea = | ?PrjResTopic = | limit = 0 | searchlabel = result table }}
See the result table
Visualizing results in a template
An apposite template has been created for the visualization of project proposals. To show the results inside the template:
{{#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 descending end date
{{#ask: [[Category:Project]][[prjResTopic::Folksonomies]][[prjStatus::Closed]]| ?prjTitle = |sort=prjEnd |order=desc |format=ul }}
See the result here.
Ask Page
In the page Special:Ask you can try any query, specifying conditions and printout options.