I am developing an application that creates embedded entities, and I’m unsure how to declare these in the type index registry.
Maybe “embedded” is not the correct nomenclature for this, please correct me if there is a specific term. What I mean with embedded entities is the following. Imagine that I have this document in my POD at
@prefix : <#>. @prefix movies: <./>. @prefix ldp: <http://www.w3.org/ns/ldp#>. @prefix schema: <https://schema.org/>. movies:spirited-away a ldp:Resource, schema:Movie; schema:name "Spirited Away". :abc a schema:WatchAction; schema:object movies:spirited-away.
In this case, the main entity of the document is the Spirited Away movie. But the document also contains an embedded
schema:WatchAction related to this movie. I understand the proper way of declaring that movies can be found in
/movies/ is this:
<#movies> a solid:TypeRegistration; solid:forClass schema:Movie; solid:instanceContainer </movies/>.
But how would I declare where
schema:WatchAction can be found? The obvious thing that comes to mind is this:
<#actions> a solid:TypeRegistration; solid:forClass schema:WatchAction; solid:instanceContainer </movies/>.
But this isn’t correct. Semantically speaking, the
/movies/ container only contains the movies. This also wouldn’t be a problem if I could reference the actions from the movie, but the only way to reference each other is using the
schema:object property in the
schema:WatchAction entity. I’ve found a way to declare reverse properties in JSON-LD, but I’m not sure if that can be done in turtle as well.
With all this knowledge, my conclusion is that the only proper way of doing this is not embedding entities. But then it makes my life a lot more difficult to find the actions for a given movie.
To clarify, this is not a problem in my application. I can assume that movie documents have embedded actions. But I wonder the proper way to declare this so that other applications can interact with the same data.