Problem/Motivation
Being able to change the RDF mappings based on some particular context has been requested in the D7 schema.org module. The use case illustrated in that issue is a node of type "event" and mapped to schema.org/Event. The event content type has a taxonomy field listing the kinds of events supported by schema:org/Event:
- BusinessEvent
- ChildrensEvent
- ComedyEvent
- DanceEvent
- EducationEvent
- Festival
- FoodEvent
- ...
Selecting an option in this list would add this subtype to the mapping of the node. For example, if the editor was to select "DanceEvent", the mapping type for that node would be "schema:Event schema:DanceEvent".
Proposed resolution
Let RdfMappingInterface call Drupal::moduleHandler()->alter($hook) or use the Configuration override and context system similar to how translations are implemented in core. The main context here would be the entity we're preparing the mappings for.
Remaining tasks
write patch.
User interface changes
none
API changes
API addition for RdfMappingInterface.