Mobile app version of vmapp.org
Login or Join
Phylliss660

: Microdata markup for a chemical substance? 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

@Phylliss660

Posted in: #Microdata #SchemaOrg #StructuredData

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.



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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

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 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>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme