2

Using Schema.org vocabulary in JSON-LD, when describing the height and width dimensions of a VideoObject, do I write:

"width": "100"

or

"width": "100px"

or

"width": {
    "@type": "QuantitativeValue",
    "unitCode": "E37",
    "value": "100"
}

The last option seems excessive, the middle option seems wrong and the first option seems lacking.

Update

I've seen that width can take a Distance value:

Properties that take Distances as values are of the form ' '. E.g., '7 ft'.

So … does that mean the correct entry would be:

"width": "100 px"

?

1 Answer 1

4

The height and width properties expect either a Distance or a QuantitativeValue value.

Both of your corresponding examples are correct:

  • Distance value:

    "width": "100 px"
    
  • QuantitativeValue value (E37 is the UN/CEFACT Common Code for "pixel"):

    "width": {
        "@type": "QuantitativeValue",
        "unitCode": "E37",
        "value": "100"
    }
    

For a consumer that supports both ways, these should be equivalent.

Possible risk when using a Distance value: a consumer might expect the unit to be written in a different way than px (e.g., px., pixel etc.). I guess there is no standard abbreviation (at least the Wikipedia article Pixel doesn’t specify one). You don’t have this risk with a QuantitativeValue value, because the units are standardized in the UN/CEFACT Common Code.

1
  • 1
    Wonderful, @unor. Thank you for the clarification. It's (still) rather hard to find explicit confirmation of this sort of thing across the web. I think I will risk "width": "100 px" for now, based on my guess that the abbreviation for pixels used in CSS (px) will eventually be the one officially adopted in Schema.org. (I can always do a multiple-file search and replace, if that turns out later not to be the case).
    – Rounin
    Commented Dec 5, 2017 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.