Developer forum

Forum » PIM » Clarification on Data Models and Data Set Behavior

Clarification on Data Models and Data Set Behavior

Than Lwin Chit
Reply

Hello Everyone,

I would like to get a better understanding of how data models work.

Currently, I am trying to create multiple datasets under one data model for Vehicles.

For example:

  • Create a Honda data model and assign one product attribute group.

  • Create datasets under the Honda model (e.g., Fit dataset and Accord dataset).

When I assign both datasets to a single product, the data seems to overwrite, and only one dataset is visible.

Is this the expected behavior, or could this be an issue?

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi

The behavior you’re seeing is expected, based on how data models and data sets are designed to work in Dynamicweb 10 (DW10). Let me explain why, and also what your alternatives are if you need more flexibility.

How data models & datasets work in DW10 — the key constraints

What is a data model / dataset

  • A data model in DW10 is a structure that defines a set of product attributes (fields) — for example, “Vehicle” might be a model that defines attributes like engine size, number of doors, etc.

  • A dataset is a variant under a data model. For instance, under the “Vehicle” data model, you might define datasets like “Honda Civic”, “Honda Accord”, “Mercedes C-Class”, etc. Each dataset can have its own default values, validations, or attribute subsets.

When you assign a product to a data model, the product “inherits” the attributes defined by that model. This is described in the “Data model membership” docs:

“When a product is linked to a data model it inherits the product attributes associated with that model” doc.dynamicweb.dev

Why a product can’t effectively have multiple datasets from the same model

Because of how the system is built:

  • The dataset defines a subset or override of the model’s attribute settings for that product.

  • If you assign more than one dataset under the same data model to a product, there’s a conflict: which dataset’s settings should “win” (which default values, which validation rules, which attribute overrides)? The system is not designed to merge or reconcile two dataset configurations under the same model.

  • In practice, DW10 will “overwrite” one dataset with another (or only show one) because only one dataset can logically apply. In your case, when you assign both “Honda” and “Mercedes” datasets to the same product under model “Vehicle,” you’ll see only one dataset in effect (i.e. the last one, or whichever the system resolves to).

So yes — the behavior of seeing only one dataset is expected given the architectural rules of DW10.

In your forum post you said:

“When I assign both datasets to a single product … only one dataset is visible.” doc.dynamicweb.com

That aligns with the system’s design: one product → one dataset (per data model).

Why your initial structure (“Honda”, “Mercedes” as models) is misaligned

What you described in your message:

“The customer created data models called honda, mercedes etc. The data model for that would be a car and then each dataset would be a honda or a mercedes.”

This is backwards relative to the standard use of models and datasets. Instead:

  • You want “Car” (or “Vehicle”) as the model.

  • Then “Honda”, “Mercedes”, “BMW”, etc. would be datasets under that model (or variants / types).

  • Each product is linked to one dataset under that model (e.g. a particular car instance is either “Honda” or “Mercedes,” not both).

If you treat “Honda” as a model, and then tried to put multiple dataset-likes under it, you’ll hit the same conflict.

 

What to do if you need cross-model relationships (e.g. “car that is both X and Y”)

If your business requirements demand that a product “plays” in multiple categories or brands (for instance, a product that is both “sport car” and “luxury brand” or a car that spans features from multiple “datasets”), then the built-in dataset mechanism is not suitable for that. Instead, you should use:

  1. Product relations
    Use related products or linking tables to represent relationships. For example, a "base model" product could have relations to multiple “packages” or “brands” etc.

  2. Dynamic relations / references
    You can define dynamic relations or reference fields so that a product can reference or link to multiple other dataset-like entities, without “inheriting” them as its own dataset. In other words, your product is in one dataset, but has links (relations) to others.

These approaches let you maintain clean separation of dataset inheritance (only one per product per model) while still modeling multiple associations or classifications.

Feel free to explain what you are trying to achieve and we can provide a way to structure it.

Also reach out - we can do a session with you and our product manager to help get a better understanding of these concepts in DW10.

BR Nicolai

 
Than Lwin Chit
Reply

Hi Nikolai,

Thanks a lot for your detailed explanation — it really helped me gain a much better understanding.

What I’m trying to achieve, as I also mentioned in another thread [https://doc.dynamicweb.com/forum/pim/pim/scalable-data-modeling-for-spare-parts-and-vehicle-compatibility-in-pim], is to create spare parts that are compatible with a list of vehicles.

For example, I have vehicle data like this:

ID Make Model Years
001 TOYOTA COROLLA (E120) 2000–2006
002 TOYOTA CAMRY XV40 (ACV40) 2006–2011
003 TOYOTA RAV4 (ASA44) 2012–2018
... ... ... ...
015 MERCEDES-BENZ SLK Roadster (R171) 2004–2010

Then I have a list of spare parts (e.g., brake disc, wiper, etc.).

My goal is that when I create a spare part, I can link it to the list of compatible vehicles.

For example:

  • Brake pad is compatible with:

    • TOYOTA COROLLA (E120) 2000–2006

    • TOYOTA CAMRY XV40 (ACV40) 2006–2011

    • MERCEDES-BENZ E-Class (W211) 2002–2009

    • MERCEDES-BENZ S-Class (W220) 1998–2005

  • Wiper is compatible with:

    • HONDA CR-V (RE5) 2002–2006

    • HONDA S2000 (AP1) 1999–2003

    • HONDA NSX Targa (NA1) 1995–1996

    • MERCEDES-BENZ C-Class (W203) 2000–2007

    • MERCEDES-BENZ E-Class (W211) 2002–2009

    • MERCEDES-BENZ S-Class (W220) 1998–2005 etc.

Initially, I tried to structure this by creating spare parts as products and vehicles as data models. For example:

  • I created a product category group called Vehicles with attributes like ID, Make, Model, and Years.

  • Then I created data models for each maker (Toyota, Honda, Mercedes-Benz).

  • Under Toyota, I added datasets like Corolla, Camry, RAV4.

  • Under Honda, datasets like Civic, Accord, CR-V, etc.

But since DW10 allows only one dataset per product per data model, this structure doesn’t work for my case, because one spare part may need to link to multiple datasets across different models.

Based on your explanation, I think the better approach is to treat both spare parts and vehicles as products and then use relations to connect them. This way, I can model compatibility without being limited by the one-model-one-dataset restriction.

Thanks again for clarifying .

Best regards,

Than Lwin

 

 

 

You must be logged in to post in the forum