UNIT III XML DATABASES
• Structured data – Structured data is data whose
elements are addressable for effective analysis. It
has been organized into a formatted repository that
is typically a database. It concerns all data which can
be stored in database SQL in a table with rows and
columns. They have relational keys and can easily be
mapped into pre-designed fields. Today, those data
are most processed in the development and
simplest way to manage information. Example:
Relational data. Semi-Structured data –
• Semi-structured data is information that does
not reside in a relational database but that has
some organizational properties that make it
easier to analyze. With some processes, you
can store them in the relation database (it
could be very hard for some kind of semi-
structured data), but Semi-structured exist to
ease space. Example: XML data.
• Unstructured data – Unstructured data is a data
which is not organized in a predefined manner or
does not have a predefined data model, thus it is
not a good fit for a mainstream relational database.
So for Unstructured data, there are alternative
platforms for storing and managing, it is
increasingly prevalent in IT systems and is used by
organizations in a variety of business intelligence
and analytics applications. Example: Word, PDF,
Text, Media logs.
XML Hierarchical Data Model
XML Documents
Document Type Definition
XML Schema
XML Documents and Database
• Different approaches for storing XML documents are as
given below:A RDBMS or object-oriented database
management system is used to store XML document in
the form of text.
• A tree model is very useful to store data elements
located at leaf level in tree structure.
• The large amount of data is stored in the form of
relational database or object-oriented databases. A
middleware software is used to manage communication
between XML document and relational database.
XML Query:
• XML query is based on two methods.
1. Xpath:Xpath is a syntax for defining parts or elements of
XML documents.
• Xpath is used to navigate between elements and attributes
in the XML documents.
• Xpath uses path of expressions to select nodes in XML
documents.
• Example:
In this example, the tree structure of employee is
represented in the form of XML document.
• Xquery:Xquery is a query and functional programming
language. Xquery provides a facility to extract and manipulate
data from XML documents or any data source, like relational
database.
• The Xquery defines FLWR expression which supports iteration
and binding of variable to intermediate results.
FLWR is an abbreviation of FOR, LET, WHERE, RETURN. Which
are explained as follows:
FOR: Creates a sequence of nodes.
LET: Binds a sequence to variable.
WHERE: Filters the nodes on condition.
RETURN: It is query result specification.
• Xquery comparisons:
• The two methods for Xquery comparisons are as follows:
1. General comparisons: =, !=, <=, >, >=
Example:
In this example, the expression (Query) can return true value if any attributes have a
value greater than or equal to 15000.
$ TVStore//TV/price > =15000
2. Value comparisons: eq, ne, lt, le, gt , ge
Example:
In this example, the expression (Query) can return true value, if there is only one
attribute returned by the expression, and its value is equal to 15000.
$ TVStore//TV/price eq 15000
Example:
Lets take an example to understand how to write a XMLquery.
xpath
• XPath is a major element in the XSLT standard.
• XPath can be used to navigate through elements
and attributes in an XML document.
• XPath stands for XML Path Language
• XPath uses "path like" syntax to identify and
navigate nodes in an XML document
• XPath contains over 200 built-in functions
• XPath is a major element in the XSLT standard
• XPath is a W3C recommendation
• XPath Path Expressions
• XPath uses path expressions to select nodes or
node-sets in an XML document.
• These path expressions look very much like
the path expressions you use with traditional
computer file systems:
• XPath Standard Functions
• XPath includes over 200 built-in functions.
• There are functions for string values, numeric values,
booleans, date and time comparison, node
manipulation, sequence manipulation, and much more.
• Today XPath expressions can also be used in JavaScript,
Java, XML Schema, PHP, Python, C and C++, and lots of
other languages.
• XPath is Used in XSLT
• XPath is a major element in the XSLT standard.
• With XPath knowledge you will be able to take
great advantage of your XSLT knowledge.

XML DATABASES in the Master of Engineering

  • 1.
    UNIT III XMLDATABASES
  • 2.
    • Structured data– Structured data is data whose elements are addressable for effective analysis. It has been organized into a formatted repository that is typically a database. It concerns all data which can be stored in database SQL in a table with rows and columns. They have relational keys and can easily be mapped into pre-designed fields. Today, those data are most processed in the development and simplest way to manage information. Example: Relational data. Semi-Structured data –
  • 3.
    • Semi-structured datais information that does not reside in a relational database but that has some organizational properties that make it easier to analyze. With some processes, you can store them in the relation database (it could be very hard for some kind of semi- structured data), but Semi-structured exist to ease space. Example: XML data.
  • 4.
    • Unstructured data– Unstructured data is a data which is not organized in a predefined manner or does not have a predefined data model, thus it is not a good fit for a mainstream relational database. So for Unstructured data, there are alternative platforms for storing and managing, it is increasingly prevalent in IT systems and is used by organizations in a variety of business intelligence and analytics applications. Example: Word, PDF, Text, Media logs.
  • 5.
  • 9.
  • 11.
  • 15.
  • 20.
    XML Documents andDatabase • Different approaches for storing XML documents are as given below:A RDBMS or object-oriented database management system is used to store XML document in the form of text. • A tree model is very useful to store data elements located at leaf level in tree structure. • The large amount of data is stored in the form of relational database or object-oriented databases. A middleware software is used to manage communication between XML document and relational database.
  • 21.
    XML Query: • XMLquery is based on two methods. 1. Xpath:Xpath is a syntax for defining parts or elements of XML documents. • Xpath is used to navigate between elements and attributes in the XML documents. • Xpath uses path of expressions to select nodes in XML documents. • Example: In this example, the tree structure of employee is represented in the form of XML document.
  • 22.
    • Xquery:Xquery isa query and functional programming language. Xquery provides a facility to extract and manipulate data from XML documents or any data source, like relational database. • The Xquery defines FLWR expression which supports iteration and binding of variable to intermediate results. FLWR is an abbreviation of FOR, LET, WHERE, RETURN. Which are explained as follows: FOR: Creates a sequence of nodes. LET: Binds a sequence to variable. WHERE: Filters the nodes on condition. RETURN: It is query result specification.
  • 23.
    • Xquery comparisons: •The two methods for Xquery comparisons are as follows: 1. General comparisons: =, !=, <=, >, >= Example: In this example, the expression (Query) can return true value if any attributes have a value greater than or equal to 15000. $ TVStore//TV/price > =15000 2. Value comparisons: eq, ne, lt, le, gt , ge Example: In this example, the expression (Query) can return true value, if there is only one attribute returned by the expression, and its value is equal to 15000. $ TVStore//TV/price eq 15000 Example: Lets take an example to understand how to write a XMLquery.
  • 24.
    xpath • XPath isa major element in the XSLT standard. • XPath can be used to navigate through elements and attributes in an XML document. • XPath stands for XML Path Language • XPath uses "path like" syntax to identify and navigate nodes in an XML document • XPath contains over 200 built-in functions • XPath is a major element in the XSLT standard • XPath is a W3C recommendation
  • 25.
    • XPath PathExpressions • XPath uses path expressions to select nodes or node-sets in an XML document. • These path expressions look very much like the path expressions you use with traditional computer file systems:
  • 26.
    • XPath StandardFunctions • XPath includes over 200 built-in functions. • There are functions for string values, numeric values, booleans, date and time comparison, node manipulation, sequence manipulation, and much more. • Today XPath expressions can also be used in JavaScript, Java, XML Schema, PHP, Python, C and C++, and lots of other languages.
  • 27.
    • XPath isUsed in XSLT • XPath is a major element in the XSLT standard. • With XPath knowledge you will be able to take great advantage of your XSLT knowledge.