rdf schema(轉)
RDF使用Schema來定義其類型系統,在定義類型時,RDF引入了部分面向對象的思想。由于RDF的圖中主要包含以下幾個部分,主語,謂語,賓語,文本。因此RDF Schema要做的主要就是為這不同的部分提供對應的一個類型。RDF Schema本身也是一個RDF文件。
<!--[if !supportLists]-->a) <!--[endif]-->繼承關系與實例關系
rdfs:subClassOf用于表示繼承關系。三元組A rdfs:subClassOf B表示A是B的子類,這與Java當中的class A extends B等價。
rdfs:type用于表示實例關系。三元組A rdfs:type B表示A是B的一個實例,這與Java當中的A = new B()等價。
<!--[if !supportLists]-->b) <!--[endif]-->類標記:
標記 |
說明 |
繼承關系(rdfs:subClassOf) |
實例關系(rdfs:type) |
rdfs:Resource |
所有出現在RDF圖中的對象都屬于資源 |
|
rdfs:Class |
rdfs:Class |
主語和賓語。用于指明主語或賓語所屬的類型 |
rdfs:Resource |
rdfs:Class |
rdfs:Literal |
文本 |
rdfs:Resource |
rdfs:Class |
rdfs:Datatype |
用于有類型文本,指定數據類型 |
rdfs:Class |
rdfs:Class |
rdf:XMLLiteral |
XML文本 |
rdfs:Literal |
rdfs:Datatype |
rdf:Property |
謂語 |
rdfs:Resource |
rdfs:Class |
rdfs:Container |
容器的基類 |
rdfs: Resource |
rdfs:Class |
rdf:Bag |
|
rdfs:Container |
rdfs:Class |
rdf:Seq |
|
rdfs:Container |
rdfs:Class |
rdf:Alt |
|
rdfs:Container |
rdfs:Class |
rdf:List |
集合 |
rdfs: Resource |
rdfs:Class |
rdf:nil |
空列表 |
|
rdf:List |
<!--[if !supportLists]-->c) <!--[endif]-->類定義:
<rdf:Description rdf:about="A">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class">
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Description>
等價于
<rdfs:Class rdf:about="A">
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdfs:Class>
<!--[if !supportLists]-->d) <!--[endif]-->范圍與域:
rdfs:range用于指定賓語的范圍。三元組P rdfs:range Q;A P B,在第一個三元組當中,我們規定了如果一個三元組使用了屬性P,那么三元組當中的賓語必須是Q的實例。第二個三元組單中,由于使用了P,所以可以得出B必定是Q的實例。
rdfs:domain用于指定主語的范圍。三元組P rdfs:range Q;A P B,在第一個三元組當中,我們規定了如果一個三元組使用了屬性P,那么三元組當中的主語必須是Q的實例。第二個三元組單中,由于使用了P,所以可以得出A必定是Q的實例。
<!--[if !supportLists]-->e) <!--[endif]-->屬性標記,所有的標記都是rdfs:Proerpty的實例
標記 |
說明 |
域,主語(rdfs:domain) |
范圍,賓語(rdfs:range) |
rdfs:range |
對賓語進行約束 |
rdfs:Class |
rdfs:Property |
rdfs:domain |
對主語進行約束 |
rdfs:Class |
rdfs:Property |
rdf:type |
用于定義實例關系 |
rdfs:Resource |
rdfs:Class |
rdfs:subClassOf |
用于定義繼承關系 |
rdfs:Class |
rdfs:Class |
rdfs:subPropertyOf |
用于定義屬性之間的繼承關系。子屬性的含義是指如果A是B的子屬性,那么如果主語和賓語符合A關系,那么他們也符合B關系。 |
rdfs:Property |
rdfs:Property |
rdfs:label |
提供用戶友好的標簽 |
rdfs:Resource |
rdfs:Literal |
rdfs:comment |
對資源進行描述 |
rdfs:Resource |
rdfs:Literal |
rdfs:member |
用于表示集合與元素之間的關系 |
rdfs:Resource |
rdfs:Resource |
rdf:first |
用于指明某個資源是某個集合的首元素 |
rdf:List |
rdfs:Resource |
rdf:rest |
|
rdf:List |
rdf:List |
<!--[if !supportLists]-->f) <!--[endif]-->屬性定義
<rdf:Property rdf:about="B">
<rdfs:domain rdf:resource="http://www.w3.org/
<rdfs:range rdf:resource="http://www.w3.org/
</rdf:Property>
posted on 2007-08-09 12:48 九寶 閱讀(655) 評論(1) 編輯 收藏 所屬分類: Semantic