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 –

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
1 DTD (Document Type Definition) Imposing Structure on XML Documents (W3Schools on DTDs)W3Schools on DTDs.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:  Elements.
1 XML DTD & XML Schema Monica Farrow G30
Tutorial 9 Working with XHTML
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Document Type Definitions
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
Chapter 2A Semantic Web Primer 1 Chapter 2 Structured Web Documents in XML Grigoris Antoniou Frank van Harmelen.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
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 Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Unit 4 – XML Schema XML - Level I Basic.
Introduction to XML This material is based heavily on the tutorial by the same name at
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.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
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.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Chapter 2 Structured Web Documents in XML Adapted from slides from Grigoris Antoniou and Frank van Harmelen.
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.
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.
Neminath Simmachandran
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML Syntax - Writing XML and Designing DTD's
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.
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.
FIGIS’ML Hands-on training - © FAO/FIGIS An introduction to XML Objectives : –what is XML? –XML and HTML –XML documents structure well-formedness.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Chapter 2A Semantic Web Primer 1 Chapter 2 Structured Web Documents in XML Grigoris Antoniou Frank van Harmelen.
New Perspectives on XML, 2nd Edition
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
An OO schema language for XML SOX W3C Note 30 July 1999.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
XML – A Quick Introduction Kerry Raymond (stolen from others)
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Introduction to XML Schema John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: (x2073)
XSD: XML Schema Language Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
What information can we see… WWW2002 The eleventh international world wide web conference Sheraton waikiki hotel Honolulu, hawaii, USA 7-11 may
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
CITA 330 Section 4 XML Schema. XML Schema (XSD) An alternative industry standard for defining XML dialects More expressive than DTD Using XML syntax Promoting.
MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard Facoltà di scienze della comunicazione Università.
Chapter 2A Semantic Web Primer 1 Chapter 2 Structured Web Documents in XML Grigoris Antoniou Frank van Harmelen.
CS 480: Database Systems Lecture 26 March 18, 2013.
Tutorial 9 Working with XHTML
ece 720 intelligent web: ontology and beyond
Document Type Definition (DTD)
New Perspectives on XML
Presentation transcript:

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 – basics, language Semantics of RDF and RDF Schema SPARQL – query language for RDF ece 627, winter '132

of 33 XML introduction XML – Extensible Markup Language  designed to describe structured documents  users may create their own tags (they can create their own specific languages)  tags have no semantics indicting how to present documents through a Web browser ece 627, winter '133

of 33 XML example Semantic Web is Cool John Smith Springer ece 627, winter '134

of 33 ece 627, winter '135 XML prolog of a document the prolog:  an XML declaration  an optional reference to external structuring documents

of 33 ece 627, winter '136 XML elements “things” the XML document talks about  books, authors, publishers, … each element contains three parts  an opening tag  the content  a closing tag John Smith

of 33 ece 627, winter '137 XML elements (2) tag names can be chosen almost freely the first character must be a letter, an underscore, or a colon no name may begin with the string “xml” in any combination of cases (“Xml”, “xML”)

of 33 ece 627, winter '138 XML content of elements content may be text, or other elements, or nothing John Smith +1 − 780 − if no content for

of 33 ece 627, winter '139 XML attributes an empty element is not necessarily meaningless  it may have some properties in terms of attributes an attribute is a name-value pair inside the opening tag of an element

of 33 ece 627, winter '1310 XML other components comments processing instructions (define procedural attachments)

of 33 ece 627, winter '1311 XML well-formed documents syntactically correct documents – ones that obey some syntactic rules:  there is only one outermost element (called root element)  each element has an opening and a corresponding closing tag  tags may not overlap Lee Hong  attributes have unique names  names of elements and tags must be permissible

of 33 ece 627, winter '1312 XML tree model of XML documents <from name=”John Smith" <to name=”Jenny Doe" How are you? Hi, it was nice …

of 33 ece 627, winter '1313 XML tree model of XML documents

of 33 ece 627, winter '1314 XML structure of documents definition of all element and attribute names that may be used definition of structure  what values an attribute may take  which elements may or must occur within other elements, etc. if such structuring information exists, the document can be validated

of 33 ece 627, winter '1315 an XML document is valid if  it is well-formed  respects the structuring information it uses there are two ways of defining the structure of XML documents:  DTDs (the older and more restricted way)  XML Schema (offers extended possibilities) XML structure of documents (2)

of 33 ece 627, winter '1316 John Smith +1 − 780 − DTD for above element (and all author elements): XML structure of documents: DTD

of 33 ece 627, winter '1317 XML DTD: its meaning the element types author, name, and phone may be used in the document an author element contains a name element and a phone element, in that order (sequence)

of 33 ece 627, winter '1318 XML DTD: its meaning a name element and a phone element may have any content in DTDs, #PCDATA is the only atomic type for elements

of 33 ece 627, winter '1319 XML Schema richer language for defining the structure of XML documents its syntax is based on XML itself sophisticated set of data types, compared to DTDs (which only supports strings)

of 33 ece 627, winter '1320 XML Schema (2) it is like an element with an opening tag like <xsd:schema xmlns:xsd=“ XMLSchema” version=“1.0”>...

of 33 ece 627, winter '1321 XML Schema element types type=“…” minOccurs=“x” (x may be any natural number) maxOccurs=“x” (any number of unbounded)

of 33 ece 627, winter '1322 XML Schema element types - examples

of 33 ece 627, winter '1323 XML Schema attribute types type=“…” use=“x” (x may be optional or required or prohibited) default value

of 33 ece 627, winter '1324 XML Schema attribute types - examples < attribute name="speaks" type="Language" use="default" value="en"/> existence: use="x", where x may be optional or required default value: use="x" value="...", where x may be default or fixed

of 33 ece 627, winter '1325 XML Schema data types built-in data types  numerical data: integer, Short, …  string: string, ID, IDREF, CDATA, …  date and time: time, Month, … user-defined data types  simple data types, which cannot use elements or attributes  complex data types, which can use these

of 33 ece 627, winter '1326 XML Schema data types (2) complex data types are defined from already existing data types by defining some attributes (if any) and using:  sequence, a sequence of existing data type elements (order is important)  all, a collection of elements that must appear (order is not important)  choice, a collection of elements, of which one will be chosen

of 33 ece 627, winter '1327 XML Schema data type extension already existing data types can be extended by new elements or attributes <element name=" " type="string" minOccurs="0" maxOccurs="1"/>

of 33 ece 627, winter '1328 XML Schema data type restriction an existing data type may be restricted by adding constraints on certain values (it is not the opposite process from extension) the following hierarchical relationship still holds:  instances of the restricted type are also instances of the original type (they satisfy at least the constraints of the original type and some new ones)

of 33 ece 627, winter '1329 XML Schema data type restriction – example <element name="firstname" type="string" minOccurs="1" maxOccurs="2"/> <attribute name="title" type="string" use="required"/>

of 33 ece 627, winter '1330 XML Schema restriction of simple data types

of 33 ece 627, winter '1331 XML Schema namespaces a single XML document may use more than one DTD or schema in order to avoid clashes a different prefix for each DTD or schema can/should be used prefix:name

of 33 ece 627, winter '1332 XML Schema namespaces namespaces are declared within an element and can be used in that element and any of its children (elements and attributes) a namespace declaration has the form: xmlns:prefix="location" location is the address of the DTD or schema if a prefix is not specified: xmlns="location" then the location is used by default

of 33 ece 627, winter '1333 XML Schema namespaces – example <… xmlns=" xmlns:staff=" <staff:facultystaff:title=“professor" staff:name="John Smith" staff:department=”ECE"/> <academicStafftitle="lecturer" name=”Jenny Doe" school="Information Technology"/>