OBO-Edit: Arcana for User's Guide

From GO Wiki
Jump to: navigation, search

This is a page that includes information that is vital for the OBO-Edit 2.0 user's guide, and would be very difficult to discover through simple poking around:

Renderer Expression Format

It's possible to specify OBO-Edit renderers in HTML code. Most renderers are implemented in this way behind the scenes, but users can specify their own html code directly (using the "HTML Code" checkbox on any renderer configuration screen). This HTML code is standard HTML, with the addition of some special purpose expressions. These expressions are always enclosed between $ characters (e.g. $name$), and are of two types:

Search Criterion IDs

Any renderer specification can include a search criterion identifier, enclosed in $ characters. The available search criteria ids in any OBO-Edit session can be discovered with the code:

for(SearchCriterion<?> crit : FilterManager.getManager().getCriteria()) {
    System.out.println(crit.getID());
}

Jen: What do we do with this code?

The search criterion id may be provided on its own (e.g. $name$), or it may include parameters in parentheses (e.g. $synonym(<li><i>no_synonyms</i>, *, <li>$item$)$). Search criteria may have up to three parameters, explained below. If any parameter is omitted, its default value is automatically used. Parameters

  1. Default value - The text to display if there are no values for this search criterion, or if an out-of-range index is given for the second parameter. The default value for this parameter is an empty string.
  2. Value index- The index of the value to use if this search criterion returns multiple values. If the value of this parameter is *, all the values are used and displayed according to the formatting specified in the third parameter. The default value for this parameter is 0.
  3. Repeated value expression - Another html expression used to format multi-valued search criteria. This expression will be repeated for each value of the given search criterion. In this expression, the variable $item$ will be replaced with the current search criterion value.

Results from other renderers

A term may match several HTML renderers, so most HTML renderers will be written to wrap HTML data generated by some other renderer with additional HTML. The output from any nested renderers is wrapped in the $term$ variable. So, for example, the following renderer expression would take the result of any previous renderers and append the word "obsolete" in italics after it:

$term$ <i>(obsolete)</i>

HTML Expression Format

The Ontology Editor Panel, Graph Editor, and Global Filter Manager allow users to specify an "HTML Expression" - the basic html expression used as the starting value for all other renderers. This expression uses the exact same syntax as the renderer expressions described above, except that the $term$ variable is not available, because there are no previous renderer values to access.