|
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www./1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www./2000/01/rdf-schema#" xmlns:jeromedl="http://www./rdf/jeromedl.rdfs#" xmlns:xalan="http://xml./xslt" xmlns:xs="http://www./2001/XMLSchema" xml:lang="pl"> <rdf:RDF xmlns:owl="http://www./2002/07/owl#" xmlns="http://www./unnamed.owl#" xmlns:rdfs="http://www./2000/01/rdf-schema#" xmlns:rdf="http://www./1999/02/22-rdf-syntax-ns#" xml:base="http://www./unnamed.owl"> <owl:Ontology rdf:about=""/> <owl:Class rdf:ID="PizzaBase"> <owl:disjointWith> <owl:Class rdf:ID="Pizza"/> </owl:disjointWith> <owl:disjointWith> <owl:Class rdf:ID="PizzaTopping"/> </owl:disjointWith> </owl:Class> <owl:Class rdf:about="#Pizza"> <owl:disjointWith rdf:resource="#PizzaBase"/> <owl:disjointWith> <owl:Class rdf:about="#PizzaTopping"/> </owl:disjointWith> </owl:Class> <owl:Class rdf:about="#PizzaTopping"> <owl:disjointWith rdf:resource="#PizzaBase"/> <owl:disjointWith rdf:resource="#Pizza"/> </owl:Class> </rdf:RDF> 1)rdf:ID和rdf:about的區(qū)別: rdf:about的值是一個(gè)完整URIref,注意也可以是相對(duì)URI,(相對(duì)于xml:base); rdf:ID是對(duì)rdf:about的值的縮寫(xiě),其值是一個(gè)“ XML Name”,所以,不能是數(shù)字開(kāi)頭,不能有“/”符號(hào)等。 例如:rdf:ID="PizzaBase" 等價(jià)于rdf:about="(xml:base)+‘#’+‘PizzaBase’ " 這個(gè)xml:base的值可以在XML文件頭聲明,如你例子中的,xml:base="http://www./unnamed.owl", 如果沒(méi)有聲明,則其值是RDF文件所放在的位置uri。 2)rdf:resource 和rdf:about <owl:disjointWith rdf:resource="#PizzaBase"/> 是 <owl:disjointWith > <rdf:Description rdf:about="#PizzaBase" /> </owl:disjointWith > 的縮寫(xiě)。這里必須沒(méi)有對(duì)資源="#PizzaBase" 做進(jìn)一步的說(shuō)明。所以,rdf:resource只能出現(xiàn)在表示屬性的節(jié)點(diǎn)中,如這里的owl:disjointWith節(jié)點(diǎn)。 而 <owl:disjointWith> <owl:Class rdf:about="#PizzaTopping"/> </owl:disjointWith> 是等價(jià)于: <owl:disjointWith > <rdf:Description rdf:about="#PizzaTopping" > <rdf:type rdf:resource="&rdfs;Class" /> </rdf:Description> </owl:disjointWith > 這里不能用rdf:resource了,因?yàn)槁暶髁?PizzaTopping是一個(gè)類(lèi)。 所以,我們可以看出: 說(shuō)明了: <owl:Class rdf:ID="PizzaBase"> 以后,后面的都是用: <owl:disjointWith rdf:resource="#PizzaBase"/> 了。 ---------------------------------------------- Semantic Web is a dream; Semantic Web technology is the reality. Weblog: http://blog./~orangebench/ |
|
|
來(lái)自: Erica_Shea > 《rdf數(shù)據(jù)庫(kù)》