SlideShare a Scribd company logo
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-ShareAlike 3.0” license, by Creative
                                                  Commons, available at
04/09/12                  Ontologies and Semantic                     2
                http://creativecommons.org/licenses/by-sa/3.0/
Summary

 Introduction
 Ontologies
 OWL and RDF.
 QualiPSo: Information management
 Semantic Queries




 04/09/12           Ontologies and Semantic   3
Introduction

Definition:
     “ 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
Introduction


Computers 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.” - Wikipedia
How to make an standard, in order to define the parts of
a concept.



04/09/12              Ontologies and Semantic              5
Ontologies

Vocabularies to define entities and concepts.
For example, the ontology of an email or a a tree.
Knowledge representation.
Knowledge understandable by machines and
computer programs.
Similar to object orientation paradigm.



04/09/12              Ontologies and Semantic        6
Ontologies


 This is not understandable by a machine:


           Car               Colour                 Price

           Ford Fiesta       Blue                   30

           Ferrari F40       Red                    10




04/09/12                  Ontologies and Semantic           7
Ontologies

Information clasified and structured:
I want to rent a Ford Fiesta car by 60€
Class car -> Model -> Ford Fiesta
Class car -> Colour -> Blue
Class Money -> Type -> Coin
Class Money -> Value -> 60
Class Money -> Coin -> euro




04/09/12                 Ontologies and Semantic   8
Ontologies


Something 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
Ontologies


And 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
Ontologies


An ontology should allow to define all the
information of a concept:
Is this possible?
Standards -> Competency vs Community
Different persons will define concepts in very different
ways.
Are we able to define the world around us?
Specific concepts
    Tree: { Root, Trunk, type... }
Difficult to define abstract concepts
04/09/12              Ontologies and Semantic              11
Ontologies

 Ontologies are useful when...
You can define enough information about a concept.
Used by many people/projects/communities
Widely spread <-> Standard <-> Community




04/09/12             Ontologies and Semantic         12
Ontologies: FOAF
Friend of a Friend: http://www.foaf-project.org/
People
Activities
People relations: People living in Europe, common
friends
     <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
Ontologies: SIOC
Semantically-Interlinked Online Communities
    http://sioc-project.org/ontology




 04/09/12                Ontologies and Semantic   14
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
Ontologies: Mixing
To define a concept (resource), usually, you dont
have 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
RDF

Resource Description Framework
Classes
   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
    model
Resource Description Framework
Subject, predicate y object
       Subject -> Resource (Jose)
04/09/12                Ontologies and Semantic        17
04/09/12   Ontologies and Semantic   18
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
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
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
RDF/XML
Foaf: 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
RDF/XML
You 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
RDF/XML... but triplets
Where 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
RDF/XML... but triplets
Here they are..




 04/09/12          Ontologies and Semantic   25
RDF/XML... and graphs




04/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, 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
RDF/XML
Parsing tool
http://www.w3.org/RDF/Validator/




 04/09/12            Ontologies and Semantic   28
OWL

Ontology Web Language
Markup language in order to publish and share
information using ontologies.
Extension of RDF/XML
Classes and relations
Terminology
       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
OWL

Terminology
   Classes
      Descriptions: property restrictions, intersections, unions,
        constraints...
      Axioms: subClassOf, equivalentClass
      have a range which is the class Person




04/09/12                    Ontologies and Semantic                 30
<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
<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
<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
<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
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
OWL


Terminology
       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 Person


04/09/12                   Ontologies and Semantic                   36
OWL


 <owl:Class
rdf:about="http://....../qualipso_maillinglist#Mail">
        <rdf:type
rdf:resource="http://..../2002/07/owl#Class"/>
        <rdfs:label >Mail</rdfs:label>
        <rdfs:comment >An electronic
mail.</rdfs:comment>
        <rdfs:subClassOf
rdf:resource="http://..../ns#Post" />
   </owl:Class>




  04/09/12              Ontologies and Semantic         37
OWL
Online ontologies browser
http://owl.cs.manchester.ac.uk/browser/ontologies/
Examples
Pizza:
  http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.ow




 04/09/12             Ontologies and Semantic         38
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 forges



04/09/12                Ontologies and Semantic           39
QualiPSo – Information
                      management
Relations between different information sources.
Extractors searching for relations and then they put
marks of meta-info using ontologies.
Relations searching for patterns: #bug 396
Some relations:
Bugs -> commits -> lines of code
Bugs -> emails
Docs -> emails



04/09/12                 Ontologies and Semantic       40
Semantic Queries (SPARQL)

SPARQL:
SPARQL Protocol and RDF Query Language
Queries language
   http://sparql.org/query.html
PREFIX dc:
<http://purl.org/dc/elements/1.1/>
SELECT ?title
WHERE
{
<http://example.org/books> dc:title ?title
}
04/09/12                Ontologies and Semantic   41
Examples

Commit 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
Examples

Commit 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
"Introduction to the Semantic Web" - Ivan Herman -
       http://www.w3.org/2009/Talks/0829-Nanjing-IH/
04/09/12                       Ontologies and Semantic   44
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
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
Play with SPARQL

 http://dbpedia.org/snorql/
  Extract all the films (and producer's 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
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 20
04/09/12                    Ontologies and Semantic                48
Jose Gato Luis
      <jose.gato@atosresearch.eu>

           http://www.linkedin.com/in/josegatoluis


04/09/12                  Ontologies and Semantic    49

More Related Content

PPT
Ist16-04 An introduction to RDF
PPT
Ontologies in RDF-S/OWL
PPT
PPTX
Resource description framework
KEY
The Semantic Web meets the Code of Federal Regulations
PPT
Web ontology language (owl)
PPTX
Owl web ontology language
PPT
Querying the Semantic Web with SPARQL
Ist16-04 An introduction to RDF
Ontologies in RDF-S/OWL
Resource description framework
The Semantic Web meets the Code of Federal Regulations
Web ontology language (owl)
Owl web ontology language
Querying the Semantic Web with SPARQL

What's hot (20)

PPTX
The Semantic Web #9 - Web Ontology Language (OWL)
PPT
Understanding RDF: the Resource Description Framework in Context (1999)
PPT
Introduction to RDF
PPT
Ks2008 Semanticweb In Action
PPT
Intro to OWL & Ontology
PDF
XSPARQL Tutorial
PDF
Jarrar: OWL (Web Ontology Language)
PPT
PPT
RDF and OWL
PDF
The Web Ontology Language
PPTX
Semantic web Technology
PDF
An introduction to Semantic Web and Linked Data
PDF
OWL Web Ontology Language Overview
PPT
Introduction To RDF and RDFS
PPTX
Jarrar: OWL -Web Ontology Language
PPT
PDF
SPARTIQULATION - Verbalizing SPARQL queries
PPT
Rdf Overview Presentation
PPTX
Name That Graph !
PDF
Ontologies and semantic web
The Semantic Web #9 - Web Ontology Language (OWL)
Understanding RDF: the Resource Description Framework in Context (1999)
Introduction to RDF
Ks2008 Semanticweb In Action
Intro to OWL & Ontology
XSPARQL Tutorial
Jarrar: OWL (Web Ontology Language)
RDF and OWL
The Web Ontology Language
Semantic web Technology
An introduction to Semantic Web and Linked Data
OWL Web Ontology Language Overview
Introduction To RDF and RDFS
Jarrar: OWL -Web Ontology Language
SPARTIQULATION - Verbalizing SPARQL queries
Rdf Overview Presentation
Name That Graph !
Ontologies and semantic web
Ad

Similar to Ontologies and Semantic in OpenSource projects (20)

PPT
Lee Iverson - How does the web connect content?
PPTX
Semantic web
PDF
CS6010 Social Network Analysis Unit II
PPT
Corrib.org - OpenSource and Research
KEY
Semantic Web: A web that is not the Web
PPT
Publishing data on the Semantic Web
PPTX
SNSW CO3.pptx
PPT
DM110 - Week 10 - Semantic Web / Web 3.0
PPT
Semantic web
PPTX
The Social Semantic Web
PPTX
Breaking Down Walls in Enterprise with Social Semantics
PPT
The Semantic Web An Introduction
PPT
Tutorial on Semantic Digital Libraries (WWW'2007)
ODP
Building a semantic website
PPT
Intro semanticweb
PPT
Year of the Monkey: Lessons from the first year of SearchMonkey
PPT
Semantic Web Austin Yahoo
PDF
Semantic Web and web of commerce - Disruptive technology
PDF
Semantic Web and the Web Of Commerce - pdf version
PPTX
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
Lee Iverson - How does the web connect content?
Semantic web
CS6010 Social Network Analysis Unit II
Corrib.org - OpenSource and Research
Semantic Web: A web that is not the Web
Publishing data on the Semantic Web
SNSW CO3.pptx
DM110 - Week 10 - Semantic Web / Web 3.0
Semantic web
The Social Semantic Web
Breaking Down Walls in Enterprise with Social Semantics
The Semantic Web An Introduction
Tutorial on Semantic Digital Libraries (WWW'2007)
Building a semantic website
Intro semanticweb
Year of the Monkey: Lessons from the first year of SearchMonkey
Semantic Web Austin Yahoo
Semantic Web and web of commerce - Disruptive technology
Semantic Web and the Web Of Commerce - pdf version
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
Ad

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
master seminar digital applications in india
PPTX
Institutional Correction lecture only . . .
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Classroom Observation Tools for Teachers
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Complications of Minimal Access Surgery at WLH
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial disease of the cardiovascular and lymphatic systems
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Supply Chain Operations Speaking Notes -ICLT Program
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Anesthesia in Laparoscopic Surgery in India
master seminar digital applications in india
Institutional Correction lecture only . . .
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
A systematic review of self-coping strategies used by university students to ...
Module 4: Burden of Disease Tutorial Slides S2 2025
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Classroom Observation Tools for Teachers
Final Presentation General Medicine 03-08-2024.pptx
Complications of Minimal Access Surgery at WLH

Ontologies and Semantic in OpenSource projects

  • 1. Ontologies and Semantic Jose Gato Luis <jose.gato@atosresearch.eu> (4-09-2012)
  • 2. © 2009,2011 Jose Gato Luis Some rights reserved. This presentation is distributed under the “Attribution-ShareAlike 3.0” license, by Creative Commons, available at 04/09/12 Ontologies and Semantic 2 http://creativecommons.org/licenses/by-sa/3.0/
  • 3. Summary Introduction Ontologies OWL and RDF. QualiPSo: Information management Semantic Queries 04/09/12 Ontologies and Semantic 3
  • 4. Introduction Definition: “ 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. Introduction Computers 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.” - Wikipedia How to make an standard, in order to define the parts of a concept. 04/09/12 Ontologies and Semantic 5
  • 6. Ontologies Vocabularies to define entities and concepts. For example, the ontology of an email or a a tree. Knowledge representation. Knowledge understandable by machines and computer programs. Similar to object orientation paradigm. 04/09/12 Ontologies and Semantic 6
  • 7. Ontologies This is not understandable by a machine: Car Colour Price Ford Fiesta Blue 30 Ferrari F40 Red 10 04/09/12 Ontologies and Semantic 7
  • 8. Ontologies Information clasified and structured: I want to rent a Ford Fiesta car by 60€ Class car -> Model -> Ford Fiesta Class car -> Colour -> Blue Class Money -> Type -> Coin Class Money -> Value -> 60 Class Money -> Coin -> euro 04/09/12 Ontologies and Semantic 8
  • 9. Ontologies Something 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. Ontologies And 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. Ontologies An ontology should allow to define all the information of a concept: Is this possible? Standards -> Competency vs Community Different persons will define concepts in very different ways. Are we able to define the world around us? Specific concepts Tree: { Root, Trunk, type... } Difficult to define abstract concepts 04/09/12 Ontologies and Semantic 11
  • 12. Ontologies Ontologies are useful when... You can define enough information about a concept. Used by many people/projects/communities Widely spread <-> Standard <-> Community 04/09/12 Ontologies and Semantic 12
  • 13. Ontologies: FOAF Friend of a Friend: http://www.foaf-project.org/ People Activities People relations: People living in Europe, common friends <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. Ontologies: SIOC Semantically-Interlinked Online Communities http://sioc-project.org/ontology 04/09/12 Ontologies and Semantic 14
  • 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. Ontologies: Mixing To define a concept (resource), usually, you dont have 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. RDF Resource Description Framework Classes 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 model Resource Description Framework Subject, predicate y object Subject -> Resource (Jose) 04/09/12 Ontologies and Semantic 17
  • 18. 04/09/12 Ontologies and Semantic 18
  • 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. 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. 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. RDF/XML Foaf: 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. RDF/XML You 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. RDF/XML... but triplets Where 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. RDF/XML... but triplets Here they are.. 04/09/12 Ontologies and Semantic 25
  • 26. RDF/XML... and graphs 04/09/12 Ontologies and Semantic 26
  • 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
  • 29. OWL Ontology Web Language Markup language in order to publish and share information using ontologies. Extension of RDF/XML Classes and relations Terminology 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. OWL Terminology Classes Descriptions: property restrictions, intersections, unions, constraints... Axioms: subClassOf, equivalentClass have a range which is the class Person 04/09/12 Ontologies and Semantic 30
  • 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. <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. <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. <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. 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. OWL Terminology 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 Person 04/09/12 Ontologies and Semantic 36
  • 37. OWL <owl:Class rdf:about="http://....../qualipso_maillinglist#Mail"> <rdf:type rdf:resource="http://..../2002/07/owl#Class"/> <rdfs:label >Mail</rdfs:label> <rdfs:comment >An electronic mail.</rdfs:comment> <rdfs:subClassOf rdf:resource="http://..../ns#Post" /> </owl:Class> 04/09/12 Ontologies and Semantic 37
  • 38. OWL Online ontologies browser http://owl.cs.manchester.ac.uk/browser/ontologies/ Examples Pizza: http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.ow 04/09/12 Ontologies and Semantic 38
  • 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 forges 04/09/12 Ontologies and Semantic 39
  • 40. QualiPSo – Information management Relations between different information sources. Extractors searching for relations and then they put marks of meta-info using ontologies. Relations searching for patterns: #bug 396 Some relations: Bugs -> commits -> lines of code Bugs -> emails Docs -> emails 04/09/12 Ontologies and Semantic 40
  • 41. Semantic Queries (SPARQL) SPARQL: SPARQL Protocol and RDF Query Language Queries language http://sparql.org/query.html PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?title WHERE { <http://example.org/books> dc:title ?title } 04/09/12 Ontologies and Semantic 41
  • 42. Examples Commit 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. Examples Commit 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. "Introduction to the Semantic Web" - Ivan Herman - http://www.w3.org/2009/Talks/0829-Nanjing-IH/ 04/09/12 Ontologies and Semantic 44
  • 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. 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. Play with SPARQL http://dbpedia.org/snorql/ Extract all the films (and producer's 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. 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 20 04/09/12 Ontologies and Semantic 48
  • 49. Jose Gato Luis <jose.gato@atosresearch.eu> http://www.linkedin.com/in/josegatoluis 04/09/12 Ontologies and Semantic 49