Excuse me for some random thoughts, but I've been reconciling using Hydra for an API which typically returns JSON-LD representations of entities described using schema.org. Similar issues may exist with the schema.org action vocabulary as well. As a simple example, I may want to express follows information for a Person. In Turtle, this might look like the following:
<http://example/people/gregg> a schema:Person;
schema:name "Gregg Kellogg"@en;
schema:follows <http://example/people/markus>, <http://example/people/kingsley> ...
However, given that the list of potentially people I follow could be large; using Hydra I may construct this using a separate relationship to a Collection:
<http://example/people/gregg> a schema:Person, :ApiPerson;
:follows <http://example/people/gregg/follows> .
:ApiPerson a hydra:Class;
hydra:supportedProperties [hydra:property schema:name], [hydra:property :follows] .
:follows a hydra:Link
rdfs:label "follows";
rdfs:comment "Collection of followed people";
rdfs:domain schema:Person;
rdfs:range schema:Person;
hydra:supportedOperations [
hydra:method "GET";
hydra:returns hydra:Collection
] .
If the referenced collection contained the following data:
<http://example/people/gregg/follows> a hydra:Collection;
hydra:members ( <http://example/people/markus> <http://example/kingsley> .
After loading both the original document and the collection into a graph, I would now have the following:
<http://example/people/gregg> a schema:Person, :ApiPerson;
:follows <http://example/people/gregg/follows> .
<http://example/people/gregg/follows> a hydra:Collection;
hydra:members (<http://example/people/markus> <http://example/kingsley> .
This now does not describe what I would want using the schema.org definitions. One way to reconstruct what I want would be to add more data to the collection document:
The issue is better for single-valued properties, as the property value would be the same as the entity identifier, which would result in what you would expect when merging both entity definitions.
I guess the question is, is this an expected usage pattern? Should the collection examples represent this, or should it be described as a recommended practice? Perhaps I've missed something.
_This was raised by Gregg Kellogg:_
Excuse me for some random thoughts, but I've been reconciling using Hydra for an API which typically returns JSON-LD representations of entities described using schema.org. Similar issues may exist with the schema.org action vocabulary as well. As a simple example, I may want to express follows information for a Person. In Turtle, this might look like the following:
However, given that the list of potentially people I follow could be large; using Hydra I may construct this using a separate relationship to a Collection:
If the referenced collection contained the following data:
After loading both the original document and the collection into a graph, I would now have the following:
This now does not describe what I would want using the schema.org definitions. One way to reconstruct what I want would be to add more data to the collection document:
This is actually easier to do in JSON-LD:
The issue is better for single-valued properties, as the property value would be the same as the entity identifier, which would result in what you would expect when merging both entity definitions.
I guess the question is, is this an expected usage pattern? Should the collection examples represent this, or should it be described as a recommended practice? Perhaps I've missed something.