Hello Ivan,
JSON-LD is always a balancing act between pure JSON documents and the RDF
output.
For RWPM, the priorities were:
1. generic hypermedia format first
2. linked data second
By separating the metadata in a metadata object, we can do the following:
- whenever a client encounters an element that's neither metadata or
links, it can assume that it's a collection
- collections are well defined, which means that even if a parser
doesn't know anything about the role of the collection, it can be properly
parsed and presented to the client
- any foreign element in metadata can be treated as additional metadata
as well
I agree that from an RDF standpoint it would be better to avoid the blank
node, but there are clear benefits to this approach as well:
- extensibility
- it's possible to write a generic parser/client that knows nothing
about context documents or collection roles
Basically, this makes it easier for non JSON-LD aware clients to write code
that will handle potential extensions easily.
We already use this for OPDS 2.0, that introduces additional collection
roles and metadata, yet retains the same model.
Best,
Hadrien