Extensible Markup Language

Slides:



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

Semantics for Valid XML Documents Harold Boley Dagstuhl Seminar Semantics in Databases Jan. 7-12, 2001.
SDPL 2003Notes 2: Document Instances and Grammars1 2.5 XML Schemas n A quick introduction to XML Schema –W3C Recommendation, May 2, 2001: »XML Schema Part.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Winter 2002Arthur Keller – CS 18018–1 Schedule Today: Mar. 12 (T) u Semistructured Data, XML, XQuery. u Read Sections Assignment 8 due. Mar. 14.
Semi-structured Data. Facts about the Web Growing fast Popular Semi-structured data –Data is presented for ‘human’-processing –Data is often ‘self-describing’
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
XML – Data Model, DTD and Schema
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.
22-Sep-06 CS6795 Semantic Web Techniques 0 Horn Logic Markup Languages.
SDPL 2002Notes 2: Document Instances and Grammars1 2.5 XML Schemas n A quick introduction to XML Schema –W3C Recommendation, May 2, 2001: »XML Schema Part.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
Lecture 21 XML querying. 2 XSL (eXtensible Stylesheet Language) In HTML, default styling is built into browsers as tag set for HTML is predefined and.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation XML Schema 1 Lecturer.
Dr. Azeddine Chikh IS446: Internet Software Development.
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
XML A Single Entity. xml a single entity Objectives Objectives :  understand the data model  describe the XML Document  describe the XML Schema  describe.
MIS 315 Bsharah An Introduction to XML 1MIS Bsharah.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
18-Sep-14 CS6795 Semantic Web Techniques 0 Extensible Markup Language.
WHAT THE HELL IS XML?. What the Hell is XML? What the hell is XML?  Markup Language  Derived from SGML (Standardized General Markup Language)  Describes.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Session IV Chapter 9 – XML Schemas
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 –
SDPL 2005Notes 2.5: XML Schemas1 2.5 XML Schemas n Short introduction to XML Schema –W3C Recommendation, 1 st Ed. May, 2001; 2 nd Ed. Oct, 2004: »XML Schema.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 27 XML: Extensible Markup Language.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Jeff Ullman: Introduction to XML 1 XML Semistructured Data Extensible Markup Language Document Type Definitions.
An Introduction to XML Sandeep Bhattaram
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
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.
Martin Kruliš by Martin Kruliš (v1.1)1.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
eXtensible Markup Language
XML: Extensible Markup Language
Unit 4 Representing Web Data: XML
CITA 330 Section 3 XHTML.
Representation and Markup
G52IWS: Extensible Markup Language (XML)
XML QUESTIONS AND ANSWERS
XML: Extensible Markup Language
XML in Web Technologies
CSCE 315 – Programming Studio Spring 2013
Chapter 7 Representing Web Data: XML
Web Programming Maymester 2004
Introduction to XML Extensible Markup Language
XML Data Introduction, Well-formed XML.
ece 720 intelligent web: ontology and beyond
eXtensible Markup Language (XML)
Chapter 13 XML Yingcai Xiao.
Lecture 9: XML Monday, October 17, 2005.
CSE591: Data Mining by H. Liu
Semi-Structured data (XML)
Presentation transcript:

Extensible Markup Language XML XML CS6795 Semantic Web Techniques 19-Sep-11

General Advantages of XML for KR XML offers new general possibilities, from which AI knowledge representation (KR) can profit: (1) Definition of self-describing data in worldwide standardized, non-proprietary format (2) Structured data and knowledge exchange for enterprises in various industries (3) Integration of information from different sources (into uniform documents) XML CS6795 Semantic Web Techniques 19-Sep-11

Specific Advantages of XML for KR XML provides the most suitable infrastructure for knowledge bases on the Web (incl. for W3C languages such as RDF) Additional special KR uses of XML are: Uniform storage of knowledge bases Interchange of knowledge bases between different AI languages Exchange between knowledge bases and databases, application systems, etc. XML Even transformation/compilation of AI source programs using XML markup and annotations is possible CS6795 Semantic Web Techniques 19-Sep-11

Address Example: External to HTML External Presentation: Xaver M. Linde Wikingerufer 7 10555 Berlin HTML tags are still presentation-oriented XML HTML Markup: <em>Xaver M. Linde</em> <br> Wikingerufer 7 <strong>10555 Berlin</strong> CS6795 Semantic Web Techniques 19-Sep-11

Address Example: HTML to XML HTML Markup: While not conveying any formal semantics: <em>Xaver M. Linde</em> <br> Wikingerufer 7 <strong>10555 Berlin</strong> XML tags are chosen for content-structuring needs XML XML Markup: <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </address> CS6795 Semantic Web Techniques 19-Sep-11

Address Example: XML to External XML Markup: <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </address> XML XML stylesheets are, e.g., usable to generate different presentations External Presentations: Xaver M. Linde Wikingerufer 7 10555 Berlin Xaver M. Linde Wikingerufer 7 10555 Berlin . . . CS6795 Semantic Web Techniques 19-Sep-11

Address Example: XML to XML XML Markup 1: <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </address> XML stylesheets are also usable to transform XML representations XML XML Markup 2: <address> <name>Xaver M. Linde</name> <place> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </place> </address> CS6795 Semantic Web Techniques 19-Sep-11

CS6795 Semantic Web Techniques Address Example: Some Stylesheets Will Contain Term-(Tree-)Rewriting Rules address name street town N S T XML address name place street town N S T CS6795 Semantic Web Techniques 19-Sep-11

Address Example: XML Queries XML Markup: subelements element <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </address> s XML Query (XML-QL, which influenced XQuery standard): XML WHERE <address> <name>Xaver M. Linde</name> <street>$s</street> <town>$t</town> </address> CONSTRUCT <binding> <s>$s</s> <t>$t</t> </binding> XML queries can select subelements of XML elements <binding> <s>Wikingerufer 7</s> <t>10555 Berlin</t> </binding> CS6795 Semantic Web Techniques 19-Sep-11

Address Example: Prolog Queries Prolog Term: address( name("Xaver M. Linde"), street("Wikingerufer 7"), town("10555 Berlin") ) substructures s structure XML Prolog Query: address( name("Xaver M. Linde"), street(S), town(T) ) Prolog queries can select substructures of Prolog structures S = "Wikingerufer 7" T = "10555 Berlin" CS6795 Semantic Web Techniques 19-Sep-11

Address Example: The Element Tree <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> </address> XML Markup: element s subelements address( name("Xaver M. Linde"), street("Wikingerufer 7"), town("10555 Berlin") ) Prolog Term: structure s substructures XML Node-Labeled, (Left-to-Right-)Ordered Element Tree: address Xaver M. Linde Wikingerufer 7 10555 Berlin name street town subtrees tree CS6795 Semantic Web Techniques 19-Sep-11

Address Example: Document Type Definition and Tree (1) Document Type Definition (DTD): Extended Backus-Naur Form (EBNF): <!ELEMENT address (name, street, town) > <!ELEMENT name (#PCDATA) > <!ELEMENT street (#PCDATA) > <!ELEMENT town (#PCDATA) > address ::= name street town name ::= PCDATA street ::= PCDATA town ::= PCDATA XML Document Type Tree: address PCDATA name street town CS6795 Semantic Web Techniques 19-Sep-11

Address Example: Document Type Definition and Tree (2) Document Type Definition (DTD): <!ELEMENT address (name, place) > <!ELEMENT place (street, town) > <!ELEMENT name (#PCDATA) > <!ELEMENT street (#PCDATA) > <!ELEMENT town (#PCDATA) > Document Type Tree: XML address name place PCDATA street town PCDATA PCDATA CS6795 Semantic Web Techniques 19-Sep-11

Well-Formedness and Validity XML principles for a document being well-formed: XML principle for a document being valid with respect to (w.r.t.) a DTD : Open and close all tags Empty tags end with /> There is a unique root element Elements may not overlap Attribute values are quoted < and & are only used to start tags and entities Only the five predefined entity references are used Match the constraints listed in the DTD (or, generate from DTD as linearized derivation tree, as shown later) XML Checked by validators such as http://validator.w3.org/ CS6795 Semantic Web Techniques 19-Sep-11

Mail-Box Example: Address Variant <name>Xaver M. Linde</name> <box>2001</box> <town>10555 Berlin</town> </address> XML Markup: address( name("Xaver M. Linde"), box("2001"), town("10555 Berlin") ) Prolog Term: XML Node-Labeled, (Left-to-Right-)Ordered Element Tree: address Xaver M. Linde 2001 10555 Berlin name box town CS6795 Semantic Web Techniques 19-Sep-11

CS6795 Semantic Web Techniques "|"-Disjoined Street/Mail-Box Example: Document Type Definition and Tree Document Type Definition (DTD): <!ELEMENT address (name, (street | box), town) > <!ELEMENT name (#PCDATA) > <!ELEMENT street (#PCDATA) > <!ELEMENT box (#PCDATA) > <!ELEMENT town (#PCDATA) > "|": Choice The above box address and the original street address are valid w.r.t. this "|"-DTD XML Document Type Tree: address name street box town PCDATA PCDATA PCDATA PCDATA CS6795 Semantic Web Techniques 19-Sep-11

Phone & Fax Example: Address Variant <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> <phone>030/1234567</phone> <phone>030/1234568</phone> <fax>030/1234569</fax> </address> XML Markup: Prolog Term: address( name("Xaver M. Linde"), street("Wikingerufer 7"), town("10555 Berlin"), phone("030/1234567"), phone("030/1234568"), fax("030/1234569") ) XML Node-Labeled, (Left-to-Right-)Ordered Element Tree: address name street town phone phone fax Xaver M. Linde Wikingerufer 7 10555 Berlin 030/1234567 030/1234568 030/1234569 CS6795 Semantic Web Techniques 19-Sep-11

CS6795 Semantic Web Techniques "+"/"*"-Repetitive-Phone & -Fax Example: Document Type Definition and Tree Document Type Definition (DTD): <!ELEMENT address (name, street, town, phone+, fax*) > <!ELEMENT name (#PCDATA) > <!ELEMENT street (#PCDATA) > <!ELEMENT town (#PCDATA) > <!ELEMENT phone (#PCDATA) > <!ELEMENT fax (#PCDATA) > "+"/"*": One/Zero or More The above two-phone/one-fax address is valid w.r.t. this "+"/"*"-DTD but the original no-phone/no-fax address is not (1 phone!) XML Document Type Tree: address name street town phone fax PCDATA PCDATA PCDATA PCDATA PCDATA CS6795 Semantic Web Techniques 19-Sep-11

Country Example: Address Variant <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> <country>Germany</country> </address> XML Markup: Prolog Term: address( name("Xaver M. Linde"), street("Wikingerufer 7"), town("10555 Berlin"), country("Germany") ) XML Node-Labeled, (Left-to-Right-)Ordered Element Tree: address name street town country Xaver M. Linde Wikingerufer 7 10555 Berlin Germany CS6795 Semantic Web Techniques 19-Sep-11

"?"-Optional-Country Example: Document Type Definition and Tree Document Type Definition (DTD): <!ELEMENT address (name, street, town, country?) > <!ELEMENT name (#PCDATA) > <!ELEMENT street (#PCDATA) > <!ELEMENT town (#PCDATA) > <!ELEMENT country (#PCDATA) > "?": One or Zero The above country address and the original countriless address are valid w.r.t. this "?"-DTD XML Document Type Tree: address name street town country PCDATA PCDATA PCDATA PCDATA CS6795 Semantic Web Techniques 19-Sep-11

Country Address: A Complete XML Document Referring to an External DTD XML Instance Document Referring to DTD (via root element): <?xml version="1.0" standalone="no"?> <!DOCTYPE address SYSTEM "country-address.dtd"> <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> <country>Germany</country> </address> XML The XML declaration uses standalone attribute with "no" value: DTD import The DOCument TYPE declaration names the root element address and, after the SYSTEM keyword, refers to an external DTD at "country-address.dtd" (or, at absolute URL "http://www.cs.unb.ca/~boley/cs6795swt/country-address.dtd") CS6795 Semantic Web Techniques 19-Sep-11

"minOccurs"-Optional-Country Example: XML Schema Definition Equivalent XML Schema Definition (XSD): <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="address"> <xsd:complexType> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="town" type="xsd:string"/> <xsd:element name="country" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> XML CS6795 Semantic Web Techniques 19-Sep-11

"minOccurs"-Optional-Country Example: XML Schema Tree Equivalent Document Schema Tree: address xsd:string name street town country XML CS6795 Semantic Web Techniques 19-Sep-11

Country Address: A Complete XML Document Referring to an External XSD XML Instance Document Referring to XSD (via root element): <?xml version="1.0"?> <address xsi:noNamespaceSchemaLocation="country-address.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> <country>Germany</country> </address> XML The xsi:noNamespaceSchemaLocation attribute is embedded in the root element address and refers to an external XSD at "country-address.xsd" (or, at absolute URL "http://www.cs.unb.ca/~boley/cs6795swt/country-address.xsd") CS6795 Semantic Web Techniques 19-Sep-11

"?"-Optional-Country Example: Relax NG Compact Syntax (RNC) Equivalent Relax NG in Compact Syntax (RNC): default namespace = "" start = address address = element address { name, street, town, country? } name = element name { xsd:string } street = element street { xsd:string } town = element town { xsd:string } country = element country { xsd:string } XML CS6795 Semantic Web Techniques 19-Sep-11

"optional"-Country Example: Relax NG XML Syntax (RNG) Equivalent Relax NG in XML Syntax (RNG): <?xml version="1.0"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0"> <start> <ref name="address"/> </start> <define name="address"> <element name="address" ns=""> <group> <ref name="name"/> <ref name="street"/> <ref name="town"/> <optional> <ref name="country"/> </optional> </group> </element> </define> <define name="name"> <element name="name" ns=""> <data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/> </element> </define> <define name="street"> <element name="street" ns=""> <define name="town"> <element name="town" ns=""> <define name="country"> <element name="country" ns=""> </grammar> XML CS6795 Semantic Web Techniques 19-Sep-11

Country Address: A Complete XML Document Referring to an External RNG XML Instance Document Referring to RNG (via xml-model line): <?xml version="1.0"?> <?xml-model href="country-address.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> <address> <name>Xaver M. Linde</name> <street>Wikingerufer 7</street> <town>10555 Berlin</town> <country>Germany</country> </address> XML The href attribute refers to an external RNG at "country-address.rng" (or, at absolute URL "http://www.cs.unb.ca/~boley/cs6795swt/country-address.rng") CS6795 Semantic Web Techniques 19-Sep-11