1. RDF schema is quite different from XML Schema
XML Schema constrains the structure of XML documents, whereas RDF Schema defines the vocabulary used in RDF data models.
Resource
Property
Statement
RDF里用到的很多数据类型是在XML Schema里定义的,比如Boolean, integer等
XML中的namespace是用来保证元素的唯一性.
RDF中的external namespace指向一个RDF文件,这个文件里定义了一些resource,被导入到了当前RDF中.
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XLMSchema#"
xmlns:uni="http://www.mydomain.org/uni-ns#">
……
<rdf:Description rdf:about="CIT1111">
<rdf:type rdf:resource="&uni;course"/>
// 应该相当于 <rdf:type rdf:resource=”http://www.mydomain.org/uni-ns#course”>, 即&uni用来指代xmlns:uni的值
<uni:courseName>Discrete Mathematics</uni:courseName>
<uni:isTaughtBy rdf:resource="949318"/>
</rdf:Description>
1. RDF Schema is a primitive ontology language.
2. In RDFS, properties are defined globally.
3. In RDFS, properties also have class hierarchy.
4. RDFS ingredients: subClassOf, Class, Property, subPropertyOf, Resource, etc.
rdfs:Resource
rdfs:Class
rdfs:Literal
rdf:Property
rdf:Statement
rdfs:domain
指定可以做这个property的subjet
rdfs:range
指定可以做这个property的object
rdf:subject
rdf:predicate
rdf:object
rdf:Bag
rdf:Alt
rdf:Seq
rdfs:seealso
rdfs:comment
// 没看
逻辑推理
// 没看
(1) 相同的内容可以用不同的形式来表示,无法用统一的XPath语句来查询
如以下3段都表示了相同的意思:
<rdf:Description rdf:about="949318">
<rdf:type rdf:resource="&uni;lecturer"/>
<uni:name>David Billington</uni:name>
<uni:title>Associate Professor</uni:title>
</rdf:Description>
rdf query: /rdf:Description[rdf:type="http://www.mydomain.org/uni-ns#lecturer"]/uni:title
或
<uni:lecturer rdf:about="949318">
<uni:name>David Billington</uni:name>
<uni:title>Associate Professor</uni:title>
</uni:lecturer>
rdf query: //uni:lecturer/uni:title
或
<uni:lecturer rdf:about="949318"
uni:name="David Billington"
uni:title="Associate Professor"/>
rdf query: //uni:lecturer/@uni:title
(2) XML 查询语言(如XPath) 不支持semantic(如无法”理解”继承关系)
见教材
An extensive list of tools and other resources is maintained at:
• <http://www.ilrt.bris.ac.uk/discovery/rdf/resources/>.
• <http://www.w3.org/RDF>