Home | Index

SearchMonkey Guide

Appendix A. DataRSS Specification

Table of Contents

DataRSS Feeds
Normative references:
The DataRSS elements
XML Schema syntax

DataRSS Feeds

Valid DataRSS feeds must conform to the XML Schema specification provided below, which defines an extension of Atom and uses a subset of RDFa attributes. Please refer to the normative references listed below.

Normative references:

RDFa — http://www.w3.org/TR/rdfa-syntax

CURIE (A syntax for expressing Compact URIs) — http://www.w3.org/TR/curie

Atom — http://atomenabled.org/developers/syndication/atom-format-spec.php

The DataRSS elements

Element name: adjunct

  • Element namespace: http://search.yahoo.com/datarss/

  • Attributes: @id, @updated, @version, @name, @scope, @xml:base

  • Content model: meta* | item* | type*

  • Description: the outermost container element for metadata assertions

Element name: item

  • Element namespace: as above

  • Attributes: @rel, @resource, @xml:base, @xml:lang

  • Reserved attributes: @role, @about, @rev, @href, @src

  • Content model: meta* | item* | type*

  • Description: Represents a specific resource, item or object. The rel attribute describes the relationship with the enclosing item. Optionally, a resource attribute contains the URI of the item. Again, it is optional (but highly recommended) to provide the type of the item through a nested type element. This URI is optional — there will be cases where an item doesn't have one. In RDF terms, each item element establishes a triple between the parent item (or adjunct) and another object, possibly a "blank node", and sets the new object as the current resource. The item element can be empty in cases when the only information given is the existence of a relationship to another object and possibly the URI and type of that resource.

Element name: type

  • Element namespace: as above

  • Attributes: @typeof, @xml:base, @xml:lang

  • Reserved attributes: @role, @about, @rev, @href, @src

  • Content model: meta* | item*

  • Description: this element provides the type of the enclosing item. In other words, the type element appears inside the item for which it provides the type of.

    [Note] Note

    When the type element is nested inside an item element with a resource attribute, the resource attribute must be repeated on the type element.

Element name: meta

  • Element namespace: as above

  • Attributes: @property, @datatype, @xml:base, @xml:lang

  • Reserved attributes: @role, @content

  • Content model: empty

  • Description: Assign a literal value to a property of the current object (the entire page or the enclosing item). The property attribute is required and it should contain the abbreviated name of a single property or a space-separated list of properties. Normally, this element should have text content representing the literal value of the property, i.e. it is normally never empty. The optional datatype attribute provides the datatype of the literal (e.g. currency, unit).

Attribute name: @id

  • Contents: a unique identifier of a publisher group within a specific organization; normally auto-assigned by the system

  • Description: a unique identifer that sets apart the metadata assertions that follow Attribute name; @version

  • Contents: A numeric version string (e.g. "1.0")

  • Description: an identifer of the version in use for this particular adjunct. When substantial changes are made to the adjunct format, this value should be incremented.

Attribute name: @updated

  • Contents: An ISO 8601 date-time stamp conforming to the xsd:dateTime datatype

  • Description: The moment in time of the last update to this adjunct. Optional: if not present, the system will insert the datetime during processing.

Attribute name: @name

  • Contents: A human-readable name for an adjunct

  • Description: In incoming feeds, the name of an adjunct serves to differentiate it from other adjuncts, and is used to generate an internal system identifer.

Attribute name: @scope

  • Contents: Public or private feed

  • Description: In incoming feeds, the scope attribute determines whether the submitted data will be exposed through public APIs such as Yahoo! BOSS and YQL. A value of 'public' indicates public data, a value of 'private' indicates private data, i.e. data that will not be exposed publicly.

Attribute name: @rel

  • Contents: A space-separated list of CURIEs indicating the property or properties (object-properties in RDF parlance) that relate the enclosing item to this item.

  • Description: the rel attribute from RDFa

Attribute name: @property

  • Contents: A space-separated list of CURIEs indicating the attribute or attributes (datatype-properties in RDF parlance) for which the meta element provides a value for.

  • Description: the property attribute from RDFa

Attribute name: @datatype

  • Contents: A CURIE indicating the datatype of a metadata value.

  • Description: the datatype attribute from RDFa

Attribute name: @resource

  • Contents: the literal value (object) of a triple that is to be treated

Attribute name: @typeof

  • Contents: A space separated list of CURIEs providing the class(es) an item belongs to

  • Description: the typeof attribute from RDFa

Attribute name: @xml:base

  • Contents: a standard XML attribute that sets the Base URI for relative URLs, additionally sets the root subject for metadata assertions

Attribute name: @xml:lang

  • Contents: a standard XML attribute that describes the human language of the contents, taken from RFC 3066

  • Reserved attributes: Attributes designated as reserved are intended for use in future versions of this specification and SHOULD NOT be used at this time.

XML Schema syntax

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://search.yahoo.com/datarss/" xmlns:y="http://search.yahoo.com/datarss/" xmlns:xml="http://www.w3.org/XML/1998/namespace"
  xmlns:vertex="http://search.yahoo.com/vertex/">
  
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
  <xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="http://www.kbcafe.com/rss/atom.xsd.xml"/>
 
  <!-- CURIE syntax is governed by the RDFa specification -->
  <xs:simpleType name="CURIE">
    <xs:restriction base="xs:string">
      <xs:pattern value="[\c-[:]]+:[\c-[:]]+"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="CURIEs">
    <xs:list itemType="y:CURIE"/>
  </xs:simpleType>
  
  <xs:simpleType name="scopeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="public"/>
      <xs:enumeration value="private"/>
    </xs:restriction>
  </xs:simpleType>
  
  <!-- must be a space-separated list of CURIEs -->
    <xs:complexType name="feed">
        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element ref="y:adjunct"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="adjunct">
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element ref="y:item"/>
        <xs:element ref="y:meta"/>
      </xs:choice>
      <xs:attribute name="id" type="xs:string"/>
      <xs:attribute name="version" use="required" type="xs:string"/>
      <xs:attribute name="updated" type="xs:dateTime"/>
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="scope" type="y:scopeType" default="private"/>
      
    </xs:complexType>

    <xs:complexType name="item">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="y:item"/>
        <xs:element ref="y:meta"/>
        <xs:element ref="y:type"/>
      </xs:choice>
      <xs:attribute name="rel" use="required" type="y:CURIEs"/>
      <xs:attribute name="resource" type="xs:anyURI"/>
      <xs:attribute ref="xml:lang"/>

    </xs:complexType>

    <xs:complexType name="meta" mixed="true">
      <xs:attribute name="property" use="required" type="y:CURIEs"/>
      <xs:attribute name="datatype" type="y:CURIE"/>
      <xs:attribute name="content" type="xs:string"/> 
      <xs:attribute ref="xml:lang"/>
    </xs:complexType>

   <xs:complexType name="type" mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="y:item"/>
        <xs:element ref="y:meta"/>
      </xs:choice>
      <xs:attribute name="typeof" use="required" type="y:CURIEs"/>
      <xs:attribute name="resource" type="xs:anyURI"/>      
      <xs:attribute ref="xml:lang"/>
    </xs:complexType>

  <xs:element name="adjunct" type="y:adjunct"></xs:element>
  <xs:element name="item" type="y:item"></xs:element>
  <xs:element name="meta" type="y:meta"></xs:element>
  <xs:element name="type" type="y:type"></xs:element>
  
</xs:schema>