staticSearch
staticSearch copied to clipboard
Add schematron rules for document collection
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.