Re: How to avoid that collections "break" relationships (ISSUE-41)

On Jun 13, 2014, at 8:03 AM, Markus Lanthaler <markus.lanthaler@gmx.net> wrote:

> On 13 Jun 2014 at 01:24, Gregg Kellogg wrote:
>> In any case, the collection mechanism is more than just a way of referencing specific
>> members, but also associating a relationship between a subject and object, which is no-where
>> to be seen in any ListItem proposal. I am concerned that those of us using both schema.org
>> and Hydra will have some difficult decisions on how to separate an entity's definition
>> between multiple resources other than relying exclusively on reverse relationships, and that
>> still doesn't handle wide many-to-many relationships such as Friend or Follows.
> 
> Could you please elaborate a bit? Are you worried that simple crawlers and other clients won't be able to reconstruct the complete resource description and it's relationships to other resources?

Not clear exactly what SEO scrapers do or don’t do, but my guess is that they restrict themselves to schema.org properties. Even then, there’s not always an obvious property to connect to classes defined in schema.org. For example, its natural to want to link things such as questions from, say, a Person to the set of questions asked of her. Question has an about property, which can link back to a Thing, but there is no forward relationship. In JSON-LD (or RDFa), I could create this relationship using @reverse or @rev, but no natural way to do that in Microdata. If I create my own property to reference questions, does just the fact that I’ve linked to another resource cause an SEO scraper to dereference it?

> Does the hasCollection/collection forward link help in that regard in your opinion?

hasCollection suffers from the same ambiguity; it makes perfect sense to provide this, and a Hydra client will be able to use it to find appropriate collections (vs, having to query for collections having a subject referencing the interesting entity. But, for SEO, is there some reason to believe that a scraper will follow this to find related information?

Similarly, if I split the definition of an entity between the main entity resource, and the collections having that entity as a subject, will this result in a search engine marrying those properties together? From a linked data prospective, sure, but for SEO we’re sort of shooting in the dark.

> What do you think makes many-to-many relationships special?

Many-to-many relationships are interesting because you don’t use CREATE/DELETE operations to cause to entities to become related. For example, in the Friend case, if I want to friend Markus, performing a CREATE doesn’t make sense as the Markus entity presumably already exists. This is where I think LINK/UNLINK become interesting (and that seems to be exactly what they’re intended for). You might be able to do this with PATCH on the collection manifesting these relationships, but again the semantics would be clear. If I patch the member property of a collection, do I replace it’s values, or add a new value? How would I remove a specific value from a property? LINK/UNLINK make this fairly clear (although, IMO, the operation should be performed on the entities, not the collection.

In contrast, many-to-one relationships always result in a new entity being created, updated or deleted. For example, I create a new instance of a Game by performing a create on the collection (in my view), but manipulate it or delete it by operating on the game directly.

Gregg

> --
> Markus Lanthaler
> @markuslanthaler
> 
> 
> 
> 

Received on Friday, 13 June 2014 21:50:25 UTC