XML Design(A Gentle Transition from XML to RDF)
                               Roger L. Costello
                              David B. Jacobs
什么时候使用rdf:ID?什么时候使用rdf:about?
当你想介绍一个资源,并提供一系列关于这个资源的最初信息的时候使用rdf:ID;当你想扩展关于这个资源的信息时,使用rdf:about。RDF的原理和Web的原理一样:无论什么人,无论什么地方,无论什么时间都能提供关于资源的信息。
解释RDF
<?xml version="1.0"?>
<River xmlns="http://www.geodesy.org/river#">
     <name>Yangtze</name>     
     <length>6300 kilometers</length>
     <startingLocation>western China's Qinghai-Tibet Plateau</startingLocation>
     <endingLocation>East China Sea</endingLocation>
</River>
以上RDF文件理解如下:这是一个River类的实例。其名为Yangtze,长6300千米,起源地位西部青海,结束地点为中国东海。此RDF文档的资源是匿名的,它没有识别符。
rdf:Bag类型:表示一个未排序的集合。如,
 
<?xml version="1.0"?>
<Meeting rdf:ID="XML-Design-Pattern"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                xmlns="http://www.business.org#">
     <attendees>
          <rdf:Bag>
               <name>John Smith</name>
               <name>Sally Jones</name>
          </rdf:Bag>
     </attendees>
</Meeting>
 
rdf:Alt类型:表示一系列供选择的序列。如,
 
<?xml version="1.0"?>
<Retailer rdf:ID="BarnesAndNoble"       
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                xmlns="http://www.retailers.org#">
     <webLocation>
          <rdf:Alt>
               <url>http://www.bn.com</url>
               url>http://www.barnesandnoble.com</url>
          </rdf:Alt>
     </webLocation>
</Retailer>
 
rdf:Seq类型:用作表示顺序的属性。如,
 
<?xml version="1.0"?>
<ToDoList rdf:ID="MondayMeetings"
                   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                   xmlns="http://www.reminders.org#">
     <activities>
          <rdf:Seq>
               <activity1>Meet with CEO at 10am</activity1>
               <activity2>Luncheon at The Eatery</activity2>
               <activity3>Flight at 3pm</activity3>
          </rdf:Seq>
     </activities>
</ToDoList>
	posted on 2008-01-14 23:27 
matthew 阅读(343) 
评论(0)  编辑  收藏  所属分类: 
阅读笔记