Docsity

XML Query Languages: XQL and XML-QL Comparison, Slides of Information Security and Markup Languages

Partial preview of the text

Download XML Query Languages: XQL and XML-QL Comparison and more Slides Information Security and Markup Languages in PDF only on Docsity!

The Problem (DBMS Vs Docs) 

3-level hierarchy: table, record and field

Order is not part of the information

Strings in separate fields are separate

Location of data is not generally significant

Linking is far more often part of the data, not part of the schema representing data

Goals 

Data Model

Based on XML Infoset

Query Operators

Query Language

General Requirements 

Syntax Binding

MAY have more than one syntax binding

Declarativity

MUST be declarative

Protocol Independence

MUST be defined independently of any

protocols

Error Conditions

XML Query Functionality (1)

Quantifiers

MUST include support for both Universal and

Existential Quantifiers

Hierarchy and Sequence

MUST support operations on hierarchy and

sequence of document structures

Aggregation

MUST allow computing summary information

XML Query Functionality (3) 

Structural Transformation

MUST be able to transform and create new

structures

References

MUST be able to traverse intra- and inter-

document references

Text and Element Boundaries

MUST handle text across element boundaries

XML Query Functionality (4) 

Operation on Schemas

MUST be able to access Schemas or DTDs

Extensibility

SHOULD support the use of externally

defined functions

Operation on Names

MUST perform simple operations on names

MAY perform more powerful operations

XML Query Data Model (1) 

Datatypes

MUST represent XML 1.0 data as well as

simple and complex types of XML Schema

References

MUST include support for references, both,

internal and external

Schema Availability

MUST query even in the absence of Schema

XML Query Data Model (2) 

Trees

Node-labeled

Edge-labeled

XML Query data model is a Node-labeled, tree-constructor representation

Node functions

Constructors

Accessors

Value Constructors 

Fourteen primitive XML Schema datatypes 

stringValue

boolValue

floatValue

doubleValue

decimalValue

timeDurValue

recurDurValue

binaryValue

urirefValue

idValue

idrefValue

qnameValue

entityValue

notationValue

Note: ValueNode replaces XPath’s TextNode

Example

xsi:schemaLocation = “http://www.mywebsite.com/PartSchema

http://www.mywebsite.com/PartSchema”

name=“nutbolt”>

Acme10.50

</p:part>

Data-Model (2)

parent(A1)

= Ref(E1)

prefix(N1)

= Ref(StringValue("p", Ref(Def_string)))

uri(N1)

= URIRefValue("http://www.mywebsite.com/PartSchema",

Ref(Def_uriReference))

parent(N1)

= Ref(E1)

Constraints on Data Model

Node References

Defined by the query system NOT by the

query language

Node Identity

The function ref is one-to-one onto

ref_equal(ref(n1), ref(n2))

equal(n1,n2)

Unique parent

Duplicate-free list of children

XQL Design (1)

Compact, easy to type and read

Simple for common cases

Embeddable in programs, scripts, URLs

Unique identification of each node

Declarative NOT procedural

Evaluation at any level in the document

Result in document order; no repeat node

XQL Design (2)

Superset of XSL

Closure is guaranteed ONLY if the implementation returns well-formed XMLdocuments