Ontologies    and Semantic       Jose Gato Luis<jose.gato@atosresearch.eu>         (4-09-2012)
© 2009,2011 Jose Gato Luis   Some rights reserved. This presentation is distributed under           the “Attribution-Share...
Summary Introduction Ontologies OWL and RDF. QualiPSo: Information management Semantic Queries 04/09/12           Ontologi...
IntroductionDefinition:     “ Ontology is the philosophical study of the nature of being,       existence or reality in ge...
IntroductionComputers engineering vision:   “Ontology is a formal representation of a set of     concepts within a domain ...
OntologiesVocabularies to define entities and concepts.For example, the ontology of an email or a a tree.Knowledge represe...
Ontologies This is not understandable by a machine:           Car               Colour                 Price           For...
OntologiesInformation clasified and structured:I want to rent a Ford Fiesta car by 60€Class car -> Model -> Ford FiestaCla...
OntologiesSomething understandable by a machine:    <rdf:RDF            xmlns:rdf="http://w.o/1999/02/22-rdf-    syntax-ns...
OntologiesAnd relations...   <rdf:RDF            xmlns:rdf="http://w.o/1999/02/22-rdf-   syntax-ns#"            xmlns:coch...
OntologiesAn ontology should allow to define all theinformation of a concept:Is this possible?Standards -> Competency vs C...
Ontologies Ontologies are useful when...You can define enough information about a concept.Used by many people/projects/com...
Ontologies: FOAFFriend of a Friend: http://www.foaf-project.org/PeopleActivitiesPeople relations: People living in Europe,...
Ontologies: SIOCSemantically-Interlinked Online Communities    http://sioc-project.org/ontology 04/09/12                On...
Ontologies: SIOC  <sioc:Post rdf:about="http://..../post/7#post">    <dc:title>Example post</dc:title>    <sioc:has_creato...
Ontologies: MixingTo define a concept (resource), usually, you donthave enough with only one ontology     <foaf:Person rdf...
RDFResource Description FrameworkClasses   A ressource with the property rdf:type Class   OOP and abstract charcteristics ...
04/09/12   Ontologies and Semantic   18
RDF: Triplets <Subject>                            <Predicate><Object><http://es.person/jose> <http://foaf/#name> "Jose" ....
RDF: Schemas Schemas to define the namespaces of the  resources Property names must be associated to schemas<?xml version=...
RDF: Schemas RDF Schema: "http://www.w3.org/1999/02/22-rdf-syntax-ns# DC Dublin Core: light weight RDFS vocabulary for des...
RDF/XMLFoaf: friend of a friend ontology: http://http://xmlns.com/foaf/spec/ <rdf:RDF         xmlns:rdf="http://w.o/1999/0...
RDF/XMLYou can use the resource type as an element name. Abbreviated RDF syntax<rdf:RDF        xmlns:rdf="http://w.o/1999/...
RDF/XML... but tripletsWhere are the triplets? <foaf:Group rdf:about="http://groups/ILRT">  <foaf:name>ILRT staff</foaf:na...
RDF/XML... but tripletsHere they are.. 04/09/12          Ontologies and Semantic   25
RDF/XML... and graphs04/09/12         Ontologies and Semantic   26
RDF Extensibility!!!!!! How do you extend the  properties in your data model?   If you have a DDBB? Change tables, queries...
RDF/XMLParsing toolhttp://www.w3.org/RDF/Validator/ 04/09/12            Ontologies and Semantic   28
OWLOntology Web LanguageMarkup language in order to publish and shareinformation using ontologies.Extension of RDF/XMLClas...
OWLTerminology   Classes      Descriptions: property restrictions, intersections, unions,        constraints...      Axiom...
<owl:Class rdf:ID="WhiteBurgundy">    <owl:intersectionOf rdf:parseType="Collection">      <owl:Class rdf:about="#Burgundy...
<owl:Class rdf:ID="WhiteWine">    <owl:intersectionOf rdf:parseType="Collection">      <owl:Class rdf:about="#Wine" />    ...
<owl:Class rdf:ID="Fruit">  <owl:unionOf rdf:parseType="Collection">    <owl:Class rdf:about="#SweetFruit" />    <owl:Clas...
<owl:Class rdf:ID="SweetFruit">    <rdfs:subClassOf rdf:resource="#EdibleThing" />  </owl:Class>  <owl:Class rdf:ID="NonSw...
OWL  <owl:Class>    <owl:intersectionOf rdf:parseType="Collection">      <owl:Class>        <owl:oneOf rdf:parseType="Coll...
OWLTerminology       Properties: A property is a directed binary relation         that specifies class characteristics    ...
OWL <owl:Classrdf:about="http://....../qualipso_maillinglist#Mail">        <rdf:typerdf:resource="http://..../2002/07/owl#...
OWLOnline ontologies browserhttp://owl.cs.manchester.ac.uk/browser/ontologies/ExamplesPizza:  http://www.co-ode.org/ontolo...
QualiPSo“Issues” in OpenSource projects   Huge amount of data in different information sources   Heterogeneous information...
QualiPSo – Information                      managementRelations between different information sources.Extractors searching...
Semantic Queries (SPARQL)SPARQL:SPARQL Protocol and RDF Query LanguageQueries language   http://sparql.org/query.htmlPREFI...
ExamplesCommit related with bugs:  PREFIX rdf: <http://.../-rdf-syntax-ns#>  PREFIX  relation:<"http://www.q.org/ont/qr#">...
ExamplesCommit related with the bug #252:  PREFIX rdf: <http://.../-rdf-syntax-ns#>  PREFIX  relation:<"http://www.q.org/o...
"Introduction to the Semantic Web" - Ivan Herman -       http://www.w3.org/2009/Talks/0829-Nanjing-IH/04/09/12            ...
Play with SPARQL http://dbpedia.org/snorql/   Extract all the films      PREFIX ont: <http://dbpedia.org/ontology/>      P...
Play with SPARQL http://dbpedia.org/snorql/   Extract all the films starred by cruise from the year    1990   PREFIX ont: ...
Play with SPARQL http://dbpedia.org/snorql/  Extract all the films (and producers name) starred by   cruise from the year ...
Play with SPARQL http://dbpedia.org/snorql/       Abstracts of movies starring Tom Cruise, released        before 1999   S...
Jose Gato Luis      <jose.gato@atosresearch.eu>           http://www.linkedin.com/in/josegatoluis04/09/12                 ...
Upcoming SlideShare
Loading in …5
×

Ontologies and Semantic in OpenSource projects

2,213
-1

Published on

This presentation was used in Madrid during a session to talk about Ontologies and Legal Issues.

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

  • Be the first to like this

No Downloads
Views
Total Views
2,213
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
60
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ontologies and Semantic in OpenSource projects

  1. 1. Ontologies and Semantic Jose Gato Luis<jose.gato@atosresearch.eu> (4-09-2012)
  2. 2. © 2009,2011 Jose Gato Luis Some rights reserved. This presentation is distributed under the “Attribution-ShareAlike 3.0” license, by Creative Commons, available at04/09/12 Ontologies and Semantic 2 http://creativecommons.org/licenses/by-sa/3.0/
  3. 3. Summary Introduction Ontologies OWL and RDF. QualiPSo: Information management Semantic Queries 04/09/12 Ontologies and Semantic 3
  4. 4. IntroductionDefinition: “ Ontology is the philosophical study of the nature of being, existence or reality in general, as well as of the basic categories of being and their relations. Traditionally listed as a part of the major branch of philosophy known as metaphysics, ontology deals with questions concerning what entities exist or can be said to exist, and how such entities can be grouped, related within a hierarchy, and subdivided according to similarities and differences.” - Wikipedia 04/09/12 Ontologies and Semantic 4
  5. 5. IntroductionComputers engineering vision: “Ontology is a formal representation of a set of concepts within a domain and the relationships between those concepts. It is used to reason about the properties of that domain, and may be used to define the domain.” - WikipediaHow to make an standard, in order to define the parts ofa concept.04/09/12 Ontologies and Semantic 5
  6. 6. OntologiesVocabularies to define entities and concepts.For example, the ontology of an email or a a tree.Knowledge representation.Knowledge understandable by machines andcomputer programs.Similar to object orientation paradigm.04/09/12 Ontologies and Semantic 6
  7. 7. Ontologies This is not understandable by a machine: Car Colour Price Ford Fiesta Blue 30 Ferrari F40 Red 1004/09/12 Ontologies and Semantic 7
  8. 8. OntologiesInformation clasified and structured:I want to rent a Ford Fiesta car by 60€Class car -> Model -> Ford FiestaClass car -> Colour -> BlueClass Money -> Type -> CoinClass Money -> Value -> 60Class Money -> Coin -> euro04/09/12 Ontologies and Semantic 8
  9. 9. OntologiesSomething understandable by a machine: <rdf:RDF xmlns:rdf="http://w.o/1999/02/22-rdf- syntax-ns#" xmlns:coche="http://car/spec/"> <rdf:Description rdf:about="http://car/FordFiesta”> <car:colour> blue </car:colour> <car:price> 30 </car:price> </rdf:Description> </rdf:RDF>04/09/12 Ontologies and Semantic 9
  10. 10. OntologiesAnd relations... <rdf:RDF xmlns:rdf="http://w.o/1999/02/22-rdf- syntax-ns#" xmlns:coche="http://car/spec/"> <rdf:Description rdf:about="http://car/FordFiesta”> <car:colour> blue </car:colour> <car:price> 30 </car:price> <manufacturer:id> http://manufacturer/FordSpain </manufacturer:id> </rdf:Description> </rdf:RDF>04/09/12 Ontologies and Semantic 10
  11. 11. OntologiesAn ontology should allow to define all theinformation of a concept:Is this possible?Standards -> Competency vs CommunityDifferent persons will define concepts in very differentways.Are we able to define the world around us?Specific concepts Tree: { Root, Trunk, type... }Difficult to define abstract concepts04/09/12 Ontologies and Semantic 11
  12. 12. Ontologies Ontologies are useful when...You can define enough information about a concept.Used by many people/projects/communitiesWidely spread <-> Standard <-> Community04/09/12 Ontologies and Semantic 12
  13. 13. Ontologies: FOAFFriend of a Friend: http://www.foaf-project.org/PeopleActivitiesPeople relations: People living in Europe, commonfriends <foaf:Person rdf:ID=”PeterParker”> <foaf:name>Peter Parker</foaf:name> <foaf:gender> Male </foaf:gender> <foaf:title> Mr </foaf:title> <foaf:givenname>Pet</foaf:givenname> <foaf:knows rdf:nodeID="harry"/> </foaf:Person> 04/09/12 Ontologies and Semantic 13
  14. 14. Ontologies: SIOCSemantically-Interlinked Online Communities http://sioc-project.org/ontology 04/09/12 Ontologies and Semantic 14
  15. 15. Ontologies: SIOC <sioc:Post rdf:about="http://..../post/7#post"> <dc:title>Example post</dc:title> <sioc:has_creator> <sioc:User rdf:about="person/pepe"> <sioc:name>John</sioc:name> </sioc:User> </sioc:has_creator> <sioc:content>there was a time</sioc:content> <sioc:has_reply> <sioc:Post rdf:about="post/3#post" /> </sioc:has_reply> </sioc:Post>04/09/12 Ontologies and Semantic 15
  16. 16. Ontologies: MixingTo define a concept (resource), usually, you donthave enough with only one ontology <foaf:Person rdf:ID=”PeterParker”> <foaf:name>Peter Parker</foaf:name> <foaf:gender> Male </foaf:gender> <foaf:title> Mr </foaf:title> <foaf:givenname> Peter </foaf:givenname> <foaf:knows rdf:nodeID="harry"/> <sioc:email>spiderman@gmail.com</sioc:email> </foaf:Person> 04/09/12 Ontologies and Semantic 16
  17. 17. RDFResource Description FrameworkClasses A ressource with the property rdf:type Class OOP and abstract charcteristics of an object, properties and behaviors RDF class does not define behaviors. It is a data modelResource Description FrameworkSubject, predicate y object Subject -> Resource (Jose)04/09/12 Ontologies and Semantic 17
  18. 18. 04/09/12 Ontologies and Semantic 18
  19. 19. RDF: Triplets <Subject> <Predicate><Object><http://es.person/jose> <http://foaf/#name> "Jose" .<http://es.person/jose> <http://foaf/#has> "car" .<http://es.person/jose> <http://foaf/#friend_of> <http://es.person/jose>.04/09/12 Ontologies and Semantic 19
  20. 20. RDF: Schemas Schemas to define the namespaces of the resources Property names must be associated to schemas<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description about="http://www.cs.vassar.edu/~ide/rdf/"> <dc:creator>Nancy Ide</dc:creator> </rdf:Description> </rdf:RDF>04/09/12 Ontologies and Semantic 20
  21. 21. RDF: Schemas RDF Schema: "http://www.w3.org/1999/02/22-rdf-syntax-ns# DC Dublin Core: light weight RDFS vocabulary for describing generic metadata: “http://purl.org/dc/elements/1.1”<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description about="http://www.cs.vassar.edu/~ide/rdf/"> <dc:creator>Nancy Ide</dc:creator> </rdf:Description> </rdf:RDF>04/09/12 Ontologies and Semantic 21
  22. 22. RDF/XMLFoaf: friend of a friend ontology: http://http://xmlns.com/foaf/spec/ <rdf:RDF xmlns:rdf="http://w.o/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <rdf:Description rdf:about="http://es.person/jose"> <rdf:type>http://xmlns.com/foaf/spec/#Person</rdf:type> <foaf:has> car </foaf:has> <foaf:friend_of> http://es.person/jose </foaf:friend_of> </rdf:Description> </rdf:RDF> 04/09/12 Ontologies and Semantic 22
  23. 23. RDF/XMLYou can use the resource type as an element name. Abbreviated RDF syntax<rdf:RDF xmlns:rdf="http://w.o/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <foaf:Person rdf:about="http://es.person/jose"> <foaf:has> car </foaf:has> <foaf:friend_of> http://es.person/jose</foaf:friend_of> </foaf:Person></rdf:RDF> 04/09/12 Ontologies and Semantic 23
  24. 24. RDF/XML... but tripletsWhere are the triplets? <foaf:Group rdf:about="http://groups/ILRT"> <foaf:name>ILRT staff</foaf:name> <foaf:member> <foaf:Person> <foaf:name>Martin Poulter</foaf:name> <foaf:workplaceHomepage rdf:resource="http://www.ilrt.bris.ac.uk/"/> </foaf:Person> </foaf:member> </foaf:Group> 04/09/12 Ontologies and Semantic 24
  25. 25. RDF/XML... but tripletsHere they are.. 04/09/12 Ontologies and Semantic 25
  26. 26. RDF/XML... and graphs04/09/12 Ontologies and Semantic 26
  27. 27. RDF Extensibility!!!!!! How do you extend the properties in your data model? If you have a DDBB? Change tables, queries, inserts, update and modify. A nightmare. OOP. New properties in your class, incompatibility. RDF: add new triplets to the resources using new properties. Nothing changes. See example of Tutorial Ivan Herman (pag 55)04/09/12 Ontologies and Semantic 27
  28. 28. RDF/XMLParsing toolhttp://www.w3.org/RDF/Validator/ 04/09/12 Ontologies and Semantic 28
  29. 29. OWLOntology Web LanguageMarkup language in order to publish and shareinformation using ontologies.Extension of RDF/XMLClasses and relationsTerminology Instance: object Class: collection of objects. Description concept. All classes maybe a subclass of another (base: Thing)04/09/12 Ontologies and Semantic 29 Properties: A property is a directed binary relation
  30. 30. OWLTerminology Classes Descriptions: property restrictions, intersections, unions, constraints... Axioms: subClassOf, equivalentClass have a range which is the class Person04/09/12 Ontologies and Semantic 30
  31. 31. <owl:Class rdf:ID="WhiteBurgundy"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Burgundy" /> <owl:Class rdf:about="#WhiteWine" /> </owl:intersectionOf> </owl:Class>04/09/12 Ontologies and Semantic 31
  32. 32. <owl:Class rdf:ID="WhiteWine"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Wine" /> <owl:Restriction> <owl:onProperty rdf:resource="#hasColor" /> <owl:hasValue rdf:resource="#White" /> </owl:Restriction> </owl:intersectionOf></owl:Class>04/09/12 Ontologies and Semantic 32
  33. 33. <owl:Class rdf:ID="Fruit"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#SweetFruit" /> <owl:Class rdf:about="#NonSweetFruit" /> </owl:unionOf></owl:Class>04/09/12 Ontologies and Semantic 33
  34. 34. <owl:Class rdf:ID="SweetFruit"> <rdfs:subClassOf rdf:resource="#EdibleThing" /> </owl:Class> <owl:Class rdf:ID="NonSweetFruit"> <rdfs:subClassOf rdf:resource="#EdibleThing" /> <owl:disjointWith rdf:resource="#SweetFruit" /> </owl:Class>04/09/12 Ontologies and Semantic 34
  35. 35. OWL <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Tosca" /> <owl:Thing rdf:about="#Salome" /> </owl:oneOf> </owl:Class> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Turandot" /> <owl:Thing rdf:about="#Tosca" /> </owl:oneOf> </owl:Class> </owl:intersectionOf> </owl:Class>04/09/12 Ontologies and Semantic 35
  36. 36. OWLTerminology Properties: A property is a directed binary relation that specifies class characteristics Datatype properties: modelName (String datatype) is the property of Manufacturer class Object properties: ownedBy may be an object type property of the Vehicle class and may have a range which is the class Person04/09/12 Ontologies and Semantic 36
  37. 37. OWL <owl:Classrdf:about="http://....../qualipso_maillinglist#Mail"> <rdf:typerdf:resource="http://..../2002/07/owl#Class"/> <rdfs:label >Mail</rdfs:label> <rdfs:comment >An electronicmail.</rdfs:comment> <rdfs:subClassOfrdf:resource="http://..../ns#Post" /> </owl:Class> 04/09/12 Ontologies and Semantic 37
  38. 38. OWLOnline ontologies browserhttp://owl.cs.manchester.ac.uk/browser/ontologies/ExamplesPizza: http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.ow 04/09/12 Ontologies and Semantic 38
  39. 39. QualiPSo“Issues” in OpenSource projects Huge amount of data in different information sources Heterogeneous information Information neither classified nor structured No relations between data in different information sources Outdated forges04/09/12 Ontologies and Semantic 39
  40. 40. QualiPSo – Information managementRelations between different information sources.Extractors searching for relations and then they putmarks of meta-info using ontologies.Relations searching for patterns: #bug 396Some relations:Bugs -> commits -> lines of codeBugs -> emailsDocs -> emails04/09/12 Ontologies and Semantic 40
  41. 41. Semantic Queries (SPARQL)SPARQL:SPARQL Protocol and RDF Query LanguageQueries language http://sparql.org/query.htmlPREFIX dc:<http://purl.org/dc/elements/1.1/>SELECT ?titleWHERE{<http://example.org/books> dc:title ?title}04/09/12 Ontologies and Semantic 41
  42. 42. ExamplesCommit related with bugs: PREFIX rdf: <http://.../-rdf-syntax-ns#> PREFIX relation:<"http://www.q.org/ont/qr#"> PREFIX qvc:<"http://www.q.org/ont/qvc#"> SELECT ?resource WHERE { ?resource relation:commitAboutIssue ?bugID . }04/09/12 Ontologies and Semantic 42
  43. 43. ExamplesCommit related with the bug #252: PREFIX rdf: <http://.../-rdf-syntax-ns#> PREFIX relation:<"http://www.q.org/ont/qr#"> PREFIX qvc:<"http://www.q.org/ont/qvc#"> SELECT ?resource ?message WHERE { ?resource relation:commitAboutIssue “252” . ?resource qvc:message ?message . }04/09/12 Ontologies and Semantic 43
  44. 44. "Introduction to the Semantic Web" - Ivan Herman - http://www.w3.org/2009/Talks/0829-Nanjing-IH/04/09/12 Ontologies and Semantic 44
  45. 45. Play with SPARQL http://dbpedia.org/snorql/ Extract all the films PREFIX ont: <http://dbpedia.org/ontology/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?e WHERE { ?e rdf:type ont:Film . }04/09/12 Ontologies and Semantic 45
  46. 46. Play with SPARQL http://dbpedia.org/snorql/ Extract all the films starred by cruise from the year 1990 PREFIX ont: <http://dbpedia.org/ontology/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?e WHERE { ?e rdf:type ont:Film . ?e ont:starring <http://dbpedia.org/resource/Tom_Cruise> . ?e ont:releaseDate ?date. ?e ont:producer ?producer ?producer FILTER (?date >= "1990"^^xsd:date) }04/09/12 Ontologies and Semantic 46
  47. 47. Play with SPARQL http://dbpedia.org/snorql/ Extract all the films (and producers name) starred by cruise from the year 1990 PREFIX ont: <http://dbpedia.org/ontology/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?e ?producer ?productor_name WHERE { ?e rdf:type ont:Film . ?e ont:starring <http://dbpedia.org/resource/Tom_Cruise> . ?e ont:releaseDate ?date. ?e ont:producer ?producer . ?producer dbpedia2:name ?productor_name FILTER (?date >= "1990-01-01"^^xsd:date) }04/09/12 Ontologies and Semantic 47
  48. 48. Play with SPARQL http://dbpedia.org/snorql/ Abstracts of movies starring Tom Cruise, released before 1999 SELECT ?subject ?label ?released ?abstract WHERE { ?subject rdf:type <http://dbpedia.org/ontology/Film>. ?subject dbpedia2:starring <http://dbpedia.org/resource/Tom_Cruise>. ?subject rdfs:comment ?abstract. ?subject rdfs:label ?label. FILTER(lang(?abstract) = "en" && lang(?label) = "en"). ?subject <http://dbpedia.org/ontology/releaseDate> ?released. FILTER(xsd:date(?released) < "2000-01-01"^^xsd:date). } ORDER BY ?released LIMIT 2004/09/12 Ontologies and Semantic 48
  49. 49. Jose Gato Luis <jose.gato@atosresearch.eu> http://www.linkedin.com/in/josegatoluis04/09/12 Ontologies and Semantic 49
  1. A particular slide catching your eye?

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

×