The TocCriteria class

class ferenda.TocCriteria(binding, label, pagetitle, selector, key, selector_descending=False, key_descending=False)

Represents a particular way of organizing the documents in a repository, for the purpose of generating a table of contents for those douments.

  • binding (str) – The variable name (binding) for that same predicate in the sparql results retrieved from the query constructed by toc_query().
  • label (str) – A text label for the entire set of toc for this criteria.
  • pagetitle (str) – A template string used together with whatever selector returns to form a full TOC page title, eg Documents starting with "%s".
  • selector (callable) – Function that takes a single dict (from toc_select()) and returns a single value used for grouping documents (eg. first letter of title, year-part of date, etc).
  • key (callable) – Function that takes a single dict and returns a value that can be used for sorting documents
  • selector_descending (bool) – Whether pagesets constructed by this selector should be sorted in descending (reverse) order
  • key_descending (bool) – Whether pages selected by this key should be sorted in descending (reverse) order