Judgment
s are an integral part of Taxonomy. They represent whatever you want to code about a Record
. More specifically, a Judgement
might be about the Record
, a Study
within a Record
, or about a Model
. To define a judgment you must supply a name, on which JudgementLevel
it is (Study
, Record
, Model
), some documentation (i.e., what it is you want to code), and optionally, type constrains, a function to check the validity (e.g., N can not be smaller than zero), and if the judgement can only be made once (unique
).
using Taxonomy
using Taxonomy.Judgements
## We can also do specific input checks, e.g. if we want to check if the input has a predefined value:
@newjudgement(
Access,
RecordJudgement,
"""
A judgement type that codes how accessable a paper is.
""",
AbstractString,
x -> x in ["open", "closed", "none"] ? nothing : throw(ArgumentError("Not an agreed upon value."))
)
Access("open")
Access("not open")
By default, Judments
are assumed to be unique, i.e., there can only be one. If specified more than once, such a Judgement will throw an error. Judgements with unique = false
are gathered into a vector.