Semantic web2


Published on


Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Semantic web2

  1. 1. Semantic Web
  2. 2. Little Known Facts• Harrison Ford Played Hans Solo• Harrison Ford Played in Rolling Stones• Harrison Ford Played Duke Nukem
  3. 3. Little Known Facts• Harrison Ford Played Hans Solo• Harrison Ford Played in Rolling Stones• Harrison Ford Played Duke Nukem
  4. 4. Harrison Ford Played Hans Solo
  5. 5. Little Known Facts• Harrison Ford Played Hans Solo• Harrison Ford Played in Rolling Stones• Harrison Ford Played Duke Nukem
  6. 6. Harrison Ford Played in Rolling Stones Harrison Ford
  7. 7. Harrison Ford Played Hans Solo
  8. 8. Harrison Ford Played in Rolling Stones
  9. 9. Rolling Stones ?
  10. 10. Little Known Facts• Harrison Ford Played Hans Solo• Harrison Ford Played in Rolling Stones• Harrison Ford Played Duke Nukem
  11. 11. Harrison Ford Played Duke NukemMovie and Character Video Game
  12. 12. Http:// PLAYED
  13. 13. Harrison Ford Played Hans Solo (triple)
  14. 14. Harrison Ford Played in Rolling Stones (Triple) 26
  15. 15. Harrison Ford Played Duke Nukem (triple) 27
  16. 16. Lets eliminate the duplicate data wikp: dict: 27 26 ibdb:
  17. 17. wikp = dict = Ibdb = Name Short Namewikp: wikp:Harrison_ford wikp:Hans_Solo wikp:Harrison_ford_(silent_film_actor) wikp:Duke_Nukem dict: 22 dict:played?s=t&def=22 26 dict:played?s=t&def=26 27 dict:played?s=t&def=27 ibdb: ibdb:7057
  18. 18. Harrison Ford Played Hans Solo wikp:Harrison_ford dict:played?s=t&def=22 wikp:Hans_Solo Harrison Ford Played in Rolling Stoneswikp:Harrison_ford_(silent_film_actor) dict:played?s=t&def=26 ibdb:7057 Harrison Ford Played Duke Nukem wikp:Harrison_ford dict:played?s=t&def=27 wikp:Duke_Nukem wikp = dict = Ibdb =
  19. 19. Resource Description Framework a framework for representing information in the Web. - W3C a framework for describing data through the “subject > predicate > object” relationships. Where the “predicate” and “Object” can be subsequent “Subjects” of more detailed descriptions (RDF is the idea of “triples”). All Subject, Predicates, and Objects are defined by either URI or Literals - Me “This is admittedly a pretty odd use of the word resource, but alternatives like entity or thing, which might be more accurate, Have their own issues. In any case, resource is the word used In semantics -Semantic web for the working ontologist Jim Hendler and Dean Allemang
  20. 20. “Played in” verses “Played” “Played In” “Portrayed an character in” “Played” i n” y ed “ Pla for o m ary.c wikp:Rollingstone,_Minnesota t io n n Dic g i thi nNo
  21. 21. RDFS = Resource Definition Framework Schema Language
  22. 22. Make one uphttp://Art-Nicewicks-URL-Used-To-Globally-Define-Terms.comPlayedInIpaddress 111.222.333.444 = Art-Nicewicks-URL-Used-To-Globally-Define-Terms.com111.222.333.444Playin Is there a easy way for me to say what this term “Playedin” means, without Having to put up a website? … Is there some way I could just say a little Data about the data …. Hmm … Metadata …Note: Tim Berneers –lee wants all URIURL assigned
  23. 23. RDF schemaRDF Schema – Metadata about the dataThere is a schema definition vocabulary for triples at “”rdfs =” myTerm = MyTerm:playedIn rdfs:Label “Portrayed an character in”
  24. 24. Lets also use •dict:played?s=t&def=22RDFS:Label to make •dict:played?s=t&def=26 •dict:played?s=t&def=27it more readable •ibdb:7057 •wikp:Duke_NukemI’d like to say“dict:played?s=t&def=22” RDFS:label “Acted”“dict:played?s=t&def=27” RDFS:label “Played a Game”“ibdb:7057” RDFS:label “The 1918 play called Rolling Stones”“wikp:Duke_Nukem” RDFS:label “Duke Nukem the Video Game”
  25. 25. Our Triple Store (Ambiguous) Subject Predicate Object• Harrison Ford Played Hans Solo• Harrison Ford Played in Rolling Stones• Harrison Ford Played Duke Nukem
  26. 26. Our Triple Store(Not Ambiguous) Subject Predicate Objectdict:played?s=t&def=22 Rdfs:label “Acted ”dict:played?s=t&def=27 Rdfs:label “Played a Game”myTerm:PlayedIn Rdfs:label “Portrayed an character in”ibdb:7057 Rdfs:label “The 1918 play called Rolling Stones”wikp:Duke_Nukem” Rdfs:label “Duke Nukem the Video Game”wikp:Harrison_ford dict:played?s=t&def=22 wikp:Hans_Solowikp:Harrison_ford_ myTerm:PlayedIn ibdb:7057(silent_film_actor)wikp:Harrison_ford dict:played?s=t&def=27 wikp:Duke_Nukem wikp = dict = Ibdb = rdfs =” myTerm =
  27. 27. Our Triple Store (Not Ambiguous) Subject Predicate Object ibdb:7057 Rdfs:label “The 1918 play called Rolling Stones” wikp:Duke_Nukem” Rdfs:label “Duke Nukem the Video Game” myTerm:PlayedIn Rdfs:label “Portrayed an character in” dict:played?s=t&def=27 Rdfs:label “Played a Game” wikp:Harrison_ford_ Rdfs:label “Harrison Ford of silent movies” (silent_film_actor) wikp:Harrison_ford dict:played?s=t&def=22 wikp:Hans_Solo wikp:Harrison_ford_ myTerm:PlayedIn ibdb:7057 (silent_film_actor) wikp:Harrison_ford dict:played?s=t&def=27 wikp:Duke_NukemHarrison Ford of the silent movies portrayed an character in The 1918 play called “Rolling Stones”
  28. 28. GRAPH -
  29. 29. Triples and GraphsTopics to cover: Blank Node, Literal, Property, Graph
  30. 30. W3C (Everything is a Resource)
  31. 31. Our Graph Triple wikp:Harrison_ford dict:played?s=t&def=22 wikp:Hans_Solo Harrison FordSubjectPredicate Played AKA: PropertyObject “Hans Solo”
  32. 32. RDF:Type = “is a”
  33. 33. Lets collect a little more info (“is a”) Harrison Ford is a Male Actor Harrison Ford is a Male Actor is a Video Game is a Play
  34. 34. Creating Classes (Rdf:type) rdf:Type (AKA “is a” or “a”)wikp:Harrison_ford wikp:Actorwikp:Harrison_ford_(silent_film_actor) rdf:Typewikp:Duke_Nukem” rdf:Type wikp:Video_gameibdb:7057 rdf:Type wikp:Play_theator Rdfs:label “The 1918 play called Rolling Stones”
  35. 35. Actor Table Type = Class ~= Table Primary Key Name BirthDate BirthPlace wikp:Harrison_ford Harrison Ford 7/13/1942 Illinois wikp:Harrison_ford_ Harrison Ford 3/18/1884 Kansas (silent_film_actor) wikp:Brad_Pitt William Brad Pitt 12/18/1963 Oklahoma Subject Predicate Object Triple<wikp:Brad_Pitt> Rdf:Type Actor<wikp:Brad_Pitt> dbpedia2:birthPlace "Shawnee, Oklahoma, U.S."@en<wikp:Brad_Pitt> dbpedia2:dateOfBirth "1963-12-18"^^xsd:date<wikp:Brad_Pitt> dbpedia2:name "Pitt, William Bradley"@en<wikp:Harrison_Ford> Rdf:Type Actor<wikp:Harrison_Ford> dbpedia2:birthPlace "Chicago, Illinois, U.S."@en<wikp:Harrison_Ford> dbpedia2:dateOfBirth "1942-07-13"^^xsd:date<wikp:Harrison_Ford> dbpedia2:name "Ford, Harrison"@en<wikp:Harrison_Ford(Silent_File_Actor)> Rdf:Type Actor<wikp:Harrison_Ford(Silent_File_Actor)> dbpedia2:name "Ford, Harrison"@en ...
  36. 36. Named Graph
  37. 37. What about the other “Rolling Stones” Rolling Stones is a Music Group Rdf:TypePredicate(AKA: Property)“Table Columns ? ”
  38. 38. Rolling Stones has 29 rdf:type ?? ??
  39. 39. Lets collect a little more info (“is a”) “Played” is a type of pretending Hans Solo is a fictional character Star Wars is a Hans Solo is a character in the movie “star wars” is a character in is a participation
  40. 40. Our Graph (now we can infer) Is aInference Is a type of Played In Properties A character In Have classes Is a Is a Is a type of “Participation”
  41. 41. Properties and Classes “Show” “Film” Rdfs:subClassOf “Pretending” “Acting” Rdfs:subPropertyOf
  42. 42. “Movie Star” “Movie” Domain Range “property “values of a Instance property” of class” “Performs In” (Subject) “Rdfs:Type” “Rdfs:Type” “Performs In” (Property) Subject Predicate Object Triple<wikp:Harrison_Ford> PerformedIn StarWarsPerformedIn Rdfs:Domain MovieStarsPerformedIn Rdfs:Range StarWars
  43. 43. <wikp:Brad_Pitt> dbpedia2:name "Pitt, William Bradley” Simple Typed <wikp:Brad_Pitt> dbpedia2:dateOfBirth "1963-12-18"^^xsd:date xsd:date Rdf:type Rdfs:DataTypeRdfs:XMLLiteral Rdf:subClassOf Rdfs:DataType Triple
  44. 44. rdf:RDF xmlns:rdf=" rdf-syntax-ns#" xmlns:ex=""> <rdf:Description rdf:about=""> <ex:prop rdf:parseType="Literal" xmlns:a=""><a:Box required="true"> <a:widget size="10" /> <a:grommit id="23" /></a:Box> </ex:prop> </rdf:Description> </rdf:RDF>Xsd:Date Rdf:type Rdfs:DataType
  45. 45. Rdfs:subClassOf Rdfs:subClassOf Actor ExtraMovie Star
  46. 46. RDF:Type = “is a”
  47. 47. A break, to tell you what I don’t want to talk aboutURI vs IRI vs URIN3 vs RDFXML vs Turtle
  48. 48. InfoBlox
  49. 49.
  50. 50. Lets look at Dbpedia – First we need A Query … SPARQL ~ SQL SELECT Subject , ?Predicate , ?Object FROM Subject_Predicate_Object_Table WHERE { Subject = “<>" and Not required in ?Predicate like ‘%’ and SQL, but we’ll leave It here to help show ?Object like ‘%’ The differences }
  51. 51. 1. The “from” is defaulted2. The position infers the “Subject =“3. No Quotes around URL4. Use “{}” instead of () SELECT Subject , ?Predicate , ?Object FROM Subject_Predicate_Object_Table WHERE { Subject = “<>" and ?Predicate like ‘%’ and ?Object like ‘%’ }
  52. 52. 5. Only the positional values with “?” in front areinferred in the select list6. No comma between items in select list7. The “and” is inferred8. The “like ‘%’” is inferred SELECT Subject , ?Predicate , ?Object FROM Subject_Predicate_Object_Table WHERE { Subject = <> and ?Predicate like ‘%’ and ?Object like ‘%’ }
  53. 53. SPARQLSELECT ?Predicate ?Object WHERE { <> ? Predicate ?Object}
  54. 54. SELECT ?Predicate ?Object WHERE{<> ?Predicate ?Object } Predicate Object
  55. 55. SELECT ?Subject ?Predicate WHERE{<> ?Subject ? ?Predicate } Predicate Object
  56. 56. Sparql Queries The movies that were written by one of Harrison Fords wives ? SELECT ?s ?p ?o WHERE { { :Harrison_Ford dbpedia2:spouse ?o. ?s <> ?o } } order by ?ss callret-1 o:E.T._the_Extra-Terrestrial dbpedia2:writer :Melissa_Mathison:Kundun dbpedia2:writer :Melissa_Mathison:The_Black_Stallion_%28film%29 dbpedia2:writer :Melissa_Mathison:The_Escape_Artist dbpedia2:writer :Melissa_Mathison:Twilight_Zone:_The_Movie dbpedia2:writer :Melissa_Mathison
  57. 57. Virtuoso online iSparql
  58. 58. Any Other repositoriesSELECT ?s owl:sameAs ?o WHERE{:Harrison_Ford owl:sameAs ?o.} callret-0 callret-1 o :Harrison_Ford owl:sameAs < :Harrison_Ford owl:sameAs > <> :Harrison_Ford owl:sameAs <>
  59. 59. Freebase or DBPediaBoth extract structured data from Wikipedia and make it available as RDFFreebase and dbpedia have different schemas, different identifiers, and differentgoals.Freebase imports data from a wide variety of sources, not just Wikipedia, whereasDBPedia focuses on just Wikipedia dataDBPedia is funded by grants/sponsorships from various organisations, whileFreebase is run by Metaweb, an incorporated company.DBpedia has strong connections to the Semantic Web research community.Freebase has strong connections to the open data / startup community.DBpedia tools are developed by 3rd parties and the open-source community.Freebase tools are developed by Metaweb and the Freebase community.DBpedia lets you query its data via a SPARQL end pointFreebase lets you query its data via an MQL API
  60. 60. Freebase and MQL
  61. 61. YAGO Beatles wives born before Woodstock and near London
  62. 62. RPI Logd
  63. 63. LOGD
  64. 64. RPI Logd results from Sparql Query
  65. 65. Sparql service (Types)
  66. 66. RDFa (Query the web pages)<html> <html><head> ... </head> <body> ... <head> ... </head> Wikinomics <body> ... <br/> <div xmlns:dc="" Don Tapscott xmlns:my="" <br/> about=“my:Page001” 2006-10-01 <p> <span property="dc:title">Wikinomics</span> <br/> <br/></body> <span property="dc:creator">Don Tapscott</span> <span property="dc:date">2006-10-01</span> </div> </body>exec SELECT * WHERE { ?s ?p ?o } --data ‘ Subject Predicate Object Triple My:Page001 <dc:title> “Wikinomics” My:Page001 <dc:creator> “Don Tapscott” My:Page001 <dc:date> “2006-10-01”
  67. 67. Drupal (Most popular CMS ) *1 *1 Wordpress is much larger, but classified as blog
  68. 68. OWLWeb Ontology Language
  69. 69. OWLWeb Ontology Language
  70. 70. OWL Web Ontology Languagecallret-0 callret-1 o:Harrison_Ford owl:sameAs < owl:sameAs > <>:Harrison_Ford owl:sameAs <>
  71. 71. rdf:type owl:Thing -rdf:type dbpedia:ontology/Person -rdf:type <> - dbpedia:class/yago/Person100007846rdf:type - dbpedia:class/yago/AmericanFilmActorsrdf:type - dbpedia:class/yago/AmericanConservationistsrdf:type -rdf:type foaf:Person -rdf:type dbpedia:class/yago/JewishActors -rdf:type dbpedia:class/yago/LivingPeople - dbpedia:class/yago/AmericanTelevisionActorsrdf:type -rdf:type dbpedia:class/yago/AmericanAviators - dbpedia:class/yago/ActorsFromCaliforniardf:type - dbpedia:class/yago/AmericanActorsOfRussianDescentrdf:type -rdf:type <> -rdf:type <> - dbpedia:class/yago/PeopleFromLosAngeles,Californiardf:type - dbpedia:class/yago/AmericanPeopleOfGermanDescentrdf:type - dbpedia:class/yago/AmericanPeopleOfIrishDescentrdf:type - dbpedia:class/yago/ActorsFromChicago,Illinoisrdf:type
  72. 72. rdfs =”rdf =”
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.