schemaorg / schemaorg

Schema.org - schemas and supporting software
https://schema.org/
Apache License 2.0
5.44k stars 825 forks source link

Extend the subtypes of collection #3663

Open rhdunn opened 1 month ago

rhdunn commented 1 month ago

So far Collection only has a generic ProductCollection subtype for products being sold. Comparing with other parts of the hierarchy:

It would make sense to mirror the Collection and CollectionPage hierarchies (where a CollectionPage is effectively a view of a Collection) and extend them to contain only specific types:

  1. Extend MediaGallery and a new MediaCollection subtype to have *Gallery and *Collection variants for various MediaObject types -- 3DModel*, Audio*, Image*, Legislation*, MusicVideo*, Text*, and Video*.
  2. Extend Collection and CollectionPage to have *Collection and *CollectionPage variants of the CreativeWorkSeries subtypes for general (unordered) collections of these types of work -- BookCollection(Page)? > AudiobookCollection(Page)?, MovieCollection(Page)?, ComicCollection(Page)?, PodcastCollection(Page)?, RadioCollection(Page)?, VideoGameCollection(Page)?.

My use case is that I have an application managing creative works (images, audio, etc.) and want to restrict the parts of a collection to specific subtypes, e.g. to have an ImageCollection contain parts of type ImageObject, Drawing, etc. but not Play or MusicRecording. This helps with things like searching for parts to add to a collection, like can be done when e.g. searching for parts to add to a BookSeries or PodcastSeason.

MatthiasWiesmann commented 1 month ago

Technically, you don't need these specific types, except if you need new attributes, like these in ProductCollection.

rhdunn commented 1 month ago

If I just have a Collection then it could contain anything (as hasPart/isPartOf relationships). What I want is to say e.g. "this collection can only contain images" or "this collection can only contain books".

MatthiasWiesmann commented 1 month ago

Do you have a concrete application in mind, i.e. an existing system that would ingest schema.org data with that constraint?

rhdunn commented 1 month ago

I don't have a system that ingests the content but do have one that I'm working on (a library management style application) that uses these constraints in the way I describe which can generate schema.org metadata.