22-Sep-06 CS6795 Semantic Web Techniques 0 Horn Logic Markup Languages.

Slides:



Advertisements
Similar presentations
22-Sep-06 CS6795 Semantic Web Techniques 0 Extensible Markup Language.
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Semantics (Representing Meaning)
1 DTD (Document Type Definition) Imposing Structure on XML Documents (W3Schools on DTDs)W3Schools on DTDs.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
176 Formal Languages and Applications: We know that Pascal programming language is defined in terms of a CFG. All the other programming languages are context-free.
Document Type Definition DTDs CS-328. What is a DTD Defines the structure of an XML document Only the elements defined in a DTD can be used in an XML.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
1 XML and QUERY Shilpi Ahuja CSE Data Mining 4 th April 2002.
Semi-structured Data. Facts about the Web Growing fast Popular Semi-structured data –Data is presented for ‘human’-processing –Data is often ‘self-describing’
XML for Information Management – Day 3: Formal and Natural Languages in XML Airi Salminen XML for Information Management University of Erlangen-Nuremberg.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
CSE S. Tanimoto Syntax and Types 1 Representation, Syntax, Paradigms, Types Representation Formal Syntax Paradigms Data Types Type Inference.
Markup Languages & XML - BY VISHAL KAMTAM VENKATESH.
Unit 4 – XML Schema XML - Level I Basic.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
XML Validation I DTDs Robin Burke ECT 360 Winter 2004.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Document Type Definition.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Chapter 10: XML.
1 XML Schemas. 2 Useful Links Schema tutorial links:
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
18-Sep-14 CS6795 Semantic Web Techniques 0 Extensible Markup Language.
XML Syntax - Writing XML and Designing DTD's
XMLI Structure of XML Data Structure of XML Data XML Document Schema XML Document Schema XPATH XPATH.
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Syntax Specification and BNF © Allan C. Milne Abertay University v
Winter 2006Keller, Ullman, Cushing18–1 Plan 1.Information integration: important new application that motivates what follows. 2.Semistructured data: a.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
XML Validation I DTDs Robin Burke ECT 360 Winter 2004.
CONTEXT FREE GRAMMAR presented by Mahender reddy.
Database Systems Part VII: XML Querying Software School of Hunan University
An OO schema language for XML SOX W3C Note 30 July 1999.
XML Name: Niki Sardjono Class: CS 157A Instructor : Prof. S. M. Lee.
Jeff Ullman: Introduction to XML 1 XML Semistructured Data Extensible Markup Language Document Type Definitions.
Chapter 23 XML. 2 Introduction  XML: eXtensible Markup Language (What is a Markup language?)  Defined by the WWW Consortium (W3C)  Originally intended.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Copyright © 2006 Addison-Wesley. All rights reserved. Ambiguity in Grammars A grammar is ambiguous if and only if it generates a sentential form that has.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Introduction to DTD A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
MB: 26 Feb 2001CS Lecture 11 Introduction Reading: Read Chapter 1 of Bratko Programming in Logic: Prolog.
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
1 Representing and Reasoning on XML Documents: A Description Logic Approach D. Calvanese, G. D. Giacomo, M. Lenzerini Presented by Daisy Yutao Guo University.
Chapter 3 – Describing Syntax
Introduction to Logic for Artificial Intelligence Lecture 2
Representation, Syntax, Paradigms, Types
Web Programming Maymester 2004
XML Data DTDs, IDs & IDREFs.
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Extensible Markup Language
Programming Techniques
Representation, Syntax, Paradigms, Types
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

22-Sep-06 CS6795 Semantic Web Techniques 0 Horn Logic Markup Languages

22-Sep-06 CS6795 Semantic Web Techniques 1 Herbrand Terms: Individual Constants, Variables, Flat Ground Structures,... Individual constant for channel-tunnel between Britain and France: element channel-tunnel Ground structure undersea-connection(britain,france) is element with embedded element for constructor, followed by elements for argument terms: Representation of Herbrand terms in XML as and elements ( similar): undersea-connection britain france

22-Sep-06 CS6795 Semantic Web Techniques 2 Herbrand Terms:..., Nested Ground Structures service-tunnel( undersea-connection( britain, surrounded-country( belgium, luxembourg, germany, switzerland, italy, spain))) service-tunnel undersea-connection britain surrounded-country belgium luxembourg germany switzerland italy spain Embedded elements:

22-Sep-06 CS6795 Semantic Web Techniques 3 Interim Discussion: Tag and Type In Prolog not clear, in isolation, that channel-tunnel is individual constant, whereas service-tunnel is constructor In XML, as in strongly typed LP languages, made explicit - however at every occurrence of a symbol Example gives impression of self-description advantage - but also ‘space requirement’ - of this generous application of “syntactic sugar”

22-Sep-06 CS6795 Semantic Web Techniques 4 Horn Clauses: Relation Symbol Applications Predicate or relation symbol in XML is element. For example, relation symbol travel is travel Relation symbol application to terms is labeled with element. Application travel(john,channel-tunnel) on two individual constants thus is travel john channel-tunnel

22-Sep-06 CS6795 Semantic Web Techniques 5 Horn Clauses: Facts Hence, Horn fact can be asserted as element that possesses elements as subelements In the example, the Prolog fact travel(john,channel-tunnel). becomes travel john channel-tunnel

22-Sep-06 CS6795 Semantic Web Techniques 6 Horn Clauses: Rules Then, Horn rule is asserted as Element that has a head element followed by at least one body element So, above example generalized to Prolog rule travel(Someone,channel-tunnel) :- carry(eurostar,Someone). travel someone channel-tunnel carry eurostar someone and rewritten as

22-Sep-06 CS6795 Semantic Web Techniques 7 Attributes for Extended Logics Nested elements - trees - allow representation of arbitrary information, but in some situations lead to unnecessarily deeply/widely nested representations Therefore XML attributes: Start-Tag is ‘attributed’ with n attribute-value pairs a i =v i Element:... Helpful Prolog uses of XML attributes are arity labelings of relation symbols such as our binary relation symbol travel: Prolog’s travel/2 in XML with an arity attribute becomes travel Analogously, annotations become possible on arbitrary element levels: mode declarations for logic variables, determinism specifications for clauses or procedures, and context conditions for entire knowledge bases

22-Sep-06 CS6795 Semantic Web Techniques 8 ID and IDREF Attribute types ID and IDREF for naming and referencing of elements ID-typed value must uniquely identify an element and IDREF-typed value must occur as ID value of an element E.g., clause can be named (in a hypothesis knowledge base) : travel john channel-tunnel

22-Sep-06 CS6795 Semantic Web Techniques 9 Now a “modal Prolog fact” belief(mary,travel(john,channel-tunnel)). can access the "john-channel" assertion: belief mary Propositional argument of the belief operator written as (XML abbreviation of empty elements to ) Also disbelief fact has "john-channel" access with idref: ID/IDREF “break out of the tree” and enable ‘sharing’ ID and IDREF

22-Sep-06 CS6795 Semantic Web Techniques 10 Up to now:Examples for Horn Logic in XML etc. Now: General language definition XML's Document type definitions (DTDs) initially only as ELEMENT declarations for non-attributed elements For nonterminals: DTD  ordinary context-free grammar in modified (EBNF) notation For terminals: Usually arbitrary permutations of the base alphabet ("PCDATA'') instead of fixed terminal sequences DTD grammar derives context-free word patterns: derivation trees themselves - linearized through brackets - as generated result XML element is valid with respect to DTD: can be generated from DTD as linearized derivation tree DTDs: Elements as Derivation Trees

22-Sep-06 CS6795 Semantic Web Techniques 11 Syntactic ELEMENT declaration of Horn logic as a knowledge base (kb) of zero or more Horn clauses (hn*): DTDs: Defining Horn Logic in XML Note struc recursion!

22-Sep-06 CS6795 Semantic Web Techniques 12 (Start-)symbol kb brackets derived clause(s) as linearized start-tag/end-tag-tree representation... : kb hn*... relationship relationship... #PCDATA #PCDATA #PCDATA #PCDATA #PCDATA #PCDATA DTDs: Generation of the Example Rule (1)

22-Sep-06 CS6795 Semantic Web Techniques 13 travel someone channel-tunnel carry eurostar someone DTDs: Generation of the Example Rule (2)

22-Sep-06 CS6795 Semantic Web Techniques 14 DTDs for attributed elements: ATTLIST declarations, which associate element name with an attribute name plus attribute type and possible occurrence indication 1st Example: declare the relator attribute arity as CDATA-typed (cf. #PCDATA) and occurring optionally (#IMPLIED): 2nd Example (Preparation): define the extended Horn logic with (named hn clauses and) embedded propositions: Attribute DTDs (1)

22-Sep-06 CS6795 Semantic Web Techniques 15 2nd Example (Execution): Append an ATTLIST declaration that specifies, for the hn respectively prop elements, the attributes id - as optional ID type - respectively idref - as mandatory IDREF type: With entire DTD now, e.g., earlier "john-channel"-named fact and its accessing facts can be generated Attribute DTDs (2)

22-Sep-06 CS6795 Semantic Web Techniques 16 Assume fact: carry eurostar carry(eurostar,fred). fred A Horn-logic interpreter can use it to answer this query: carry eurostar carry(eurostar,Someone) someone by binding someone Someone to fred fred Horn Queries in XML Notation

22-Sep-06 CS6795 Semantic Web Techniques 17 With carry basis fact carry(eurostar,fred). a rule is usable to dynamically derive travel assertions as needed, without having to store them all-inclusively and statically: travel(Someone,channel-tunnel) :-carry(eurostar,Someone). That is, its earlier XML version is useable by a Horn-logic interpreter for inferential queries like travel(fred,Where)  carry(eurostar,Someone)  true Horn Inferences in XML Notation (1) Someone=fred Where=channel-tunnel

22-Sep-06 CS6795 Semantic Web Techniques 18 Rule: travel someone channel-tunnel carry eurostar someone Horn Inferences in XML Notation (2) travel fred where carry eurostar someone true Fact: carry eurostar fred 3-Step Animation:

22-Sep-06 CS6795 Semantic Web Techniques 19 Rule: travel someone channel-tunnel carry eurostar someone Horn Inferences in XML Notation (2) travel fred where Fact: carry eurostar fred 3-Step Animation:

22-Sep-06 CS6795 Semantic Web Techniques 20 Rule: travel someone channel-tunnel carry eurostar someone Horn Inferences in XML Notation (2) Fact: carry eurostar fred 3-Step Animation: carry eurostar someone

22-Sep-06 CS6795 Semantic Web Techniques 21 Rule: travel someone channel-tunnel carry eurostar someone Horn Inferences in XML Notation (2) Fact: carry eurostar fred 3-Step Animation: true

22-Sep-06 CS6795 Semantic Web Techniques 22 Horn Inferences: SLD-Resolution, XML-QL Implementation, Open World This inference is carried out as an SLD-resolution step The procedural semantics of SLD-resolution can be used An XML-QL implementation seems possible as for queries A functional-logic generalization of HornML is RFMLRFML If distribution of the clauses over different documents in the Web is assumed, in this “open world” logical completeness, in particular, can hardly still be asked for