听dj战歌,就上傲气战歌网!2015年传奇家族玩家最喜爱的家族战歌网
战歌推荐:战歌网 战歌网dj Mc战歌网 DJ战歌网下载 激情战歌-冰雪战歌网 客服Q:350317
新闻搜索:

Extending RSS(3)

作者:傲气战歌网     来源: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:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdf:Property rdf:about="http://supersemantics.com/ns/release/product">
<rdfs:label>Product Name</rdfs:label>
<rdfs:comment>The official name of a software package</rdfs:comment>
<rdfs:subPropertyOf rdf:resource="http://eikster.com/2003/release#name" />
<rdfs:domain rdf:resource="http://purl.org/dc/elements/1.1/item"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
<rdfs:isDefinedBy rdf:resource="http://supersemantics.com/ns/release"/>
</rdf:Property> <rdf:Property rdf:about=""http://supersemantics.com/ns/release/version">
<rdfs:label>Release Version</rdfs:label>
<rdfs:comment>The release version of a software package, given in major.minor format, e.g. 2.3</rdfs:comment>
<rdfs:subPropertyOf rdf:resource="http://eikster.com/2003/release#version" />
<rdfs:domain rdf:resource="http://purl.org/dc/elements/1.1/item"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
<rdfs:isDefinedBy rdf:resource="http://supersemantics.com/ns/release"/>
</rdf:Property>

</rdf:RDF>

Together 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 Party

There 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"
xmlns:rel="http://supersemantics.com/ns/release/" xmlns:ssr="http://purl.org/stuff/ssr"> <ssr:rdf transform="http://ideagraph.net/xmlns/ssr/source/rss2rdf.xsl" /> ...
<item>
<title>New Release</title>
<pubDate>Sat, 19 Jun 2003 14:02:33 GMT+1</pubDate>
<link>#9</link>
<rel:product>IronBoard</rel:product>
<rel:version>2.3</rel:version>
... </rss>

A regular RSS 2.0 client can understand this, as there is no change to the core format.

Conclusion

数据统计中!!

看过该文章的网友还看过
最新评论共有  位网友发表了评论
发表评论(评论内容:请文明参与评论,禁止谩骂攻击!)
不能超过250字节,请自觉遵守互联网相关政策法规.
昵称:    发表评论 (Ctrl+Enter快速回复)

关于本站 | 合作加盟 | 合作说明 | 免责声明 | 广告服务 | 网站地图

健康游戏忠告:抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活

如有意见和建议,请惠赐E-mail至350317@qq.com 联系QQ:350317

Copyright © 2010-2013 Www.27zG.CoM
苏ICP备11049833号