知识管理国家标准_第1页
知识管理国家标准_第2页
知识管理国家标准_第3页
知识管理国家标准_第4页
知识管理国家标准_第5页
已阅读5页,还剩80页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

知识管理

KnowledgeManagement李海生

1课程邮箱PWD:123456782与知识管理相关的Topic信息检索InformationRetrieval知识工程KnowledgeEngineering语义网SemanticWeb本体Ontology资源描述框架ResourceDescriptionFramework本体描述语言OntologyWebLanguage知识网格KnowledgeGrid面向服务的架构Service-OrientedArchitecture知识管理成熟度模型KnowledgeManagementMaturityModel(K3M)知识管理案例……3知识管理标准知识管理标准国家标准GB/T23703.1欧洲标准澳大利亚国家标准加拿大国家标准英国国家标准美国APQC标准(美国生产力与质量中心AmericanProductivityandQualityCenter)4知识管理国家标准框架术语组织文化知识活动实施指南评价5知识管理业务流程知识管理成熟度模型K3M知识管理评估模型6上次课程内容回顾元数据召回率(Recall)检索出的相关文档数和文档库中所有的相关文档数的比率衡量的是搜索引擎的查全率

精度(Precision)

检索出的相关文档数与检索出的文档总数的比率

衡量的是搜索引擎的查准率7语义Web语义Web的基础架构[TimBerners-Lee,2000]

8语义网书籍推荐9语义网书籍推荐10元数据表示语言

标记语言

标准通用标记语言SGML超文本标记语言HTML可扩展标记语言XML虚拟现实模型语言VRML无线标记语言WML元数据标准

DublinCoreHL7(描述医学网络资源的元数据)教育资源元数据

机读目录(MARC)

11XML

性质W3C于1998年2月发布的一种标准

是SGML的一个简化子集

可扩展标记语言特点较好地解决了HTML无法表达数据内容等问题允许各个组织、个人建立适合自己需要的标记集合

12XML与HTML比较文档的3个要素数据、结构以及显示方式

HTML显示方式内嵌在数据中

在创建文本时,要时时考虑输出格式

创建文档的重复工作量大

不易抽取语义信息

XML显示格式从数据内容中独立出来,保存在样式单文件(StyleSheet)中

自我描述性质能够很好地表现许多复杂的数据关系

13XML结构

文件头

与HTML类似,是可选的文件主体

包括一个或多个元素

形式是一棵分级的树

混杂的“结尾部分”由注释、处理指令和空白组成

注释用<!----!>表示,可在文档中任意位置

14元素(Element)

表示方法由开始标记、结束标识以及标识之间的数据构成

标记之间的数据被认为是元素的值

每个元素都有不同的标记名<director>王力</director>元素名是director元素值是“王力”<actor>王力</actor>元素名是actor元素值是“王力”15元素要点关键的3点

所有元素必须有结束标记

所有元素必须正确嵌套,不允许交迭

所有属性值必须加引号

注意点XML文档主体有且仅有一个XML根元素

可以嵌套XML元素,形成一棵树形结构

16XML文档例子<书类><书

国际标准书号="0345374827"><标题>数据结构</标题><作者>许卓群等</作者></书><书

国际标准书号="0345374828"><标题>数据挖掘</标题><作者>韩家炜等</作者></书></书类>17例子的树状结构

18XML属性

给元素提供进一步的说明信息

必须出现在起始标记中

以名称/取值对出现,属性名不能重复名称与取值之间用等号“=”分隔用引号把取值引起来

例如

<工资

货币="人民币元">100000</工资>说明了工资的货币单位是人民币元

19XML处理器

目的解析XML文档提供对XML文档内容和结构的访问

文档对象模型(DocumentObjectModel,DOM)将完整的XML转换成一棵树的形式放在内存中

供随机访问元素、属性

XML简单API(SimpleAPIforXML,SAX)采用事件驱动模型

通过标记的起止来触发事件

DOM与SAX的比较(讨论)20处理指令(ProcessingInstruction)

目的给XML处理器提供信息,使其能够正确解释文档内容表示起始标记是“<?”,结束标记是“?>”方法XML分析器把这些信息原封不动地传给应用程序

由应用程序来解释这个指令

遵照它所提供的信息进行处理

21两种处理指令XML声明

<?Xmlversion="1.0"encoding="gb2312"standalone="no"?>必须包括version属性,指明所采用的XML的版本号,而且它必须在属性列表中排在第一位standalone属性表明该XML文档是否和一个外部文档类型定义DTD配套使用

encoding属性则指明了数据所采用的编码标准

XSL样式单引用

<?xml-stylesheettype=“text-xsl”href=“contacts.xsl”?>告诉XSL样式单解析器,样式单的类型是text-xsl类型text-xsl可以在文档contacts.xsl中找到

22XML的名字空间

背景由于XML对互操作性的支持,每个人都可以创建属于自己的XML词汇

不同的开发者会用相同的元素来代表不同的实体

作用为XML文档元素提供了一个上下文

允许开发者按一定的语义来处理元素

为什么引入NS(命名空间)讨论23XMLNS例子<?xmlversion="1.0"?><hamburgersxmlns:purchase=/franchise/pricesxmlns:sales=/customer/prices><hamburgerlowfat="dreamon"><name>CowBurger</name><description>Greasyandgood.</description><purchase:price>0.99</price><sales:price>2.99</price></hamburger></hamburgers>24XSL(ExtensibleStylesheetLanguage)

背景用标准的DOMAPI来实现XML数据的交互,是十分单调乏味的

如想找到所有满足某些条件的元素,或转换为简单的HTML表格,必须手工书写代码遍历整棵树来寻找

目的为标准化及简化人们完成这些任务所需做的工作

25精度(Precision)<Riverid="Yangtze"org/river#River"/><li><xsl:value-ofselect="name"/>,<Damrdf:ID="ThreeGorges"org/geography/rivers"></obstacle>Types(classes)containproperties.<property-B><Riverid="Yangtze"<length>6300kilometers</length>Equivalent!xmlns:rdf="http://www.食品的例子XML文档<?xmlVersion="1.0"?><食品><食品

脂肪含量="低"><名称>月饼</名称><描述>中秋节食用的传统食品</描述><价格>2.99</价格></食品><食品>HTML文档<html><body><h1>食品</hl><o1><li>月饼,中秋节的传统食品,2元</li></o1></body></html>26XSL文件

<?xmlVersion="1.0"?>-xsl">

<xsl:templatematch="/">选取了当前结点的所有食品子结点

<html><body><hl>hamburgers</hl><xsl:for—eachselect="hamburgers[@lowfat="dreamon"]">

标识出符合给定条件的结点

<li><xsl:value-ofselect="name"/>,<xsl:value-ofselect="description"/>,<xsl:value-ofselect="price"/>

取结点中各个元素的值</li></xsl:for—each><body><html></xsl:template></xsl:stylesheet>27XSL用途增强了互操作性

XML数据转换为HTML从一种XML格式到另一种XML格式之间的转换

开发人员不用为了描述某种类型的数据而采用通用的词汇某个人向你的系统发送了一篇XML文档,而你的系统不认识它所采用的XML词汇只要进行一次简单的XSL转换就可以得到自己熟悉的词汇28文档类型定义

DTD

目的定义XML文档结构,即其中的元素、属性以及元素之间关系的

定义了文件中的元素能用什么名字,能放在什么位置,应该怎样组合

可以检测XML文档的结构是否正确

例如描述一组<表>,其中每个<表>又可以包含若干个<项>DTD中应该有语句:<!ELEMENT表(项)+><!ELEMENT项(#PCDATA)>生成的表:<表><项>管乐</项><项>弦乐</项><项>器乐</项><表>29DTD引用内部引用包含在XML文档的前导说明部分

如<?xmlversion="1.0"encoding="GB2312"standalone="yes"?><!DOCTYPE根元素名[元素描述]>

文档体…外部引用作为一个外部文档被引用

如<?xmlversion="1.0"encoding="GB2312"standalone="no"?><!DOCTYPE根元素名

SYSTEM"外部DTD文件的URL">

文档体…SYSTEM指一个作者或组织所编写的通用的DTD或是<!DOCTYPE根元素PUBLIC"DTD名称""外部DTD的URL">PUBLIC指由权威机构制订的、提供给特定行业或公众使用的DTD

30DTD中ETD(元素类型声明)作用声明所有有效的文档元素

结构

<!ELEMENT元素名元素内容描述>类型

空元素类型

<!ELEMENT元素名EMPTY>使用空元素标记,元素中没有内容

ANY元素类型

元素中可以包含任何内容

父元素类型

元素中可以包含子元素在DTD中通过正则表达式规定子元素出现的顺序和次数

混合元素类型

<!ELEMENT元素名(#PCDATA|子元素名1|子元素名2|…)>元素中可以包含文本文本之间可以有选择地插入子元素,子元素出现的顺序和次数不受限制

31XMLSchema

DTD缺点采用了非XML的语法规则不支持数据类型扩展性较差XML模式己经渐有取代DTD的趋势拥有比DTD更强大的功能

用于更精确和有效地描述XML文档结构32XML模式的优点一致性直接借助XML自身的特性利用XML的基本语法规则定义XML文档的结构不必再利用一种特定的形式化的语言扩展性

引入了数据类型、命名空间在基本数据类型基础上用户可自己扩展数据类型互换性

利用模式能够书写XML文档并验证文档的合法性

对不同的模式进行转换,以实现更高层次的数据交换

规范性

利用元素的内容和属性来定义XML文档的整体结构基于XML,更具有规范性

33数据类型

用途为ElementType和AttributeType指定数据类型

基本数据类型(10种)entity,entities,enumeration,id,idref,idrefs,nmtoken,nmtokens,notation和string扩展数据类型

bin.baSe64,bin.heX,boolean,char,date,dateTime,dateTime.tz,,float,int,number,timetime.tz,i1,i2,i4,r4,r8,ui1,ui2,ui4,uri,uuid34XMLS元素类型基本格式

<ElementTypecontent="{|empty|textOnly|eltOnly|mixed}"dt:type="datatype"model="{open|closed}"name="idref"order="{one|seq|many}“>

</ElementType>

取值及含义

(略)35XMLS属性类型基本格式

<AttributeTypedefault="default-value"dt:type="primitive-typedt:values="enumerated-values"name="idref"required="{yes|no}">取值及含义

(略)36数据类型的使用例子(1)定义元素“名字”和“生日”<elementname="name"type="string"minOccurs="1"maxOccurs="1"/><elementname="birthday"type="date"minOccurs="1"maxOccurs="1"/>其中string和date类型都是Schema中自带的基本数据类型minOccurs和maxOccurs是最少和最多出现次数的约束,这里表示有而且只出现一次

37数据类型的使用例子(2)扩展数据类型Schema中没有规定的类型,如“性别”类型

定义例子

<simpleTypename="性别"><restrictionbase="string"><enumerationvalue="男"/><enumerationvalue="女"/></restriction></simpleType>注释name属性是该数据类型的名称

数据类型由restriction子元素进行约束该元素中的base属性是基类型

38元数据自动抽取技术

预处理

剔除在格式、内容、语言等方面存在问题或严重缺失的文档

产生格式相对规整的文本文档

提取元数据

由数字化文档元数据的规范定义,产生提取元数据的各种模式

依据元数据模式进行数字化文档的挖掘与匹配

利用与数字化文档相关的启发式规则和经验规则,有效提取元数据

39MathML含义MathematicalMarkupLanguage用途用来描述数学符号、纪录其结构和内容目标是在Web上实现能像HTML处理文本一样,处理数学问题

40例:x2+4x+4=0

<apply>

<plus/><apply><power/><ci>x</ci><cn>2</cn></apply><apply>

<times/><cn>4</cn><ci>x</ci></apply><cn>4</cn></apply>41SMIL含义SynchronizedMultimediaIntegrationLanguage用途一种基于XML的表述多媒体演示的语言

将一组独立的多媒体对象整合为一个多媒体演示

42SMIL例子<HTML><HEAD><STYLE>.time{behavior:url(#default#time);}</STYLE></HEAD><BODY>

<DIVCLASS="time"t:timeline="seq"><Pclass="time"t:dur="1">

Thisappearsforonesecondandgoesaway

</P><Pclass="time"t:dur="1">

Thisappearsafteronesecond,remainsvisibleforonesecondandgoesaway

</P><Pclass="time"t:dur="1">

Thisappearsaftertwoseconds,remainsvisibleforonesecondandgoesaway

</P></DIV></BODY></HTML>43CDF

含义ChannelDefinitionFormat

一种开放的规格允许Web的发布者经常更新信息或是频道

CDF起到了频道内容目录的作用用户仅需选择一下频道

信息就会从Web服务器定时的传递到客户端

44资源描述语言RDF45资源描述框架语言RDF采用元数据来索引网络上的信息使用RDF(ResourceDescriptionFramework)来描述元数据以及元数据之间的关系元数据是“关于数据的数据”,是用来描述网络资源的数据。RDF是处理元数据的基础,它为在应用程序之间交换机器可理解的网络数据提供了可互操作性。46RDF的应用领域RDF可以应用在很多领域中在资源发现中,RDF可以增强搜索引擎语义处理能力在编目领域中,RDF可以用来描述某个网站、网页之间或者数字图书馆中的内容及内容之间的关系采用RDF的智能主体(Agent)能够提高机构之间知识共享和交换的能力47RDF的作用?RDF(ResourceDescriptionFramework)来描述元数据以及元数据之间的关系长江的XML描述文档<?xmlversion="1.0"?><Riverid="Yangtze"xmlns="/river"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>"HereisdataabouttheYangtzeRiver.Ithasalengthof6300kilometers.ItsstartingLocationiswesternChina'sQinghai-TibetPlateau.ItsendingLocationistheEastChinaSea."48XML-->RDF<?xmlversion="1.0"?><Riverid="Yangtze"xmlns="/river"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>XML将XML文档修改为有效的RDF文档:<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"

xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>RDFYangtze.xmlYangtze.rdf"convertto"49RDF格式<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"

xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>RDFprovidesanIDattributeforidentifyingtheresourcebeingdescribed.TheIDattributeisintheRDFnamespace.Addthe"fragmentidentifiersymbol"tothenamespace.12350RDF格式(cont.)<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"

xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>Identifiesthetype(class)oftheresourcebeingdescribed.Identifiestheresourcebeingdescribed.ThisresourceisaninstanceofRiver.Theseareproperties,orattributes,ofthetype(class).Valuesoftheproperties123451命名规则xmlns="/river#"Question:为什么在命名空间后放置"#"?E.g.,Answer:RDFisveryconcernedaboutuniquelyidentifyingthings-uniquelyidentifyingthetype(class)anduniquelyidentifyingtheproperties.Ifweconcatenatethenamespacewiththetypethenwegetauniqueidentifierforthetype,e.g.,/river#RiverIfweconcatenatethenamespacewithapropertythenwegetauniqueidentifierfortheproperty,e.g.,/river#length/river#startingLocation/river#endingLocationThus,the"#"symbolissimplyamechanismforseparatingthenamespacefromthetypenameandthepropertyname.BestPracticeBestPractice52RDF格式<?xmlversion="1.0"?><Class

rdf:ID="Resource"

xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="uri"><property>value</property><property>value</property>...</Class>53使用RDF格式的好处TheRDFformat,ifwidelyused,willhelptomakeXMLmoreinteroperable:Toolscaninstantlycharacterizethestructure,"thiselementisatype(class),andhereareitsproperties”.RDFpromotestheuseofstandardizedvocabularies...standardizedtypes(classes)andstandardizedproperties.TheRDFformatgivesyouastructuredapproachtodesigningyourXMLdocuments.TheRDFformatisaregular,recurringpattern.Itenablesyoutoquicklyidentifyweaknessesandinconsistenciesofnon-RDF-compliantXMLdesigns.Ithelpsyoutobetterunderstandyourdata!Youreapthebenefitsofbothworlds:YoucanusestandardXMLeditorsandvalidatorstocreate,edit,andvalidateyourXML.YoucanusetheRDFtoolstoapplyinferencingtothedata.ItpositionsyourdatafortheSemanticWeb!NetworkeffectInteroperability54使用RDF格式的缺点受限制:在设计XML文件时受到RDF格式的约束.RDF使用命名空间来唯一识别类(types/classes),属性和资源。要求对命名空间有准确的理解。必须掌握RDF格式的语法。55唯一识别资源EarlierwesaidthatRDFisveryconcernedaboutuniquelyidentifyingthetype(class)andtheproperties.RDFisalsoveryconcernedaboutuniquelyidentifyingtheresource,e.g.,<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>Thisistheresourcebeingdescribed.Wewanttouniquelyidentifythisresource.56<名称>月饼</名称>元素名是director<startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation>xmlns="http://www.<Damid="ThreeGorges"<property-B>由开始标记、结束标识以及标识之间的数据构成0"encoding="gb2312"standalone="no"?><endingLocation>EastChinaSea</endingLocation><obstaclerdf:resource="http://www.<length>6300kilometers</length>rdf:IDThevalueofrdf:IDisa"relativeURI".The"completeURI"isobtainedbyconcatenatingtheURLoftheXMLdocumentwith"#"andthenthevalueofrdf:ID,e.g.,<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>Thus,thecompleteURIforthisresourceis:Yangtze.rdf/geography/rivers#Yangtze57Yangtze2,v2.ItpositionsyourdatafortheSemanticWeb!RDFisalsoveryconcernedaboutuniquelyidentifyingtheresource,e.文本之间可以有选择地插入子元素,子元素出现的顺序和次数不受限制ItalsoshowsRivercontainingatype-Dam.<Riverrdf:ID="Yangtze"<endingLocation>EastChinaSea</endingLocation>xml:base="http://www.<标题>数据结构</标题><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><?xmlversion="1.0"encoding="gb2312"standalone="no"?>ThisisinconsistentwithRDFdesignpattern.org/geography/rivers">NoticethattheRDFdesignpatternisanxml:baseOnthepreviousslideweshowedhowtheURLofthedocumentprovidedthebaseURI.Dependingonthelocationofthedocumentisbrittle:itwillbreakifthedocumentismoved,oriscopiedtoanotherlocation.AmorerobustsolutionistospecifythebaseURIinthedocument,e.g.,<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"

xml:base="/geography/rivers"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>ResourceURI=concatenation(xml:base,'#',rdf:ID)=concatenation(/geography/rivers,'#',"Yangtze")=/geography/rivers#Yangtze58rdf:about不使用相对的URI,而是用rdf:about标识出完整的资源URI。<?xmlversion="1.0"?><Riverrdf:about="/geography/rivers#Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>59RDF三元组->资源/属性/值/geography/rivers#Yangtzehasa/river#lengthof6300kilometersresourcepropertyvalue/geography/rivers#Yangtzehasa/river#startingLocationofwesternChina's...resourcepropertyvalue/geography/rivers#Yangtzehasa/river#endingLocationofEastChinaSearesourcepropertyvalue60TheRDFFormat=triples!ThefundamentaldesignpatternofRDFistostructureyourXMLdataasresource/property/valuetriples!Thevalueofapropertycanbealiteral(e.g.,lengthhasavalueof6300kilometers).Also,thevalueofapropertycanbearesource,asshownabove(e.g.,property-AhasavalueofResource-B,property-BhasavalueofResource-C).Wewillseeexamplesofpropertieshavingaresourcevalueinalittlebit.<?xmlversion="1.0"?><Resource-A><property-A><Resource-B><property-B><Resource-C><property-C>Value-C</property-C></Resource-C></property-B></Resource-B></property-A></Resource-A>valueofproperty-Avalueofproperty-BNoticethattheRDFdesignpatternisanalternatingsequenceofresource-property.Thispatternisknownas"striping".61命名规范类名的第一个字母大写,属性名的第一个字母小写。便于快速识别类名,属性名。<?xmlversion="1.0"?><Riverrdf:about="/geography/rivers#Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River>uppercaselowercase62RDFModel(graph)Legend:Ellipseindicates"Resource"Rectangleindicates"literalstringvalue"63rdf:Description+rdf:typeThereisstillanotherwayofrepresentingtheXML.Thiswaymakesitveryclearthatyouaredescribingsomething,anditmakesitveryclearwhatthetype(class)isofthethingyouaredescribing:<?xmlversion="1.0"?><rdf:Descriptionrdf:about="/geography/rivers#Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#">

<rdf:typerdf:resource="/river#River"/><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></rdf:Description>Thisisreadas:"ThisisaDescriptionabouttheresource/geography/rivers#Yangtze.This

resourceisaninstanceoftheRivertype(class).The/geography/rivers#Yangtzeresourcehasalengthof6300kilometers,astartingLocationofwesternChina'sQinghai-TibetPlateau,andanendingLocationoftheEastChinaSea."Note:thisformofdescribingaresourceiscalledthe"longform".Theformwehaveseenpreviouslyisanabbreviationofthislongform.AnRDFParserinterpretstheabbreviatedformasifitwerethislongform.64AlternativeAlternativelywecanuserdf:IDratherthanrdf:about,asshownhere:<?xmlversion="1.0"?><rdf:Description

rdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"

xml:base="/geography/rivers">

<rdf:typerdf:resource="/river#River"/><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></rdf:Description>65EquivalentRepresentations!<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"

xml:base="/geography/rivers"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River><?xmlversion="1.0"?><Riverrdf:about="/geography/rivers#Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></River><?xmlversion="1.0"?><rdf:Description

rdf:about="/geography/rivers#Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"><rdf:typerdf:resource="/river#River"/><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation></rdf:Description>Note:IntheRDFliteraturetheexamplesaretypicallyshowninthisform.66RDFNamespace/1999/02/22-rdf-syntax-ns#IDabouttyperesourceDescription67术语AsyoureadtheRDFliteratureyoumayseethefollowingterminology:Subject:thistermreferstotheitemthatisplayingtheroleoftheresource.predicate:thistermreferstotheitemthatisplayingtheroleoftheproperty.Object:thistermreferstotheitemthatisplayingtheroleofthevalue.SubjectObjectpredicateResourceValuepropertyEquivalent!68RDFParserThereisaniceRDFparserattheW3Website:ThisRDFparserwilltellyouifyourXMLisintheproperRDFformat.69Example#2<?xmlversion="1.0"?><Riverid="Yangtze"xmlns="/river"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation>

<Damid="ThreeGorges"xmlns="/dam"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam></River>Yangtze2.xmlModifythefollowingXMLdocumentsothatitisRDF-compliant:70Notethetwotypes(classes)RiverDamInstance:YangtzeProperties: length startingLocation endingLocationInstance:ThreeGorgesProperties: name width height cost71Dam-outofplace<?xmlversion="1.0"?><Riverid="Yangtze"xmlns="/river"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation>

<Damid="ThreeGorges"xmlns="/dam"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam></River>DamTypes(classes)containproperties.HereweseetheRivertypecontainingtheproperties-length,startingLocation,andendingLocation.ItalsoshowsRivercontainingatype-Dam.Thus,thereisaResourcethatcontainsanotherResource.ThisisinconsistentwithRDFdesignpattern.(WeareseeingoneofthebenefitsofusingtheRDFformat-toidentifyinconsistenciesinanXMLdesign.)72Propertyvaluemustbea

LiteraloraResource<length>6300kilometers</length>propertyValueisaLiteral<obstacle><Damid="ThreeGorges"xmlns="/dam"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam></obstacle>propertyValueisaResource73ModifiedXML(tomakeitconsistent)<?xmlversion="1.0"?><Riverid="Yangtze"xmlns="/river"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation><obstacle><Damid="ThreeGorges"xmlns="/dam"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam></obstacle></River>Yangtze2,v2.xml"TheYangtzeRiverhasanobstaclethatistheThreeGorgesDam.TheDamhasaname-TheThreeGorgesDam.Ithasawidthof1.5miles,aheightof610feet,andacostof$30billion."74RDFFormat<?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"#"xml:base="/geography/rivers"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation>

<obstacle><Damrdf:ID="ThreeGorges"#"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam></obstacle></River>Changedidtordf:IDAddedthe'#'symbolAsalways,theotherrepresentationsusingrdf:aboutandrdf:Descriptionareavailable.75RDFModel(graph)76<?xmlversion="1.0"?><Damrdf:ID="ThreeGorges"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"#"xml:base="/geography/rivers"><name>TheThreeGorgesDam</name><width>1.5miles</width><height>610feet</height><cost>$30billion</cost></Dam><?xmlversion="1.0"?><Riverrdf:ID="Yangtze"xmlns:rdf="/1999/02/22-rdf-syntax-ns#"xmlns="/river#"xml:base="/geography/rivers"><length>6300kilometers</length><startingLocation>westernChina'sQinghai-TibetPlateau</startingLocation><endingLocation>EastChinaSea</endingLocation>

<obstaclerdf:resource="/geography/rivers#ThreeGorges"/></River>Three-Gorges-Dam.rdfAlternatively,supposethatsomeonehasalreadycreatedadocumentcontaininginformationabouttheThreeGorgesDam:Yangtze.rdfThenwecansimplyreferencetheThreeGorgesDamresourceusingrdf:resource,asshownhere:77Note:referenceistoaresource,nottoafile<obstaclerdf:resource="/geography/rivers#ThreeGorges"/>Whywasthisthereference:<obstaclerdf:resource="/geography/rivers/Three-Gorges-Dam.rdf"/>andnotthis:Thatis,whywasn'tthereferencetoa"file"?Answer:1.Whatifthefilemoved?Thenthereferencewouldbreak.2.ByusinganidentifieroftheThreeGorgesDam,andkeepingaparticularfileunspecified,thenan"aggregatortool"willbeabletocollectinformationfromallthefilesthattalkabouttheThreeGorgesDamresource(seenextslide).DoLab278Anyone,Anywhere,AnytimeCanTalkAboutaResourceInallofourexampleswehaveprovidedauniqueidentifiertoresources,e.g.,/geography/rivers#YangtzeConsequently,ifanotherRDFdocumentidentifiesthesameresourcethenthedatathatitspecifiesgivesadditionaldataaboutthatresource.Anaggregatortoolwillbeabletocollectalldataaboutaresourceandpresentaconsolidatedsetofdatafortheresource.That'spowerful!79rdf:IDversusrdf:aboutWhenshouldrdf:IDbeused?Whenshouldrdf:aboutbeused?Whenyouwanttointroducearesource,andprovidean

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论