<?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的区别: rdf:about的值是一个完整URIref,注意也可以是相对URI,(相对于xml:base); rdf:ID是对rdf:about的值的缩写,其值是一个“ XML Name”,所以,不能是数字开头,不能有“/”符号等。 例如:rdf:ID="PizzaBase" 等价于rdf:about="(xml:base)+‘#’+‘PizzaBase’ " 这个xml:base的值可以在XML文件头声明,如你例子中的,xml:base="http://www./unnamed.owl", 如果没有声明,则其值是RDF文件所放在的位置uri。 2)rdf:resource 和rdf:about <owl:disjointWith rdf:resource="#PizzaBase"/> 是 <owl:disjointWith > <rdf:Description rdf:about="#PizzaBase" /> </owl:disjointWith > 的缩写。这里必须没有对资源="#PizzaBase" 做进一步的说明。所以,rdf:resource只能出现在表示属性的节点中,如这里的owl:disjointWith节点。 而 <owl:disjointWith> <owl:Class rdf:about="#PizzaTopping"/> </owl:disjointWith> 是等价于: <owl:disjointWith > <rdf:Description rdf:about="#PizzaTopping" > <rdf:type rdf:resource="&rdfs;Class" /> </rdf:Description> </owl:disjointWith > 这里不能用rdf:resource了,因为声明了#PizzaTopping是一个类。 所以,我们可以看出: 说明了: <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/ |
|
来自: Erica_Shea > 《rdf数据库》