solid / type-indexes

About Type Indexes and how they can be used by Solid developers.
https://solid.github.io/type-indexes/
MIT License
7 stars 3 forks source link

Confirm that solid:instanceContainer container contains documents containing instances? #34

Open josephguillaume opened 2 weeks ago

josephguillaume commented 2 weeks ago

The spec says: "solid:instanceContainer - This predicate maps a type to a Solid container which the client would have to list to get the instances of that type."

My understanding is that this should be interpreted as "a Solid container containing documents which the client needs to read to get instances of that type."

This interpretation provides an affirmative answer to: https://github.com/solid/type-indexes/issues/30#issuecomment-1977393830 "A container contains documents, not instances of the given type. So does it mean I have to read all documents contained in the container and consider all instances of the type found in those documents?"

This interpretation is based on: 1) This seems to be how it is implemented in practice at the moment 2) The notion that "Linked data is a set of documents" https://github.com/solid/type-indexes/issues/8#issuecomment-1399476614

Additionally, to maintain an open world assumption, it appears that not all the documents in the container are required to contain instances of the registered type. This may cause surprises, with clients parsing data they do not expect to parse or did not need to parse. See e.g. https://github.com/NoelDeMartin/media-kraken/issues/34#issuecomment-2312324108

josephguillaume commented 2 weeks ago

A counterexample in solidos, where the objects of ldp:contains will directly be of the class defined by solid:forClass.

:photos solid:forClass schema:Image; solid:instanceContainer  ${AlicePhotoFolder} .

https://github.com/SolidOS/solid-logic/blob/efa1982bb7c91373121c723952b8d7b1fc915e4e/test/helpers/dataSetup.ts#L68