h-review: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(→‎See Also: add change control section)
(note proposal to merge review properties into h-entry since if successful it will likely eliminate this as a separate microformat (turn it into a legacy alias for h-entry))
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<entry-title>h-review</entry-title>
{{warning|Note proposal to [https://github.com/microformats/h-entry/issues/32 merge h-review properties into h-entry]. If the points in that issue are addressed and we get [[h-entry]] change control approval for adding <code>u-review-of</code>, then we’ll likely merge accordingly and redirect this page accordingly}}
<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
----
<dfn style="font-style:normal;font-weight:bold">h-review</dfn> is a simple, open format for publishing reviews on the web. h-review is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML.
<dfn style="font-style:normal;font-weight:bold">h-review</dfn> is a simple, open format for publishing reviews on the web. h-review is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML.


h-review is the [[microformats2]] update to [[hReview]].
h-review is the [[microformats2]] update to [[hReview]].


{{cc0-owfa-license}}
;<span id="Status">Status</span>
:This is a '''Draft Specification'''
;Participate
:[[IRC]]: [irc://irc.libera.chat/microformats #microformats on Libera]
;Editor
:<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
;License
:{{cc0-owfa-license}}
__TOC__


== Example ==
== Example ==
Here is a simple review example:
Here is a simple review example:


<source lang=html4strict>
<syntaxhighlight lang="html">
<div class="h-review">
<div class="h-review">
   <h1 class="p-name">Microformats: is structured data worth it?</h1>
   <h1 class="p-name">Microformats: is structured data worth it?</h1>
Line 29: Line 35:
   </div>
   </div>
</div>
</div>
</source>
</syntaxhighlight>


Parsed JSON:
Parsed JSON:
<source lang=javascript>
<syntaxhighlight lang="json">
{
{
   "items": [
   "items": [
Line 91: Line 97:
   ]
   ]
}
}
</source>
</syntaxhighlight>


=== Get started ===
=== Get started ===
Line 108: Line 114:


* '''<code>p-name</code>''' - name of the review
* '''<code>p-name</code>''' - name of the review
* '''<code>p-item</code>''' - thing been reviewed, including embedded microformat for e.g. business or person ([[h-card]]), event ([[h-event]]), place ([[h-adr]] or [[h-geo]]), product ([[h-product]]), website, url, or other item ([[h-item]]).
* '''<code>p-item</code>''' - thing being reviewed, including embedded microformat for e.g. business or person ([[h-card]]), event ([[h-event]]), place ([[h-adr]] or [[h-geo]]), product ([[h-product]]), recipe ([[h-recipe]]), website, url, or other item ([[h-item]]).
* '''<code>p-author</code>''' - person who authored the review, optionally with an embedded [[h-card]]
* '''<code>p-author</code>''' - person who authored the review, optionally with an embedded [[h-card]]
* '''<code>dt-published</code>''' - date time of when the review was written and published
* '''<code>dt-published</code>''' - date time of when the review was written and published
* '''<code>p-rating</code>''' - value from 1-5 indicating a rating for the item (5 best).
* '''<code>p-rating</code>''' - value from 0-5 indicating a rating for the item (5 best).
* '''<code>p-best</code>'''  - define best rating value. can be numerically lower than worst.
* '''<code>p-best</code>'''  - define best rating value. can be numerically lower than worst.
* '''<code>p-worst</code>'''  - define worst rating value. can be numerically higher than best.  
* '''<code>p-worst</code>'''  - define worst rating value. can be numerically higher than best.  
Line 141: Line 147:
== Implementations ==
== Implementations ==
* [https://github.com/cleverdevil/Known-Reviews Reviews plugin for Known CMS] by [https://cleverdevil.io Jonathan LaCour].
* [https://github.com/cleverdevil/Known-Reviews Reviews plugin for Known CMS] by [https://cleverdevil.io Jonathan LaCour].
** [https://github.com/cleverdevil/Known-Reviews/pull/4 pending pull request to sync with spec update 2016-05-29] -t


== Validating ==
== Validating ==
Line 150: Line 155:
For backward compatibility, you may wish to use classic [[hReview]] classnames on an h-review permalink page in addition to the more future-proof h-review properties, for example:
For backward compatibility, you may wish to use classic [[hReview]] classnames on an h-review permalink page in addition to the more future-proof h-review properties, for example:


<source lang=html4strict>
<syntaxhighlight lang="html">
<div class="h-review hreview">
<div class="h-review hreview">
   <h1 class="p-name fn">My great review</h1>
   <h1 class="p-name fn">My great review</h1>
</div>
</div>
</source>
</syntaxhighlight>


See [https://aaronparecki.com/ Aaron Parecki]’s [https://aaronparecki.com/2016/12/17/8/owning-my-reviews Why Microformats? Owning My Reviews] for a reason to be backwards compatible.
See [https://aaronparecki.com/ Aaron Parecki]’s [https://aaronparecki.com/2016/12/17/8/owning-my-reviews Why Microformats? Owning My Reviews] for a reason to be backwards compatible.
Line 196: Line 201:
== Background ==
== Background ==
h-review is based on the existing [[hReview]] specification.
h-review is based on the existing [[hReview]] specification.
== Change control ==
Minor editorial changes (e.g. fixing minor typos or punctuation) that do not change and preferably clarify the structure and existing intended meaning may be done by anyone without filing issues, requiring only a sufficient "Summary" description field entry for the edit. More than minor but still purely editorial changes may be made by an editor. Anyone may question such editorial changes by undoing corresponding edits without filing an issue. Any further reversion or iteration on such an editorial change must be done by filing an issue.
For the stable features of this document, substantive issue filing, resolution, and edits may be done by filing an [[h-entry-issues|issue]] and discussing them on the issue and on #microformats [[IRC]] with a link to the issue.
Because this is primarily a vocabulary specification, very few issues beyond the list of vocabulary have filed or required any lengthy discussion. If such a non-trivial issue arises in the future, use the [[microformats2-parsing#change_control|microformats2-parsing change control process]] to resolve them.
In general, non-vocabulary related features or requirements should be avoided in this specification, e.g. changes to microformats2 syntax must be proposed as [[microformats2-parsing]] changes using the [[microformats2-parsing#change_control|microformats2-parsing change control process]].
Beyond that, the following requirements must be met for adding or moving features (e.g. properties and values) to proposed, draft, or stable:
;Proposed
:[[#Proposed_Additions|Proposed features]] must provide documentation of what specific real world use-cases they are solving, preferably with a link to a step-by-step user scenario, e.g. demonstratable using existing non-standard / single-site / single-implementation tools.
;Draft
:[[#Draft_Properties|Draft properties]] must in addition be published and consumed in the wild on the public web, demonstrate solving the use case for which they were proposed, and should provide citations of real world public web sites publishing and (other sites) consuming them, interoperably.
;Stable
:Stable features (e.g. [[#Core_Properties|Core Properties]]) must in addition be published and consumed in the wild on multiple sites by multiple implementations (3+ different sites and implementations for publishing and  consuming). When a draft property reaches a critical mass of deployment by numerous sites and implementations (far beyond 3+), due to network effects and backward compatibility considerations it effectively becomes stable, since it becomes increasingly difficult to change it in any way and have so many sites and implementations also change.
For creating an entirely new vocabulary, and more details about how to research existing values, properties, document examples in the wild, etc., see the microformats [[process]].


== See Also ==
== See Also ==

Latest revision as of 20:22, 5 February 2024

⚠️ Warning: Note proposal to merge h-review properties into h-entry. If the points in that issue are addressed and we get h-entry change control approval for adding u-review-of, then we’ll likely merge accordingly and redirect this page accordingly

h-review is a simple, open format for publishing reviews on the web. h-review is one of several open microformat draft standards suitable for embedding data in HTML.

h-review is the microformats2 update to hReview.

Status
This is a Draft Specification
Participate
IRC: #microformats on Libera
Editor
Tantek Çelik (Editor)
License
Per CC0, to the extent possible under law, the editors have waived all copyright and related or neighboring rights to this work. In addition, as of 2024-11-24, the editors have made this specification available under the Open Web Foundation Agreement Version 1.0.

Example

Here is a simple review example:

<div class="h-review">
  <h1 class="p-name">Microformats: is structured data worth it?</h1>
  
  <blockquote>
    <a class="p-item h-item" href="http://microformats.org">Microformats</a> are the simplest way to publish structured data on the web.
  </blockquote>
  
  <p>
    <data class="p-rating" value="5">★★★★★</data>
    Published <time class="dt-published" datetime="2013-06-12 12:00:00">12<sup>th</sup> June 2013</time>
    by <a class="p-author h-card" href="http://example.com">Joe Bloggs</a>.
  </p>
  
  <div class="e-content">
    <p>Yes, microformats are undoubtedly great. They are the simplest way to markup structured data in HTML and reap the benefits thereof, including using your web page as your API by automatic conversion to JSON. The alternatives of microdata/schema and RDFa are much more work, require more markup, and are more complicated (harder to get right, more likely to break).</p>
  </div>
</div>

Parsed JSON:

{
  "items": [
    {
      "type": [
        "h-review"
      ],
      "properties": {
        "name": [
          "Microformats: is structured data worth it?"
        ],
        "item": [
          {
            "value": "Microformats",
            "type": [
              "h-item"
            ],
            "properties": {
              "name": [
                "Microformats"
              ],
              "url": [
                "http://microformats.org"
              ]
            }
          }
        ],
        "rating": [
          "5"
        ],
        "published": [
          "2013-06-12 12:00:00"
        ],
        "author": [
          {
            "value": "Joe Bloggs",
            "type": [
              "h-card"
            ],
            "properties": {
              "name": [
                "Joe Bloggs"
              ],
              "url": [
                "http://example.com"
              ]
            }
          }
        ],
        "content": [
          {
            "value": "Yes, microformats are undoubtedly great. They are the simplest way to markup structured data in HTML and reap the benefits thereof, including using your web page as your API by automatic conversion to JSON. The alternatives of microdata/schema and RDFa are much more work, require more markup, and are more complicated (harder to get right, more likely to break).",
            "html": "<p>Yes, microformats are undoubtedly great. They are the simplest way to markup structured data in HTML and reap the benefits thereof, including using your web page as your API by automatic conversion to JSON. The alternatives of microdata/schema and RDFa are much more work, require more markup, and are more complicated (harder to get right, more likely to break).</p>"
          }
        ]
      }
    }
  ]
}

Get started

The class h-review is a root class name that indicates the presence of an h-review.

p-name, p-item, p-rating, dt-published, p-author, e-content and the other property class names listed below defined elements as properties of the h-review.

The class h-item is a root class name that indicates an embedded h-item for the p-item property.

The class h-card is a root class name that indicates an embedded h-card for the p-author property.

See microformats2-parsing to learn more about property class names.

Properties

h-review properties, inside an element with class h-review:

  • p-name - name of the review
  • p-item - thing being reviewed, including embedded microformat for e.g. business or person (h-card), event (h-event), place (h-adr or h-geo), product (h-product), recipe (h-recipe), website, url, or other item (h-item).
  • p-author - person who authored the review, optionally with an embedded h-card
  • dt-published - date time of when the review was written and published
  • p-rating - value from 0-5 indicating a rating for the item (5 best).
  • p-best - define best rating value. can be numerically lower than worst.
  • p-worst - define worst rating value. can be numerically higher than best.
  • e-content - the full text written evaluation and opinion of the reviewer
  • p-category - freeform categories or tags applied to the item by the reviewer
  • u-url - review permalink URL

All properties are optional.

Experimental properties currently in use in the wild but not (yet) part of the official h-review spec. Several of these seem to be because of h-review convergence towards h-entry, as h-review gets used alongside h-entry within h-feed:

Status

h-review is a microformats.org draft specification. Public discussion on h-review takes place on h-review-feedback and the #microformats irc channel on irc.freenode.net.

h-review is ready to use.

Property Details

(stub, add any property explanations here)

Examples in the Wild

Implementations

Validating

Main article: validators

Test and validate microformats2 markup in general with:

Backward Compatibility

Publisher Compatibility

For backward compatibility, you may wish to use classic hReview classnames on an h-review permalink page in addition to the more future-proof h-review properties, for example:

<div class="h-review hreview">
  <h1 class="p-name fn">My great review</h1>
</div>

See Aaron Parecki’s Why Microformats? Owning My Reviews for a reason to be backwards compatible.

Parser Compatibility

Microformats parsers should detect classic properties and parse them as microformats 2 properties. If an "h-review" is found, don't look for an "hReview" on the same element.

Compatibility root class name: hreview

Properties: (parsed as p- plain text unless otherwise specified)

  • summary parse as p-name
  • fn - parse as p-name of the item being reviewed (p-item h-item p-name)
  • photo - parse as u-photo of the item being reviewed (p-item h-item u-photo)
  • url - parse as u-url of the item being reviewed (p-item h-item u-url)
  • item (without vcard, vevent, hproduct) - parse as p-item h-item including backcompat nested properties:
    • fn - parse as p-name of the item being reviewed (p-item h-item p-name)
    • photo - parse as u-photo of the item being reviewed (p-item h-item u-photo)
    • url - parse as u-url of the item being reviewed (p-item h-item u-url)
  • item vcard - parse as p-item h-card including backcompat hCard parsing
  • item vevent - parse as p-item h-event including backcompat hCalendar vevent property parsing
  • item hproduct - parse as p-item h-product including backcompat hProduct parsing
  • reviewer - parse as p-author, including compat root vcard in the absence of h-card
  • dtreviewed - parse as dt-published
  • rating
  • best
  • worst
  • description - parse as e-content
  • rel=tag - parse as p-category. While not a class name nor typical microformats property, rel=tag was the typical way to tag an hreview. Thus parsers should look for rel=tag hyperlinks inside an hreview, and take the last path segment of their "href" value as a value for a p-category property.
  • rel="self bookmark" - parse as u-url. note that rel attribute value is treated as a space separated set, thus any presence of "self" and "bookmark" within such a set in a rel value is accepted.

Note: The hReview format has three properties which make use of rel attribute, these are tag, permalink (via the self and bookmark values) and license. Microformats 2 parsers SHOULD map these URLs into the page scoped rel collection.

prior property names

There may be a handful of h-reviews out there (only one known so far) that use prior h-review property names. Parsers encountering these *may* interpret them as follows:

  • dt-reviewed treat as a fallback for dt-published
  • e-description treat as a fallback for e-content
  • p-reviewer treat as a fallback for p-author

Background

h-review is based on the existing hReview specification.

See Also