Semantic Web: an introduction

912 views
732 views

Published on

Short seminar about the Semantic Web for the "Artificial Intelligence" course at Politecnico di Torino (academic year 2012/2013)

An updated version is available at http://www.slideshare.net/luigidr/semantic-web-an-introduction

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
912
On SlideShare
0
From Embeds
0
Number of Embeds
60
Actions
Shares
0
Downloads
39
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Semantic Web: an introduction

  1. 1. THE SEMANTIC WEBAN INTRODUCTIONLUIGI DE RUSSIS
  2. 2. THE WEB IS A WEB OF DOCUMENTFOR PEOPLE,NOT FOR MACHINES
  3. 3. THE SEMANTIC WEB IS A WEB OF DATALinkingOpen Data cloud diagram,by Richard Cyganiak and Anja Jentzsch.http://lod-cloud.net/
  4. 4. LET’S THINK!
  5. 5. EXERCISE:BUILD A MUSIC CATALOGComprehensive guidetomusicacrosstheworldWeb-basedWithalways-updatedinformationabouteachartist
  6. 6. HOW?WHAT ARE THE PROBLEMS?WHAT ABOUT DATA REPLICATION?WHAT ABOUT DATA SYNCHRONIZATION?…?
  7. 7. SOLUTION #1HOW?SiteeditorsroamtheWebfornewfactsandupdatethesitemanuallyWHAT ARE THE PROBLEMS?AlotofpeopleneedtocontinuouslyroamtheWeb;thesitewillgetsoonout-of-dateWHAT ABOUT DATA?Dataisreplicatedandnotup-to-datewithnewfacts
  8. 8. SOLUTION #2HOW?SiteeditorsroamtheWebfornewdataandwriteaprogramtoextracttheinformationWHAT ARE THE PROBLEMS?Codeneedstobeupdatedeachtimeanewsiteisfound;the sitewillgetout-of-date,soonorlater…WHAT ABOUT DATA?Dataisreplicatedandnotup-to-date
  9. 9. SOLUTION #3HOW?SiteeditorsbrowsetheWebfornewdataviaAPIs,andwritesomecodetoincorporatetheinformationWHAT ARE THE PROBLEMS?Codeneedstobeupdatedeachtimeanewsiteisfoundand/oranAPIischanged;thesitewillgetout-of-date,soonorlater…WHAT ABOUT DATA?Dataisreplicatedandnotup-to-date
  10. 10. SOLUTION #4HOW?Siteeditorschoosetousesomeexternal,publicdatasets(e.g.,Wikipedia,MusicBrainz,…)WHAT ARE THE PROBLEMS?NoproblemWHAT ABOUT DATA?Dataisimmediatelyavailable,notasAPIsorhiddenonaWebsite.InformationcanbeextractedusingstandardqueriesorHTTPrequests.
  11. 11. IN SHORT…UsetheWebofDataasaContentManagementSystemUsethecommunityatlargeascontenteditorAN EXAMPLE:BBCMUSIChttp://www.bbc.co.uk/musicSOLUTION #4
  12. 12. DATA ON THE WEB IS NOT ENOUGH!weneedaproperinfrastructureDATA SHOULD BE AVAILABLE ON THE WEBaccessibleviastandardWebtechnologiesDATA SHOULD BE INTERLINKED OVER THE WEBi.e.,datacanbeintegratedovertheWebTHIS IS WHERE SEMANTIC WEB COME IN
  13. 13. FUNDAMENTALS
  14. 14. To a computer,theWeb is a flat,boring world, devoid ofmeaning. This is a pity, as in factdocumentson theWebdescribereal objects and imaginary concepts.[…]Adding semanticstothe Web involvestwothings: allowingdocuments which have informationin machine-readableforms, and allowing links tobe createdwith relationshipvalues. Only when we have this extra level of semanticswewill be able touse computerpower tohelp us exploit theinformation toa greaterextent than our own reading.TIM BERNERS-LEE,1994
  15. 15. WHAT IS THE RELATIONSHIP WITH AI?INFLUENCESometechnologiesintheSemanticWebbenefitedalotfromAIresearchanddevelopment(andviceversa)DIFFERENT GOALSArtificialIntelligenceapproach:buildsmartermachines,teachcomputerstoinferthemeaningofdataSemanticWebapproach:havesmarterdata,makedataeasierformachinestofind,accessandprocess
  16. 16. RESOURCE AND DESCRIPTIONRESOURCEeverydocument“reachable”ontheWebnomatterthecontent,format,language,etc.RESOURCE DESCRIPTIONindependentfromtheformatstandardlanguage(metadata)
  17. 17. RESOURCE AND DESCRIPTIONResources
  18. 18. RESOURCE AND DESCRIPTIONDescription
  19. 19. RESOURCE AND DESCRIPTIONDescriptionTitleAuthorDateTopicQualityTitle AuthorDate Topic
  20. 20. URISunambiguousnamesforresourcesRDFacommondatamodeltoconnectanddescriberesourcesSPARQLaccesstothedatamodelRDFS,OWLcommondescriptionlanguagesOWL,RIFreasoning(mainlylogicinference)
  21. 21. MODELING DATA
  22. 22. EXAMPLE:BOOKSTORERepresentthefollowingdataabouttheAIbookasasetof relationsTitle:“ArtificialIntelligence:AModernApproach”Author:Russel,StuartandNorvig,PeterPublisher: PrenticeHallISBN:978-0136042594
  23. 23. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594Resource
  24. 24. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachLiteral
  25. 25. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachtitle
  26. 26. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HallRussel, StuartNorvig, Petertitlepublisherauthorauthor
  27. 27. RDF:RESOURCE DESCRIPTION FRAMEWORKSTRUCTURED IN STATEMENTSSUBJECTaresource(URI)PREDICATEaverb,propertyorrelationshipOBJECTaresourceoraliteralstring
  28. 28. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HallRussel, StuartNorvig, PetertitlepublisherauthorauthorSubject ObjectObjectObjectObjectPredicatePredicatePredicate
  29. 29. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachtitleRDFIN XMLSYNTAX<rdf:RDFxmlns:rdf=http://www.w3.org/…/22-rdf-syntax-ns#><rdf:Descriptionabout=“http://...isbn/9780136042594”><title>ArtificialIntelligence:AModernApproach</title></rdf:Description></RDF>
  30. 30. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachtitleRDFIN TURTLE<http://...isbn/9780136042594>title“ArtificialIntelligence:AModernApproach”
  31. 31. LINKIN’DATA
  32. 32. EXAMPLE:BOOKSTORERepresentthefollowingdataabouttheItaliantranslationoftheAIbookasasetofrelationsTitle:“Intelligenzaartificiale.Unapprocciomoderno”Author:Russel,StuartandNorvig,PeterPublisher: PrenticeHallISBN:978-8871925936OriginalISBN:978-0136042594
  33. 33. EXAMPLE:BOOKSTOREhttp://...isbn/9788871925936Intelligenza Artificiale. Unapproccio modernoPrentice HallRussel, StuartNorvig, Petertitlepublishercreator creatorhttp://...isbn/9780136042594original
  34. 34. EXAMPLE:BOOKSTOREhttp://...isbn/9788871925936Intelligenza Artificiale. Unapproccio modernoPrentice Halltitlepublisherhttp://...isbn/9780136042594originalhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice Halltitlepublisher
  35. 35. EXAMPLE:BOOKSTOREhttp://...isbn/9788871925936Intelligenza Artificiale. Unapproccio modernoPrentice Halltitlepublisherhttp://...isbn/9780136042594originalhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HalltitlecreatorsameURI,sameresource
  36. 36. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HallRussel, StuartNorvig, Petertitlepublisherauthorauthorhttp://...isbn/9788871925936Intelligenza Artificiale. Unapproccio modernoPrentice HalltitlepublisheroriginalRussel, StuartNorvig, Petercreatorcreator
  37. 37. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HallRussel, StuartNorvig, Petertitlepublisherauthorauthorhttp://...isbn/9788871925936Intelligenza Artificiale. Unapproccio modernoPrentice HalltitlepublisheroriginalRussel, StuartNorvig, PetercreatorcreatorWhataboutmergingcreatorandauthor?InRDF,itisnotpossible!
  38. 38. PROBLEM:FIELD NAMES ARE ARBITRARYSynonyms:authororcreatorormakerorcontributoror…Singularorplural:authororauthorsSOLUTION:STANDARDSgeneralordomain-specific
  39. 39. DUBLIN COREGENERAL VOCABULARYDublinCoreMetadataInitiative(DCMI)http://dublincore.orgBUILDING BLOCKS TO DEFINE METADATA FOR THESEMANTIC WEBDefinetitle,contributor,publisher,license,date,language,etc.
  40. 40. PROBLEM:FIELD VALUES ARE ARBITRARYValuetype:string,date,integer,…Valueformat:“Norvig,Peter”or“Norvig,P.”or“PeterNorvig”or…Valuerestrictions:onevalueormultiplevalues(howmany?)SOLUTIONSStandardsControlledvocabulary(closelistofterms)Semanticallyrichdescriptionstosupportsearch(RDFSand/orOWL)
  41. 41. FRIEND OF AFRIEND (FOAF)GENERAL ONTOLOGYDescribepersons,theiractivitiesandtheirrelationstootherpeopleandobjectshttp://www.foaf-project.orgBUILDING BLOCKS TO DEFINE STRUCTUREDRELATIONS BETWEEN PEOPLEDefinename,familyName,givenName,knows,age,nick,etc.
  42. 42. EXAMPLE:BOOKSTOREhttp://...isbn/9780136042594 Artificial Intelligence: A ModernApproachPrentice HallRussel, StuartNorvig, Peterdc:titledc:publisherdc:creatordc:creatorfoaf:http://xmlns.com/foaf/specdc:http://purl.org/dc/termsfoaf:namefoaf:namefoaf:name
  43. 43. http://...isbn/9780136042594Norvig, Peterdc:creatorfoaf:namehttp://...isbn/9780136042594Norvig, PeterauthorWHY?
  44. 44. RDFSCHEMA
  45. 45. RDFSCHEMASCHEMADefinitionofthenodesandpredicatesusedinaRDFdocumentDOMAIN AND RANGERDFSdescribespropertiesintermsofclassesofresourcetowhichtheyapply(froma“domain”toa“range”)
  46. 46. EXAMPLERDFdatahttp://elite.polito.it/people/derussisteacheshttp.//bit.ly/lingambmult
  47. 47. http://elite.polito.it/people/derussisteachesEXAMPLERDFdataRDFschemahttp.//bit.ly/lingambmultTeacherPersonteaches Coursedomain rangesubClassOftypetype
  48. 48. http://...isbn/9780136042594Norvig, Peterdc:creatorfoaf:namehttp://...isbn/9780136042594Norvig, PeterauthorBACK TO THE BOOKSTORE EXAMPLE…
  49. 49. http://...isbn/9780136042594Norvig, Peterdc:creatorfoaf:namehttp://...isbn/9780136042594Norvig, PeterauthorBACK TO THE BOOKSTORE EXAMPLE…dc:creatorhasrangeAgent,i.e.aclass(resource),notaliteral:weuseananonymousclassforthisscope.Finally,foaf:Namehasrangerdfs:Literal.anonymousclass
  50. 50. RDFSEXPRESSIVITYSIMPLE RELATIONSHIP BETWEEN THINGSRDFSprovidesavocabularytoexpressrelationshipbetweenthings(e.g.,subClassOfortype)AVOID COMPLEX RELATIONSHIPRDFScannotdescribedataintermsofsetofoperations(e.g., unionOf),equivalence(e.g.,sameAs)orcardinality(e.g.,allValueFrom)
  51. 51. OWL
  52. 52. WEB ONTOLOGY LANGUAGEWHAT?OWL(version2):aknowledgerepresentationlanguageDesignedtoformulate,exchangeandreasonwithknowledgeaboutadomainofinterest
  53. 53. WEB ONTOLOGY LANGUAGEINDIVIDUALS,CLASSES AND PROPERTIES“PolitecnicodiTorinoisauniversity”“PolitecnicodiTorinohasaprofessornamedElioPiccolo”“PolitecnicodiTorino”isaobject:anindividualinOWL2“university”isacategory:aclassinOWL2“hasaprofessor”isarelation:apropertyinOWL2“ElioPiccolo”isanindividual,too
  54. 54. WEB ONTOLOGY LANGUAGEEXPRESSIVITYDesignedtorepresentrichandcomplexknowledgeaboutthings,groupofthings,andtheirrelationsLOGIC-BASEDKnowledgeexpressedinOWLcanbereasonedwithacomputerprogramtoverifyitsconsistencyortomakeimplicitknowledgeexplicit
  55. 55. WEB ONTOLOGY LANGUAGELINKEDOntologiesinOWLcanbepublishedontheWebandmay referorbereferredfromotherOWLontologiesCHOOSE THE SYNTAX YOU LIKEVarioussyntaxesavailableforOWL,fordifferentpurposes(RDF/XML,Turtle,Manchester,etc.)
  56. 56. EXAMPLE:BOOKSTOREIntelligenza Artificiale. Unapproccio modernoPrentice Halldc:titledc:publisherArtificial Intelligence: A ModernApproachPrentice Halldc:titledc:publisherLibroBookrdfs:typerdf:typeowl:sameAshttp://...isbn/9788871925936http://...isbn/9780136042594
  57. 57. HANDS ON OWL
  58. 58. EXAMPLE:BOOKSTOREItistimetosellthebookswemodeled.Usersmusthavethepossibilitytosearchinourbookcatalog.Weneedtodescribeourstoreandaddsomeotherinformationaboutthebooks.GoodRelationshelpsinrealizingsuchanexample:http://www.heppnetz.de/projects/goodrelations/
  59. 59. Bookstore_1Offering_1TypeAndQuantityNode_1UnitPriceSpecification_1AIBook_enitem:BookQuantitativeValueInteger_1gr:Sell120.0“EUR”1.01132gr:ActualProductOrServiceInstancegr:ProductOrServicegr:offersgr:includeObjectgr:hasBusinessFunctiongr:hasPriceSpecificationgr:hasCurrencygr:hasCurrencyValue gr:amountOfThisGoodgr:typeOfGoodrdf:typerdfs:subClassOfrdf:typeitem:hasTotalPagesgr:hasValuegr:Offeringrdf:type
  60. 60. DESCRIBE THE BUSINESS ENTITYdefault:BookStore_1agr:BusinessEntity;gr:legalName“bookstore.comLtd.”^^xsd:string.Bookstore_1
  61. 61. DESCRIBE THE OFFERED ITEMSdefault:AIBook_enaitem:Book,gr:ActualProductOrServiceInstance ;item:hasTotalPagesdefault:QuantitativeValueInteger_1.AIBook_endefault:QuantitativeValueInteger_1agr:QuantitativeValueInteger;gr:hasValue“1132”^^xsd:integer.QuantitativeValueInteger_1
  62. 62. DESCRIBE THE OFFERdefault:Offering_1agr:Offering ;gr:hasBusinessFunctiongr:Sell;gr:hasPriceSpecificationdefault:UnityPriceSpecification_1;gr:includeObjectdefault:TypeAndQuantityNode_1.Offering_1LINK THE OFFER TO THE BUSINESS ENTITYdefault:BookStore_1gr:offersdefault:Offering_1
  63. 63. DESCRIBE THE OFFERdefault:TypeAndQuantityNode_1agr:TypeAndQuantityNode ;gr:amountOfThisGood“1.0”^^xsd:float;gr:typeOfGooddefault:AIBook_en.default:UnitPriceSpecification_1agr:UnitPriceSpecification;gr:hasCurrency“EUR”^^xsd:string;gr:hasCurrencyValue “120.0”^^xsd:float.TypeAndQuantityNode_1UnitPriceSpecification_1
  64. 64. QUERY THE WHOLE!PREFIXgr:<http://purl.org/goodrelations/v1#>PREFIXitem:<http://www.elite.polito.it/ontologies/example/item#>SELECT?offeringWHERE{?offeringrdf:typegr:Offering.?offeringgr:includesObject?object.?objectgr:typeOfGood?item.?itemrdf:typeitem:Book.}Howtogetalltheavailableofferforthebook?SPARQL
  65. 65. QUERY THE WHOLE!?itemrdf:typeitem:Book.SPARQL?itemitem:Bookrdf:type
  66. 66. QUERY THE WHOLE!?objectgr:typeOfGood?item.SPARQL?objectAIBook_enitem:Bookgr:typeOfGoodrdf:type
  67. 67. QUERY THE WHOLE!?offeringgr:includesObject?object.SPARQL?offeringTypeAndQuantityNode_1AIBook_enitem:Bookgr:includeObjectgr:typeOfGoodrdf:type
  68. 68. QUERY THE WHOLE!?offeringrdf:typegr:Offering.SPARQL?offeringTypeAndQuantityNode_1AIBook_enitem:Bookgr:includeObjectgr:typeOfGoodrdf:typegr:Offeringrdf:type
  69. 69. QUERY THE WHOLE!SELECT?offeringSPARQLOffering_1TypeAndQuantityNode_1AIBook_enitem:Bookgr:includeObjectgr:typeOfGoodrdf:typegr:Offeringrdf:type
  70. 70. REFERENCESSemanticWebstandards:http://w3c.org/standards/semanticwebSemanticWebWiki:http://semanticweb.orgSemanticWebFAQ:http://www.w3c.org/2001/sw/SW-FAQBook:ASemanticWebPrimer(http://www.semanticwebprimer.org)Book:SemanticWebProgramming(http://semwebprogramming.org)Lastaccess:04June2013
  71. 71. THANKS!LuigiDeRussishttp://elite.polito.it
  72. 72. LICENSEThisworkislicensedundertheCreativeCommons“Attribution-NonCommercial-ShareAlikeUnported(CCBY-NC-SA3,0)”License.Youarefree:toShare-tocopy,distributeandtransmittheworktoRemix-toadapttheworkUnderthefollowingconditions:Attribution -Youmustattributetheworkinthemannerspecifiedbytheauthororlicensor(but notinanywaythatsuggeststhattheyendorseyouoryouruseofthework).Noncommercial-Youmaynotusethisworkforcommercialpurposes.ShareAlike-Ifyoualter,transform,orbuilduponthiswork,youmaydistributetheresultingworkonlyunderthesameorsimilarlicensetothisone.Toviewacopyofthislicense,visithttp://creativecommons.org/licenses/by-nc-sa/3.0/

×