Supporting Ordering in schema.org

·

Ordering is hard in RDF.  Triples are not ordered by default and expressing order requires either relying on implicit syntax or RDF structures like rdf:List or rdf:Seq.  We’re not going to fix that at schema.org but we do want to take some small steps to make it easier.

Currently, it is unclear whether the individual elements within these RDF structures are required to match the property’s expected value types (the ‘range’). For instance if there is a rdf:List in the value of a http://schema.org/recipeInstructions that’s technically invalid or at least undefined. We’re changing that so that collections and containers are explicitly supported.

In the past we’ve tried to address this issue by using http://schema.org/ItemList which has explicit edges in the schema.org domain for positions.  There is still a place for ItemList because RDF structures are not as expandable and are really best suited for property targets than the named/top-level collections that ItemLists are frequently used for.  But making this change will allow some use cases to properly support order without the bulkiness of an ItemList.

For instance:

"positiveNotes": {
  "@type": "ItemList",
  "itemListElement": [
    { "@type": "ListItem", "position": 1, "name": "Consistent results" },
    { "@type": "ListItem", "position": 2, "name": "Still sharp after many uses" }
  ]
}

Could become:

"positiveNotes": {
  "@list": [ "Consistent results", "Still sharp after many uses" ]
}

See the updated documentation.

Leave a Reply

Get updates

Subscribe

Discover more from Schema.org • Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading