} p ] kt>zimmermann/teaching/krr/dl+owl2.pdf · 2020. 4. 28. · } p ] kt> ] ( ] ] o / v o o ] p v...

19
KRR: Description Logics & OWL Artificial Intelligence Challenge Défi IA – ICM 2A 3rd May 2019 [email protected] 1

Upload: others

Post on 30-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • KRR: Description Logics & OWLArtificial Intelligence Challenge

    Défi IA – ICM 2A3rd May 2019

    [email protected]

    1

  • Reminders

    • Two parts in this course:1. Theoretical: formalise knowledge in a logic Resources online at https://www.emse.fr/~zimmermann/Teaching/KRR/* Tests in the form of MCQs (1st test in 2 weeks)

    2. Practical: knowledge engineering on the topic of pandemics Define a knowledge modelWrite the computarised model in a format for knowledge representation Provide a documentation of the model Deliver your work as two files: a human readable documentation + an ontology fileWe will use an international standard: The Web Ontology Language (a.k.a. OWL)

    2

  • The Web Ontology Language

    • A Web standard of the World Wide Web Consortium (W3C) since 2004 (latest version 11 Dec. 2012): https://www.w3.org/TR/owl2-overview/

    • Built on top of other Web standards:• Uniform Resource Identifiers (URIs) – a uniform mechanism for identifying anything at Web scale• XML Schema datatypes – ensures explicit typing of data values• The Resource Description Framework (RDF) – a standard graph data model

    • Logic formalism based on Description Logics• APIs exist in many programming languages• Several free and commercial OWL ontology editors• Several free and commercial OWL reasoners• Thousands of ontology files available online• OWL ontologies used as the knowledge model of tens of thousands of open data sets

    (including some Covid-19 data sets)

    3

  • Typical question for online test

    • Choose the correct definition of a general notion of logic (among choices)• Propositional / FOL: is a given formula F a tautology, a contradiction, or

    simply satisfiable?• FOL: is a given formula F closed, in PNF, in CNF?• Which formula (among multiple choices) is entailed by a given theory T?• I give you the definition of a simple logic:

    • What formula (among choices) is equivalent to a given formula?• Provide an example of a tautology• Possibly, for a well defined case, write a formula modelling a given situation• Examples of simple logics are found in last year exam and last year resit exam (see

    web site of the course)

    4

  • A simple description logic: EL

    • EL is a simple description logic where classes can be:• Atomic classes (e.g., Employee)• Intersection of classes (e.g., Employees that are Engineers)• The class of things that have a relationship with some type of things (e.g.,

    those who are employedBy a company)• The class of all things

    • EL can instantiate classes (e.g., AZ is a Teacher)• EL can instantiate relations (e.g., AZ worksFor EMSE)

    5

  • Formalising EL: syntax

    • Symbols

    • {(, ), ⊓, ⊑, ⊤, ∃, .}

    • A set of class names (Employee, etc.) called concept names

    • A set of relation names (hasEmployer, etc.) called role names

    • A set of instance names (AZ, EMSE, etc.) called individual names

    6

    In OWL, these are URIs

  • Formalising EL: syntax

    • Symbols

    • {(, ), ⊓, ⊑, ⊤, ∃, .}

    • A set of class names (Employee, etc.) called concept names

    • A set of relation names (hasEmployer, etc.) called role names

    • A set of instance names (AZ, EMSE, etc.) called individual names

    7

    In OWL, these are URIs

    In OWL, Classes

    In OWL, Object Properties

    In OWL, Individuals

  • Formalising EL: syntax

    • Concepts are either:• concept names, or• ⊤, or• C ⊓ D, or • ∃R.C,where C and D are concepts and R is a role name

    • Formulas are:• Class inclusion: C ⊑ D where C and D are concepts• Class assertions: C(a) where C is a concept and a is an individual name• Role assertions: R(a,b) where R is a role name and a, b are individual names

    8

  • Formalising EL: syntax

    • Concepts are either:• concept names, or• ⊤, or• C ⊓ D, or • ∃R.C,where C and D are concepts and R is a role name

    • Formulas are:• Class inclusion: C ⊑ D where C and D are concepts• Class assertions: C(a) where C is a concept and a is an individual name• Role assertions: R(a,b) where R is a role name and a, b are individual names

    9

    In OWL: owl:Thing

    In Protégé: C and D

    In Protégé: R some C

    In Protégé: select C and add D to SubClass Of area

    In Protégé: add individual to C

    In Protégé: add property assestion to a

  • Formalising EL: semantics

    • Interpretations are tuple ℑ = (D, ·ℑ) such that:• D is a non empty set (the domain of interpretation)• ·ℑ is a function from concept names, role names, individual names such that:

    • Aℑ ⊆ D for all concept name A• Rℑ ⊆ D×D for all role name R• aℑ ∈ D for all individual name a

    • Extending intepretations to general concepts:• ⊤ℑ = D• (C ⊓ D)ℑ = Cℑ ∩ Dℑ• (∃R.C)ℑ = {x ∈ D | ∃y ∈ Cℑ, (x,y) ∈ Rℑ}

    10

  • Formalising EL: semantics

    The satisfaction relation ⊨ is defined as follows:• ℑ ⊨ C ⊑ D if and only if Cℑ ⊆ Dℑ• ℑ ⊨ C(a) if and only if aℑ ∈ Cℑ• ℑ ⊨ R(a,b) if and only if (aℑ,bℑ) ∈ Rℑ

    11

  • Another DL: FL0• Concepts are either:

    • concept names, or• ⊤, or• C ⊓ D, or • ∀R.C,where C and D are concepts and R is a role name

    • Semantics: Given an interpretation ℑ = (D, ·ℑ), we define• (∀R.C)ℑ = {x ∈ D | ∀y ∈ D, (x,y) ∈ Rℑ ⇒ y ∈ Cℑ}

    12

  • Another DL: FL0• Concepts are either:

    • concept names, or• ⊤, or• C ⊓ D, or • ∀R.C,where C and D are concepts and R is a role name

    • Semantics: Given an interpretation ℑ = (D, ·ℑ), we define• (∀R.C)ℑ = {x ∈ D | ∀y ∈ D, (x,y) ∈ Rℑ ⇒ y ∈ Cℑ}

    13

    In Protégé: R only C

  • Extensions of FL0 and the AL family

    • Add concepts:• ⊥ (leads to DL FL⊥)• ∃R.⊤ (with ⊥, leads to DL FL–)• ¬A where A is an atomic concept (with ⊥ and ∃, leads to AL)

    (¬A)ℑ = {x ∈ D | x ∉ Aℑ})• Then, add to AL:

    • (E) ∃R.C• (I) R– (role inverse R – ℑ = {(x,y) ∈ D × D | (y,x) ∈ Rℑ})• (U) C ⊔ D ((C ⊔ D)ℑ = Cℑ ∪ Dℑ)• (C) ¬C, where C is an arbitrary concept• (O) {a}

    We can name a description logic by combining letters, e.g.: ALCIO14

    In OWL: owl:Nothing

    In Protégé: not A

    In Protégé: C or D

    In Protégé: {a}

  • More extensions

    • You can check the page online: https://www.emse.fr/~zimmermann/Teaching/KRR/al.html

    • But this is not the topic of today’s course• We are going to do ontology engineering

    15

  • Example DL ontology

    • Cow ⊑ Herbivore• Herbivore ⊑ ∀eats.Plant• Carnivore ⊑ ∀eats.Meat• Plant ⊑ ¬Meat• MadCow ⊑ ∃eats.MeatCan Daisy be a mad cow? (i.e., is the assertion MadCow(daisy) consistent with the above ontology?)

    16

  • Example DL ontology (revised)

    • Cow ⊑ Herbivore• Herbivore ⊑ ∀eats.Plant• Carnivore ⊑ ∀eats.Meat• Plant ⊑ ¬Meat• MadCow ⊑ ∃eats.Meat ⊓ CowCan Daisy be a mad cow? (i.e., is the assertion MadCow(daisy) consistent with the above ontology?)

    17

  • Exercise: simple model of official reports on Covid-19 cases• A report has a date, an institution, organisation, or ministry issuing

    the report, a geographic area of coverage, a number of new cases, a number of new deceased people, a number of recoveries, a number of tests made, a number of hospitalised people, a number of people in intensive care units;

    • Possibly, reports could be weekly, monthly, or twice a day: we must know the timespan of validity;

    • Geographic areas may be included in other geographic areas; they have a population; they have a number of hospital beds and intensive care units available;

    18

  • More precision, more difficult

    • Model individual cases:• Who gets the disease?• When they get infected?• When the symptoms start?• When are they cured?• What virus / disease they have?• How old?• What comorbidities they have at the time of getting the disease?• Where did they travel prior to getting the disease?• Who were they in contact with when being infectious?

    • Politicial decisions? Closing schools? Shops? Complete shutdown?

    19