Help:FormattingResults

Jump to: navigation, search

Ask Queries are used to pull results from semantic wiki content and can be displayed in a variety of formats. This page lists examples of the more common formats with the code used to generate them and when applicable, links to eternal help documents describing the options available for each format.

When writing an ask query, one specifies the format with |format=. The examples below contain the ask query code used to generate them, including the format declaration.


UL

{{#ask:[[Category:Tools]] 
[[ProgramTopics::Resource assessment]] 
[[ProgramResources::Dataset]] 
[[Sector::Biomass]]
|format=ul 
|limit=4
}}


format = ul

More Info

Google Pie Charts

{{#ask:[[Category:Geothermal Project Types]] 
[[Geothermal/ProjectTypeTopic2Count::>0]]
|?Geothermal/ProjectTypeTopic2Count
|width=500
|height=400
|legend=left
|legendfontsize=10
|enableTooltip=false
|id=LabCallTech
|selectable=true
|format=google-piechart
}}


format = google-piechart

More Info

Outline

{{#ask:[[Category:References]]
 |?Document type
 |format=outline
 |outlineproperties=Document type
 |sort=Document type
 |order=des
 |limit=3
}}


format = outline

An Outline is more or less an organized ul.

Calendar

{{#ask: [[EndDate::+]] 
[[EndDate::>{{#calendarstartdate:}}]] 
[[EndDate::<{{#calendarenddate:}}]]
|?EndDate
|format=calendar
|offset=0
}}


format = calendar

The {{calendarstartdate}} and {{calendarenddate}} parser functions will limit the search results to the portion of the calendar visible to the user, improving performance.

More Info

Timeline

You need to have JavaScript enabled to view the interactive timeline. Further results for this query.
{{#ask:[[Category:Events]]
|? Event/Date
|sort=Event/Date
|order=desc
|format=timeline
|timelinebands=WEEK,MONTH,YEAR 
|timelineposition=today
|timelinesize=200px
|limit=200}}


format = timeline

More Info

Gallery

… further results
<div style="border:1px solid #AAAAAA; 
height:200px; overflow:auto;margin:0 auto;">
{{#ask: [[Category:Map_Files]] 
[[File/RelatedTechnology::Biomass]]
|format=gallery
|limit=6
|perrow=3}}


format = gallery

More Info

Google Map

Loading map...
{{#ask:[[Category:Energy Generation Facilities]][[Sector::Wind energy]]
|?Coordinates
|?FacilityStatus
|limit=2500
|format=map
|icon=File:Windturbine.png
}}


format = googlemaps2

More Info

Geochart

Programs & Projects by Country
{{#ask:[[Category:Countries]][[NumberOfPrograms::>1]]
|?NumberOfPrograms=Programs & Projects
|format=google-geochart
|limit=300
|width=500
}}


format = geochart

More Info

OpenEI custom parameters
  • target=Target page that state or country will be added (eg. target=/Incentives ) Example: Map of Incentives in the United States
  • targetpos=Position to add state to the target page (before or after page name). (eg. target=pre). Checks for pre, defaults to post.
  • valueformat=Format for the displayed value (eg. $%s )