作者:傲气战歌网 来源:www.27zg.com 发表时间:2014-03-14 02:02
As it happens, there is at least one existing vocabulary designed to describe software releases. In fact, the schema at eikster.com contains terms that directly correspond to our product and version called name and version. We can inherit their descriptions by making our properties subproperties of them.
There is one significant difference between eikster.com's properties and ours -- their schema provides a Release class, to which the properties apply. Looking back at the RSS 1.0 example, we have our product and version applied to an RSS item -- the resource on the left-hand side of the triples is an item, on the right-hand side we have a string literal. We can use RDF Schema to say we want the domain (left-hand side) of our properties to be instances of item and the range (right-hand side) to be literals. Note that the domain and range are primarily descriptive, they don't in themselves offer any real constraint as found in WXS. It's up to applications to interpret this as they wish (true constraints can be added using the Web Ontology Language OWL).
A few more things that are easy to add to the schema and are likely to be useful are human-readable labels and comments for each property and references to their definition. Including a reference to the definition might seem a little redundant in part of the definition itself, but the statements in an RDF Schema may be used outside of their original context.
<rdf:RDFTogether with this schema, RDF Schema-aware software that understands eikster.com's Release classes will also be able to understand our RSS items, as we have defined how they relate.
Bringing RSS 2.0 to the PartyThere are various reasons, substantially matters of personal preference, why some may prefer an RSS 2.0 format. If we can map RSS 2.0 with our extension module unambiguously to the equivalent RSS 1.0 version, then what we have done is to effectively turned the XML syntax into a task-specific serialization of RDF. We can get all the semantic goodness of RDF in the simple XML packaging of RSS 2.0. This is the approach taken by my project, Simple Semantic Resolution (SSR), which is actually defined as an RSS 2.0 module. A step-by-step description, SSR-Enabling an RSS 2.0 Module, is available, but we have already looked at most of these steps already here. What we haven't done yet is defined the mapping. In SSR this is done by supplying an XSLT stylesheet that can carry out transformations of documents using our module in combination with RSS 2.0 into their RSS/RDF counterpart.
A stylesheet is available (thanks to Sjoerd Visscher) that can convert core RSS 2.0 into RSS 1.0, so all we have to do is to do the extra needed to convert our XML elements and contents into RDF properties and objects via a syntactical transformation. Which for our software release module is absolutely nothing. Sjoerd's XSLT passes through unchanged any XML that isn't recognised as RSS, and that's exactly what we want for our syntax.
So all we have to do to give instances of our extended RSS 2.0 the RDF semantics is to use SSR to identify the transform that defines the mapping. All this takes is the insertion of an extra element into the RSS just below the root level, so our enriched RSS 2.0 will look like this:
<rss version="2.0"A regular RSS 2.0 client can understand this, as there is no change to the core format.
Conclusion