Re: Pluralize plurals

2015-09-25 21:23 GMT+02:00 Tomasz Pluskiewicz <tomasz@t-code.pl>:
>
> I don't agree. JSON-LD naturally stems from the JavaScript land, where
> JSON also originated. JavaScript is often used in a way where a given
> parameter accepts either a single element or an array.


That might be, but in order for Hydra to be interoperable with less dynamic
languages like Java, C#, etc., properties should either be singular or
plural. That is, their type should either be a single item or an array, not
both.


> In such cases I would expect a singular form. For example in knockout
> validation it is possible to supply a single custom validator or an array
> [1]. . Plural would mean that an array is always expected, which is not
> true.
>

Using an array would mean a plural form would always be right, but you
could still have only one item in the array, meaning you still support the
use-case of only having a single validator. If you want multiple values,
use an array, even though the array may contain only one item.


> To back it up, consider a JSON-LD document, where a property is defined as
> "@container": "@set" (or list). Both a single element or JSON array produce
> equal expanded JSON-LD and triples. See playground examples [2] and [3].
> Thus I think that it isn't necessary to do what you propose and may
> arguably be less confusing than you fear.


Synonymous words to "list", such as "collection", "array", "set",
"dictionary", "matrix", etc., naturally have a singular form even though
their type takes some sort of plural form, because the words themselves
describe the outer data structure and not in any way what the semantics of
the items within the structure mean.

So while the type of a property called "operations" naturally can be of a
type "@set" in singular form, the correct spelling of "operations" would be
in plural form to indicate that "this is a property whose data type is
@set, where each item in the set is an operation".

You should not have to reflect on the value of the property to understand
the semantics of the property, imho. Since we're able to map this in
JSON-LD, I think we should.

-- 
Asbjørn Ulsberg           -=|=-        asbjorn@ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»

Received on Friday, 25 September 2015 22:52:35 UTC