Product database

From semantic-mediawiki.org

Hi, we use MW as a source for basic information about our products in our company for internal use. Recently I have been asked, whether it is possible to return some information from the Wiki using some API. As it would be difficult to parse the source text and extract the info, I'm thinking about using the SMW.

Today the structure of our wiki pages is as follows:

  • Each product is described in a separate page (there are also pages not directly related to individual products)
  • Products are categorized
  • Products can consists of other products (such as CPU board in rack based system) via links
  • Each product has one or more model variants. The variants are described via a table where rows are models and columns are attributes. The attributes are usually number or availability of an interface, display resolution, redundancy support, etc. The table is created via a template.

My idea is to move some important information about the product from the plain text into SMW attributes. However I'm not sure, how to go with the model variants. I would like to avoid creating of individual pages for every model variant. Also the model variants are named using a slash and letter (product/A, product/B), which collides with MW sub-pages.

I would be thankful for any idea.

18:23, 4 January 2016

> I would like to avoid creating of individual pages for every model variant. Also the model variants are named using a slash and letter (product/A, product/B), which collides with MW sub-pages.

[0] should give you an idea how to accomplish this. Feel free to use the sandbox and adjust the example.

[0] http://sandbox.semantic-mediawiki.org/wiki/Product_A

Cheers

21:19, 4 January 2016

Thanks for the example! It looks so simple :-)

I have noticed that attribute names like in your demo are "Has component of", "Is product variant of", "Has description" e.g. long names using "Is", "Has". etc. What is the idea or requirement behind?

Our Wiki pages are in Czech. We often tend to use English in source code as sometimes we have to provide it to our customers and Czech is difficult to understand for foreigners and English is universal. This is not the case, but I always have in mind someday can change it. Do you recommend to use English for SMW or is there a way for multilanguage attributes?

10:53, 5 January 2016

> I have noticed that attribute names like in your demo are "Has component of", "Is product variant of", "Has description" e.g. long names using "Is", "Has". etc. What is the idea or requirement behind?

Help:Property naming should help to explain the idea of the naming convention and for a quick introduction to SMW, see Help:Getting started.

> Do you recommend to use English for SMW or is there a way for multilanguage attributes?

It depends on your use case but in future we hope to support labels in different languages with work currently under way [0] which could look similar to [1].

I've just created Localization and multilingual content to collect requirements and ideas on how to make this topic more actionable.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1344

[1] https://www.youtube.com/watch?v=jcau-ZA_uYc

17:42, 5 January 2016

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