Multiple schemas per entity

I wonder how to apply multiple schemas to the same entity. Just to give an example: Let's say we have a typical shoebox application for note taking. Notes can be organized in hierarchical folders.

  • For notes the note entity schema makes obviously sense.
  • And for folders we need to apply the schema notes.folder, so this entity type can be used with the createNode and updateNote intent schemas.
  • But, it would also make sense to use the file schema for folder entities, as it allows me to use the createFolder intent schema or deleteFile.

Unfortunately, I can only apply one schema to one entity. So I can't declare a folder as note.folder and file.file simultaneously.

I thought about using multiple entity types for the same entity to have somewhat multiple representations, but I can only assign a single app entity identifier to a view.

I am also curious about this!

However, I think in this example, the "File/Folder" Scheme is explicitly about URL-based filesystem items.

Now, your notes could be stored as files, and the "folders" could be literal folders.

You could use two different Entities, each conforming to the appropriate Schemas and then allow them to be interchangeable with one another by implementing transferable on them. (I think!)

I've gotten things like that to work for in-app-actions, but not yet for cross-app actions.

The problem with using multiple entities seems to me that Spotlight and On Screen Awareness would face different identifiers for the same entity (e.g. one time it's a Note, the other time it's a file).

I would need to expose different entity identifiers through the .appEntityIdentifier-modifier, depending on the UI context.

Wouldn't this confuse Siri and Spotlight?

Multiple schemas per entity
 
 
Q