510 likes | 640 Views
Knowledge Systems Laboratory Stanford University. Faculty Richard Fikes Edward Feigenbau (Director) (Emeritus). Senior Scientists Deborah McGuinness Sheila McIlraith (Associate Director).
E N D
Knowledge Systems LaboratoryStanford University Faculty Richard Fikes Edward Feigenbau (Director) (Emeritus) Senior Scientists Deborah McGuinness Sheila McIlraith (Associate Director) Technology for effectively representing and using knowledge in computer systems “In the knowledge is the power.”
KSL’s Roles on the AQUA Team • Providing knowledge tools for team • Ontolingua Knowledge Server (OKS) • Background ontologies and lexicons • JTP deductive answer determination system • Developing new methods for – • Answer determination from large, complex KBs • Providing understandable explanations for deduced answers • Detecting and resolving conflicts in KBs
Recent Developments • JTP – A hybrid reasoner for query answering • Expanded functionality of DAML+OIL reasoner • Developed reasoners for time-dependent knowledge • DQL – Agent language and protocol for deductive query answering • Providing understandable explanations for derived query answers
JTP – A Hybrid Reasoner for Query Answering • Developing an architecture for hybrid reasoning • First-order logic model elimination theorem prover • Suite of special purpose reasoners • Dispatchers and APIs for reasoners • Developing special purpose query-answering reasoners • Using Semantic Web knowledge expressed in DAML+OIL • Using time-dependent knowledge • Available from the Web as a JAVA program www.ksl.stanford.edu/software/JTP
JTP’s DAML+OIL Reasoner • Infers relationships among objects as KB is loaded • Enables rapid replies to queries • Compiles DAML+OIL semantics into forward chaining actions Example forward chaining actions: • If a restriction R is asserted to be the class of all objects whose values of property P are all type C, then activate the following forward chaining action: • If an object X is asserted to be type R, then activate the following forward chaining action: • If an object V is asserted to be a value of property P for object X, then assert that V is type C. • Efficiently stores DAML+OIL sentences (triples) E.g., linking of values of transitive properties such as subClassOf • Provides proofs as justifications for answers
Recent Developments • JTP – A hybrid reasoner for query answering • Expanded functionality of DAML+OIL reasoner • Developed reasoners for time-dependent knowledge • DQL – Agent language and protocol for deductive query answering • Providing understandable explanations for derived query answers
Negation Using Complements • DAML+OIL does not include explicit negation I.e., cannot say “(not …)” in DAML+OIL • Negation is related to complements via these axioms: • “If NC is the complement of C, then X is not type C exactly when X is type NC.” (=> (complementOf ?c ?nc) (<=> (not (type ?x ?c)) (type ?x ?nc))) • “If R is the class of all objects that have Y as a value of property P and NR is the complement of R, then Y is not a value of P for X exactly when X is type NR.” (=> (and (onProperty ?r ?p) (hasValue ?r ?y) (complementOf ?r ?nr)) (<=> (not (holds ?p ?x ?y)) (type ?x ?nr)))
Inferring Negations Using Complements • Consider the defining axiom for toClass restrictions “If R is the class of objects all of whose values of P are type C, X is type R, and V is a value of P for X, then V is type C.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (holds ?p ?x ?v)) (type ?v ?c)) • That axiom is equivalent to the following: “If R is the class of objects all of whose values of P are type C, X is type R, and V is not type C, then V is not a value of P for X.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (not (type ?v ?c))) (not (holds ?p ?x ?v)))
Inferring Negations Using Complements • The axiom: “If R is the class of objects all of whose values of P are type C, X is type R, and V is not type C, then V is not a value of P for X.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (not (type ?v ?c))) (not (holds ?p ?x ?v))) is equivalent to: “If R is the class of objects all of whose values of P are type C, X is type R, CC is the complement of C, V is type CC, R2 is the class of objects that have V as a value of P, and CR2 is the complement of R2, then X is type CR2.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (complementOf ?c ?cc) (type ?v ?cc) (onProperty ?r2 ?p) (hasValue ?r2 ?v) (complementOf ?r2 ?cr2)) (type ?x ?cr2))) which can be used as a forward chaining rule. (!)
Compiling Actions For Complements • JTP compiles implicative normal form sentences into forward chaining actions (=> (and L1 … Ln) Lx) is compiled into an action that fires when an Li is asserted • Rule compiler has been expanded as follows: • Produce redundant forms of each input (=> (and L1 … Li-1 Li+1 … Ln (not Lx)) (not Li)) • Replace negations by complements (=> (and L1 … Li-1 Li+1 … Ln … (complement …) (type …) … (complement …)) (type …)) • Produce forward chaining actions from the redundant forms • Essentially adds actions that fire when (not Lx) is asserted
Subclass Hierarchy Inferred By JTP For any C1 … Cn, JTP infers these subclass relationships: (Union C1 … Cn) = ~(Intersection ~C1 … ~Cn) (Union (Ci … )) Cj (Intersection (Ck … )) (Intersection C1 … Cn) = ~(Union ~C1 … ~Cn) Note: ~C denotes (complement C)
Recognizing Individuals In Complements • New compiler produce recognition actions (!) • Examples • “If R is the class of objects all of whose values of P are type C, X is type R, and V is a value of P for X, then V is type C.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (holds ?p ?x ?v)) (type ?v ?c)) From that axiom the compiler produces: “If R is the class of objects all of whose values of P are type C, X is type R, CC is the complement of C, V is type CC, R2 is the class of objects that have V as a value of P, and CR2 is the complement of R2, then X is type CR2.” (=> (and (onProperty ?r ?p) (toClass ?r ?c) (type ?x ?r) (complementOf ?c ?cc) (type ?v ?cc) (onProperty ?r2 ?p) (hasValue ?r2 ?v) (complementOf ?r2 ?cr2)) (type ?x ?cr2)))
Recognizing Individuals In Complements • Examples of recognition actions the new compiler produces • “If Csub is a subclass of Csuper and X is type Csub, then X is type Csuper.” (=> (and (subClassOf ?csub ?csuper) (type ?x ?csub)) (type ?x ?csuper)) From that axiom the compiler produces: “If Csub is a subclass of Csuper, C-Csub is the complement of Csub, C-Csuper is the complement of Csuper, and X is type C-Csuper, then X is type C-Csub.” (=> (and (subClassOf ?csub ?csuper) (complementOf ?ccsub ?csub) (complementOf ?ccsuper ?csuper) (type ?x ?ccsuper)) (type ?x ?ccsub)))
Recent Developments • JTP – A hybrid reasoner for query answering • Expanded functionality of DAML+OIL reasoner • Developed reasoners for time-dependent knowledge • DQL – Agent language and protocol for deductive query answering • Providing understandable explanations for derived query answers
Representations of Time • Fundamental to KBs about actions and events • Time ontologies are important building block modules • Current time ontologies have significant deficiencies Expressive power, formality, and/or coherence • Challenge is to support a broad range of applications • Allow interval ends point to be in, out, or non-committal “during the meeting on July 10” • Support wide range of granularity of time points “born in 1983” • Support non-contiguous time intervals “Noon to 1:00 every other Friday” • Primary reference • Pat Hayes; “A Catalog of Temporal Theories”
About Time • Consider time to be a physical dimension • Using an included “Units and Measures” ontology • Assume time is continuous and linear • Time line analogous to continuous number line • Do not support a space of temporally possible worlds
Class Hierarchy of Time Ontology Time-Quantity Time-Point Time-Interval Convex-Time-Interval Non-Convex-Time-Interval Time-Interval-Left-Open Time-Interval-Left-Closed Time-Interval-Right-Open Time-Interval-Right-Closed Calendar-Month Calendar-Day . . . Regular-Non-Convex-Time-Interval . . . . . . . . . Time-Interval-Left-Open-Right-Open Time-Interval-Left-Closed-Right-Closed Time-Interval-Left-Open-Right-Open Time-Interval-Left-Closed-Right-Closed Calendar-Saturday Calendar-December Calendar-Day-31 Calendar-Sunday Calendar-January Calendar-Day-1
Top Level Classes: Time-Quantity • Time-Quantity • An amount of time E.g., “a century” “25 minutes” “as long as it takes for the kettle to boil” • A duration • Time-Point • Time-Interval
Top Level Classes: Time-Point • Time-Quantity • Time-Point • Position on a temporal coordinate system E.g., “2:22 p.m., February 2, 2000” • Analogous to a real number • Also represented at varying granularities E.g., “March 14, 1994” • Time-Interval
Top Level Classes: Time-Interval • Time-Quantity • Time-Point • Time-Interval • Set of two or more time points E.g., “the 16th century” “10:50 to 11:00 a.m. on May 30, 1993” “noon to 1:00 p.m. every Tuesday in 2000” • Convex-Intervalanalogous to interval on number line • Has two distinguished points: Start-Point and End-Point • Can be Left-Open, Left-Closed, Right-Open, and/or Right-Closed • Note that Time-Point and Time-Interval are disjoint
Class Frame Time-Point Time-Point Subclass-Of: Thing *Location-Of: Maximum-Cardinality: 1 Value-Type: Time-Quantity *Year-Of: Maximum-Cardinality: 1 Value-Type: Calender-Year *Month-Of: Maximum-Cardinality: 1 Value-Type: Calendar-Month *Day-Of: Maximum-Cardinality: 1 Value-Type: Calendar-Day *Hour-Of: Maximum-Cardinality: 1 Value-Type: Calendar-Hour *Minute-Of: Maximum-Cardinality: 1 Value-Type: Calendar-Minute *Second-Of: Maximum-Cardinality: 1 Value-Type: Calendar-Second *Granularity-Of: Slot-Cardinality: 1 Value-Type: Time-Granularity
Location of Time Points • Property Location-Of • Amount of time from “point zero” to the time-point • Value is a time quantity • Point zero assumed to be midnight Jan 1, 1900 Midnight-January-1-1900 Instance-Of: Time-Point Location-Of: Time-Instant Time-Instant Instance-Of: Time-Quantity (=> (Time-Unit ?u) (Quantity-Magnitude Time-Instant ?u 0)) • Represented as a function in the axioms
Example Time-Point TP1-On-July-29-2002 Instance-Of: Time-Point Location-Of: TQ1 Maximum-Cardinality: 1 Value-Type: Time-Quantity Year-Of: Year-2002 Maximum-Cardinality: 1 Value-Type: Calendar-Year Month-Of: July-2002 Maximum-Cardinality: 1 Value-Type: Calendar-Month Day-Of: July-Day-29-2002 Maximum-Cardinality: 1 Value-Type: Calendar-Day … Year-2002 Instance-Of: Calendar-Year July-2002 Instance-Of: Calendar-July July-Day-29-2002 Instance-Of: Calendar-Day-29 …
Binary Relations on Time-Points • Before, After, Equal-Point • Defined in terms of Location-Of • (=> (AND (Time-Point ?i) (Time-Point ?j)) (<=> (Before ?i ?j) (OR ... (< (Location-Of ?i) (Location-Of ?j)) ...))) • (=> (AND (Physical-Quantity ?q1) (Physical-Dimension ?q1 ?d) (Physical-Quantity ?q2) (Physical-Dimension ?q2 ?d) (Unit-Of-Measure ?u) (Unit-Dimension ?u ?d) (<=> (< ?q1 ?q2) (< (Quantity-Magnitude ?q1 ?u) (Quantity-Magnitude ?q2 ?u))))
What Points Are In An Interval? • Point-In-Interval • Primitive relation between a point and an interval • Time-Interval frame Instance-Of: Class *Starting-Point: Value-Type: Time-Point Slot-Cardinality: 1 *Ending-Point: Value-Type: Time-Point Slot-Cardinality: 1 • For any interval I: • The starting point of I is the greatest lower bound of the points in I • The ending point of I is the least upper bound of the points in I • Starting-Point and Ending-Point may or may not be in the interval
Relations on Time-Interval • Ontology includes James Allen relations on time intervals • Precedes: |————| End-1 < Start-2 |——————| • Meets: |————| End-1 = Start-2 |——————| • Overlaps: |————| Start-1 < Start-2 < End-1 |——————| • Costarts: |————| Start-1 = Start-2 |——————| • During: |————| Start-2 < Start-1 |——————| End-1 < End-2 • Cofinishes: |————| End-1 = End-2 |——————| • Equal
“A Week in January” • Function The-Quantity • “The physical quantity with a given magnitude in a given unit of measure” • Defining axiom: (<=> (= (The-Quantity ?m ?u) ?q) (Quantity-Magnitude ?q ?u ?m)) • Duration of an interval • For a convex time interval is: Time quantity whose magnitude is the difference between the locations of the interval’s ending point and starting point • For a non-convex time interval is: Sum of durations of all non-overlapping convex time intervals contained in it • Class Week-In-January (AND (Subclass-Of Week-In-January Convex-Time-Interval) (=> (Week-In-January ?w) (and (Duration ?w (The-Quantity Day 7)) (exists ?j (and (Calendar-January ?j) (or (During ?w ?j) (Costarts ?w ?j) (Cofinishes ?w ?j]
Time Granularity • Time cannot be measured with infinite accuracy • Need a notion of “abstracted” time points E.g., 1984, May-1927, 12:50 p.m. February 14, 2000 • Time intervals are not sufficient • Specify a granularity for a time point • Provides for uncertainty that a point is somewhere in an interval E.g., The time point 1984 at granularity “year” occurs somewhere during the convex interval 1984
Time Granularity Class Frames Time-Granularity Subclass-Of: Thing *Time-Unit-Of Value-Type: Time-Unit Max-Cardinality: 1 Year-Granularity Instance-Of: Time-Granularity Time-Unit-Of: Year Infinitely-Fine-Granularity Instance-Of: Time-Granularity Time-Unit-Of: Slot-Cardinality: 0
Equal-Point (<=> (Equal-Point ?i ?j) (or (and (Granularity-Of ?i Infinitely-Fine-Granularity) (Granularity-Of ?j Infinitely-Fine-Granularity) (= (Location-Of ?i) (Location-Of ?j))) (and (Granularity-Of ?i ?gran) (Granularity-Of ?j ?gran) (= (LINLT (Quantity-Magnitude (Location-Of ?i) (Time-Unit-Of ?gran))) (LINLT (Quantity-Magnitude (Location-Of ?j) (Time-Unit-Of ?gran] [Note: LINLT means “Largest Integer Less Than”.] • Two time points on two different levels of granularity cannot be said to be equal to each other
Full Definition of Before (=> (and (Time-Point ?i) (Time-Point ?j)) (<=> (Before ?i ?j) (or (and (Granularity-Of ?i Infinitely-Fine-Granularity) (Granularity-Of ?j Infinitely-Fine-Granularity) (< (Location-Of ?i) (Location-Of ?j))) (and (Granularity-Of ?i Infinitely-Fine-Granularity) (Granularity-Of ?j ?gran-j) (< (Location-Of ?i) (The-Quantity (LINLT (Quantity-Magnitude (Location-Of ?j) (Time-Unit-Of ?gran-j))) (Time-Unit-Of ?gran-j)))) ... (and (Granularity-Of ?i ?gran-i) (Granularity-Of ?j ?gran-j) (< (The-Quantity (SINLT (Quantity-Magnitude (Location-Of ?i) (Time-Unit-Of ?gran-i))) (Time-Unit-Of ?gran-i)) (The-Quantity (LINLT (Quantity-Magnitude (Location-Of ?j) (Time-Unit-Of ?gran-j))) (Time-Unit-Of ?gran-j)))))))
Special Purpose Reasoners for Time • JTP special purpose reasoners operationalize definitions of Before, After, Equal-Point, During, Meets, … • Evaluate instances E.g., (Before A-Point-In-1942 A-Point-In-January-1968) • Infer instances of goals E.g., find intervals ?int such that (During ?int 1942) • Respond to assertions with additional inferred assertions E.g., (=> (and (starting-point ?s1 ?i1) (starting-point ?s2 ?i2) (during ?i1 ?i2)) (before ?s2 ?s1))
Recent Developments • JTP – A hybrid reasoner for query answering • Expanded functionality of DAML+OIL reasoner • Developed reasoners for time-dependent knowledge • DQL – Agent language and protocol for deductive query answering • Providing understandable explanations for derived query answers
DAML Query Language (DQL) Joint US/EU ad hoc Agent Markup Language Committee Editors Richard Fikes Pat Hayes Ian Horrocks
DQL • Language and agent protocol for query-answering • From knowledge represented in DAML+OIL • Supports aquery-answering dialogue • Client – the querying agent • Server – the answering agent • Design Issues • The formal properties of queries and answers • How are queries, answers, and knowledge bases related? • Inferring answers may be expensive • Impractical to always try to compute all answers • Answers may only be known to exist • There may be an infinite number of answers • Is a query to a specific knowledge base? • What are justifications and when should they be computed?
Queries and Answers • Aquerycontains aquery pattern Collection of DAML+OIL sentences in which some literals and/or URIrefs have been replaced by variables E.g. (owns ?p ?c) (type ?c Car) (has-color ?c Red) “Who owns a red car?” • Aquery answerprovidesbindingsof terms to some of the variables in the query pattern The conjunction of the sentences produced by applying the bindings to the query pattern and considering the remaining variables in the query pattern to be existentially quantified is entailed by a knowledge base called the answer KB E.g., query answer with bindings {(?p Joe)} means the answer KB entails: (exists ?c (and (owns Joe ?c) (type ?c Car) (has-color ?c Red))) “Joe owns a red car.”
Bindings • A query contains a query pattern • A query answer provides bindings of terms to some of the variables in the query pattern • Abinding is a lexical mappingthat associates a URIref or literal to a query variable • Each URIref or literal in a binding – • Explicitly occurs as a term in the answer KB, or • Is a term in DAML+OIL • DQL is for answering queries of the form: • "What URIrefs and literals from the answer KB and DAML+OIL denote objects that make the query pattern true?”or • “Is the query pattern true in the answer KB?”
Query Variables • Each variable in a query is one of the following: • must-bind – Answer must provide a binding • may-bind – Answer may provide a binding • don’t-bind – Answer is not to provide a binding • “Who owns a red car?” • Query pattern: (owns ?p ?c) (type ?c Car) (has-color ?c Red) • must-bind ?p; don’t-bind ?c
Example Query-Answering Dialogue DAML+OIL Knowledge Base • Every person has a father • Bill is a person Query-Answering Dialogue • “Father of Bill?” • Query pattern: (has-father Bill ?f) • must-bind: ?f • No answers • may-bind: ?f (or don’t-bind: ?f) • One answer (with no binding for ?f)
Example Query-Answering Dialogue • Every person has a father • … lots of persons … • … a few persons whose fathers are known … DAML+OIL Knowledge Base Query-Answering Dialogue • “Who is a father of who?” • Query pattern: (has-father ?p ?f) • must-bind: ?p ?f • One answer for each known father • must-bind: ?p may-bind: ?f (or don’t-bind: ?f) • One answer for each known person
Premises • A DML query optionally includes a premise • KB or KB reference • Used to facilitate if-then queries • The sentences in the premise are considered to be included in the answer KB • “If C1 is a Seafood Course and W1 is a drink of C1, what color is W1?” • Premise: (type C1 Seafood-Course) (drink C1 W1) • Query pattern: (has-color W1 ?x) • Must-bind: ?x
Answer Bundles • A query may have zero or more answers • response set– The set of all answers provided by the server in a query-answering dialogue • Answers are delivered in groups, each of which is called an answer bundle • A query may specify an upper bound on the number of answers delivered in a single answer bundle (called an answer bundle size bound) • Provides client with additional dialogue control
Answer KB • answer KB – The set of DAML sentences that are used by the server in answering a query • Knowledge base • Union of knowledge bases • Virtual entity representing the total information available to the server at the time of answering • A query contains ananswer KB pattern • KB • KB reference • List of KB references • Variable • Server can select or generate a KB to answer the query • If must-bind, then the answer must provide a binding that is a reference to the answer KB
Query-Answering Protocol Query Client Answer Bundle Server Process Handle Answer Bundle … • Answer bundle • answer set(possibly empty) • server continuation • Process handleor • One or more termination tokens • none – no further answers are entailed by the answer KB • end – no further answers will be produced by the server
Duplicate and Redundant Answers • response set – The set of all answers provided by the server in a query-answering dialogue • Aredundant answeris subsumed by some other answer • One answer subsumes another if its bindings are a superset of the bindings in the other answer • A server can declare that it is: • non-repeating– response sets contain no duplicate answers • terse–response sets contain no duplicate or redundant answers • complete – response sets will be correctly terminated with 'none‘ • answer set– the largest set of query answers that are entailed by the answer KB and none of which are entailed by any other answer • The response set of a complete server contains the answer set • The response set of a terse complete server is the answer set
Queries, Answers, and Answer Bundles Query Necessarily includes Query pattern Answer KB pattern Must-bind variables list May-bind variables list Optionally includes Query premise Justification request Answer bundle size bound Answer Necessarily includes Binding set Query Server Optionally includes Justification Answer bundle Necessarily includes Answer set Server continuation
Formalization of KB Entailing Answer • Consider a binding set in an answer to a query • Q – the query pattern • B – the subset of the binding set consisting of all the bindings to variables in Q • B(Q) – the KB obtained by applying the bindings B to Q • Remaining variables – variables from Q that are not replaced by B • Aninterpretation I satisfies B(Q)if there is a mapping C from the remaining variables of B(Q) to the universe of I such that I+C satisfies B(Q) • The answer KB entails B(Q) just in case B(Q) is true in every interpretation that makes the answer KB true • A binding set must be such that the answer KB entails B(Q)
Recent Developments • JTP – A hybrid reasoner for query answering • Expanded functionality of DAML+OIL reasoner • Developed reasoners for time-dependent knowledge • DQL – Agent language and protocol for deductive query answering • Providing understandable explanations for derived query answers
Trusting Query Answers • Trusting an agent’s answers means that we trust: • The input (and their sources) to the agent • The recency of the input • The inference rules in the reasoner(s) • Automated reasoners provide little support for explaining how queries are answered since proofs produced by them are usually: • Unsharable: Described in an ad hoc syntax without a formal semantics • Monolithic: Not structured to identify and modularize subproofs • Difficult to combine: Different reasoners may be quite dissimilar in style • Reasoner-specific: Often contain ad hoc undefined inference rules • Difficult to visualize: Difficult to find places to focus to understand a proof • Inappropriate notations: Usually designed for developers • Difficult to refine: No infrastructure in proof segments for annotation
Inference Web • Framework for explaining reasoning results by storing, exchanging, combining, annotating, comparing and rendering proofs (www.ksl.stanford.edu/projects/DAML/Proof/) • The Inference Web framework is composed of: • A DAML+OIL specification of proofs based on an ontology of expressions in predicate logic • A format specification based on DAML+OIL for the materialization and exchanging of proofs • Proof browsers • Proof parsers to support the IW format • Proof lookup facilities