2008-2010byLiWeigang.Allrightsreserved.服务计算基础主讲:李伟刚liweigang@nwpu.edu.cn西北工业大学软件与微电子学院2008-2010byLiWeigang.Allrightsreserved.第九章语义Web服务2008-2010byLiWeigang.Allrightsreserved.主要内容概述语义网语义Web服务2008-2010byLiWeigang.Allrightsreserved.第一节概述2008-2010byLiWeigang.Allrightsreserved.语义是事物的观察者给事物本身赋予的含义,一致共享的语义构成观察者对事物的知识,是观察者之间互相交流的基础。语义网通过给万维网上的文档(如:HTML)添加能够被计算机理解的语义(Metadata),从而使整个万维网中现存的信息发展成一个巨大的全球信息库、知识库。语义和语义网2008-2010byLiWeigang.Allrightsreserved.Web服务使用标准的、规范的XML进行描述,包括消息格式、传输协议和位置,隐藏了实现服务的细节。WSDL从句法层面对Web服务的功能进行描述,包括4个不同的方面:数据类型、消息、操作和访问端口。这只是提供了Web服务的接口描述,对服务的行为约束和属性描述缺乏进一步的支持。缺陷数据管理有序性与Web上信息无序性;搜索引擎查全查准要求与服务描述缺语义;信息获取效率与Web海量动态数据。语义Web服务2008-2010byLiWeigang.Allrightsreserved.语义Web服务的主要方法是利用Ontology来描述Web服务,通过带有语义信息的Web服务来实现服务的自动发现,调用和组合。语义Web和Web服务是语义Web服务的两大支撑技术。OWL-S是连接两大技术的桥梁。目前对语义Web服务标记语言研究最典型的组织就是DARPA(DefenceAdvancedResearchProjectsAgency)组织,其研究组OWLServicesCoalition提出了语义Web服务标记语言OWL-S语义Web服务2008-2010byLiWeigang.Allrightsreserved.第二节语义网2008-2010byLiWeigang.Allrightsreserved.SemanticWeb的由来Webwas“invented”byTimBerners-Lee,aphysicistworkingatCERNTBL’soriginalvisionoftheWebwasmuchmoreambitiousthantherealityoftheexisting(syntactic)Web:TBL(andothers)havesincebeenworkingtowardsrealisingthisvision,whichhasbecomeknownastheSemanticWebE.g.,articleinMay2001issueofScientificAmerican…“...agoaloftheWebwasthat,iftheinteractionbetweenpersonandhypertextcouldbesointuitivethatthemachine-readableinformationspacegaveanaccuraterepresentationofthestateofpeople'sthoughts,interactions,andworkpatterns,thenmachineanalysiscouldbecomeaverypowerfulmanagementtool,seeingpatternsinourworkandfacilitatingourworkingtogetherthroughthetypicalproblemswhichbesetthemanagementoflargeorganizations.”2008-2010byLiWeigang.Allrightsreserved.TheSemanticWebisanextensionofthecurrentwebinwhichinformationisgivenwell-definedmeaning,betterenablingcomputersandpeopletoworkinco-operation.–TimBerners-Lee,JamesHendler,OraLassila,TheSemanticWeb,ScientificAmerican,May2001SemanticWeb的定义2008-2010byLiWeigang.Allrightsreserved.SemanticWeb的架构的相关标准本体层1.以谓词演算为基础的语言KIF-basedOntolingua,CycL,Loom,Frame-Logic2.基于XML的本体表示语言SHOE,XOL,OML&CKML,RDFS,Riboweb,OIL,DAML+OIL,OWL规则层RuleML、HornML、DLML逻辑框架层FOL、HOL、DL、Horn-logic、OMDoc下四层已经发展的比较成熟与完善1.数据格式层2.信息表示层3.元数据表示层4.元数据定义层5.本体层6.规则层7.逻辑框架层8.证据层9.高信度Web层Wearehere!2008-2010byLiWeigang.Allrightsreserved.本体(ontology)aphilosophicaldiscipline,branchofphilosophythatdealwiththenatureandtheorganizationofreality.ScienceofbeingTriestoanswerthequestions:whatisbeing?whatarethefeaturescommontoallbeings?本体(ontology)的定义2008-2010byLiWeigang.Allrightsreserved.Ontologyisaformal,explicitspecificationofasharedconceptualization–Gruber要点:Conceptualization:anabstractmodelofphenomenaintheworldbyhavingidentifiedtherelevantconceptsofthosephenomena.Explicit:thetypeofconceptsused,andtheconstraintsontheiruseareexplicitlydefined.Formal:thefactthattheontologyshouldbemachinereadable.Shared:ontologyshouldcaptureconsensualknowledgeacceptedbythecommunities本体(ontology)的定义2008-2010byLiWeigang.Allrightsreserved.Whatisaconcept?Differentcommunitieshavedifferentnotionsonwhataconceptmeans:formalconceptsconceptlabelterminologyframeorOOThereism:nrelationshipbetweenwordsandconceptsdifferentwordsmayrefertothesameconceptsawordmayrefertoseveralconceptsOntologylanguagesshouldprovidemeansformakingthisdifferenceexplicit本体(ontology)的定义2008-2010byLiWeigang.Allrightsreserved.Classesconceptsofthedomainortasks,whichareusuallyorganizedintaxonomiesinuniv-ontology:studentandprofessoraretwoclassesRelationsatypeofinteractionbetweenconceptsofthedomainsuchas:subclass-of,is-a本体的构成2008-2010byLiWeigang.Allrightsreserved.FunctionsAspecialcaseofrelationsinwhichthen-thelementoftherelationshipisuniqueforthen-1precedingelementsSuchas:Price-of-a-used-carcandefinethecalculationofthepriceofthesecond-handcaronthecar-model,manufacturingdataandkilometersAxioms(公理)ModelsentencesthatarealwaystrueSuchas:ifthestudentattendsbothAandBcourse,thenheorshemustbeasecondyearstudent本体的构成2008-2010byLiWeigang.Allrightsreserved.Instancesrepresentspecificelementssuchas:StudentcalledPeterisaninstanceofStudentclass本体的构成2008-2010byLiWeigang.Allrightsreserved.RDFdatamodelResourcesAresourceisathingyoutalkabout(canreference)ResourceshaveURI’s(UniformResourceIdentifiers)RDFdefinitionsarethemselvesResourcesPropertiesAspecialkindofresources,describerelationsbetweenresources.(subject,predicate,object)资源描述框架(RDF)2008-2010byLiWeigang.Allrightsreserved.rdf:RDFxmlns:rdf=:uni=:Descriptionrdf:about=CIT1111uni:courseNameDiscreteMathematics/uni:courseNameuni:isTaughtByrdf:Descriptionrdf:about=949318uni:nameDavidBillington/uni:nameuni:titleAssociateProfessor/uni:title/rdf:Description/uni:isTaughtBy/rdf:Description/rdf:RDFRDF2008-2010byLiWeigang.Allrightsreserved.Classesandpropertiesclasses:asetofobjects,rdfs:Classinstances:individualobjectproperty:addrestrictionsonobjec