TransWikia.com

What is the impact of changing schema namespaces on existing content items?

Tridion Asked on September 30, 2021

In order to be able to use semantic mapping in DXA models, the documentation states that we need to specify a vocab which MUST match the Schema namespace.

Semantic Mapping (.NET)

By default each schema gets a unique GUID namespace identifier.

This looks likely to cause problems in our Models if we specify the vocab using a GUID because it may not be the same in all DTAP environments.

[SemanticEntity(EntityName = "Event", Prefix = "e", Vocab = "uuid:78e55fb7-4dc6-44dd-a875-fbede33717c2")]

Should we replace all the schema namespaces with a unique url string instead?

[SemanticEntity(EntityName = "Event", Prefix = "e", Vocab = " https://www.tridionation.com/web/schemas/event")]

The default schema namespace seems to be a legacy problem that will break DXA based solutions that require semantic mapping cases highlighted in the SDL docs.

What is the impact of changing schema namespaces on existing content items?

2 Answers

I would recommend to align Schema namespace URIs across DTAP environments, regardless of DXA.

For DXA, it will only be required to do so if you are using retrofit mode for semantic mapping, because that uses the CM Schema's namespace URI as semantic Vocabulary ID (whereas regular mode uses a single "Core Vocabulary" for all CM Schemas).

Retrofit mode should be used if your CM Schemas don't have distinct root element names and you want to use advanced semantic mapping constructs. In particular: if you want to use polymorphic mapping (see the code example in the documentation)

Even retrofit mode can be made independent of CM Schema namespace URI by using an even more advanced semantic mapping concept: CM-side semantic mapping.

Answered by Rick Pannekoek on September 30, 2021

If you change the namespace of a Schema, you can and should synchronize your Components with the appropriate method and flag using Core Service. So in essence, not a major impact but you should consider your Components non-stable until they are synchronized. If you were to open them in the UI without syncing, it might even do that for you, or it will cause issues with saving them, one of these two :). The safest bet is to just run the script to sync them.

But... before you start changing namespaces and syncing Components, there is one important thing to point out. The "Vocab must match the Schema namespace." is true in retrofit mode, and only there. The documentation is incorrect! I checked this with the DXA team and got confirmation.

Answered by Atila Sos on September 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP