staticSearch icon indicating copy to clipboard operation
staticSearch copied to clipboard

Add schematron rules for document collection

Open joeytakeda opened this issue 3 years ago • 0 comments

Arising out of #73 and email conversation with @martindholmes, we have decided that we should add schematron validation for the document collection.

Some of the constraints that we've considered are:

  • All documents have an html/@id
  • Every class that starts with staticSearch_ has a supported suffix (bool, desc, num, date, feat)
  • Must have a @name with text
  • Must have a @content with text
  • Maybe check that there's only one staticSearch class (i.e. you can't have both staticSearch.desc and staticSearch.num).
  • Num filters: Must have a @content that's castable to an xs:decimal
  • Bool filters: Check @content that can be cast as a boolean (right now, everything can be cast to boolean since if it's not a truthy thing it's false). We might want to be more strict on that
  • Date filters: Must have a @content that can be properly formed as a date or date range and that the right hand is greater than the left hand.

joeytakeda avatar Feb 05 '22 00:02 joeytakeda