Product database

From semantic-mediawiki.org

I have successfully installed new MW 1.26 and SMW extension. Now I'm doing tests and thinking how to specify the properties of product and its variants, best if I do not need to repeat them.

For example we have a product A:

  • CPU: MPC5200B
  • LCD size: 10.4"
  • LCD resolution: 640x480 or 800x600
  • RAM memory: 256MB
  • MRAM memory: 1MB
  • Interfaces: Ethernet, USB, video in, audio out

Product A variant /A:

  • LCD resolution: 640x480
  • Interfaces: 3x Ethernet, 2x USB, 0x video in, 0x audio out

Product A variant /B:

  • LCD resolution: 800x600
  • Interfaces: 1x Ethernet, 1x USB, 1x video in, 1x audio out

You see there are attributes that are common to all variants, but there are attributes that are different for each variant. I would like to be able to find:

  1. all products that have LCD, resolution (at least) 800x600 and Ethernet and USB interfaces
    • will find "Product A"
  2. all product variants that have LCD, resolution (at least) 800x600 and Ethernet and USB interfaces
    • will find "Product A/B"
  3. all products that have LCD and at least 2xEthernet and 1xUSB interfaces
    • will find "Product A"
  4. all product variants that have LCD and at least 2xEthernet and 1xUSB interfaces
    • will find "Product A/A"

Actually the last two should satisfy our needs, as the search 1 and 2 is a subset.

I'm in doubt, how to specify the product "has interface" and how to specify the interface count. Also how to share the attributes between the product and its variants so I do not need to specify for example the changing attributes for product and the common attributes for variants.

I could do

[[Has interface:Ethernet]] [[Has interface:USB]]

or

[[Has Ethernet interfaces:3]] [[Has USB interfaces:2]]

Last but not least, on the product page I have now a table showing all variants and the available interfaces. The table shows, which exact interfaces are available: If there are 3 Ethernet ports, there are connectors labeled as ETH-1, ETH-2 and ETH-3. E.g. product variant A can offer ETH-1, ETH-2 and ETH-3 whilst variant B only ETH-2. This is than visualised in 3 columns - and each variant has either + or - if the interface is available or not. Not sure how to store and show this info using SMW.

I would be thankful for any tips.

11:56, 3 February 2016

I would point you to example [0, 1].

I'd prefer the record type for a truth or count matrix, similar on how [2, 3] is modeled which avoids having to create properties for every combination and apply constraints on values instead to permit certain values.

The data model maybe a bit difficult to understand at first but I hope [0, 1] can shed some light.

[0] http://sandbox.semantic-mediawiki.org/wiki/Intel_8%E2%88%9516_LAN_Adapter

[1] http://sandbox.semantic-mediawiki.org/wiki/Product/A

[2] http://sandbox.semantic-mediawiki.org/wiki/Property:Ethernet_device_classification

[3] http://sandbox.semantic-mediawiki.org/wiki/Property:Has_interface_device_name

15:31, 3 February 2016

I'm still not sure how to design the subobjects holding the individual variants. Actually I have not yet found an way to visualize the values of the record datatype as I would like.

However my question is different now. Have to be defined all properties of a subobject using the {{#subobject so1 |...}} tag or is there a way to add additional values later on? I tried adding second {{#subobject so1 |}}, but saving the page resulted in a critical error of MWException type.

11:33, 5 February 2016

> I'm still not sure how to design the subobjects holding the individual variants. Actually I have not yet found an way to visualize the values of the record datatype as I would like

There are always different ways to accomplish things, in the given example I used to declare subobjects to represent a product variation that relates to a subject (lets called the super product).

In my understanding, products and each different variations of it would represent a different entity and are therefore distinguishable from the rest hence can be queried individually.

> However my question is different now. Have to be defined all properties of a subobject using the {{#subobject so1 |...}} tag or is there a way to add additional values later on?

Using #subobject to be declared within a wiki-page (== subject) and having {{#subobject:ABC declared on top of the page and later on within the same page you try the extend #subobject:ABC that is not possible because, SMW only sees a page in its entirety. (This not completely true for named subobjects but the would stretch this thread)

Further more, declaring a #subobject:ABC on Page A and declaring a #subobject:ABC and Page B are two totally different entities that can be linked to each other but do not represent the same thing (or knowledge, or data, or fact). Remember that we interpret a data by Subject A (== Page A) posses an object value (property value) described by an attribute (the property itself), so that it reads as "A has something of X value".

As named subobject, Page A + #subobject:ABC|has something of=Foo !== Page B + #subobject:ABC|has something of=Foo

As anonymous (or hashed) subobject, Page A + #subobject: |has something of=Foo !== Page B + #subobject: |has something of=Foo

> I tried adding second {{#subobject so1 |}}, but saving the page resulted in a critical error of MWException type.

I would be interested to see what sort of issue you encountered together with a stack trace.

PS: Don't try to build Rome in a day, finding the right data model may take some time but with more practice (just use the sandbox) things should get clearer.

  • Build a simple product without variations, query its component and understand what can and cannot be done.
  • Build the same simple product but this time using the #subobject and query it.
  • ...
16:22, 5 February 2016

Thanks again for your detailed description and help. Exactly as you have suggested, I'm now researching what SMW can and what data model is best to use to solve my product catalogue. For that I'm using both SMW sandbox and my own sandbox installation. I think that defining product attributes is pretty clear for me now but I'm still not happy with the product variants. I try to make it as simple as possible, so I tend to use templates to add and display data.

I know that subobjects defined in different pages will create different entities even they have same name. Anyway I was interested, if it would be possible to add more information to subobject on the SAME PAGE using second, third etc. subobject with the same name. Exactly the same way I can add attributes using #set. I have just tried it on SMW sandbox and it seems to work :-) Maybe there is some improvement over SMW 2.3.1 I'm using.

Additionally I tried subproperty and it does not seem to work - please look at the demo [[1]]

Thanks!

10:34, 8 February 2016