2. Semantic Web Layers - XML and RDF

  • Upload
    imran

  • View
    238

  • Download
    0

Embed Size (px)

Citation preview

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    1/58

    Ontology languages, XML and RDF

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    2/58

    Contents

    • Definition of ontology•A quick survey to famous ontology languages

    • Graphical• Logic based● XML

    ● XML, namespaces, XL!● XL!, XL"#$

    ● %D#

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    3/58

    Ontology

    • An ontology is a hierarchically structured set of terms for

    describing a domain that can be used as a skeletal foundation

    for a kno&ledge base' (&artout, )atil, *night, %uss+

    • An ontology provides the means for describing eplicitly theconceptuali-ation behind the kno&ledge represented in a

    kno&ledge base' (.ernaras, Lasergoiti, /orrera+• An ontology is a formal, eplicit specification of a shared 

    conceptuali-ation (tuder, .en0amins,#ensel+

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    4/58

    (In)famous “Layer Cake”

    ≈ Data Exchange

    ≈ Semantics+reasoning

    ≈ Relational Data

    ?

    ?

    ???

    ???

    ???

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    5/58

    Ontology Languages• Wide variety of languages for “Explicit Specification”

     – Graphical notations

    • Semantic networks

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    6/58

    Ontology Languages• Wide variety of languages for “Explicit Specification”

     – Graphical notations

    • Topic Maps

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    7/58

    Ontology Languages• Wide variety of languages for “Explicit Specification”

     – Graphical notations

    • M!

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    8/58

    Ontology Languages

    • Wide variety of languages for “Explicit Specification”

     – Graphical notations

    • "#$

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    9/58

    Ontology Languages

    • Wide variety of languages for “Explicit Specification”

     – !ogic %ased

    • #escription !ogics &e'g'( )*!( #+M!,)*!( )W!-

    • "ules &e'g'( "uleM!( !./.rolog-

    • $irst )rder !ogic &e'g'( 0*$-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    10/58

    Ontology Languages• Wide variety of languages for

    “Explicit Specification”

     – !ogic %ased

    • 1onceptual graphs

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    11/58

    Ontology Languages

    • Wide variety of languages for “Explicit Specification”

     – !ogic %ased

    • 1onceptual graphs

    • &Syntactically- higher order logics &e'g'( !2ase-

    • 3on4classical logics &e'g'( $logic( 3on4Mon( modalities-

     – 2ayesian/pro%a%ilistic/fu55y

    • #egree of formality varies widely

     – *ncreased formality makes languages more amena%le to

    machine processing &e'g'( automated reasoning-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    12/58

    • )%6ects /*nstances/*ndividuals – Elements of the domain of discourse

     – E7uivalent to constants in $)!

    • Types /1lasses/1oncepts – Sets of o%6ects sharing certain characteristics

     – E7uivalent to unary predicates in $)!

    • "elations /.roperties/"oles – Sets of pairs &tuples- of o%6ects

     – E7uivalent to %inary predicates in $)!

    • Such languages are/can %e8 – Well understood

     – $ormally specified

     – &"elatively- easy to use

     – +mena%le to machine processing

    Many languages use “object oriented” model based on:

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    13/58

    We “!"#ema” Languages

    • Existing We% languages extended to facilitate contentdescription

     – 9M!  9M! Schema &9M!S-

     – "#$  "#$ Schema &"#$S-

    • 9M!S not  an ontology language – 1hanges format of #T#s &document schemas- to %e 9M!

     – +dds an extensi%le type hierarchy

    • *ntegers( Strings( etc'

    • 1an define su%4types( e'g'( positive integers

    • "#$S is recognisa%le as an ontology language

     – 1lasses and properties

     – Su%/super4classes &and properties-

     – "ange and domain &of properties-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    14/58

    XML

     – Unformal definition:

     –  XML is a markup language for representation of 

     – documents which contain stuctured information.

    •Usages:

    Data exchange (e.g. RSS S!"#$en%elope ad hoc &'&data exchange

    )e* ser%ices

    Data integration

    +ontent pu*lishing (single source multiple output

    Multimedia presentations (SM,L

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    15/58

    XML

    • .rocessing

     – .arsing

    • S+98 uses call%ack to notify occurences of each

    element&e'g' Start#ocument&-( startElement&-(

    end#ocument&-( etc'-• #)M8 Makes and o%6ect model of the document in memory

     – "emote procedure call8 9M!4".1

     – S)+. &we% serices-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    16/58

    $ames%a"es &n XML

    3amespaces avoids name conflicts

    • same tag for different things

    • same tag for different format

    Example8

    #ocument :8 ;person

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    17/58

    $ames%a"es &n XML ("ont')

    • $irst try   Tim Berners Lee  

    Second try

    Tim Berners Lee

    Final solution

    Tim Berners Lee

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    18/58

    $ames%a"e eam%le

     

      !eorge "oros  

      $ounting ...    

      .....

      

      

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    19/58

    XML Schema: What is a Schema ?

     A schema defnes the content o a number o XML-documents

    It defnes

    which elements and attributes can be included the element content the order of elements

    Schema substitutes DTD

    Think o classes (schema) and instances(documents)

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    20/58

    XML Schema

    Schema is saved ith !ostf" #"sd  A document is validated a$ainst a schema  A schema is a XML-document

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    21/58

    XSL9S! consist of

     – formatting o%6ects – 9S! Transformations &9S!T-

    • $ormatting o%6ect8 specifies presentation

    • 9S!T8 Transformations to ar%itrary format

    • The idea of 9S!T8 traverse the tree and apply a specific

    template at each node

    • sage – 9M! to 9M! &i'e' S>G-

     – 9M! to &9-?TM!

     – 9M! to text

     – 9M! to other formats &i'e 1S>-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    22/58

     The XSLT language

    • Transformation in 9M! dialect

    • Example8

      

      

      

    • + rule %ased language

    • )utput handled %y the enviroment

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    23/58

     Terminology

    • Template rules consists of8

     – pattern

     – template

    • .attern specifies nodes a template applies to

     – tag name

     – attri%utes

     – context

    • Template defines the transformations

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    24/58

    XML Example

      

      chic)en soup  

      

      *ntroduction  

      *+,e lw-s..  

      

      

    book 

    title section

    title para

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    25/58

     Template rule for boo

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    26/58

     Template rule for section

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    27/58

    Formatting ob!ects

    • $ormatting represents common document elements

    • Example – %lock

     – external4graphic

     – ta%le – simple4link

    • They are specified in 9M!

    • +ttri%utes specify their appearance

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    28/58

     Template rule "ith ob!ects

      

        

     

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    29/58

    SM#L

    SMIL Synchronized Multimedia Integration Language SMIL is an XML extension

    used for multimedia presentations which integratestreaming audio and video with images, text, etc

    enables to specify what should be presented when

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    30/58

    SM#L

    Introduction !bout XML XML Schema XML

    "amespaces XSL# $uture

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    31/58

    SM#L

    %smil&  %head& %'head&

      %bod&  %!ar&

      %audio src*sound#rm*'&  %se+&  %te"tstream src*tobbe,#rt* re$ion*videore$ion*'&  %!ar&

      %te"tstream src*tobbe#rt* re$ion*te"tre$ion*'&  %video src*tobias#rm* re$ion*videore$ion*'&

      %'!ar&  %'se+&  %'!ar&  %'bod&

    %'smil&

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    32/58

    RDF and RDF!

    • "#$ stands for "esource #escription $ramework

    • *t is a W@1 candidate recommendation

    &http8//www'w@'org/"#$-

    • "#$ is graphical formalism & , 9M! syntax , semantics-

     – for representing metadata

     – for descri%ing the semantics of information in a machine4

    accessi%le way

    • "#$S extends "#$ with “schema voca%ulary”( e'g'8

     – 1lass( .roperty

     – type( su%1lass)f( su%.roperty)f 

     – range( domain

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    33/58

    #e RDF Data Model

    • Statements are ;su%6ect( predicate( o%6ect< triples8

     

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    34/58

    +RIs

    • "* niform "esource *dentifier 

    • HThe generic set of all names/addresses that are short

    strings that refer to resourcesH

    •"!s &niform "esource !ocators- are a particular type of"*( used for resources that can %e accessed on the WWW

    &e'g'( we% pages-

    • *n "#$( "*s typically look like “normal” "!s( often with

    fragment identifiers to point at specific parts of a

    document8

     – http8//www'somedomain'com/some/path/to/fileIfragment*#

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    35/58

    L&nk&ng !tatements

    • The su%6ect of one statement can %e the o%6ect of another 

    • Such collections of statements form a directed( la%eled

    graph

    • 3ote that the o%6ect of a triple can also %e a “literal” &a

    string-

    *nut# !+#asColleague

    Carole #tt%--...'stanford'edu

    #asColleague#as/ome0age

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    36/58

    /o. "an RDF e &m%lemented

    • sally "#$/9M! syntax

    • ?owever other notations are possi%le

     – e'g' 3otation@

    "Sean"

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    37/58

    RDF !ynta

    • "#$ has an 9M! syntax that has a specific meaning8

    • Every Description element descri%es a resource

    • Every attri%ute or nested element inside a Description  is a  propert- of that "esource

    •We can refer to resources %y using "*s

      

       

      http://www.stn%ord.edu/6th 

      

      

     

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    38/58

    Rdf ty%e

    • "#$ predifined property

    • *ts value J a resource that represent a category or class

    • *ts su%6ect J *nstance of that category or class

     pre%ix ex :0 7*: http://www.exmple.org/terms

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    39/58

    Rdf "onta&ners

    • 2ag8 &+ resource having type rdf82ag-

     – "epresents an unordered list of resources or literals

     – #uplicated values are prermitted

    • Se7uence8 &+ resource having type rdf8Se7-

     – "epresents ordered list of resources or literal – #uplicated values are permitted

    • +lternatives8 &+ resource having type rdf8+lt-

     – "epresents group of resources or literals that are alternatives

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    40/58

    1ag eam%le

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    41/58

    RDF re&f&"at&on

    • association of a statement and a specific resourcerepresenting the statement

    • used to make statements a%out statements

    • >oca%ulary8• type rdf:Statement

    • properties

    • rdf:subject

    • rdf:predicate• rdf:object

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    42/58

    Re&f&"at&on eam%le

    • The mem%er of pro6ect opposed the statement thathttp8//www'daml'org/pro6ects/I:: is an 3S$ foundedpro6ect

    http://www.daml.org/projects/#11http://www.daml.org/projects/#11

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    43/58

    RDF gra%#s

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    44/58

    RDF !"#ema (RDF!)

    • "#$ gives a formalism for meta data annotation( and a wayto write it down in 9M!( %ut it does not give any specialmeaning to voca%ulary such as su%1lass)f  or type

     – *nterpretation is an ar%itrary %inary relation

    • "#$ Schema allows you to define voca%ulary terms and the

    relations %etween those terms

     – it gives “extra meaning” to particular "#$ predicates and

    resources

     – this “extra meaning”( or semantics( specifies how a term

    should %e interpreted

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    45/58

    RDF! 2am%les•

    "#$ Schema terms &6ust a few examples-8 – 1lass

     – .roperty

     – type

     – su%1lass)f 

     – range – domain

    • These terms are the "#$ Schema %uilding %locks

    &constructors- used to create voca%ularies8

      

        

      

      

      

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    46/58

    RDF! &s aout "reat&ng taonom&es

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    47/58

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    48/58

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    49/58

    *nferences8

     Kangt5e is ariver 

     Kangt5e has a length of L@DD 0ilometers

    Inferen"es &n RDF and RDF!

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    50/58

    • Two classes same concept8

     – E7uivalent classes8 +irplane and .lane

    • 1ardinality constraints8

     – )cean has one max#epth

    Des&re for more e%ress&3eness

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    51/58

    RDF-RDF! “L&eral&ty”

    • 3o distinction %etween classes and instances &individuals-

      

      

    • .roperties can themselves have properties  

      

    • 3o distinction %etween language constructors and

    ontology voca%ulary( so constructors can %e applied to

    themselves/each other 

      

      

      

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    52/58

    RDF! semant&" us&ng log&"

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    53/58

    0rolems .&t# RDF!

    • "#$S too weak to descri%e resources in sufficient detail

     – 3o localised range and domain constraints

    • 1ant say that the range of has1hild is person when

    applied to persons and elephant when applied to elephants

     – 3o existence/cardinality constraints• 1ant say that all instances of person have a mother that is

    also a person( or that persons have exactly = parents

     – 3o transitive( inverse or symmetrical properties

    • 1ant say that is.art)f is a transitive property( that has.art

    is the inverse of is.art)f or that touches is symmetrical – F

    • #ifficult to provide reasoning support

     – 3o “native” reasoners for non4standard semantics

     – May %e possi%le to reason via $) axiomatisation

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    54/58

    RDF(!) tools• "ead "#$ data

     – .arsers8 Nena( "edland( SW*4.rolog

     – >alidators8 W@1 "#$ validation service

     – Editors8 *sa>i5( "#$ +uthor( "#$Ed( *nferEd

    • Store "#$ data &9M! format( tripples or relational/oo #2-

     – "SS#2( "#$!i%

    • se "#$ data &applications( "SS news( etc'-

    • Manipulate "#$ data &inference( 7uery( etc'-

     – Nena "#O!( etc'

     – Example8SE!E1T Bperson( Bknows

    W?E"E &Bx ;http8//xmlns'com/foap/knows< B5-(

    &Bx ;http8//xmlns'com/foap/name< Bperson-(

     &B5 ;http8//xmlns'com/foap/name< Bknows-

    http://xmlns.com/foap/knowshttp://xmlns.com/foap/namehttp://xmlns.com/foap/namehttp://xmlns.com/foap/namehttp://xmlns.com/foap/namehttp://xmlns.com/foap/knows

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    55/58

    We Ontology Language Re4u&rements

    #esira%le features identified for We% )ntology !anguage8

    • Extends existing We% standards

     – Such as 9M!( "#$( "#$S

    • Easy to understand and use

     – Should %e %ased on familiar 0" idioms

    • $ormally specified

    • )f “ade7uate” expressive power • .ossi%le to provide automated reasoning support

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    56/58

    From RDF to OWL

    • Two languages developed to satisfy a%ove re7uirements

     – )*!8 developed %y group of &largely- European researchers &several

    from E )nto0nowledge pro6ect-

     – #+M!4)3T8 developed %y group of &largely- S researchers &in #+".+

    #+M! programme-

    • Efforts merged to produce #+M!,)*!

     – #evelopment was carried out %y “Noint E/S 1ommittee on +gent

    Markup !anguages”

     – Extends &“#! su%set” of- "#$

    • #+M!,)*! su%mitted to W@1 as %asis for standardisation

     – We%4)ntology &We%)nt- Working Group formed

     – We%)nt group developed )W! language %ased on #+M!,)*!

     – )W! language now a W@1 1andidate "ecommendation

     – Will soon %ecome .roposed "ecommendation

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    57/58

    OWL Language

    • Three species of )W! – )W! full is union of )W! syntax and "#$

     – )W! #! restricted to $)! fragment &¼ #+M!,)*!-

     – )W! !ite is “easier to implement” su%set of )W! #!

    • Semantic layering – )W! #! ¼ )W! full within #! fragment – #! semantics officially definitive

    • )W! #! %ased on SHIQ #escription !ogic

     – *n fact it is e7uivalent to SHOIN(Dn) #!

    • )W! #! 2enefits from many years of #! research – Well defined semantics – $ormal properties well understood &complexity( decida%ility-

     – 0nown reasoning algorithms

     – *mplemented systems &highly optimised-

  • 8/17/2019 2. Semantic Web Layers - XML and RDF

    58/58

    (In)famous “Layer Cake”

    ≈ Data Exchange

    ≈ Semantics+reasoning

    ≈ Relational Data

    ?

    ?

    ???

    ???

    ???

    • "elationship %etween layers is not clear 

    • )W! #! extends “#! su%set” of "#$