Comments
Description
Transcript
IC2009_27_V-1_Semantic-Web
Ingegneria della conoscenza 2007-08 Emanuele Della Valle Scienze e Tecniche Della Comunicazione Parte V: conclusione 1. Semantic Web Modellare e Condividere per Innovare I-1 1 Un modello per studiare l’innovazione Il Semantic Web Esempi di applicazione Sommario I-1 2 Innovazione I-1 Innovazione 3 creare idea macro micro analizzare innovare problemi fenomeno fenomeno complessità = 6.000.000.000 persone I-1 Innovazione 4 creare idea macro micro analizzare innovare problemi fenomeno fenomeno complessità = magia I-1 Innovazione 5 creare idea macro micro analizzare innovare problemi fenomeno fenomeno complessità = magia I-1 Innovare … 6 creare idea innovare micro fenomeno complessità I-1 7 … non è mai solo una questione di tecnologia creare idea sociale innovare soluzione micro soluzione tecnica fenomeno complessità I-1 8 Un modello per studiare l’innovazione creare idea soluzione sociale macro innovare analizzare problemi micro fenomeno fenomeno complessità soluzione tecnica I-1 Analizziamo il Web delle origini 9 Non riesco ad accedere all’informazione Ipertesti + Internet creare problemi Come posso scrivere? soluzione sociale macro Condividere info Link a cose interessanti fenomeno Esplosione del fenomeno Web innovare analizzare Come trovo le pagine? idea soluzione tecnica micro fenomeno WWW complessità URI HTTP HTML I-1 Analizziamo google 10 Come trovo le pagine? creare problemi idea soluzione sociale macro Condividere info Link a cose interessanti fenomeno Il fenomeno Google innovare analizzare Google spoofing Indici + SVM Page Rank soluzione tecnica micro fenomeno Google complessità I-1 Analizziamo il Web 2.0 11 Come posso scrivere? wiki-wiki e diari Web creare idea Come gestire tutta questa info? soluzione sociale macro Condividere info Link a cose interessanti fenomeno I fenomeni Wikipedia, blogosphere, … innovare analizzare problemi wiki blog soluzione tecnica micro fenomeno Web 2.0 complessità I-1 Analizziamo il Semantic Web 12 Come gestire i dati sul Web? creare problemi idea soluzione sociale macro Condividere info Link a cose interessanti fenomeno ? innovare analizzare ? KR + Web Modellare RDF OWL SPARQL RIF soluzione tecnica micro fenomeno complessità Semantic Web I-1 13 I-1 14 Semantic Web Un modo di specificare dati e relazioni tra i dati Permette di condividere e riusare dati tra applicazioni, imprese e gruppi di interesse Una collezione di tecnologie RDF RDF-S OWL GRDDL SPARQL … La prossima onda del Web da surfare … I-1 15 Tim Berners-Lee’s Semantic Wave (2003) I-1 16 Tim Berners-Lee’s Semantic Wave (2008) I-1 17 The “corporate” landscape is moving Major companies offer (or will offer) Semantic Web tools or systems using Semantic Web: Adobe, Oracle, IBM, HP, Software AG, GE, Northrop Gruman, Altova, Microsoft, Dow Jones, … Others are using it (or consider using it) as part of their own operations: Novartis, Boeing, Pfizer, Telefónica, … Some of the names of active participants in W3C SW related groups: ILOG, HP, Agfa, SRI International, Fair Isaac Corp., Oracle, Boeing, IBM, Chevron, Siemens, Nokia, Pfizer, Sun, Eli Lilly, … I-1 18 The 2007 Gartner predictions During the next 10 years, Web-based technologies will improve the ability to embed semantic structures [… it] will occur in multiple evolutionary steps… By 2017, we expect the vision of the Semantic Web […] to coalesce […] and the majority of Web pages are decorated with some form of semantic hypertext. By 2012, 80% of public Web sites will use some level of semantic hypertext to create SW documents […] 15% of public Web sites will use more extensive Semantic Web-based ontologies to create semantic databases Source: “Finding and Exploiting Value in Semantic Web Technologies on the Web”, Gartner Research Report, May 2007 I-1 The Web Today 19 Large number of integrations - ad hoc - pair-wise Millions of Applications Too much information to browse, need for searching and mashing up automatically 10100 10 0010 01 101 0 101 01 1101 110 1 10 1 10 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 10 0 1 101 0 1 010 0 1 1 0 Each site is “understandable” for us Search & Mash-up Engine Computers don’t “understand” much I-1 20 What does “understand” mean? What we say to Web agents " For more information visit <a href=“http://www.ex.org” > my company </a> Web site. . .” What they “hear” [ source http://www.thefarside.com/ ] " blah blah blah blah blah <a href=“http://www.ex.org” > blah blah blah </a> blah blah. . .” Jet this is enought to train them to achive tasks for us I-1 21 What does Google “understand”? Understanding that [page1] links [page2] page2 is interesting Google is able to rank results! “The heart of our software is PageRank™, a system for ranking web pages […] (that) relies on the uniquely democratic nature of the web by using its vast link structure as an indicator of an individual page's value.” http://www.google.com/technology/ I-1 22 Two ways for computer to “understand” 1/2 Smarter machines Smarter data I-1 23 Two ways for computer to “understand” 2/2 Smarter machines Such as Natural Langue processing (NLP) Audio Processing Image Processing (IP) Video Processing … many many more They all work fine alone, the problem is combinig them E.g., NLP meets IP – NLP: What does your eye see? – IP: I see a sea – NLP: You see a “c”? Some NLP Related Entertainment http://www.cl.cam.ac.uk/Research/ – IP: Yes, what else could it be? NL/amusement.html Not the Semantic Web approach Smarter Data Make data easier for machines to publish, share, find and understand E.g. wornet2.1:sea/noun/1 vs. wordnet2.1:c/noun/10 The Semantic Web approach I-1 24 The Semantic Web 1/4 “The Semantic Web is not a separate Web, but an extension of the current one, in which information is given well-defined meaning, better enabling computers and people to work in cooperation.” “The Semantic Web”, Scientific American Magazine, Maggio 2001 http://www.sciam.com/article.cfm?articleID=00048144-10D2-1C70-84A9809EC588EF21 Key concepts an extension of the current Web in which information is given well-defined meaning better enabling computers and people to work in cooperation. Both for computers and people I-1 25 The Semantic Web 2/4 “The Semantic Web is not a separate Web, but an extension of the current one […] ” Web 1.0 The Web Today I-1 The Semantic Web 3/4 26 “The Semantic Web […] , in which information is given well-defined meaning […]” Web 1.0 Semantic Web ? Human understandable but “only” machine-readable Human and machine “understandable” I-1 The Semantic Web 4/4 27 Fewer Integration - standard - multi-lateral […] better enabling computers and people to work in cooperation. Even More Applications T ME T ME A T ME A A Semantic Web T ME A T ME Easier to understand for people A Semantic Mash-ups & Search More “understandable” for computers I-1 28 Semantic Web “layer cake” Already Possible Under Investigation Standardized [ source http://www.w3.org/2007/03/layerCake.png ] I-1 29 Data Interchange: RDF I-1 30 RDF: Resource Description Framework RDF is a general method for conceptual description or modeling of information that is implemented in web resources Basically speaking, the RDF data model is based upon the idea of making statements about Web resources, in the form of subject-predicate-object expressions.These expressions are known as triples in RDF terminology. The subject denotes the resource, and the predicate denotes traits or aspects of the resource and expresses a relationship between the subject and the object. I-1 31 RDF: Resource Description Framework For example, one way to represent the notion "The sky has the color blue" in RDF is as the triple: a subject denoting "the sky" wordnet:synset-sky-noun-1 a predicate denoting "has the color" Click & wordnet:wordsense-color-verb-6 read! an object denoting "blue“ wordnet:synset-blue-noun-1 In FOL we could write predicate(subject, object) wn:wordsense-color-verb-6(wn:synset-sky-noun-1, wn:synset-blue-noun-1) I-1 32 Serialization of RDF Serialization (N3 notation) subject predicate object . @prefix wn: <http://www.w3.org/2006/03/wn/wn20/schema/>. wn:synset-sky-noun-1 wn:wordsense-color-verb-6 wn:synset-blue-noun-1 . Serialization (N3 notation) <rdf:Description about="subject"> <predicate rdf:resource="object“/> </rdf:Description> < rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wn="http://www.w3.org/2006/03/wn/wn20/schema/" > <rdf:Description about="wn:synset-sky-noun-1"> <wn:wordsense-color-verb-6 rdf:resource="wn:synset-blue-noun-1"/> </rdf:Description> </rdf:RDF> I-1 33 Example: BBC’s Artist as Linked Data <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#" xmlns:owl = "http://www.w3.org/2002/07/owl#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns:foaf = "http://xmlns.com/foaf/0.1/" xmlns:rel = "http://www.perceive.net/schemas/relationship/" xmlns:mo = "http://purl.org/ontology/mo/" xmlns:rev = "http://purl.org/stuff/rev#" > <rdf:Description rdf:about="/music/artists/a3cb23fc-acd34ce0-8f36-1e5aa6a18432.rdf"> <rdfs:label>Description of the artist U2</rdfs:label> <foaf:primaryTopic rdf:resource="/music/artists/a3cb23fcacd3-4ce0-8f36-1e5aa6a18432#artist"/> </rdf:Description> <mo:MusicGroup rdf:about="/music/artists/a3cb23fc-acd34ce0-8f36-1e5aa6a18432#artist"> <foaf:name>U2</foaf:name> <owl:sameAs rdf:resource="http://dbpedia.org/resource/U2" /> <foaf:page rdf:resource="/music/artists/a3cb23fc-acd3-4ce08f36-1e5aa6a18432.html" /> <mo:musicbrainz rdf:resource="http://musicbrainz.org/artist/a3cb23fc-acd34ce0-8f36-1e5aa6a18432.html" /> <mo:homepage rdf:resource="http://www.u2.com/" /> <mo:fanpage rdf:resource="http://www.atu2.com/" /> <mo:wikipedia rdf:resource="http://en.wikipedia.org/wiki/U2" /> <mo:imdb rdf:resource="http://www.imdb.com/name/nm1277752/" /> <mo:myspace rdf:resource="http://www.myspace.com/u2" /> <mo:member rdf:resource="/music/artists/7f347782-eb1440c3-98e2-17b6e1bfe56c#artist" /> <mo:member rdf:resource="/music/artists/1f52af22-020740ac-9a15-e5052bb670c2#artist" /> http://www.bbc.co.uk/music/artists/a3cb23fc-acd3-4ce0-8f36-1e5aa6a18432 HTML: RDF : http://www.bbc.co.uk/music/artists/a3cb23fc-acd3-4ce0-8f36-1e5aa6a18432.rdf I-1 34 If you want to see the triples RDF is not always serialized in N3 notation, so if you want to see the triples you can use W3C RDF Validation Service http://www.w3.org/RDF/Validator/ To see the triples in the RDF version of the page about U2 on BCC http://www.w3.org/RDF/Validator/ARPServlet?URI= http%3A%2F%2Fwww.bbc.co.uk%2Fmusic%2Fartis ts%2Fa3cb23fc-acd3-4ce0-8f361e5aa6a18432.rdf+&PARSE=Parse+URI%3A+&TRI PLES_AND_GRAPH=PRINT_TRIPLES&FORMAT=PNG _EMBED I-1 35 Query: SPARQL I-1 36 What is SPARQL? SPARQL is the query language of the Semantic Web stays for SPARQL Protocol and RDF Query Language A Query Language ...: Find names and websites of contributors to PlanetRDF: PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?website FROM <http://planetrdf.com/bloggers.rdf> WHERE { ?person foaf:weblog ?website ; ?person foaf:name ?name . ?website a foaf:Document } ... and a Protocol. http://.../qps? query-lang=http://www.w3.org/TR/rdf-sparql-query/ &graphid=http://planetrdf.com/bloggers.rdf &query=PREFIX foaf: <http://xmlns.com/foaf/0.1/... I-1 37 Ontology: RDF-S and OWL I-1 What does it mean? 38 Formal, explicit specification of a shared conceptualization Machine readable It makes domain assumption explicit A conceptual model of some aspects of the reality Several people agrees that such conceptual model is adequate to describe such aspects of the reality I-1 39 How much explicit shall the specification be? “A little semantics, goes a long way” [James Hendler, 2001] I-1 A simple ontology 40 creates Artist Piece Painter Paint paints Sculptor Sculpt sculpts I-1 41 Specifying classes, sub-classes and instances Creating a class RDFS: Artist rdf:type rdfs:Class . FOL: x Artist(x) Artist Painter Sculptor Rodin Creating a subclass RDFS: Painter rdfs:subClassOf Artist . RDFS: Sculptor rdfs:subClassOf Artist . FOL: x [Painter(x) Sculptor(x) Artist(x)] Creating an instance RDFS: Rodin rdf:type Sculptor . FOL: Sculptor(Rodin) I-1 42 Specifying properties and sub-properties Creating a property RDFS: creates rdf:type rdf:Property . FOL: x y Creates(x,y) Using a property RDFS: Rodin creates TheKiss . FOL: Creates(Rodin, TheKiss) Creating subproperties RDFS: paints rdfs:subPropertyOf creates . FOL: x y [Paints(x,y) Creates(x,y)] RDFS: sculpts rdfs:subPropertyOf creates . FOL: x y [Sculpts(x,y) Creates(x,y)] creates paints I-1 43 Specifying domain/range constrains Checking which classes and properties can be use together RDFS: creates rdfs:domain Artist . creates rdfs:range Piece . paints rdfs:domain Painter . paints rdfs:range Paint . sculpts rdfs:domain Sculptor . sculpts rdfs:range Sculpt . FOL: x y [Creates(x,y) Artist(x) Piece(y)] x y [Paints(x,y) Painter(x) Paint(y)] x y [Sculpts(x,y) Sculptor(x) Sculpt(y)] I-1 The ontology we specified 44 creates Artist Piece Painter Paint paints Sculptor Sculpt sculpts I-1 45 RDF semantics (a part of it) hypothesis x rdfs:subClassOf y . conclusion a rdf:type y . a rdf:type x . x rdfs:subClassOf y . x rdfs:subClassOf z . y rdfs:subClassOf z . x a y . x b y . a rdfs:subPropertyOf b . a rdfs:subPropertyOf b . a rdfs:subPropertyOf c . b rdfs:subPropertyOf c . x a y . x rdf:type z . a rdfs:domain z . x a u . u rdf:type z . a rdfs:range z . Read out more in RDF Semantics http://www.w3.org/TR/rdf-mt/ I-1 46 First Order Calculus and RDF semantics RDFS inference rules are valid deduction hypothesis Conclusion p rdfs:subClassOf q . a rdf:type q . a rdf:type p . In FOL x [ P(x) Q(x)], P(A) Q(A) We can demonstate that it is a valid deduction using First Order Calculus 1. x [P(x) Q(x)] hypothesis 2. P(A) hypothesis 3. P(A) Q(A) E(1) 4. Q(A) E(3,2) I-1 Without Inference 47 A recipient, that only understands XML syntax, receiving <RDF> <Description about="Rodin"> <sculpts resource="TheKiss"/> </Description> </RDF> can answer the following queries What does Rodin sculpt? RDF/Description[@about='Rodin']/sculpts/@resource Who does sculpt TheKiss? RDF/Description[sculpts/@resource='TheKiss']/@about Try out your self at http://www.mizar.dk/XPath/ but it cannot answer Who is Rodin? What is TheKiss? Is there any Sculptor/Scupts? Is there any Artist/Piece? I-1 48 Knowing the ontology and RDF semantics … A recipient, that knows the ontology and “understands” RDF semantics, creates Artist Piece Painter Paint paints Sculptor Rodin Receiving Sculpt sculpts Rodin sculpts TheKiss . TheKiss I-1 … a reasoner can answer 1/2 49 the previous queries What does Rodin sculpt? PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ex: <http://www.ex.org/schema#> SELECT ?x WHERE { ex:Rodin ex:sculpts ?x } ?x = ex:TheKiss Who does sculpt TheKiss? WHERE { ex:Rodin ex:sculpts ?x } ?x = ex:Rodin and it can also answer Who is Rodin? WHERE { ex:Rodin a ?x } ?x = ex:Artist, ex:Sculptor, rdfs:Resource What is TheKiss? WHERE { ex:TheKiss a ?x } ?x = ex:Sclupt, ex:Piece, rdfs:Resource I-1 … a reasoner can answer 2/2 50 Is there any Sculptor? WHERE { ?x a ex:Sculptor} ?x = ex:Rodin Is the any Artist? WHERE { ?x a ex:Artist } ?x = ex:Rodin Is there any Sculpt? WHERE { ?x a ex:Sculpt } ?x = ex:TheKiss Is there any Piece? WHERE { ?x a ex:Piece } ?x = ex:TheKiss Is there any Paint? WHERE { ?x a ex:Paint } 0 results Is there any Painter? WHERE { ?x a ex:Painter } 0 results I-1 SPARQL vs Reasoner 51 SPARQL alone cannot answer queries that require reasoning SPARQL service RDF but a reasoner can be exposed as a SPARQL service. RDF Reasoner SPARQL service I-1 52 More expressive power 1/3 RDFS is a light ontological language that allows for defining simple vocabularies. One may want also express Cardinality constrains (max, min, exactly) for properties usage Es. a Polygon has 3 or more edges x [Polygon(x) ≥3y Edge(y) Forms(y,x) ] Property types transitive – e.g. hasAncestor is a transitive property: if A hasAncestor B and B hasAncestor C, then A hasAncestor C. – x y z [HasAncestor(x,y) HasAncestor(y,z) HasAncestor(x,z) ] inverse – e.g. sclupts has isSculptedBy as inverse property: if A sclupts B then B isSculptedBy A – x y [Sculpts(x,y) IsSculptedBy(y,x) ] I-1 More expressive power 2/3 53 simmetric – e.g. isCloseTo is a simmetric property: if A isCloseTo B then B isCloseTo A – x y [IsCloseTo(x,y) IsCloseTo(y,x) ] Restrictions of usage for a specific property All values of property must be of a certain kind – e.g. a D.O.C. Wine can be only produced by a Certified Wienery – x y [DOCWine(x) Produces(x,y) CertifiedWienery(y)] Some values of property must be of a certain kind – e.g. a Famous Painter must have painted some Famous Painting – x [FamousPainter(x) y FamousPaint(y) IsPaintedBy(y,x)] A class is defined combining other classes (union, intersection, negation, ...) A white wine is a Wine and its color is “white” x [Wine(x) White(x)] I-1 More expressive power 3/3 54 Two instances refers to the same real object “The Boss” and “Bruce Springsteen” are two names for the same person TheBoss = BruceSpringsteen Two classes refers to the same set “Painters” in english and “Pittori” in italian x [Painter(x) Pittore(x)] Two properties refers to the same binary relationship “Paints” in english and “Dipinge” in italian x y [Paints(x,y) Dipinge(x,y)] I-1 55 Expressivity vs. Tractability The more an ontological language is expressive the less is tractable the Web Ontology Language (OWL) comes with several profiles that offers different trade-offs between expressivity and tractability. I-1 56 OWL 2 profiles OWL 1 defines only one fragment (OWL Lite) And it isn’t very tractable! OWL 2 defines several different fragments with Useful computational properties E.g., reasoning complexity in range LOGSPACE to PTIME Useful implementation possibilities E.g., Smaller fragments implementable using RDBs OWL 2 profiles OWL 2 EL, OWL 2 QL, OWL 2 RL I-1 57 OWL 2 EL Useful for applications employing ontologies that contain very large number of properties and/or classes Captures expressive power used by many largescaleontologies E.g.; SNOMED CT, NCI thesaurus Features Included: existential restrictions, intersection, subClass,equivalentClass, disjointness, range and domain, object property inclusion possibly involving property chains, and data property inclusion, transitive properties, keys … Missing: include value restrictions, Cardinality restrictions (min, max and exact), disjunction and negation Maximal language for which reasoning (including query I-1 58 OWL 2 QL Useful for applications that use very large volumes of data, and where query answering is the most important task Captures expressive power of simple ontologies like thesauri, classifications, and (most of) expressive power of ER/UML schemas E.g., CIM10, Thesaurus of Nephrology, ... Features Included: limited form of existential restrictions, subClass, equivalentClass, disjointness, range & domain, symmetric properties, … Missing: existential quantification to a class, self restriction, nominals, universal quantification to a class, disjunction etc. Can be implemented on top of standard relational DBMS Maximal language for which reasoning (including query answering) is known to be worst case logspace (same as DB) I-1 59 OWL 2 RL Useful for applications that require scalable reasoning without sacrifying too much expressive power, and where query answering is the most important task Support most OWL features but with restrictions placed on the syntax of OWL 2 standard semantics only apply when they are used in a restricted way Can be implemented on top of rule extended DBMS E.g., Oracle’s OWL Prime implemented using forward chaining rules in Oracle 11g Related to DLP and pD* Allows for scalable (polynomial) reasoning using rule-based technologies I-1 60 Application I-1 61 Light weight semantic mark-up <div id="event-info-where" class="info-wh-info vcard"> <h2><a rel="bookmark" class="fn org location" href="/venues/V0-001-000693919-2"> Circus Krone Munich</a></h2> <div class="adr"> <span class="street-address">1</span><br> <span class="locality">Munich</span>, <span class="region">Bayern</span> <br> <span class="country-name">Germany</span> A firefox plug-in such as Operator can extract those semantic mark-up from the page and offers actions such as “add the event to your calendar” https://addons.mozilla.org/en-US/firefox/addon/4106 I-1 62 Linking Open Data Project Goal: extend the Web with data commons by publishing open data sets using Semantic Web techs Project Chartres • RDFizers and ConverterToRdf • Publishing Tools • Semantic Web Browsers and Client Libraries • Semantic Web Search Engines • Applications • […] Visit http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData ! I-1 63 Navigating the Semantic Web Use a Semantic Web search engine to enter into it E.g., sindice http://sindice.com/ Search for something (e.g., Varese) Click and browse NOTE: It’s meant for machine consumption! I-1 The new era of Semantic Apps 64 One of the highlights of October's Web 2.0 Summit in San Francisco was the emergence of 'Semantic Apps' as a force. The purpose of this post is to highlight 10 Semantic Apps. […] It reflects the nascent status of this sector, even though people like Hillis and Spivack have been working on their apps for years now. Read out more at http://www.readwriteweb.com/archives/10_semantic_apps_to_watch.php I-1 65 Esempi di applicazioni Allen Brain Atlas Gene Expression Results http://sw.neurocommons.org/hcls_gene_image.html SWEO’s use case collection http://www.w3.org/2001/sw/sweo/public/UseCases/ Linking Open Data Project http://esw.w3.org/topic/SweoIG/TaskForces/Community Projects/LinkingOpenData Music Event Explorer http://meex.cefriel.it/meex/ I-1 66 Music Event Explorer Esigenza: dove posso andare a sentire musica folk nei prossimi giorni? Soluzione manuale: 1. Vado su musicmoz e scopro i cantanti che fanno musica folk 2. Vado su musicbrainz e guardo quali album hanno pubblicato 3. Per ciascuno di quelli che mi piace cerco su EVDB se ci ha organizzato eventi nei prossimi giorni 4. Mi appunto i posti e poi li cerco in GoogleMaps I-1 67 Soluzione manuale 1. Vado su musicmoz e scopro i cantanti che fanno musica folk I-1 68 Soluzione manuale 2. Vado su musicbrainz e guardo quali album hanno pubblicato I-1 69 Soluzione manuale 3. Per ciascuno di quelli che mi piace cerco su EVDB se ci ha organizzato eventi nei prossimi giorni I-1 70 Soluzione manuale 4. Mi appunto i posti e poi li cerco in GoogleMaps I-1 71 Music Event Explorer Una soluzione poco praticabile … … ma automatizzabile I-1 72 http://meex.cefriel.it/meex