[SOLVED] Information Management

$25

File Name: Information_Management.zip
File Size: 207.24 KB

5/5 - (1 vote)

Information Management
Giovanni degli Studi di databases
Characteristics
Schema oriented

Copyright By Assignmentchef assignmentchef

ACID properties
Keep large amounts of persistent data
Thanks to transactions, they limit the complexity of the management of concurrency
Integration among multiple applications made possible through a shared database
(Mostly) standard relational model
Relational algebra for accessing data

Semi-structured data
(thanks to P. Samarati)
(some examples taken from Database Systems Concepts, Languages and Architectures, P. Atzeni, S. Ceri, S. Paraboschi and R. Torlone, McGraw-Hill)

Semi-structured data
Do not have a schema, or can respect it partly
XML: eXtensible Markup Language
Data properties expressed through markup of XML documents content
A model for the data can be specified (DTD, XML Schema) There are standardized query languages
Data separated from metadata
JSON: JavaScript Object Notation
Derived from JavaScript
Key-value pairs
Data are organized in batches and nested objects

XML syntax
XML files are composed of nested tags Each XML document has a root tag
All elements are enclosed in tags
Elements
Can be extended, can include children elements Have a content (can be empty)
Attributes
Are included in elements, cannot have children
Associate a value to elements without being part of their contents Have limitations

XML example (well-formed)


Databases Dewey Huey Louie Relational modeling Relational algebra SQL: Basic concepts SQL: Advanced concepts Design methodologies and concepts Database design process
ER model
Normalization

Namespaces and Schemas
Namespaces avoid ambiguities for elements/attributes names Collections of names identified by URI

Schemas permit to define a model for documents
Tags and their properties, cardinalities, domains, default values A document can be validated w.r.t. a schema
Schemas can be defined with DTD and XML Schema DTD simpler, but XML Schema more flexible

Permits to define elements and their cardinalities, and attributes
Can specify whether it contains children and their number




Types and constraints (required, implied, fixed)

DTD example


format (paperback|hardback) paperback
number CDATA #REQUIRED

XML Schema
More flexible than DTD
They are XML files themselves
They permit to define
Simple elements
Complex elements
Indicators (how often an element can occur) Attributes

XML Schema simple elements
Simple elements
Do not contain attributes nor other elements
Can have fixed or default values
Can be associated with restrictions (number of characters, sequence of characters, min/max value, list of values, )

XML Schema complex elements
Complex elements
Can contain attributes and other elements Can have indicators
any, all, choice, sequence: ordering among elements {min,max}Occurs: min/max number of occurrences, grouping



()


XML Schema attributes
Attributes
Can have default and fixed values
Can be optional
Can have restrictions (e.g., min/max value)

XML Schema example



















Querying XML documents
Idea: XML as a tree structure to be visited
Queries are based on XPath and FLWOR expression
For, Let, Where, Order, Return
Defines path expressions selecting the objects in a path
Can return a set of nodes, a Boolean value, numbers, strings
Paths are evaluated w.r.t. a context node
Current node (.), parent node (..)
Child of a node (/), descendant of a node (//), any node (*) Attribute of current node predicate ([]), position ([n])

XPath examples

1929 978-88-452-8147-1 Bompiani
Racconti di Pietroburgo Nikolaj Gogol 1842 978-88-07-90361-8 Feltrinelli doc(books.xml)/List/Book
doc(books.xml)/List/Book[Publisher= Feltrinelli AND @availability=Y] /Title
doc(books.xml)//Author doc(books.xml)/List/Book[1]/*

XQuery FLWOR expressions
FOR, LET
They declare variables, difference in bindings
It expresses conditions filtering objects produced by LET and FOR
It orders objects produced by LET and FOR
It generates the result of the query (node, forest, or value, and can include element constructors and references to variables)

XQuery example (1)
FOR $lib IN doc(books.xml)//Book FOR $auth IN $lib/Author
RETURN $auth
LET $lib := doc(books.xml)//Book RETURN $lib
FOR $lib IN doc(books.xml)//Book WHERE $lib/Publisher=Bompiani AND
RETURN $lib

XQuery example (2)
FOR $lib IN doc(books.xml)//Book WHERE $lib/Publisher=Bompiani
RETURN $lib/TitleFOR $lib IN doc(books.xml)//Book RETURN
$lib/Title, $lib/PublisherORDER BY(Title ASCENDING)

XQuery example (3)
{
let $author := doc(catalog.xml)//author
for $name in distinct-values($author/text())
order by $name
return
}

{$name}
for $book in doc(catalog.xml)//libro
where $book/author/text()=$name
} return $book/title

XML Vs. DBMS
RDBMS with extended capabilities
Interfaces for translating XML to/from relational
Interfaces for translating XML queries to relational queries (Loose) mapping between schemas
Native XML databases
They lose RDBMS functionalities but natively manage XML structures (e.g.,
element inclusion, ordering among siblings)
Appealing when data are poorly structured (e.g., schelamess)

CS: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Information Management
$25