0

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?

  • 1
    You are saying that you have Schemas with different namespace URIs across DTAP environments? That sounds very unhealthy (regardless of DXA). – Rick Pannekoek Jul 11 at 11:25
  • Indeed, GUID can be differnet, depending if schema was content ported or just recreated in the new environment. Which is why I chose to rename the namespace in the past. I was hoping to clarify the namespace requirements for DXA vocab. – Chris Mills Jul 16 at 5:44
2

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.

| improve this answer | |
  • Indeed, there is a mistake in that particular topic. This topic does describe both modes properly: docs.sdl.com/784837/684156/… – Rick Pannekoek Jul 11 at 11:20
  • So in the non retrofit mode is the vocab required to define semantic mapping of muliple schema to a model? – Chris Mills Jul 16 at 5:50
  • In regular mode, a single Vocabulary (the “Core Vocabulary”) is used for all CM mappings. You can still map multiple Schemas to a single View Model. The assumption is that CM Schemas have distinct root element names, though (if not, you will not be able to use some of the more advanced semantic mapping techniques.) – Rick Pannekoek Jul 16 at 6:20
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.