1

I'm trying to add Microdata markup to a table of properties of a chemical substance. Below is a sample of some of the properties of one of the chemical substances I'm trying to markup.

Sample of chemical properties

I'm not exactly sure how to use the Microdata format, but right now I'm trying to use Intangible for the substance itself, and PropertyValueSpecification for the individual properties.

Anyway, I think I'm doing it wrong since Google's testing tool is giving me a separate Intangible and PropertyValueSpecification's. I had expected that the PropertyValueSpecification's would be children of the Intangible?

Google Testing Tool result

  • What is the purpose of doing so? Micro data is useful when you know that a computer program will take the data from your website and do something useful for you. I don't know of any consumers of the data you are providing. Unless somebody has asked for the markup I wouldn't try to use it. It is a common misconception, but there is no general SEO benefit for finding some markup to use on your site. – Stephen Ostermiller Jun 15 '17 at 12:16
1

Nesting HTML elements doesn’t affect Microdata unless you are using itemprop.

Here you have two Microdata items, not related in any way:

<div itemscope itemtype="http://example.com/Example">
  <span itemscope itemtype="http://example.com/Example">
  </span>
</div>

Here you have two Microdata items, connected via the example property:

<div itemscope itemtype="http://example.com/Example">
  <span itemprop="example" itemscope itemtype="http://example.com/Example">
  </span>
</div>

So you have to find suitable properties in Schema.org to connect items. For example, author to connect a Book to a Person.


In your case:

The Intangible type (which, by the way, doesn’t seem to be appropriate for substances) doesn’t provide a property that takes a PropertyValueSpecification item as value. I don’t think that PropertyValueSpecification is a suitable type anyway. Instead, PropertyValue seems to be appropriate, which can be added (for example) to a Product via the additionalProperty property. Now the question is if it makes sense to represent your substances as products.

You might find more suitable types in the health-lifesci extension. For example, they define the Substance type:

Any matter of defined composition that has discrete existence, whose origin may be biological, mineral or chemical.

But it has a medical background, and it seems to miss a way to add a PropertyValue (or similar) item. If you think Product can be appropriate, you could use both types together:

<article itemscope itemtype="http://schema.org/Substance http://schema.org/Product">
  <div itemprop="additionalProperty" itemtype="http://schema.org/PropertyValue">
    <!-- … -->
  </div>
</article>

Schema.org is not intended to go into detail for all possible domains, so you might want to consider to find a domain-specific vocabulary/ontology.

As scientific domains like chemistry are typically strong in the Linked Data world, you might also want to consider to use RDFa instead of Microdata. The example from above could be marked up as:

<article typeof="schema:Substance schema:Product">
  <div property="schema:additionalProperty" typeof="schema:PropertyValue">
    <!-- … -->
  </div>
</article>
  • It seems like a big limitation that I can't add name/value properties of an arbitrary "thing" using microdata... I could perhaps use Product, but wouldn't it be "abusing" the Product category? I mean it's not really a physical product that is for sale or anything, just a "fact sheet" of a chemical substance, which seems more like something "intangible" or a "thing"... – Magnus W Jun 15 '17 at 13:50
  • @BadCash: I think this is an intentional decision from Schema.org, as they want to prevent that people come up with various custom properties (which typically aren’t useful for consumers) for everything. -- Regarding Product: It’s somewhat subjective. For it to be a Product, you don’t have to offer it for sale (for which there is the separate Offer type), but it should be something that in principle could be offered for sale. But I agree, it’s not a good match. I don’t understand your domain very much, but I’d bet that you can find a vocabulary that provides properties you need. – unor Jun 15 '17 at 14:16
  • What about ProductModel? The description says "A datasheet or vendor specification of a product (in the sense of a prototypical description).", and I guess I can use additionalProperty for other than the substance ID and name? – Magnus W Jun 15 '17 at 17:33
  • @BadCash: Yes, ProductModel might be appropriate (it would be a more specific Product). And yes, you can use additionalProperty for every property for which there is no suitable property defined (name for the names, identifier for the IDs, maybe description for the comment). – unor Jun 15 '17 at 21:06

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.