/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, 20021 1. Extraction Operators Projection.

Slides:



Advertisements
Similar presentations
/ department of mathematics and computer science TU/e technische universiteit eindhoven WISE 2002December 12, RAL: an RDF Algebra Flavius Frasincar.
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
Relational Algebra Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
Lecture 12 – ADTs and Stacks.  Modularity  Divide the program into smaller parts  Advantages  Keeps the complexity managable  Isolates errors (parts.
/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002January 29, XAL - An XML ALgebra for Query Optimization.
Database Systems Chapter 6 ITM Relational Algebra The basic set of operations for the relational model is the relational algebra. –enable the specification.
By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and, in effect, increases the mental.
1 Indexing and Querying XML Data for Regular Path Expressions A Paper by Quanzhong Li and Bongki Moon Presented by Amnon Shochot.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
2/10/03Tucker, Sec Tucker, Applied Combinatorics, Sec. 3.2, Important Definitions Enumeration: Finding all of the possible paths in a rooted tree.
CIS607, Fall 2005 Semantic Information Integration Article Name: Clio Grows Up: From Research Prototype to Industrial Tool Name: DH(Dong Hwi) kwak Date:
Chapter 2: Algorithm Discovery and Design
Important Problem Types and Fundamental Data Structures
Induction and recursion
Trees and Tree Traversals Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Broadcast & Convergecast Downcast & Upcast
A TREE BASED ALGEBRA FRAMEWORK FOR XML DATA SYSTEMS
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 6 The Relational Algebra.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
School of Computer Science, The University of Adelaide© The University of Adelaide, Control Data Flow Graphs Further work on the definitions… Sue.
Systems of Linear Equations The Substitution Method.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
Discrete Structures Trees (Ch. 11)
Complexity of Functions with Cartesian GP and Recursion. John Woodward. School of Computer Science, The University of Birmingham, United Kingdom. 1 OVERVIEW.
Chap 8 Trees Def 1: A tree is a connected,undirected, graph with no simple circuits. Ex1. Theorem1: An undirected graph is a tree if and only if there.
Computer Science: A Structured Programming Approach Using C Graphs A graph is a collection of nodes, called vertices, and a collection of segments,
Mathematical Preliminaries
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Discrete Mathematics Chapter 5 Trees.
1 CS 430 Database Theory Winter 2005 Lecture 5: Relational Algebra.
CMPT 258 Database Systems Relational Algebra (Chapter 4)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus.
 A sequence is a list of objects arranged in a specific order.  A sequence in computer science is known as an array. An array hold objects of the same.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
LECTURE THREE RELATIONAL ALGEBRA 11. Objectives  Meaning of the term relational completeness.  How to form queries in relational algebra. 22Relational.
Algebra 2 June 18, 2016 Goals:   Identify functions in coordinate, table, or graph form   Determine domain and range of given functions.
Relational Algebra COMP3211 Advanced Databases Nicholas Gibbins
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Ritu CHaturvedi Some figures are adapted from T. COnnolly
COMP3017 Advanced Databases
BCS2143 – Theory of Computer Science
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
PDAs Accept Context-Free Languages
Algebra 2 September 16, 2018 Goals:
Chapter 3 The Relational Database Model
Identifying functions and using function notation
Chapter 6 Repetition Objectives ❏ To understand basic loop concepts:
Spanning Trees Discrete Mathematics.
The Relational Algebra and Relational Calculus
Graphs Chapter 11 Objectives Upon completion you will be able to:
Section 2-1: Functions and Relations
Graphs Part 2 Adjacency Matrix
Discrete Mathematics Lecture 6: Set and Function
FUNCTIONS.
Graphs.
Important Problem Types and Fundamental Data Structures
DAGs Longin Jan Latecki
Presentation transcript:

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Extraction Operators Projection Selection Unorder Join Cartesian Product Union Difference Intersection set-like operators (commutativity)

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Projection  [type, name](e: expression) = follows the edges of a given type and name from the input collection of vertices. The result is the collection of target vertices of the followed edges. The order of the output collection depends on the order of the input collection. type = E, A, R, D or disjunctions (|) of these name = regular expression over strings Example.  [E, (P|p)ainter[s]#)](e) produces all the target vertices of element containment edges that have names starting with Painter, painter, Painters, or painters, and that originate from the vertices in e.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Selection  [condition](e: expression) = selects input collection vertices fulfilling the given condition. The order of the output collection depends on the order of the input collection. In condition one can use projection operator, comparison operators (=, etc.), and logical operators (and, or, not). Example.  [  [A, name]=“Dali”](e: expression) selects all the vertices that have an attribute called name with the value “Dali”.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Unorder  (e: expression) = unorders an input collection. Unordering collections enables the definition of set-like (commutative) operators. ⋈, , , , and  are considering the order of the input collections in building the result. Unordering input collections enables the usage of their set-like variants (order is not important). Two vertices are equal if they have the same value.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Join (x: expression) ⋈ [condition] (y: expression) =  [condition](x  y) = the cartesian product is defined as two loops: the external loop traverses the left input collection and the internal loop traverses the right input collection. The pairs that fulfill the join condition form virtual vertices that have as outgoing edges, first the outgoing edges of the vertex from the left input collection and then the outgoing edges of the vertex from the right input collection preserving the original edge order.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Join (ctn’d) Example. (x:  [E, person](people)) ⋈ [  [A, id](x) =  [A, name](y)] (y:  [E, painter](painters)) pairs person and painter vertices in virtual vertices based on the equality of the id attribute value of a person and the name attribute value of a painter. Cartesian Product (x: expression)  (y: expression) = join without condition.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Difference (x: expression)  (y:expression) = the result is a collection containing vertices that exist in first collection but not in second one preserving the original vertex order of the left input collection. Intersection (x: expression)  (y:expression) = the result is a collection containing vertices that exist in both input collections preserving the original vertex order of the left input collection.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Union (x: expression)  (y:expression) = the result is a collection that contains first the left input collection, then the right input collection preserving the original vertex order. It can be easily generalized to an n-ary operator. Flexibility ensured by the fact that the input collections do not have to be “union compatible” as it was the case in relational algebra.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Meta-operators Map map[f](e: expression) = applies a given function f to each element of the input collection. The function results are concatenated in the output collection. All unary extraction operators have an inherent map operator associated to them. In the construction phase, the map operator is used explicitly to iterate not just over collection of vertices but also collection of edges.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Kleene Star  [f](e: expression) = repeats a given function f possibly infinite times starting with the given input collection. At each iteration the results of the function are added to the next function input. The order of the result collection depends on the order of the input collection and the recursion order. Compared with the map operator it includes in the result the input collection. When a fix point is reached (output = input) the repetition stops.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Construction Operators Create vertex vertex[type](value) = adds a new vertex with the given type and value to the graph. Example. v 1 : vertex[element](null) creates a vertex of type element which has a new value (id) given by the system (by a skolem function) and v 2 : vertex[string](“Dali”) creates a vertex of type string and value “Dali”.

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Create edge edge[type, name, parent](child) = adds a new edge with a given type, name, parent, and child vertex to the graph. Before inserting a new edge of type E, the resulting graph is checked for presence of loops among element containment edges. If such a loop is formed the operation is unsuccessful. Example. edge[E, painter, v 1 ](v 2 ) creates an edge of type E with name painter between two vertices (the vertices from the previous example).

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Examples Example. Copying a vertex v means creating a new vertex with the type and value of the original vertex: vertex[type(v)](value(v)). Example. Copying an edge e, involves copying also the parent and children vertices: edge[type(e), name(e), v p ](v c ) where v p = vertex[type(parent(e))](value(parent(e)), and v c = vertex[type(child(e))](value(child(e))).

/ department of mathematics and computer science TU/e eindhoven university of technology ADC 2002 (Extra)January 29, Example. Copying a complete graph starting from the vertex v can be done by copying all the graph edges and their associated vertices: map[edge[type(e), name(e), vertex[type(parent(e))](value(parent(e))) ](vertex[type(child(e))](value(child(e)))) ](e) where e = *[parentedge(  [E|A|D, #](child(x)))] (x: parentedge(  [E|A|D, #](v))) e represents all the edges in the original graph. For each original vertex a unique new vertex is created using a skolem function.