Presentation is loading. Please wait.

Presentation is loading. Please wait.

Application of Logic Programming and Updates for the Semantic Web Luís Moniz Pereira Dresden, November 2003.

Similar presentations


Presentation on theme: "Application of Logic Programming and Updates for the Semantic Web Luís Moniz Pereira Dresden, November 2003."— Presentation transcript:

1 Application of Logic Programming and Updates for the Semantic Web Luís Moniz Pereira Dresden, November 2003

2 The Semantics Web "The Semantic Web is an extension of the current web in which information is given well-defined meaning, better enabling computers and people to work in cooperation." [Berners-Lee01] Beyond Machine readable to Machine understandable Beyond Machine readable to Machine understandable

3 Why it is crucial Information Overload Information Overload Information on the Web currently aiming at Human Consumption Information on the Web currently aiming at Human Consumption Information Consumption is too time consuming Information Consumption is too time consuming Search Engines fail more and more Search Engines fail more and more Data Interchange growing (e.g. B2B) Data Interchange growing (e.g. B2B) XML provides common syntax XML provides common syntax Needs a common semantics Needs a common semantics

4 From XML to RDF XML key idea: XML key idea: Separate structure from presentation Separate structure from presentation XML DTDs or Schema define document structure XML DTDs or Schema define document structure Replace HTML with two things Replace HTML with two things A domain specific markup language (defined in XML) A domain specific markup language (defined in XML) A map from that markup language to HTML (defined using XSLT) A map from that markup language to HTML (defined using XSLT)

5 From XML to RDF RDF key idea: RDF key idea: Separate content from structure Separate content from structure RDF defines data models (set of triples “ Resource has Property with Value ”) RDF defines data models (set of triples “ Resource has Property with Value ”) Similar to taxonomy definition Similar to taxonomy definition RDF Schema for definition of Vocabularies and Ontologies for the data model RDF Schema for definition of Vocabularies and Ontologies for the data model

6 Beyond contents Conveying contents of documents is just a 1 st step for unfolding the potential of the Semantic Web Conveying contents of documents is just a 1 st step for unfolding the potential of the Semantic Web It is mandatory to be able to reason with and about information on the Web: It is mandatory to be able to reason with and about information on the Web: “The challenge of the Semantic Web, therefore, is to provide a language that expresses both data and rules for reasoning about the data. Adding logic to the Web – the means to use rules to make inferences, choose courses of action and answer questions – is the task before the Semantic Web community at the moment.”

7 Logic Programming for the Web Logic Programming is exactly about this: expressing knowledge with rules, and making inferences and answering queries. Logic Programming is exactly about this: expressing knowledge with rules, and making inferences and answering queries. It provides both a declarative reading (with well understood semantics) and an operational reading of rules (with implementations) It provides both a declarative reading (with well understood semantics) and an operational reading of rules (with implementations) State of the art in LP lift some of RDF limitations State of the art in LP lift some of RDF limitations RDF is an assertional logic, in which each triple expresses a simple proposition. This imposes a fairly strict monotonic discipline on the language, so that it cannot express closed-world assumptions, local default preferences, and several other commonly used non- monotonic constructs.

8 Why LP – Theoretical issues Current proposals are based on classical logic Current proposals are based on classical logic Atoms are either true or false: no form of naturally representing uncertainty (fuzzy, probabilistic, etc.). Atoms are either true or false: no form of naturally representing uncertainty (fuzzy, probabilistic, etc.). No default (non-monotonic) negation for representation of incomplete information. No default (non-monotonic) negation for representation of incomplete information. No negation(s) for stating explicit negative information. No negation(s) for stating explicit negative information. No handling of contradiction/paraconsistency. No handling of contradiction/paraconsistency. No way of extending the language with new connectives No way of extending the language with new connectives Most of the above is raised in the Semantic Web Activity Statement, and there are solutions to them in LP Most of the above is raised in the Semantic Web Activity Statement, and there are solutions to them in LP

9 Why LP – Practical issues Current proposals seem not to address some important problems: Current proposals seem not to address some important problems: What happens if a computation fails in the Web ? What happens if a computation fails in the Web ? What happens if a loop is introduced in the course of distributed inference (positive or negative) ? What happens if a loop is introduced in the course of distributed inference (positive or negative) ? Can the computation safely proceed while answers do not arrive ? Can the computation safely proceed while answers do not arrive ? How to share and avoid redundant computations ? How to share and avoid redundant computations ? How to update knowledge (in the Web) ? How to update knowledge (in the Web) ? How to handle event-condition-action rules ? How to handle event-condition-action rules ? LP based semantics and implementation technology have answers to these questions. LP based semantics and implementation technology have answers to these questions.

10 Which semantics for LP in the Web? Requirements: Requirements: Must be able to deal with incomplete knowledge Must be able to deal with incomplete knowledge Must be able to deal with inconsistencies Must be able to deal with inconsistencies Must always provide answers, even in inconsistent cases Must always provide answers, even in inconsistent cases Must be efficient, event at the cost of expressiveness Must be efficient, event at the cost of expressiveness Computation cannot be global Computation cannot be global Inference mechanisms must be query driven Inference mechanisms must be query driven Must deal with (yet) unknown, or undefined, answers Must deal with (yet) unknown, or undefined, answers

11 WFS seems to be the answer The adopted semantics for definite, acyclic and (locally) stratified logic programs. The adopted semantics for definite, acyclic and (locally) stratified logic programs. Defined for every normal logic program. Defined for every normal logic program. Polynomial data complexity. Polynomial data complexity. Efficient existing implementations, namely the SLG-WAM engine implemented in XSB. Efficient existing implementations, namely the SLG-WAM engine implemented in XSB. Good structural properties, namely supportedness and relevance. Good structural properties, namely supportedness and relevance. A lot of extensions are built over WFS. A lot of extensions are built over WFS. It can be "combined" with DBMS, Prolog and Stable Models engines. It can be "combined" with DBMS, Prolog and Stable Models engines. It has an undefined truth-value... It has an undefined truth-value...

12 More on the 3rd value The existence of an undefined logical value is fundamental: The existence of an undefined logical value is fundamental: While waiting for answers to a remote goal it can be assumed that its truth-value is undefined, and proceed the computation locally. While waiting for answers to a remote goal it can be assumed that its truth-value is undefined, and proceed the computation locally. This is the way loops through negation are dealt within tabling (in XSB), via goal suspension and resume operations. This is the way loops through negation are dealt within tabling (in XSB), via goal suspension and resume operations. Tabling is the right, successful and available implementation technique to ensure better termination properties and polynomial complexity. Tabling is the right, successful and available implementation technique to ensure better termination properties and polynomial complexity. Tabling is also a good way to address distributed query evaluation of definite and normal logic programs. Tabling is also a good way to address distributed query evaluation of definite and normal logic programs.

13 What about Paraconsistency? With the introduction of explicit negation, contradictions may arise in knowledge bases. With the introduction of explicit negation, contradictions may arise in knowledge bases. We have defined a paraconsistent well-founded semantics with explicit negation, where: We have defined a paraconsistent well-founded semantics with explicit negation, where: contradiction is "propagated". contradiction is "propagated". we can detect dependency on contradiction we can detect dependency on contradiction contradiction can be blocked by resorting to normalized default rules. contradiction can be blocked by resorting to normalized default rules. there is a program transformation into WFS. there is a program transformation into WFS. there are polynomial inference procedures. there are polynomial inference procedures.

14 W4 project Well-founded semantics for WWW Well-founded semantics for WWW Mission Statement Mission Statement The W4 project aims at developing Standard Prolog inter-operable tools for supporting distributed, secure, and integrated reasoning activities in the Semantic Web.

15 W4- project Goals Development of Prolog technology for XML, RDF, and RuleML. Development of Prolog technology for XML, RDF, and RuleML. Development of a General Semantic framework for RuleML including default and explicit negation, supporting uncertain, incomplete, and paraconsistent reasoning. Development of a General Semantic framework for RuleML including default and explicit negation, supporting uncertain, incomplete, and paraconsistent reasoning. Development of distributed query evaluation procedures for RuleML, based on tabulation, according to the previous semantics. Development of distributed query evaluation procedures for RuleML, based on tabulation, according to the previous semantics. Development of Dynamic Semantics for evolution/update of Rule ML knowledge bases. Development of Dynamic Semantics for evolution/update of Rule ML knowledge bases. Integration of different semantics in Rule ML (namely, Well- founded Semantics, Answer Sets, Fuzzy Logic Programming, Annotated Logic Programming, and Probabilistic Logic Programming). Integration of different semantics in Rule ML (namely, Well- founded Semantics, Answer Sets, Fuzzy Logic Programming, Annotated Logic Programming, and Probabilistic Logic Programming).

16 W4 server architecture XML based Communication Layer EVOLP Logic Programming Engines DLP RuleML interface XML Parser & Generator

17 Our XML Tools Non-validating XML parser with support for XML Namespaces, XML Base, complying with the recommendations of XML Info Sets. It can read US- ASCII, UTF-8, UTF-16, and ISO-8859-1 encodings. Non-validating XML parser with support for XML Namespaces, XML Base, complying with the recommendations of XML Info Sets. It can read US- ASCII, UTF-8, UTF-16, and ISO-8859-1 encodings. Converter of XML to Prolog terms. Converter of XML to Prolog terms. RuleML compiler for the hornlog fragment of the language extended with default and explicit negation. RuleML compiler for the hornlog fragment of the language extended with default and explicit negation. Query evaluation procedures under the Paraconsistent Well-founded Semantics with Explicit Negation. Query evaluation procedures under the Paraconsistent Well-founded Semantics with Explicit Negation. RDF(S) engine RDF(S) engine

18 A taxonomy in W4 Mammals are animals Bats are mammals Birds are animals Penguins are birds Dead animals are animals Normally animals don’t fly Normally bats fly Normally birds fly Normally penguins don’t fly Normally dead animals don’t fly Pluto is a mammal Pluto is a mammal Joe is a penguin Joe is a penguin Tweety is a bird Tweety is a bird Dracula is a dead bat Dracula is a dead bat The elements: Dead bats don’t fly though bats do Dead bats don’t fly though bats do Dead birds don’t fly though birds do Dead birds don’t fly though birds do Dracula is an exception to the above Dracula is an exception to the above In general, more specific information is preferred In general, more specific information is preferred The preferences:

19 The taxonomy flies animal bird penguin mammal bat dead animal plutotweetydraculajoe Absolute rules Default rules Default negated rules

20 Representation in RuleML % Mammals are animals animal(X) <- mammal(X). % Mammals are animals animal(X) <- mammal(X). % Normally animals don't fly neg flies(X) <- animal(X), neg flying_animal(X), not flies(X) neg flying_animal(X) <- not flying_animal(X) % Normally animals don't fly neg flies(X) <- animal(X), neg flying_animal(X), not flies(X) neg flying_animal(X) <- not flying_animal(X) % Normally birds fly flies(X) <- bird(X), flying_bird(X), not neg flies(X) flying_bird(X) <- not neg flying_bird(X) % Normally birds fly flies(X) <- bird(X), flying_bird(X), not neg flies(X) flying_bird(X) <- not neg flying_bird(X) The whole rulebase... And let’s try this! The whole rulebase... And let’s try this!rulebase try rulebase try

21 Extensions and integration With extensions to the RuleML/XML syntax, existing LP engines can be used, integrating: With extensions to the RuleML/XML syntax, existing LP engines can be used, integrating: Paraconsistent reasoning Paraconsistent reasoning Incompleteness Incompleteness Uncertainty Uncertainty Preferences Preferences This is simply based on work developed in LP for this integration. This is simply based on work developed in LP for this integration.

22 Evolution in the Web The Semantic Web is a “living organism” combining autonomously evolving data sources/knowledge repositories. The Semantic Web is a “living organism” combining autonomously evolving data sources/knowledge repositories. This requires (declarative) languages and mechanisms for specifying its maintenance and evolution. This requires (declarative) languages and mechanisms for specifying its maintenance and evolution. When updating the rules defining, e.g., data interchange policies, one does not want to review the whole (maybe distributed) set of previous rules! When updating the rules defining, e.g., data interchange policies, one does not want to review the whole (maybe distributed) set of previous rules!

23 LP updates for the Web Once again, there are ways of dealing with this within LP Once again, there are ways of dealing with this within LP It requires extension of the XML syntax to cope with sequences of sets of rules, and assertion of rules: It requires extension of the XML syntax to cope with sequences of sets of rules, and assertion of rules: This is already done in our XML tools This is already done in our XML tools It requires the adaptation of the LP engines: It requires the adaptation of the LP engines: This is being developed now This is being developed now

24 An example of evolution Personal assistant for email where: Personal assistant for email where: A XML/RuleML page stores rules defining behaviour of the agent A XML/RuleML page stores rules defining behaviour of the agent This page may be dynamically updated This page may be dynamically updated Personal messages are stored in a XML page Personal messages are stored in a XML page Messages are received in the XML communication layer, as EVOLP events Messages are received in the XML communication layer, as EVOLP events Either the sender sends the messages directly as “queries” to page Either the sender sends the messages directly as “queries” to page Or, preferably, an external process periodically checks for messages in a mail server, and sends existing messages to the page Or, preferably, an external process periodically checks for messages in a mail server, and sends existing messages to the page Messages to be sent are asserted, and an external process periodically checks for those asserted facts, and sends the message via an smtp server Messages to be sent are asserted, and an external process periodically checks for those asserted facts, and sends the message via an smtp server

25 Email agent Able to: Able to: Perform basic actions of sending, receiving, deleting messages Perform basic actions of sending, receiving, deleting messages Storing and moving messages between folders Storing and moving messages between folders Filtering spam messages Filtering spam messages Sending automatic replies and forwarding Sending automatic replies and forwarding Notifying the user of special situations Notifying the user of special situations All of this dependent on user specified criteria All of this dependent on user specified criteria The specification may change dynamically The specification may change dynamically

26 Some EVOLP rules By default, messages are stored in the inbox: By default, messages are stored in the inbox: assert(msg(M,F,S,B,T)) ← newmsg(M,F,S,B), time(T), not delete(M). assert(in(M,inbox)) ← newmsg(M,F,S,B), not delete(M). assert(not in(M,F)) ← delete(M), in(M,F). Spam messages are to be deleted Spam messages are to be deleted delete(M) ← newmsg(M,F,S,B), spam(F,S,B). The definition of spam can be done by LP rules The definition of spam can be done by LP rules spam(F,S,B) ← contains(S,credit). This definition can later be updated This definition can later be updated not spam(F,S,B) ← contains(F,my_accountant).

27 More EVOLP rules Messages can be automatically moved to other folders. When so happens (not shown here) the user wants to be notified Messages can be automatically moved to other folders. When so happens (not shown here) the user wants to be notified notify(M) ← newmsg(M,F,S,B), assert(in(M,F)), not assert(in(M,inbox)). notify(M) ← newmsg(M,F,S,B), assert(in(M,F)), not assert(in(M,inbox)). When a message is marked both for deletion and automatically moving to another folder, the deletion should prevail When a message is marked both for deletion and automatically moving to another folder, the deletion should prevail not assert(in(M,F)) ← move(M,F), delete(M). The user is organizing a conference and assigns papers to referees. After receiving the acceptance of the referee, a new rule is to be added, which forwards the referee all the messages about the corresponding papers The user is organizing a conference and assigns papers to referees. After receiving the acceptance of the referee, a new rule is to be added, which forwards the referee all the messages about the corresponding papers assert( send(R,S,B1) ← newmsg(M1,F,S,B1), contains(S,PId), assign(PId,Ref) ) ← newmsg(M2,Ref,PId,B2), contains(B2,accept).

28 Conclusions The Semantic Web is an important, and growing application domain The Semantic Web is an important, and growing application domain People working in this area are facing problems that were already addressed by LP People working in this area are facing problems that were already addressed by LP LP may be used for solving real problems in the Semantic Web LP may be used for solving real problems in the Semantic Web We (LP-community) may have important contributions for this domain We (LP-community) may have important contributions for this domain

29 Conclusions (Cont) Such contributions require: Such contributions require: Identification of the exact problems where LP contribution makes sense Identification of the exact problems where LP contribution makes sense Integration with other systems, where LP contribution is not needed Integration with other systems, where LP contribution is not needed Tools for putting LP to work in the Web Tools for putting LP to work in the Web Specialized engines for the Web Specialized engines for the Web (Most likely) some more work in LP to fulfill some needs of the Semantic Web (Most likely) some more work in LP to fulfill some needs of the Semantic Web We are currently working on all these issues We are currently working on all these issues

30 Who also developed this work In putting this material together: In putting this material together: Carlos Viegas Damásio Carlos Viegas Damásio José Júlio Alferes José Júlio Alferes Who collaborated in work used by W4: Who collaborated in work used by W4: João Alcântara João Alcântara António Brogi António Brogi João Leite João Leite Teodor Przymusinski Teodor Przymusinski Halina Przymusinska Halina Przymusinska


Download ppt "Application of Logic Programming and Updates for the Semantic Web Luís Moniz Pereira Dresden, November 2003."

Similar presentations


Ads by Google