rNews: Class Attributes in rNews

In the previous section we provided a high-level overview of the classes in rNews and the relations between classes. In the following sections we'll take a look at the attributes of each class. We'll start by reviewing important features common to all rNews attributes. After that, we'll examine each class individually. For each class we'll start by describing the class and detailing its attributes. Then we'll use the class to model some portion of our sample article. Once you've read through these sections, you'll know the definition of each rNews attribute and how to assign an appropriate value to each.

Important Features of rNews Attributes

 

Data Types
Each attribute in the rNews data model expects a value of a specific type. For instance the latitude attribute of the Location class expects a value of type xsd:double. All of the attribute data types used in rNews are drawn from the Word Wide Web Consortium's XML Schema Language. Below we provide a table that enumerates all of the data types used in rNews. Please note that we use Compact Uris For the names of the data types, abbreviating the full URI <http://www.w3.org/2001/XMLSchema> as XSD.

 

Data Type Full Definition Example Brief Definition
xsd:integer See W3C Site 1138 A whole number between x and y.
xsd:double See W3C Site 3.14159 A real-valued number.
xsd:string See W3C Site "Stuart Myles will love this document." A String is a sequence of characters.
xsd:datetime See W3C Site 1979-07-08T08:33:00-05:00 A string matching the format '-'? YYYY '-' MM '-' DD 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?.
xsd:anyURI See W3C Site http://data.nytimes.com/N66220017142656459133 A Universal Resource Identifier (URI). See IETF RFC 2396 for the full definition of URI.

 

Attribute Categories: Core & Power
Each attribute in rNews is placed into one of two categories: core and power. Core attributes are those attributes that publishers are strongly encouraged to include, if feasible, in their implementations of rNews. Power attributes are additional attributes that rNews specifies and that publishers may consider providing.

 

 

"Paired" Attributes
rNews defines several "paired" attributes. For instance the NewsItem class provides two attributes for defining an item's genre: genre and genreUri. For paired attributes, the variant that ends with Uri expects an object of type xsd:anyURI, whereas the other variant expects an object of a literal type. Implementations of rNews are encouraged to use the Uri variant to link to additional RDF triples, however, these properties may also be used to link to human-readable HTML documents in cases where no RDF variant exists.

 

 

Controlled Vocabularies
For some paired attributes, implementors are encouraged to draw values from controlled vocabularies. For example, implementors are encouraged to use the IPTC's controlled vocabulary for genres for assigning values to the genre and genreUri attributes. But how do you use these vocabularies to assign attribute values? Well suppose we have a NewsItem that is in the "interview" genre and we want to use the IPTC's vocabulary to express this in rNews. If you take a look at this vocabulary at http://cv.iptc.org/newscodes/genre/, you'll soon find an entry for the "interview" genre that looks like this:
Figure: Entry for the 'Interview' genre in the IPTC's controlled vocabulary for genres.
To indicate that this NewsItem is an interview, we do the following. First we set the genre attribute to Interview, the value indicated in the name EN-gb is: field. Then we set the genreUri attribute to http://cv.iptc.org/newscodes/genre/Interview, the value indicated in the Concept Id: field.

 

So that's how attributes work in rNews. Now lets move onto the classes themselves!

Want to comment on rNews: we invite you to post your comment to the rNews Forum.