XPath and XQuery: Navigating and Querying XML Documents, Study notes of Combinatorics

Xpath and xquery are languages used for navigating and extracting data from xml documents. Xpath provides a 'path like' syntax for identifying nodes, while xquery is a query language for extracting elements and attributes. Both are w3c recommendations and are supported by various xml processing libraries and tools. Rdf, the resource description framework, is an application of xml used for describing internet resources and their metadata.

Typology: Study notes

2018/2019

Uploaded on 02/16/2019

sivakumar-ajanthan
sivakumar-ajanthan 🇸🇬

1 document

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
XPath (XML Path Language) is a query language for selecting nodes from an XML document.
In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values)
from the content of an XML document. XPath was defined by the World Wide Web Consortium
(W3C).[1]
The XPath language is based on a tree representation of the XML document, and provides the
ability to navigate around the tree, selecting nodes by a variety of criteria.[2][3] In popular use
(though not in the official specification), an XPath expression is often referred to simply as "an
XPath".
Originally motivated by a desire to provide a common syntax and behavior model between
XPointer and XSLT, subsets of the XPath query language are used in other W3C specifications
such as XML Schema, XForms and the Internationalization Tag Set (ITS).
XPath has been adopted by a number of XML processing libraries and tools, many of which also
offer CSS Selectors, another W3C standard, as a simpler alternative to XPath.
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
pf3
pf4
pf5

Partial preview of the text

Download XPath and XQuery: Navigating and Querying XML Documents and more Study notes Combinatorics in PDF only on Docsity!

XPath ( XML Path Language ) is a query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C).[1]

The XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria.[2][3]^ In popular use (though not in the official specification), an XPath expression is often referred to simply as "an XPath".

Originally motivated by a desire to provide a common syntax and behavior model between XPointer and XSLT, subsets of the XPath query language are used in other W3C specifications such as XML Schema, XForms and the Internationalization Tag Set (ITS).

XPath has been adopted by a number of XML processing libraries and tools, many of which also offer CSS Selectors, another W3C standard, as a simpler alternative to XPath.

  • 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

What is XQuery?

  • XQuery is the language for querying XML data
  • XQuery for XML is like SQL for databases
  • XQuery is built on XPath expressions
  • XQuery is supported by all major databases
  • XQuery is a W3C Recommendation

XQuery is About Querying XML

XQuery is a language for finding and extracting elements and attributes from XML documents.

Here is an example of what XQuery could solve:

"Select all CD records with a price less than $10 from the CD collection stored in cd_catalog.xml"

XQuery and XPath

XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators. If you have already studied XPath you will have no problems with understanding XQuery.

XQuery - Examples of Use

XQuery can be used to:

  • Extract information to use in a Web Service
  • Generate summary reports
  • Transform XML data to XHTML
  • Search Web documents for relevant information

XQuery is a W3C Recommendation

The Resource Description Framework (RDF) is a general framework for

how to describe any Internet resource such as a Web site and its content.

An RDF description (such descriptions are often referred to as metadata, or

"data about data") can include the authors of the resource, date of creation

or updating, the organization of the pages on a site (the sitemap),

information that describes content in terms of audience or content rating,

key words for search engine data collection, subject categories, and so

forth. The Resource Description Framework will make it possible for

everyone to share Web site and other descriptions more easily and for

software developers to build products that can use the metadata to provide

better search engines and directories, to act as intelligent agents, and to

give Web users more control of what they're viewing. The RDF is an

application of another technology, the Extensible Markup Language (XML),

and is being developed under the auspices of the World Wide Consortium (

W3C).

Benefits

Here are some of the likely benefits:

  • By providing a consistent framework, RDF will encourage the

providing of metadata about Internet resources.

  • Because RDF will include a standard syntax for describing and

querying data, software that exploits metadata will be easier and

faster to produce.

  • The standard syntax and query capability will allow applications to

exchange information more easily.

  • Searchers will get more precise results from searching, based on

metadata rather than on indexes derived from full text gathering.

  • Intelligent software agents will have more precise data to work with.

@prefix rdf: . #URI from W3.org @prefix rdfs: . #URI from W3.org @prefix mod: . @prefix obu: . obu:Module rdf:type rdf:Class. #Define RDF class

#OBU modules mod:U08027 a obu:Module ; obu:module-name "CURRENT RESEARCH";

obu:lecturer "Teo Kim Heng"; obu:Module_Status "Single"; obu:Pre_requisites "NO"; obu:Semester_it_runs_in "3"; obu:Level "4"; obu:Type "Compulsory".

mod:U08025 a obu:Module ; obu:module-name "FOUNDATIONS OF COMPUTATION"; obu:lecturer "Teo Kim Heng"; obu:Module_Status "Single"; obu:Pre_requisites "NO"; obu:Semester_it_runs_in "2"; obu:Level "4"; obu:Type "Compulsory".