THE SEMANTIC WEB AN INTRODUCTION LUIGI DE RUSSIS
THE WEB IS A WEB OF DOCUMENT FOR PEOPLE,NOT FOR MACHINES
THE SEMANTIC WEB IS A WEB OF DATA LinkingOpen Data cloud diagram, by Richard Cyganiak and Anja Jentzsch. http://lod-cloud.net/
LET’S THINK!
EXERCISE:BUILD A MUSIC CATALOG Comprehensive guidetomusicacrosstheworld Web-based Withalways-updatedinformationabouteachartist
HOW? WHAT ARE THE PROBLEMS? WHAT ABOUT DATA REPLICATION? WHAT ABOUT DATA SYNCHRONIZATION? …?
SOLUTION #1 HOW? SiteeditorsroamtheWebfornewfactsandupdatethesitemanually WHAT ARE THE PROBLEMS? AlotofpeopleneedtocontinuouslyroamtheWeb;thesitewillget soonout-of-date WHAT ABOUT DATA? Dataisreplicatedandnotup-to-datewithnewfacts
SOLUTION #2 HOW? SiteeditorsroamtheWebfornewdataandwriteaprogramtoextract theinformation WHAT ARE THE PROBLEMS? Codeneedstobeupdatedeachtimeanewsiteisfound;the sitewillget out-of-date,soonorlater… WHAT ABOUT DATA? Dataisreplicatedandnotup-to-date
SOLUTION #3 HOW? SiteeditorsbrowsetheWebfornewdataviaAPIs,andwritesomecode toincorporatetheinformation WHAT ARE THE PROBLEMS? Codeneedstobeupdatedeachtimeanewsiteisfoundand/oranAPIis changed;thesitewillgetout-of-date,soonorlater… WHAT ABOUT DATA? Dataisreplicatedandnotup-to-date
SOLUTION #4 HOW? Siteeditorschoosetousesomeexternal,publicdatasets(e.g., Wikipedia,MusicBrainz,…) WHAT ARE THE PROBLEMS? Noproblem WHAT ABOUT DATA? Dataisimmediatelyavailable,notasAPIsorhiddenonaWebsite. InformationcanbeextractedusingstandardqueriesorHTTPrequests.
IN SHORT… UsetheWebofDataasaContentManagementSystem Usethecommunityatlargeascontenteditor AN EXAMPLE:BBCMUSIC http://www.bbc.co.uk/music SOLUTION #4
DATA ON THE WEB IS NOT ENOUGH! weneedaproperinfrastructure DATA SHOULD BE AVAILABLE ON THE WEB accessibleviastandardWebtechnologies DATA SHOULD BE INTERLINKED OVER THE WEB i.e.,datacanbeintegratedovertheWeb THIS IS WHERE SEMANTIC WEB COME IN
FUNDAMENTALS
To a computer,theWeb is a flat,boring world, devoid of meaning. This is a pity, as in factdocumentson theWeb describereal objects and imaginary concepts.[…] Adding semanticstothe Web involvestwothings: allowing documents which have informationin machine-readable forms, and allowing links tobe createdwith relationship values. Only when we have this extra level of semanticswe will be able touse computerpower tohelp us exploit the information toa greaterextent than our own reading. TIM BERNERS-LEE,1994
WHAT IS THE RELATIONSHIP WITH AI? INFLUENCE SometechnologiesintheSemanticWebbenefitedalotfromAIresearch anddevelopment(andviceversa) DIFFERENT GOALS ArtificialIntelligenceapproach:buildsmartermachines,teach computerstoinferthemeaningofdata SemanticWebapproach:havesmarterdata,makedataeasierfor machinestofind,accessandprocess
RESOURCE AND DESCRIPTION RESOURCE everydocument“reachable”ontheWeb nomatterthecontent,format,language,etc. RESOURCE DESCRIPTION independentfromtheformat standardlanguage(metadata)
RESOURCE AND DESCRIPTION Resources
RESOURCE AND DESCRIPTION Description
RESOURCE AND DESCRIPTION DescriptionTitle Author Date Topic Quality Title Author Date Topic
URIS unambiguousnamesforresources RDF acommondatamodeltoconnectanddescriberesources SPARQL accesstothedatamodel RDFS,OWL commondescriptionlanguages OWL,RIF reasoning(mainlylogicinference)
MODELING DATA
EXAMPLE:BOOKSTORE RepresentthefollowingdataabouttheAIbookasasetof relations Title:“ArtificialIntelligence:AModern Approach” Author:Russel,StuartandNorvig,Peter Publisher: PrenticeHall ISBN:978-0136042594
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Resource
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Literal
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach title
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall Russel, Stuart Norvig, Peter title publisher author author
RDF:RESOURCE DESCRIPTION FRAMEWORK STRUCTURED IN STATEMENTS SUBJECT aresource(URI) PREDICATE averb,propertyorrelationship OBJECT aresourceoraliteralstring
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall Russel, Stuart Norvig, Peter title publisher author author Subject Object Object Object Object Predicate Predicate Predicate
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach title RDFIN XMLSYNTAX <rdf:RDFxmlns:rdf=http://www.w3.org/…/22-rdf-syntax-ns#> <rdf:Descriptionabout=“http://...isbn/9780136042594”> <title>ArtificialIntelligence:AModernApproach</title> </rdf:Description> </RDF>
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach title RDFIN TURTLE <http://...isbn/9780136042594> title“ArtificialIntelligence:AModernApproach”
LINKIN’DATA
EXAMPLE:BOOKSTORE RepresentthefollowingdataabouttheItaliantranslationoftheAIbook asasetofrelations Title:“Intelligenzaartificiale.Unapproccio moderno” Author:Russel,StuartandNorvig,Peter Publisher: PrenticeHall ISBN:978-8871925936 OriginalISBN:978-0136042594
EXAMPLE:BOOKSTORE http://...isbn/9788871925936 Intelligenza Artificiale. Un approccio moderno Prentice Hall Russel, Stuart Norvig, Peter title publisher creator creator http://...isbn/9780136042594 original
EXAMPLE:BOOKSTORE http://...isbn/9788871925936 Intelligenza Artificiale. Un approccio moderno Prentice Hall title publisher http://...isbn/9780136042594 original http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall title publisher
EXAMPLE:BOOKSTORE http://...isbn/9788871925936 Intelligenza Artificiale. Un approccio moderno Prentice Hall title publisher http://...isbn/9780136042594 original http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall title creator sameURI,sameresource
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall Russel, Stuart Norvig, Peter title publisher author author http://...isbn/9788871925936 Intelligenza Artificiale. Un approccio moderno Prentice Hall title publisher original Russel, Stuart Norvig, Peter creator creator
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall Russel, Stuart Norvig, Peter title publisher author author http://...isbn/9788871925936 Intelligenza Artificiale. Un approccio moderno Prentice Hall title publisher original Russel, Stuart Norvig, Peter creator creator Whataboutmergingcreatorandauthor? InRDF,itisnotpossible!
PROBLEM:FIELD NAMES ARE ARBITRARY Synonyms:authororcreatorormakerorcontributoror… Singularorplural:authororauthors SOLUTION:STANDARDS generalordomain-specific
DUBLIN CORE GENERAL VOCABULARY DublinCoreMetadataInitiative(DCMI) http://dublincore.org BUILDING BLOCKS TO DEFINE METADATA FOR THE SEMANTIC WEB Definetitle,contributor,publisher,license,date,language,etc.
PROBLEM:FIELD VALUES ARE ARBITRARY Valuetype:string,date,integer,… Valueformat:“Norvig,Peter”or“Norvig,P.”or“PeterNorvig”or… Valuerestrictions:onevalueormultiplevalues(howmany?) SOLUTIONS Standards Controlledvocabulary(closelistofterms) Semanticallyrichdescriptionstosupportsearch(RDFSand/orOWL)
FRIEND OF AFRIEND (FOAF) GENERAL ONTOLOGY Describepersons,theiractivitiesandtheirrelationstootherpeopleand objects http://www.foaf-project.org BUILDING BLOCKS TO DEFINE STRUCTURED RELATIONS BETWEEN PEOPLE Definename,familyName,givenName,knows,age,nick,etc.
EXAMPLE:BOOKSTORE http://...isbn/9780136042594 Artificial Intelligence: A Modern Approach Prentice Hall Russel, Stuart Norvig, Peter dc:title dc:publisher dc:creator dc:creator foaf:http://xmlns.com/foaf/spec dc:http://purl.org/dc/terms foaf:name foaf:name foaf:name
http://...isbn/9780136042594 Norvig, Peter dc:creator foaf:name http://...isbn/9780136042594 Norvig, Peter author WHY?
RDFSCHEMA
RDFSCHEMA SCHEMA DefinitionofthenodesandpredicatesusedinaRDFdocument DOMAIN AND RANGE RDFSdescribespropertiesintermsofclassesofresource towhichtheyapply(froma“domain”toa“range”)
EXAMPLE RDFdata http://elite.polito.it/people/derussis teaches http.//bit.ly/lingambmult
http://elite.polito.it/people/derussis teaches EXAMPLE RDFdata RDFschema http.//bit.ly/lingambmult Teacher Person teaches Course domain range subClassOf type type
http://...isbn/9780136042594 Norvig, Peter dc:creator foaf:name http://...isbn/9780136042594 Norvig, Peter author BACK TO THE BOOKSTORE EXAMPLE…
http://...isbn/9780136042594 Norvig, Peter dc:creator foaf:name http://...isbn/9780136042594 Norvig, Peter author BACK TO THE BOOKSTORE EXAMPLE… dc:creatorhasrangeAgent,i.e.aclass(resource),notaliteral: weuseananonymousclassforthisscope. Finally,foaf:Namehasrangerdfs:Literal. anonymous class
RDFSEXPRESSIVITY SIMPLE RELATIONSHIP BETWEEN THINGS RDFSprovidesavocabularytoexpressrelationshipbetweenthings (e.g.,subClassOfortype) AVOID COMPLEX RELATIONSHIP RDFScannotdescribedataintermsofsetofoperations(e.g., unionOf), equivalence(e.g.,sameAs)orcardinality(e.g.,allValueFrom)
OWL
WEB ONTOLOGY LANGUAGE WHAT? OWL(version2):aknowledgerepresentationlanguage Designedtoformulate,exchangeandreasonwithknowledgeabouta domainofinterest
WEB ONTOLOGY LANGUAGE INDIVIDUALS,CLASSES AND PROPERTIES “PolitecnicodiTorinoisauniversity” “PolitecnicodiTorinohasaprofessornamedElioPiccolo” “PolitecnicodiTorino”isaobject:anindividualinOWL2 “university”isacategory:aclassinOWL2 “hasaprofessor”isarelation:apropertyinOWL2 “ElioPiccolo”isanindividual,too
WEB ONTOLOGY LANGUAGE EXPRESSIVITY Designedtorepresentrichandcomplexknowledgeaboutthings,group ofthings,andtheirrelations LOGIC-BASED KnowledgeexpressedinOWLcanbereasonedwithacomputerprogram toverifyitsconsistencyortomakeimplicitknowledgeexplicit
WEB ONTOLOGY LANGUAGE LINKED OntologiesinOWLcanbepublishedontheWebandmay referorbe referredfromotherOWLontologies CHOOSE THE SYNTAX YOU LIKE VarioussyntaxesavailableforOWL,fordifferentpurposes (RDF/XML,Turtle,Manchester,etc.)
EXAMPLE:BOOKSTORE Intelligenza Artificiale. Un approccio moderno Prentice Hall dc:title dc:publisher Artificial Intelligence: A Modern Approach Prentice Hall dc:title dc:publisher Libro Book rdfs:type rdf:type owl:sameAs http://...isbn/9788871925936 http://...isbn/9780136042594
HANDS ON OWL
EXAMPLE:BOOKSTORE Itistimetosellthebookswemodeled. Usersmusthavethepossibilitytosearchinourbookcatalog. Weneedtodescribeourstore andaddsomeotherinformationaboutthebooks. GoodRelationshelpsinrealizingsuchanexample: http://www.heppnetz.de/projects/goodrelations/
Bookstore_1 Offering_1 TypeAndQuantity Node_1UnitPriceSpecification_1 AIBook_en item:BookQuantitativeValue Integer_1 gr:Sell 120.0 “EUR” 1.0 1132 gr:ActualProductOrServiceInstance gr:ProductOrService gr:offers gr:includeObject gr:hasBusinessFunction gr:hasPriceSpecification gr:hasCurrency gr:hasCurrencyValue gr:amountOfThisGood gr:typeOfGood rdf:type rdfs:subClassOf rdf:type item:hasTotalPages gr:hasValue gr:Offering rdf:type
DESCRIBE THE BUSINESS ENTITY default:BookStore_1 agr:BusinessEntity; gr:legalName“bookstore.comLtd.”^^xsd:string. Bookstore_1
DESCRIBE THE OFFERED ITEMS default:AIBook_en aitem:Book,gr:ActualProductOrServiceInstance ; item:hasTotalPagesdefault:QuantitativeValueInteger_1. AIBook_en default:QuantitativeValueInteger_1 agr:QuantitativeValueInteger; gr:hasValue“1132”^^xsd:integer. QuantitativeValue Integer_1
DESCRIBE THE OFFER default:Offering_1 agr:Offering ; gr:hasBusinessFunctiongr:Sell; gr:hasPriceSpecificationdefault:UnityPriceSpecification_1; gr:includeObjectdefault:TypeAndQuantityNode_1. Offering_1 LINK THE OFFER TO THE BUSINESS ENTITY default:BookStore_1gr:offersdefault:Offering_1
DESCRIBE THE OFFER default:TypeAndQuantityNode_1 agr:TypeAndQuantityNode ; gr:amountOfThisGood“1.0”^^xsd:float; gr:typeOfGooddefault:AIBook_en. default:UnitPriceSpecification_1 agr:UnitPriceSpecification; gr:hasCurrency“EUR”^^xsd:string; gr:hasCurrencyValue “120.0”^^xsd:float. TypeAndQuantity Node_1 UnitPriceSpecification_1
QUERY THE WHOLE! PREFIXgr:<http://purl.org/goodrelations/v1#> PREFIXitem:<http://www.elite.polito.it/ontologies/example/item#> SELECT?offering WHERE{?offeringrdf:typegr:Offering. ?offeringgr:includesObject?object. ?objectgr:typeOfGood?item. ?itemrdf:typeitem:Book. } Howtogetalltheavailableofferforthebook? SPARQL
QUERY THE WHOLE! ?itemrdf:typeitem:Book. SPARQL ?item item:Book rdf:type
QUERY THE WHOLE! ?objectgr:typeOfGood?item. SPARQL ?object AIBook_en item:Book gr:typeOfGood rdf:type
QUERY THE WHOLE! ?offeringgr:includesObject?object. SPARQL ?offering TypeAndQuantity Node_1 AIBook_en item:Book gr:includeObject gr:typeOfGood rdf:type
QUERY THE WHOLE! ?offeringrdf:typegr:Offering. SPARQL ?offering TypeAndQuantity Node_1 AIBook_en item:Book gr:includeObject gr:typeOfGood rdf:type gr:Offering rdf:type
QUERY THE WHOLE! SELECT?offering SPARQL Offering_1 TypeAndQuantity Node_1 AIBook_en item:Book gr:includeObject gr:typeOfGood rdf:type gr:Offering rdf:type
REFERENCES SemanticWebstandards:http://w3c.org/standards/semanticweb SemanticWebWiki:http://semanticweb.org SemanticWebFAQ:http://www.w3c.org/2001/sw/SW-FAQ Book:ASemanticWebPrimer(http://www.semanticwebprimer.org) Book:SemanticWebProgramming(http://semwebprogramming.org) Lastaccess:04June2013
THANKS! LuigiDeRussis http://elite.polito.it
LICENSE ThisworkislicensedundertheCreativeCommons“Attribution-NonCommercial- ShareAlikeUnported(CCBY-NC-SA3,0)”License. Youarefree: toShare-tocopy,distributeandtransmitthework toRemix-toadaptthework Underthefollowingconditions: Attribution -Youmustattributetheworkinthemannerspecifiedbytheauthoror licensor(but notinanywaythatsuggeststhattheyendorseyouoryouruseofthe work). Noncommercial-Youmaynotusethisworkforcommercialpurposes. ShareAlike-Ifyoualter,transform,orbuilduponthiswork,youmaydistributethe resultingworkonlyunderthesameorsimilarlicensetothisone. Toviewacopyofthislicense,visithttp://creativecommons.org/licenses/by-nc-sa/3.0/

Semantic Web: an introduction