dequelabs / axrl

Accessibility Reporting Language
https://dequelabs.github.com/axrl/
9 stars 3 forks source link

single-instance v multiple-instance properties #6

Open WilcoFiers opened 5 years ago

WilcoFiers commented 5 years ago

Feedback from Peter Durham:

The schema docs don't seem to distinguish between single-instance and multiple-instance properties, which sometimes makes the intent unclear (I haven’t dug into the details of JSON-LD yet so maybe it’s covered there? Looks like https://json-ld.org/ might be a good place for me to start learning more.)

WilcoFiers commented 5 years ago

This is a very valid point. RDF doesn't (to the best of my knowledge) have a way to express that a property can only have a single value. Multiple values are always allowed. Even something like TestResult.summary can have multiple values. For example, you can have a summary in English and in French.

What I've done is use plural language for things that expect a set. "tests", "results", "relatedTargets" as a way to signal when an array is predicted. We could make this explicit in the description as well, or maybe add some kind of "constraints" to properties, which we use to indicate that something has to be an array, or that it isn't allowed to be an array.

The other thing I can do is define these as a @set in the @context. That way they are always correctly normalised.