450 likes | 460 Views
Artificial Intelligence. Universitatea Politehnica Bucuresti 2007-2008 Adina Magda Florea http://turing.cs.pub.ro/ai_07. Semantic Networks Units Specific inferences Problems with inheritance Semantic Web. Lecture No. 8. Structured knowledge representation. Semantic networks.
E N D
Artificial Intelligence Universitatea Politehnica Bucuresti2007-2008 Adina Magda Florea http://turing.cs.pub.ro/ai_07
Semantic Networks Units Specific inferences Problems with inheritance Semantic Web Lecture No. 8 Structured knowledge representation
Semantic networks • first model for structured knowledge representation • describe semantics of natural language • used extensively as a model for representing knowledge in KBS
Knowledge base • Radu sent a letter to Maria. • Radu is a student. • Ioana is a schoolgirl. • Radu's address is Luterana, 15. • occupation (radu, student) • occupation (ioana, schoolgirl) • send (radu, ioana, letter) • address (radu, luterana - 15)
Group knowledge into entities Associate properties or attributes • Radu • occupation (radu, student) • send (radu, ioana, letter) • address (radu, luterana - 15) • Ioana • occupation (ioana, schoolgirl) • send (radu, ioana, letter) Model 2 args predicates Radu occupation: student address: luterana-15Ioana occupation: schoolgirl What about 3 args predicates?
- use ISA predicate - use Skolemization to eliminate existential quantifier
Radu ISA: Person Occupation: student Address: luterana-15Ioana ISA: Person Occupation : schoolgirlT1 ISA: Sending-event Sender: Radu Receiver: Ioana Object: letter slots
ISA introduces a class-instance relationship AKO predicate introduces a subclass-class relationship
Sending-event AKO: Event Sender: Person Receiver: Person Object: ObjectClassPerson AKO: living Thing Occupation: (student, engineer, …) Address: string
Units • Units • MemberOf - ISA • SubClass, SuperClass - AKO
Facets • Facets • Features associated to slots • Possible facets • Value facet • Value type facet • Default facet • If-needed procedure or function • Demon facet • Comment facet
Specific inferences in semantic networks: properties/attributes inheritance1) Inheritance of attributes along the ISA relation 2) Inheritance of attributes along the AKO relationAttribute's value inheritance
Algorithm: Inheritance of attribute's value in a class hierarchy The algorithm gets the value V of an attribute A of the object OFindVal (O, A, V)1. Create a list L with node O and all the nodes linked to O by an ISA relationship2. whileL != [ ]do 2.1. Remove first node N from L 2.2. if attribute A of node N has value, be it V then 2.2.1. Place V as the value of attribute A of object O 2.2.3. return SUCCESS 2.3. Add all nodes linked by AKO to N at the end of L3. return FAILend.
Algorithm: Inheritance of attribute's default value in a class hierarchyThe algorithm gets the default value V of an attribute A of the object OFindDefault (O, A, V)1. Create a list L with node O and all the nodes linked to O by an ISA relationship2. whileL != [ ]do 2.1. Remove first node N from L 2.2. if attribute A of node N has a default value, be it V then 2.2.1. Place V as the value of attribute A of object O 2.2.3. return SUCCESS 2.3. Add all nodes linked by AKO to N at the end of L3. return FAILend. FindIfNeeded(O,A,V)
Control strategy • the control strategy of inheritance indicates the order of considering the different facets • 2 basic strategies • N strategy • Z strategy
Strategy N Algorithm: The algorithm gets the value V of an attribute A of the object O using the N strategyFindValN (O, A, V)1. if FindVal (O,A,V) = SUCCESS then return SUCCESS2. if FindDefault (O,A,V) = SUCCESS then return SUCCESS3. if FindIfNeeded (O,A,V) = SUCCESS then return SUCCESS4. return FAILend
Strategy Z Algoritm: Strategia Z de determinare a valorii unui atribut. Algoritmul determina valoarea unui atribut A al unei instante O utilizind strategia Z.DetValZ (O, A, V)1. Formeaza o lista L cu nodul O si toate nodurile legate de O prin relatia ISA2. cat timp L != [ ]executa 2.1. Elimina primul nod, N, din lista L 2.2. daca fateta valoare a atributului A a nodului N este Vthen 2.2.1. Depune V in nodul punctat de atributul A al obiectului O 2.2.2. intoarce SUCCES
2.3. daca fateta valoare implicita a atributului A a nodului N este V atunci 2.3.1. Depune V in nodul punctat de atributul A al obiectului O 2.3.2. intoarce SUCCES 2.4. daca fateta procedura necesara a atributului A a nodului N este proc (A1,..., An,V) atunci 2.4.1. Determina valorile atributelor A1,..., An ale instantei O 2.4.2. daca s-au gasit valori pentru A1,..., An atuncii. executa proc (A1,..., An,V) ii. Depune V in nodul punctat de atributul A al obiectului Oiii. intoarce SUCCES3. intoarce INSUCCESsfarsit.
Problems with inheritance • DAG networks • Multiple inheritance
Multiple inheritance Distance between units • If we look for the value of an attribute A of a unit U1 and find 2 paths : U1U2 and U1U3 to U2 and U3 containing values for A • then compute the length of the alternate paths from the instance/unit U1 to units U2 and U3 and choose the value from the closest unit (shortest path) • May cause semantic problems
Shortest distance Shortest inferential distance Distance and inferential distance
Multiple inheritance Inferential distance • Unit1 is closer to Unit2 than to Unit3 if and only if Unit1 has an inferential path to Unit3 which contains Unit2. • Unit1 is closer to Unit2 than to Unit3 if and only if Unit2 is on an inferential path of ISA and AKO relationships between Unit1 and Unit3
Algorithm: Inheritance of attribute's value in a class hierarchybased on inferential distanceFind the value V of slot S of unit U1. Make a list L with unit U and all units to which unit U is linked by an ISA/MemberOf2. Initialize a list CAND = [ ] 3. while L != [ ] do 3.1. remove first unit X from L 3.2. if slot S of X has valuethen CAND = CAND {X} 3.3. else add to L all units to which X is linked by a AKO/SuperClass4. for each unit C CANDdo 4.1. Verify if there is another C’ CAND having an inferential distance to U shorter than to C 4.2. if such a C' existsthen remove C from CAND
5. if card (CAND) = 0thenreturn FAIL /* no value for S */6. if card (CAND) = 1then 6.1. Be C the one element of CAND 6.2. Make the value V of slot S of C the value of slot S of U 6.3. return SUCCESS7. if card (CAND) > 1 thenreturn CONTRADICTIONend.
Combined representationsKnowledge base contains: - declarative knowledge: units - procedural knowledge: rulesdaca Camion.Inaltime > 2si Camion.Culoare = rosuatunci Camion.Pret = 1000 Inferences: both specific to units and specific to rules
“... a goal of the Web was that, if the interaction between person and hypertext could be so intuitive that the machine-readable information space gave an accurate representation of the state of people's thoughts, interactions, and work patterns, then machine analysis could become a very powerful management tool, seeing patterns in our work and facilitating our working together through the typical problems which beset the management of large organizations.” Semantic Web • Web was “invented” by Tim Berners-Lee (amongst others), a physicist working at CERN • TBL’s original vision of the Web was much more ambitious than the reality of the existing (syntactic) Web: • TBL (and others) have since been working towards realising this vision, which has become known as the Semantic Web • E.g., article in May 2001 issue of Scientific American…
Where we are Today: the Syntactic Web [Hendler & Miller 02]
The Syntactic Web is… • A hypermedia, a digital library • A library of documents called (web pages) interconnected by a hypermedia of links • A database, an application platform • A common portal to applications accessible through web pages, and presenting their results as web pages • A platform for multimedia • BBC Radio 4 anywhere in the world! Terminator 3 trailers! • A naming scheme • Unique identity for those documents • A place where computers do the presentation (easy) and people do the linking and interpreting (hard). • Why not get computers to do more of the hard work? [Goble 03]
Impossible (?) using the Syntactic Web… • Complex queries involving background knowledge • Find information about “animals that use sonar but are not either bats or dolphins” • Locating information in data repositories • Travel enquiries • Prices of goods and services • Results of human genome experiments • Delegating complex tasks to web “agents” • Book me a holiday next weekend somewhere warm, not too far away, and where they speak French or English
What is the Problem? • Consider a typical web page: • Markup consists of: • rendering information (e.g., font size and colour) • Hyper-links to related content • Semantic content is accessible to humans but not (easily) to computers…
What information can we see… WWW2002 The eleventh international world wide web conference Sheraton waikiki hotel Honolulu, hawaii, USA 7-11 may 2002 1 location 5 days learn interact Registered participants coming from australia, canada, chile denmark, france, germany, ghana, hong kong, india, ireland, italy, japan, malta, new zealand, the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire Register now On the 7th May Honolulu will provide the backdrop of the eleventh international world wide web conference. This prestigious event … Speakers confirmed Tim berners-lee Tim is the well known inventor of the Web, … Ian Foster Ian is the pioneer of the Grid, the next generation internet …
What information can a machine see… WWW2002 The eleventh international world wide web conference Sheraton waikiki hotel Honolulu, hawaii, USA 7-11 may 2002 1 location 5 days learn interact Registered participants coming from australia, canada, chile denmark, france, germany, ghana, hong kong, india, ireland, italy, japan, malta, new zealand, the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire Register now On the 7th May Honolulu will provide the backdrop of the eleventh international world wide web conference. This prestigious event … Speakers confirmed Tim berners-lee Tim is the well known inventor of the Web, … Ian Foster Ian is the pioneer of the Grid, the next generation internet …
Solution: XML markup with “meaningful” tags? <name>WWW2002 The eleventh international world wide webcon</name> <location>Sheraton waikiki hotel Honolulu, hawaii, USA</location> <date>7-11 may 2002</date> <slogan>1 location 5 days learn interact</slogan> <participants>Registered participants coming from australia, canada, chile denmark, france, germany, ghana, hong kong, india, ireland, italy, japan, malta, new zealand, the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire</participants> <introduction>Register now On the 7th May Honolulu will provide the backdrop of the eleventh international world wide web conference. This prestigious event … Speakers confirmed</introduction> <speaker>Tim berners-lee</speaker> <bio>Tim is the well known inventor of the Web,</bio>…
But What About… <conf>WWW2002 The eleventh international world wide webcon</conf> <place>Sheraton waikiki hotel Honolulu, hawaii, USA</place> <date>7-11 may 2002</date> <slogan>1 location 5 days learn interact</slogan> <participants>Registered participants coming from australia, canada, chile denmark, france, germany, ghana, hong kong, india, ireland, italy, japan, malta, new zealand, the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire</participants> <introduction>Register now On the 7th May Honolulu will provide the backdrop of the eleventh international world wide web conference. This prestigious event … Speakers confirmed</introduction> <speaker>Tim berners-lee</speaker> <bio>Tim is the well known inventor of the Web,…
Must add semantics • External agreement on meaning of annotations • E.g., Dublin Core • Agree on the meaning of a set of annotation tags • Problems with this approach • Inflexible • Limited number of things can be expressed • Use Ontologies to specify meaning of annotations • Ontologies provide a vocabulary of terms • New terms can be formed by combining existing ones • Meaning (semantics) of such terms is formally specified • Can also specify relationships between terms in multiple ontologies
Ontology in philosophy a philosophical discipline—a branch of philosophy that deals with the nature and the organisation of reality • Science of Being (Aristotle, Metaphysics, IV, 1) • Tries to answer the questions: What characterizes being? Eventually, what is being?
Ontology in Computer Science • An ontology is an engineering artifact: • It is constituted by a specific vocabulary used to describe a certain reality, plus • a set of explicit assumptions regarding the intended meaning of the vocabulary. • Thus, an ontology describes a formal specification of a certain domain: • Shared understanding of a domain of interest • Formal and machine manipulable model of a domain of interest “An explicit specification of a conceptualisation” [Gruber93]
Structure of an ontology Ontologies typically have two distinct components: • Names for important concepts in the domain • Elephant is a concept whose members are a kind of animal • Herbivore is a concept whose members are exactly those animals who eat only plants or parts of plants • Adult_Elephant is a concept whose members are exactly those elephants whose age is greater than 20 years • Background knowledge/constraints on the domain • Adult_Elephants weigh at least 2,000 kg • All Elephants are either African_Elephants or Indian_Elephants • No individual can be both a Herbivore and a Carnivore
Tools • Description Logics • OWL = Web Ontological Language • Protégé – framework for building ontologies