- From: Ruben Verborgh <ruben.verborgh@ugent.be>
- Date: Tue, 28 Jan 2014 17:31:41 +0000
- To: public-hydra@w3.org
Dear all, TL;DR: Since the range of the following properties is not a list, I think they should be singular: - hydra:mappings - hydra:members - hydra:operations - hydra:statusCodes - hydra:supportedClasses - hydra:supportedOperations - hydra:supportedProperties This mail argues why plural properties are not a good idea. 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: { "@id": "hydra:mappings", "@type": "rdf:Property", "comment": "The variable-to-property mappings of the IRI template.", "domain": "hydra:IriTemplate", "label": "mappings", "range": "hydra:IriTemplateMapping", "status": "testing" }, This can lead to situations such as :Template hydra:template "/issues{?q}" ; hydra:mappings :q. :q a hydra:IriTemplateMapping; hydra:property hydra:freetextQuery; hydra:required true; hydra:variable "q" . 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: :Template hydra:mappings :q. :q a hydra:IriTemplateMapping. 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. Best, -- Ruben Verborgh PhD Researcher in Semantic Hypermedia iMinds – Multimedia Lab – Ghent University, Belgium http://ruben.verborgh.org/ – @RubenVerborgh
Received on Tuesday, 28 January 2014 17:32:12 UTC