hnews: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(temporarily hosting images at labs.ap.org until we have someplace better.)
(s/<source>/<syntaxhighlight>/)
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<entry-title>hNews 0.1</entry-title>
{{DISPLAYTITLE:hNews 0.1}}
{{Template:DraftSpecification}}
{{Template:DraftSpecification}}


hNews is a microformat for news content. hNews extends [http://microformats.org/wiki/hatom hAtom], introducing a number of fields that more completely describe a journalistic work. hNews also introduces another data format, [http://newscredit.org/development/newscredit-specification/rel-principles-specification/ rel-principles], a format that describes the journalistic principles upheld by the journalist or news organization that has published the news item. hNews will be one of several open standards.
hNews is a microformat for news content. hNews extends [http://microformats.org/wiki/hatom hAtom], introducing a number of fields that more completely describe a journalistic work. hNews also introduces another data format, [[rel-principles]], a format that describes the journalistic principles upheld by the journalist or news organization that has published the news item. hNews will be one of several open standards.
__TOC__
__TOC__
== Draft Specification ==
== Draft Specification ==
Line 38: Line 38:
The hNews schema consists of the following:  
The hNews schema consists of the following:  


* (root) ('''<code>root</code>''') and '''<code>hentry</code>'''.  required. Using [[hAtom]].
* hNews ('''<code>hnews</code>''') and '''<code>hentry</code>'''.  required. Using [[hAtom]].
** '''<code>source-org</code>'''. required. Using [[hCard]].[*]
** '''<code>source-org</code>'''. required. Using [[hCard]].[*]
** '''<code>dateline</code>'''. optional. Using text or [[hCard]].
** '''<code>dateline</code>'''. optional. Using text or [[hCard]].
** '''<code>geo</code>'''. optional. Using [[geo]].[*]
** '''<code>geo</code>'''. optional. Using [[geo]].[*]
** '''<code>item-license</code>'''. recommended. Using a [[licensing-brainstorming#item_as_container license|brainstorm proposal]].
** '''<code>item-license</code>'''. recommended. Using a [[licensing-brainstorming#item_as_container|brainstorm proposal]].
** '''<code>principles</code>'''. recommended. Using the draft microformat. [http://newscredit.org/development/newscredit-specification/rel-principles-specification/ rel-principles].
** '''<code>principles</code>'''. recommended. Using the draft microformat [[principles-brainstorming#rel-principles_specification|rel-principles]].


[*] Some required elements have defaults if missing, see below.
[*] Some required elements have defaults if missing, see below.
Line 68: Line 68:
* a dateline element is identified by the class name <code>dateline</code>.
* a dateline element is identified by the class name <code>dateline</code>.
* dateline represents the location where the news story was written or filed (see [http://en.wikipedia.org/wiki/Dateline dateline] for more details).
* dateline represents the location where the news story was written or filed (see [http://en.wikipedia.org/wiki/Dateline dateline] for more details).
* a dateline element {{may}} be encoded in an [[hCard]].
* a dateline element {{may}} be encoded with an [[adr]], [[geo]] or [[hCard]].
* a news story {{should}} have a dateline element.
* a news story {{should}} have a dateline element.
* dateline sometimes also includes the publish date of the news story. In such cases, use the [[datetime-design-pattern]] to encode the date.
* dateline sometimes also includes the publish date of the news story. In such cases, use the [[datetime-design-pattern]] to encode the date.
Line 79: Line 79:


===== License =====
===== License =====
* a license element is identified by the class name <code>item-license</code>.
* a license element is identified by the rel value of <code>item-license</code>.
* a license element {{must}} be encoded as described in this [http://microformats.org/wiki/licensing-brainstorming#item_as_container license brainstorm proposal].
* a license element {{must}} be encoded as described in this [http://microformats.org/wiki/licensing-brainstorming#item_as_container license brainstorm proposal].
* a news story {{should}} include a license element.
* a news story {{should}} include a license element.
Line 85: Line 85:
===== Principles =====
===== Principles =====
* a principles element is identified by <code>rel-principles</code>.
* a principles element is identified by <code>rel-principles</code>.
* principles represents the statement of principles and ethics used by the news organization that produced the news story.
* principles represents the statement of principles and ethics adhered to by the news organization and/or individual that produced the news story at the time of writing.
* a principles element {{must}} be encoded in [http://newscredit.org/development/newscredit-specification/rel-principles-specification/ rel-principles].
* a principles element {{must}} be encoded in [[principles-brainstorming#rel-principles_specification|rel-principles]].
* a news story {{should}} include principles.
* a news story {{should}} include principles.
* principles {{should}} be linked to using the icons http://labs.ap.org/principles-button-blue.png or http://labs.ap.org/principles-book-blue.png.
* principles {{should}} be linked to using the icons http://labs.ap.org/principles-button-blue.png or http://labs.ap.org/principles-book-blue.png.


=== XMDP Profile ===
=== XMDP Profile ===
<pre>
<syntaxhighlight lang="html">
<dl class="profile">
<dl class="profile">
<dt>class</dt>
<dd><p>
  <a rel="help" href="http://www.w3.org/TR/html401/struct/global.html#adef-class">
  HTML4 definition of the 'class' attribute.</a>
  This meta data profile defines some 'class' attribute values (class names)
  and their meanings as suggested by a
  <a href="http://www.w3.org/TR/WD-htmllink-970328#profile">
  draft of "Hypertext Links in HTML"</a>.
  <dl>


  <dt>root</dt>
  <dt>class</dt>
  <dd>
  <dd>
     Used to describe semantic information associated with news stories.
     <p><a rel="help" href="http://www.w3.org/TR/html401/struct/global.html#adef-class">
  </dd>
    HTML4 definition of the 'class' attribute.</a>
    This meta data profile defines some 'class' attribute values (class names)
    and their meanings as suggested by a
    <a href="http://www.w3.org/TR/WD-htmllink-970328#profile">draft of
    "Hypertext Links in HTML"</a>.</p>
    <dl>
 
      <dt>hnews</dt>
      <dd>Used to describe semantic information associated with news stories.</dd>
 
      <dt>source-org</dt>
      <dd>The originating organization for the news story.</dd>
 
      <dt>dateline</dt>
      <dd>Represents the location where the news story was filed.</dd>
 
      <dt>geo</dt>
      <dd>Represents geographic coordinates of relevant locations in the story.</dd>


  <dt>source-org</dt>
    </dl>
  <dd>
  </dd>
    The originating organization for the news story.
  </dd>


  <dt>dateline</dt>
  <dt>rel</dt>
  <dd>
  <dd>
     Represents the location where the news story was filed.
     <dl>
  </dd>


  <dt>geo</dt>
      <dt>item-license</dt>
  <dd>
      <dd>Represents the license for the story.</dd>
    Represents geographic coordinates of relevant locations in the story.
  </dd>


  <dt>item-license</dt>
      <dt>principles</dt>
  <dd>
      <dd>Represents the statement of principles and ethics used by the news organization that produced the news story.</dd>
    Represents the license for the story.
  </dd>


  <dt>principles</dt>
      </dl>
  <dd>
    Represents the statement of principles and ethics used by the news organization that produced the news story.
   </dd>
   </dd>


  </dl>
</dd>
</dl>
</dl>
</pre>
</syntaxhighlight>


== Examples ==
== Examples ==
Line 147: Line 144:


== Implementations ==
== Implementations ==
* Readability parses and consumes hNews. See their [http://www.readability.com/developers/guidelines Article Publishing Guidelines] for details.
* [[Google]] also parses hAtom (e.g. it's supported by their Rich Snippets [[validator]]).


== References ==
== References ==

Latest revision as of 23:33, 20 June 2024

This document represents a draft microformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the #microformats IRC channel to stay up-to-date.

hNews is a microformat for news content. hNews extends hAtom, introducing a number of fields that more completely describe a journalistic work. hNews also introduces another data format, rel-principles, a format that describes the journalistic principles upheld by the journalist or news organization that has published the news item. hNews will be one of several open standards.

Draft Specification

Editor/Author
Jonathan Malek (Associated Press)
Contributors
Stuart Myles (Associated Press)
Martin Moore (Media Standards Trust)
Mark Ng (Media Standards Trust)
Todd B. Martin (Associated Press)

Copyright

Per the public domain release on the authors' user pages (Jonathan Malek) this specification is released into the public domain.

Public Domain Contribution Requirement. Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding the public domain release template to their user page per the Voluntary Public Domain Declarations instructions. Unreleased contributions may be reverted/removed.

Patents

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

Introduction

hNews is a microformat for identifying semantic information in news stories. It builds on hAtom, while adding a number of fields that more completely define a journalistic work. hNews can be thought of as inheriting from hAtom, since parsers and tools that do not understand the hNews extensions can still parse the hAtom content. However, those parsers and applications that understand hNews can enable a richer set of semantic actions on news stories.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Semantic XHTML Design Principles

Note: the Semantic XHTML Design Principles were written primarily within the context of developing hCard and hCalendar, thus it may be easier to understand these principles in the context of the hCard design methodology (i.e. read that first). Tantek

XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.

  1. Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
    1. For types with multiple components, use nested elements with class names equivalent to the names of the components.
    2. Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
  2. Use the most accurately precise semantic XHTML building block for each object etc.
  3. Otherwise use a generic structural element (e.g. <span> or <div>), or the appropriate contextual element (e.g. an <li> inside a <ul> or <ol>).
  4. Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
  5. Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use <abbr> instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of <abbr>: Human vs. ISO8601 dates problem solved

Format

In General

hNews extends hAtom. As the hAtom draft format notes, "Atom provides a lot more functionality than we need for a 'blog post' microformat, so we've taken the minimal number of elements needed." News stories typically introduce more fields (for instance, the publishing organization) than the current 0.1 draft of hAtom, and those fields are very important when reading or evaluating a news story. We focus on those fields that enable the development of semantic actions around news: license, principles, dateline (geo) and source organization.

Schema

The hNews schema consists of the following:

  • hNews (hnews) and hentry. required. Using hAtom.
    • source-org. required. Using hCard.[*]
    • dateline. optional. Using text or hCard.
    • geo. optional. Using geo.[*]
    • item-license. recommended. Using a brainstorm proposal.
    • principles. recommended. Using the draft microformat rel-principles.

[*] Some required elements have defaults if missing, see below.

Field and Element Details

hAtom Fields

Entry
  • an hNews story MUST be encoded as an hAtom hentry.
  • if an hNews story cannot be parsed as an hAtom hentry, it is invalid hNews.

Additional Fields

Source Organization
  • a Source Organization element is identified by the class name source-org.
  • Source Organization represents the originating organization for the news story.
  • a Source Organization MUST be encoded in an hCard.
  • if the Source Organization is missing
Dateline
  • a dateline element is identified by the class name dateline.
  • dateline represents the location where the news story was written or filed (see dateline for more details).
  • a dateline element MAY be encoded with an adr, geo or hCard.
  • a news story SHOULD have a dateline element.
  • dateline sometimes also includes the publish date of the news story. In such cases, use the datetime-design-pattern to encode the date.
Geo
  • a geo element is identified by the class name geo
  • geo represents the geographic coordinates of relevant locations in the news story.
  • a geo element should be encoded in a geo.
  • in those cases where the latitude and longitude represent the dateline, a variant of geo should be used (see Geo Improvements for an example).
License
  • a license element is identified by the rel value of item-license.
  • a license element MUST be encoded as described in this license brainstorm proposal.
  • a news story SHOULD include a license element.
Principles
  • a principles element is identified by rel-principles.
  • principles represents the statement of principles and ethics adhered to by the news organization and/or individual that produced the news story at the time of writing.
  • a principles element MUST be encoded in rel-principles.
  • a news story SHOULD include principles.
  • principles SHOULD be linked to using the icons principles-button-blue.png or principles-book-blue.png.

XMDP Profile

<dl class="profile">

  <dt>class</dt>
  <dd>
    <p><a rel="help" href="http://www.w3.org/TR/html401/struct/global.html#adef-class">
    HTML4 definition of the 'class' attribute.</a>
    This meta data profile defines some 'class' attribute values (class names) 
    and their meanings as suggested by a 
    <a href="http://www.w3.org/TR/WD-htmllink-970328#profile">draft of
    "Hypertext Links in HTML"</a>.</p>
    <dl>

      <dt>hnews</dt>
      <dd>Used to describe semantic information associated with news stories.</dd>

      <dt>source-org</dt>
      <dd>The originating organization for the news story.</dd>

      <dt>dateline</dt>
      <dd>Represents the location where the news story was filed.</dd>

      <dt>geo</dt>
      <dd>Represents geographic coordinates of relevant locations in the story.</dd>

    </dl>
  </dd>

  <dt>rel</dt>
  <dd>
    <dl>

      <dt>item-license</dt>
      <dd>Represents the license for the story.</dd>

      <dt>principles</dt>
      <dd>Represents the statement of principles and ethics used by the news organization that produced the news story.</dd>

      </dl>
   </dd>

</dl>

Examples

See hnews-examples.

Examples in the wild

See hnews-examples-in-wild.

Implementations

References

Normative References

Informative References

Work in progress

This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added.

Version 0.1

Version 0.1 was drafted August 2008.

Further Reading

Related Pages

  • hnews
  • news-brainstorming: thoughts for improving hNews.
  • hNews FAQ: if you have any questions about hNews, check here, and if you don't find answers, add your questions!
  • hnews-issues: please add any issues with the specification to the issues page.
  • news-formats: existing news and news management schemas.
  • news-examples: examples of news formats on the web.