Closed lanthaler closed 10 years ago
I can create a pull request for this if you'd like me to.
+1
I can create a pull request for this if you'd like me to.
Pull requests are always welcome :-)
Great, I'm on it. Give me a couple of days.
Progress (can be tracked in my personal singular branch):
Is there any way we can move on this issue (pull request #34)? The singularization is OK except for hydra:statusCodes, which is a separate issue (#27).
The faster we do this, the less chance that the old pluralized properties are actually being used. What happens to hydra:statusCodes is a different story anyway.
+1
On Friday, February 14, 2014 11:42 AM, Ruben Verborgh wrote:
Thanks a lot for taking a stab at this Ruben. Much appreciated. It LGTM but as you say
[...] the statusCodes issue needs fixing before it can be singularized: https://github.com/HydraCG/Specifications/issues/27
Is there any way we can move on issue 25 (pull request 34)? The singularization is OK except for hydra:statusCodes, which is a separate issue anyway (27).
Does anyone object to merge PR #34 [1]?
If we do so now, we end up with a slightly inconsistent vocabulary as hydra:statusCodes is the only property in plural. We also end up having a couple properties that differ from types only in their capitalization (ISSUE-28 [2]).
I'll wait a couple of days to give everyone a fair chance to object. If there aren't any any objections, I'll go ahead and merge it (likely on Friday).
[1] https://github.com/HydraCG/Specifications/pull/34 [2] https://github.com/HydraCG/Specifications/issues/28
Markus Lanthaler @markuslanthaler
_Raised by Ruben Verborgh:_
Dear all,
TL;DR: Since the range of the following properties is not a list, I think they should be singular:
In the RDF data model, a property creates a relation between a subject and an object. For instance, :subject :hasP :object means that “subject has object as P". We see examples of that in all popular vocabularies. Examples: RDF – :me rdf:type foaf:Person, foaf:Agent. FOAF – :me foaf:interest, :Web, :Hypermedia. Dublin Core – ;document dc:hasPart :part1, :part2.
As you can see, it doesn't matter whether one or multiple properties are expected: multiple objects can be attached to the same subject; but all are different relations. The property is singular because it describes a relation between two (singular) things. The only time we would encounter a plural, is if the object is a list/collection.
If we look at Hydra, this is not defined as one would expect:
This can lead to situations such as
So the “mappings” of /issues{?q} is actually a single mapping. Or in other words: /issues{?q} has "mappings” :q, but :q is only a single mapping, not a collection of mappings. Let me trim down the example to show this contradiction better:
Either :q should be hydra:IriTemplateMappings, or the property should be singular: "hydra:mapping".
The case of “statusCodes” shows to how much confusion this leads: we have both a “statusCode” and a ”statusCodes” property. The situation would be that a resource can lead to “statusCodes" X, Y, Z, each of which have a “statusCode” 200, 400, 500, respectively. I think the correct way is that “statusCodes” becomes “status”, and that the current statusCode remains the way it is.
I would strongly suggest that all of the aforementioned properties are turned into singular; that would align Hydra with the best practices of all other vocabularies. I know that changing this can be a pain, but I think it's important we do this.