Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to the Semantic Web


Published on

Lecture at DM110 on "Emerging Web Media", NUIG - 2nd November 2009

Published in: Technology, Education
  • Dating direct: ♥♥♥ ♥♥♥
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here
  • Very intuitive and easy explaind introduction. Thanks!
    Are you sure you want to  Yes  No
    Your message goes here

Introduction to the Semantic Web

  1. Digital Enterprise Research Institute Introduction to the Semantic Web Alexandre Passant Digital Enterprise Research Institute, National University of Ireland, Galway DM110 – Emerging Web Media Week 7 – 02 Nov. 2009 © Copyright 2009 Digital Enterprise Research Institute. All rights reserved.
  2. Agenda Digital Enterprise Research Institute   What is the Semantic Web ? What for ?   From Documents to Data   URIs and RDF   To identify resources and define statements about these resources   Ontologies with RDFS/OWL   Shared semantics to improve interoperability between applications   Querying data with SPARQL   To make use of it and create new applications   NB: The upcoming lectures will cover related topics / subtopics 2 of XYZ
  3. The initial Proposal (1989) Digital Enterprise Research Institute 3 of XYZ
  4. … but so far … Digital Enterprise Research Institute ?? ?? ?? 4 of XYZ
  5. … however … Digital Enterprise Research Institute To a computer, the Web is a flat, boring world, devoid of meaning. This is a pity, as in fact documents on the Web describe real objects and imaginary concepts, and give particular relationships between them. For example, a document might describe a person. The title document to a house describes a house and also the ownership relation with a person. Adding semantics to the Web involves two things: allowing documents which have information in machine- readable forms, and allowing links to be created with relationship values. Only when we have this extra level of semantics will we be able to use computer power to help us exploit the information to a greater extent than our own reading. Tim Berners-Lee, 1st World Wide Web Conference, Geneva, May 1994 5 of XYZ
  6. … so ? Digital Enterprise Research Institute 6 of XYZ
  7. The Semantic Web is about Digital Enterprise Research Institute   Bridging the gap from a Web of Documents to a Web of Data   With typed objects and typed relationships: The Web as a giant decentralized database   Adding machine-readable meta-data to existing content   So that information can be parsed, queried, reused   Defining shared semantics for this meta-data   For interoperability between applications and for advanced purposes, such as reasoning   Enabling machine-readable knowledge at Web scale, making information more easy to find and process 7 of XYZ
  8. A Bit of History Digital Enterprise Research Institute   Memex   1945 ! - Vannevar Bush   A memex is “a device in which an individual stores all his books, records, and communications.”   Augmenting Human Intellect   1960 - Douglas Engelbart   “By ‘augmenting human intellect’ we mean increasing the capability of a man to approach a complex problem situation, to gain comprehension to suit his particular needs, and to derive solutions to problems.” 8 of XYZ
  9. More recently Digital Enterprise Research Institute   SHOE    “SHOE is a small extension to HTML which allows web page authors to annotate their web documents with machine- readable knowledge. SHOE makes real intelligent agent software on the web possible.“ 9 of XYZ
  10. The Semantic Web, right now Digital Enterprise Research Institute   Most standardisation work is done in the W3C    The Semantic Web activity    Various Incubator Groups, Working Group, Interest Group   SPARQL -   RDB2RDF –   RIF -   HCLS -   … 10 of XYZ
  11. The Semantic Web stack Digital Enterprise Research Institute 11 of XYZ
  12. URIs Digital Enterprise Research Institute   A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource as of RFC3986   URIs are used to identify everything in a unique and non-ambiguous way   Not only pages (as on the current Web), but any resource (people, documents, books, interests …)   A URI for a person is different from a URI for a document about the person, because a person is not a document !   Example  - myself  - my homepage 12
  13. Content-negociation Digital Enterprise Research Institute   URI for resource, URI for documents   But documents made for people cannot be read by computers (the issue with the current Web)   Content negotiation   Provides a way, for a resource URI to redirect to the document describing that resource   Depending on who is accessing it –  Human-readable of machine-readable   Example    13
  14. RDF Digital Enterprise Research Institute   URI represent resources   But how define things about these resources ?   RDF – Resource Description Framework   RDF abstract syntax, a data model: a directed, labeled graph based on URIs   RDF is not XML ! RDF/XML is only one of the multiple way to serialize RDF data (N3, RDFa …)   RDF is based on triples   <subject> <predicate> <object> . 14
  15. RDF Digital Enterprise Research Institute @prefix dct: <> . ! <>! dct:title “Introduction to the Semantic Web” ; ! dct:author <> ;! dct:subject <> .! 15
  16. RDF serializations Digital Enterprise Research Institute   RDF/XML   The most used, probably the most complex !   E.g.   N3/Turtle   Easier to read for humans   E.g.   RDFa   Embeds RDF in XHTML, one page for humans and machines   E.g. (browse source) 16 16 of XYZ
  17. Ontologies Digital Enterprise Research Institute   RDF provide a way to write assertions about URIs   But what about the semantic of these assertions   E.g. how can one know that identifies an acquaintance relationship ?   Ontologies provide common semantics for resources on the Semantic Web   “An ontology is a specification of a conceptualization.”   Developing ontologies for the Semantic Web   Main languages are RDFS (RDF Schema) and OWL (Web Ontology Language) 17 17 of XYZ
  18. Ontologies Digital Enterprise Research Institute   Classes and properties   :Person a rdfs:Class .   :father a rdfs:Property .   :father rdfs:domain :Person .   :father rdfs:range :Person . 18 18 of XYZ
  19. RDFS Digital Enterprise Research Institute   RDFS defines classes, properties and subsumption relations between classes and properties   ex:Person rdfs:subClassOf ex:humanLiving .   ex:worksWith rdfs:subPropertyOf ex:knows .   Such relationships are used to infer new statements   :alex rdf:type ex:Person .   :Alex ex:worksWith :Axel .   Is enough to say that Alex is a humanLiving and knows Axel 19 19 of XYZ
  20. OWL Digital Enterprise Research Institute   OWL goes further than RDFS by introducing new axioms   Disjunction (e.g. person / document)   Transitivity (e.g. ancestor)   Symmetry (e.g. sibling)   Cardinality constraints (e.g. ancestor > 1)   OWL2 has just been standardized W3C and introduces a lot of useful features, especially for reasoning   Property Chains   parent + brother -> uncle 20 20 of XYZ
  21. OWL2 Property chain example Digital Enterprise Research Institute ex:uncle rdf:type owl:ObjectProperty . ex:parent rdf:type owl:ObjectProperty . ex:brother rdf:type owl:ObjectProperty . [] rdfs:subPropertyOf ex:uncle;   owl:propertyChain (  ex:parent   ex:brother   ). :alice ex:parent :bob . :bob ex:brother :joe . => :alice ex:uncle :joe . 21 21 of XYZ
  22. Notable ontologies Digital Enterprise Research Institute   Social networks and social data   FOAF – Friend Of A Friend   SIOC – Semantically-Interlinked Online Communities   Software development   DOAP – Description Of A Project   BEATLE - Bug And Enhancement Tracking LanguagE   Comprehensive / Top-level   Yago (From Wikipedia)   OpenCYC   Taxonomies   SKOS – Simple Knowledge Organisation System 22
  23. Zooming in: FOAF Ontology Digital Enterprise Research Institute   A model to describe people and social networks    Concepts   Person, OnlineAccount, Document, etc.   Properties   name, homepage, holdsAccount, knows, etc. 23
  24. FOAF in use Digital Enterprise Research Institute   Google Social Graph API    Uses FOAF information already there on the Web to find your contacts  samples/findcontacts.html   E.g.: – samples/findcontacts.html? –  Contacts found in various FOAF files that link to myself and to my profile 24
  25. Which ontologies to use ? Digital Enterprise Research Institute   SearchMonkey Vocabularies  profile_vocab.html 25
  26. Which ontologies to use ? Digital Enterprise Research Institute   How to Publish Linked Data on the Web  LinkedDataTutorial/ 26
  27. Extending ontologies ? Digital Enterprise Research Institute   What if existing ontologies are not enough for your needs ?   Create a new ontology   … or extend an existing one !   Ontologies can be extended in a decentralized way   E.g. you can create a subproperty of foaf:knows, “hasLecturer”, in your own ontology and publish it online    A collaborative platform to manage ontologies  27
  28. Warning: Domain and range Digital Enterprise Research Institute   Domain and range of properties in ontologies are descriptive, not prescriptive   :father rdfs:domain :Person –  Not only pre-defined Persons can be fathers –  But every father is a Person !   Consequence 1: One triple is enough to describe several informations   Consequence 2: Don’t use foaf:homepage for a shoe !   For details   Based on RDF semantics (Rule rdfs2)  28
  29. Warning: Open World Digital Enterprise Research Institute   The Open World Assumption   Might be complex to understand when coming from a RDBMS or OOP background   If a fact is not there, it does not means it is false   Bob’s father is Paul. Is Jim Paul’s father ? –  Cannot be answered unless usin cardinality constraints in the ontology (in OWL), e.g. a Person has only 1 father.   Is Axel speaking today ? –  Cannot be answered   Bob’s daughters are Alice and June. Has Bob 3 daughters ? –  Cannot be answered   In practice, most applications use close-world reasoning / querying 29 29 of XYZ
  30. Creating RDF data using ontologies Digital Enterprise Research Institute   Overview of different methods:   Create RDF manually (using your favourite text-editor or Web-based interfaces)   Create XHTML+RDFa documents and use GRDDL transformation –  For both human and machines !   Use exporters / wrappers for existing service   Use applications that natively expose RDF data   Provide mappings from RDBMS to RDF data 30
  31. Getting a FOAF profile Digital Enterprise Research Institute   Or how to give yourself a URI   Give yourself an identity on the Semantic Web   Create your FOAF file  (requires hosting, e.g. your FTP space or uploaded via Drupal)  (requires OpenID)   I already have an homepage, what about duplication of information ?   Use RDFa to embed RDF annotations in your homepage !   More on this topic in a few slides 31
  32. Extend your FOAF profile Digital Enterprise Research Institute   The foaf:knows property aims to represent social connections between people   :alex foaf:knows :axel .   … but it’s voluntary a weak relationship (no strongsemantics on why / how we know each other)   Going further with the relationship vocabulary    Various properties can be used: colleagueOf, hasMet …   You can extend your FOAF file to add colleagues, co-workers, and use different properties for each of them   Useful for querying a particular type of relationship only 32
  33. Defining personal interests Digital Enterprise Research Institute   Instead of modeling interests as plain-text strings, use URIs to describe them !   Since URI are unique and non ambiguous identifiers   Allows interlinking of various resources for advanced query purposes: “find all people that like movies directed by Tarantino”   Using the foaf:topic_interest properties   :me foaf:topic_interest :movie .   But … where to get these URIs ?   Sindice, the Semantic Web index, can be used to find URIs for a given concept  33
  34. Defining personal interests Digital Enterprise Research Institute 34
  35. Defining personal interests Digital Enterprise Research Institute 35
  36. RDFa and GRDDL Digital Enterprise Research Institute   GRDDL is a mechanism to transform any kind of XML to RDF   XHTML+RDFa is XML, hence GRDDL can extract it   Simply embeds RDFa annotations in your HTML code   Indexed by Yahoo! SearchMonkey and Google   Done via XSLT, available at 36
  37. RDFa and GRDDL Digital Enterprise Research Institute   The GRDDL Primer at shows the overall processing of XHTML+RDFa: 37
  38. RDFa and GRDDL example Digital Enterprise Research Institute  38
  39. RDFa and GRDDL example Digital Enterprise Research Institute    Browse source to check RDFa annotations 39
  40. RDFa and GRDDL Digital Enterprise Research Institute    Header contains prefixes and links to the GRDDL transformation 40
  41. RDFa and GRDDL example Digital Enterprise Research Institute    Webpage can be translated to native RDF/XML using an RDFa distiller - 41
  42. Other example Digital Enterprise Research Institute   Adding RDFa in one’s profile   Need to define prefixes in the header, or include them in the markup   See 42
  43. Wrappers for existing sources Digital Enterprise Research Institute   Creating and maintaining a FOAF file by hand can be a time-consuming task   How can we automatically get RDF data from existing sources ?   What about Web 2.0 services in which we already give lots of personal information ?   Most of them provide APIs to get structured information (JSON, XML …) about the user profiles, content, etc.   API to RDF wrappers can easily be implemented 43
  44. Wrappers for Web 2.0 services Digital Enterprise Research Institute   Facebook wrapper   Generates a FOAF file from your Facebook profile   If you have a Facebook profile, then you can have a related FOAF file (and escape the Facebook walled-garden !)    Flickr wrapper   Generates FOAF + SIOC + links to geographical information (using  44
  45. More RDF-ification services Digital Enterprise Research Institute   Translates many structured sources into RDF   URIBurner – –  Open Source, C++ , Based on Virtuoso   Any23 –  Sindice sponsored –  Open Source, Java based   Swignition – –  Perl based   Triplr –  Purely syntactic, fast – 45
  46. Native export of RDF data Digital Enterprise Research Institute   CMS can expose RDF data natively using dedicated plug-ins   SIOC Export for Drupal:   Provide RDF export of each blog post – features-sparql-working-group –   Using RDF autodiscovery feature in the HTML header –  So that RDF can be discovered when browsing HTML –  Semantic Radar:   RDFa to be included in Drupal7 core ! – –  100.000’s of RDFa-powered websites 46
  47. Overview: SIOC for vBulletin Digital Enterprise Research Institute 47
  48. Relational to RDF Mapping Digital Enterprise Research Institute   Relational data (RDB) is structured data and can be mapped to RDF straight-forward   Especially useful as various websites are back-ended by a relational database (e.g. MySQL in the previous Drupal lecture)   Main issues:   Closed-world vs. open-world modeling   Assigning URIs for entities (records)   Mapping language expressivity   For a state-of-the-art see RDB2RDF_SurveyReport.pdf 48
  49. Relational to RDF Mapping Digital Enterprise Research Institute   Standardization   W3C RDB2RDF Incubator Group 2008/2009   Upcoming W3C RDB2RDF Working Group   Current solutions (see state-of-the-art)   D2RQ – –  DBLP in RDF:   OpenLink’s Virtuoso –   Triplify – 49
  50. SPARQL Digital Enterprise Research Institute   RDF(S)/OWL useful to produce data   A need to query it   SPARQL   SPARQL Protocol and RDF Query Language   The “SQL” of the Semantic Web   FAQ    SPARQL Query Recommendation / tutorial    Currently under standardization for new features  50
  51. How it works ? Digital Enterprise Research Institute   Basic concept of Graph Pattern Matching   RDF data is graph data, SPARQL checks if the graph you are looking for belongs to the graph you are querying   Four different operators   SELECT, DESCRIBE, CONSTRUCT, ASK   Combined with the pattern you want to match and optional features (union, filters …)   A Protocol   To query RDF data using SPARQL endpoints via HTTP   Most of endpoints are associated with an RDF store   A place that stores RDF data and provides open access to it – e.g. 51
  52. Example of SELECT queries Digital Enterprise Research Institute “select persons older than 30” SELECT ?X WHERE { ?X a foaf:Person. ?X ex:age ?Y. FILTER (?Y > 30) } 52
  53. Query DBPedia Digital Enterprise Research Institute   The Semantic Web aims at creating structured data where there is only HTML data at the moment   Wikipedia: A great resource for humans, poor for machines   DBPedia – RDF version of Wikipedia   New kind of advanced queries    People born in Berlin before 1900   German musicians born in Berlin   Etc …   The following queries can be run online  53
  54. Example query 1 Digital Enterprise Research Institute   People Born in Galway   Simple triple pattern    Answer SELECT ?who! WHERE {! ?who ! <> :Galway .! }! 54
  55. Example query 2 Digital Enterprise Research Institute   Japanese name of Galway   Using the FILTER by LANG clause   FILTER(lang(?x) = “ja”)   Answer SELECT ?name! WHERE {! :Galway rdfs:label ?name .! FILTER (lang(?name) = “ja”) .! }! 55
  56. Example query 3 Digital Enterprise Research Institute   Irish cities at the east of Galway! 56
  57. Example query 3 Digital Enterprise Research Institute   FILTER by type and comparison of coordinates   Answer PREFIX yago: <>! SELECT DISTINCT ?place ?long WHERE {! :Galway dbpedia2:westCoord ?glong .! ?place rdf:type! yago:CitiesInTheRepublicOfIreland ;! dbpedia2:westCoord ?long .! FILTER (?long < ?glong) ! }! 57
  58. Assignement Digital Enterprise Research Institute   Create a FOAF file   Define your social network (>3) using the relationships vocabulary and add some interests using DBPedia URI (>3)   Validate at   Add the same information in your Drupal profile as RDFa   Check if it translates well using   Some SPARQL queries over Dbpedia (based on the interests defined in your FOAF file)   Will send the list by e-mail   Deadline 16 November 58