- From: Dietrich Schulten <ds@escalon.de>
- Date: Sun, 08 Mar 2015 11:50:55 +0100
- To: Hydra <public-hydra@w3.org>
Hi, with the introduction of hydra:collection and hydra:manages we have introduced a second link facility to json-ld, in parallel to the plain json-ld link facility that uses a simple node object with @id property. We had to do this, because the json-ld link facility is not suitable for remote collections. It has a major drawback: clients have to check in two places to find out if a json-attribute has any values: the json-attribute itself and the hydra:collection property. That is not an optimal situation, but there is no other possibility for a vocabulary. If we wanted to remove the second link facility from hydra, we would have to ask for an addendum to json-ld. Just to give an idea, maybe we could ask for two new keywords @linked and (optional) @linkedItems: { "@context": { "@vocab": "http://schema.org", "hydra": "http://www.w3.org/ns/hydra/core#", "acceptedOffer": { "@container": "@linked", "@linkedItems": "hydra:member" <-- optional } }, "@id": "http://example.com/store", "acceptedOffer": { "@id": "http://example.com/store/acceptedOffers" }, "review": { "@id": "http://example.com/store/reviews", } } where a json-ld processor must handle a json attribute with "@container":"@linked" definition in the @context so that it does not add the triple </store> acceptedOffer </store/acceptedOffers> to the RDF model of the current resource. The spec addendum would also have to say what else the processor should do. E.g. it might describe that the json-ld processor may dereference the linked container and require it: - To add one triple to the current model for each item it finds in the target resource - If there is a @linkedItems keyword, to look *inside* the received resource for the property defined by @linkedItems, and add one triple for each item found at @linkedItems. E.g. for each hydra:member of the received resource, add one triple to the current resource. That could be used by any vocab, not just by hydra, to point to a collection which is nested inside the target resource. The proposal above is just an idea. There might be other ways, e.g. the processor could construct an RDF representation of the remote collection which resembles our collection design, with reified statements etc. I just made up the keywords above to test the waters, I am not saying that should be our proposal to the json-ld group. My point is the following. Since pretty much every json-ld author is also on this list: - Do you generally agree that it would be desirable to use the same json-ld link facility for remote collections which is used for single items? - Based on the ideas given above or similar ideas, do you think it would be feasible? - If so, what are the chances to get such an addendum into json-ld? Clearly that would be quite a change and takes a considerable amount of effort. Do you think it would be worth to go that route, too, while we also proceed with our new collection design? Best regards, Dietrich
Received on Sunday, 8 March 2015 10:51:48 UTC