Recursive Functions Creating Hierarchical Reports Date: 9/30/2008 Dan McCreary President Dan McCreary & Associates (952) 931-9198 M.

Slides:



Advertisements
Similar presentations
Minnesota Department of Education Metadata Registry Case Study Date: October 31 st, 2008 Dan McCreary President Dan McCreary & Associates
Advertisements

XML: Extensible Markup Language
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
An Introduction to XML Based on the W3C XML Recommendations.
1 XQuery Syntax Dan McCreary May, Basic Syntax XQuery vs. XML Where do we put… –Curly braces "{" and "} " –Parenthesis " (" and ") " –Square Brackets.
Contensis Training How do I Create a new Web Page.
Using oXygen Using oXygen to build and execute XQuery applications on eXist Date: September 2008 Dan McCreary President Dan McCreary & Associates
Visual Web Information Extraction With Lixto Robert Baumgartner Sergio Flesca Georg Gottlob.
1 COS 425: Database and Information Management Systems XML and information exchange.
Best Practices for Website Design & Web Content Management.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
XML(EXtensible Markup Language). XML XML stands for EXtensible Markup Language. XML is a markup language much like HTML. XML was designed to describe.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
A02 Creating my website NAME ______________. UNIT 2 – A02 – Creating my Website The purpose of this assessment objective is to create 5 web pages containing.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
4/20/2017.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryForm is used to create data entry.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
XML, distributed databases, and OLAP/warehousing The semantic web and a lot more.
131 Agenda Overview Review Roles Lists Libraries Columns.
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
Software All parts of the computer people can NOT touch, such as programs, files, documents and any other data.
DATABASE and XML Moussa Mané. Learning Objectives ● Learn about Native XML Databases ● Learn about the conversion technology available ● Understand New.
DocuShare Training Welcome to DocuShare Training.
Enterprise Service Bus Lowering the cost of integration Date: 9/1/2009 Dan McCreary President Dan McCreary & Associates (952)
Using Visual Basic 6.0 to Create Web-Based Database Applications
Lesson 1 -What is a Database? -Fields and Records
Unit 1 – Web Concepts Instructor: Brent Presley. ASSIGNMENT Read Chapter 1 Complete lab 1 – Installing Portable Apps.
Sample Auto-generated XForms With XQuery Date: 1/17/2009 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
Styling XForms Using CSS to make your forms look great Date: 10/9/2008 Dan McCreary President Dan McCreary & Associates (952)
WEB DESIGN UNIT 2 Unit 2 Module 2-5. WHAT HAVE YOU LEARNED?  What is the title tag do? Where does it show?  What are the tags that need to be on every.
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
HTML Hyper Text Markup Language A simple introduction.
Metadata Management Case Study Date: 10/21/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 27 How Internet Searching Works.
EXist Indexing Using the right index for you data Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M.
HTML: Hyptertext Markup Language Doman’s Sections.
XQuery Functions Reusing XQuery Code Date: September, 2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates
Getting Started Managing a Collaboration Site Kendra Holly SharePoint Analyst June 13, 2015.
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
XRX Basic CRUDS Create, Read, Update and Delete and Search XML Data Date: May 2011 Dan McCreary President Dan McCreary & Associates
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
Knowledge Management Platform Communities of Practice User Guide for CoP users Copyright © 2010 Group Technology Solutions. All Rights Reserved.
Tutorial support.ebsco.com Core Collections Complete.
MA-401 Autodesk Inventor Project Files Revisited Autodesk Inventor Project Files Revisited MA401 Instructor: Dennis Jeffrey, AICE, MICE.
CO1552 – Web Application Development Further JavaScript: Part 1: The Document Object Model Part 2: Functions and Events.
XQuery Labs Basic Reporting Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
2004/051 >> Supply Chain Solutions That Deliver Users.
Working with XML. Markup Languages Text-based languages based on SGML Text-based languages based on SGML SGML = Standard Generalized Markup Language SGML.
1 The tree data structure Outline In this topic, we will cover: –Definition of a tree data structure and its components –Concepts of: Root, internal, and.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
UPLOADING DOCUMENTS IN MURA. Two Options 1.Upload as a “page” in your navigation (preferred)  Easier to find, delete and maintain  Can upload revisions.
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
Data Virtualization Tutorial: XSLT and Streaming Transformations
Dan McCreary President Dan McCreary & Associates (952) M D
SharePoint Information Architecture
The XML Language.
CS 3870/CS 5870 Prog 6 Site Map.
More Loops.
Manage your documents CIRCABC Module 1 DIGIT A3
Sequences in XQuery Core data structure of XQuery Date: 8/25/2009
A02 Creating my website NAME ______________.
XRX Diagrams Application Architecture Diagrams Date: Aug 21st, 2008
Presentation transcript:

Recursive Functions Creating Hierarchical Reports Date: 9/30/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions

M D Copyright 2008 Dan McCreary & Associates2 Module Outline Why use recursive functions? Sitemap example Taxonomy example

M D Copyright 2008 Dan McCreary & Associates3 Why Use Recursive Functions? Allows developers to create very simple data structures Allows hierarchical views of data Recursive functions are usually very short Allows developers to put different types of data at any level of a document

M D Copyright 2008 Dan McCreary & Associates4 What is Recursion? Functions that call themselves Ideal for: –Containers that contain containers –Folders that contain sub-folders –Collections that contain sub-collections –Groupings that have sub-groupings –Classification systems that have sub- classification systems (aka Taxonomies)

M D Copyright 2008 Dan McCreary & Associates5 For Loop vs. Recursion root row root branch for-loop branch recursion

M D Copyright 2008 Dan McCreary & Associates6 branch How Does It Work? Imagine a bug crawling up a tree. When it hits a branch it spawns a new bug for each branch. branch

M D Copyright 2008 Dan McCreary & Associates7 Site Map Example Sitemaps are web pages that present a summary of the structure of a web site Each collection can be associated with a content area Collections can be moved at any time so you don’t want to have to manually build a site map

M D Copyright 2008 Dan McCreary & Associates8 Site Maps with eXist Each collection will be a content area Create a function that will list all the child- collections of any given collection Allow that function to call itself Start at the site root node and get all child collections Use HTML nested lists to display the results

M D Copyright 2008 Dan McCreary & Associates9 Sample Web Site Hierarchy /db webroot faqsproductssupportabout xquery training xforms tei Start here eXistrest

M D Copyright 2008 Dan McCreary & Associates10 Using oXygen to Create Collections right click over collection

M D Copyright 2008 Dan McCreary & Associates11 get-child-collections() This function takes a single input collection path returns a a set of strings, each string is a child of the current collection xmldb:get-child-collections($collection as xs:string) as xs:string* let $children := xmldb:get-child-collections(‘/db/webroot’) From documentation: Example:

M D Copyright 2008 Dan McCreary & Associates12 Testing get-child-collections xquery version "1.0"; let $children := xmldb:get-child-collections('/db/webroot') return {$children} about faqs training products support Output: XQuery:

M D Copyright 2008 Dan McCreary & Associates13 For Loop about faqs training products support xquery version "1.0"; { for $child in xmldb:get-child-collections('/db/webroot') return {$child} } XQuery: Output:

M D Copyright 2008 Dan McCreary & Associates14 Declare Sitemap Function declare function local:sitemap($collection as xs:string) as node()* { for $child in xmldb:get-child-collections($collection) return {$child} {local:sitemap(concat($collection, '/', $child))} };

M D Copyright 2008 Dan McCreary & Associates15 Test Function xquery version "1.0"; declare function local:sitemap($collection as xs:string) as node()* { for $child in xmldb:get-child-collections($collection) return {$child} {local:sitemap(concat($collection, '/', $child))} }; {local:sitemap('/db/webroot')}

M D Copyright 2008 Dan McCreary & Associates16 Results about faqs training xforms rest xquery products support

M D Copyright 2008 Dan McCreary & Associates17 HTML Output Sitemap {local:sitemap('/db/webroot')}

M D Copyright 2008 Dan McCreary & Associates18 HTML UL Output

M D Copyright 2008 Dan McCreary & Associates19 Adding HTML Links declare function local:sitemap($collection as xs:string) as node()* { for $child in xmldb:get-child-collections($collection) return <a href="{concat('/exist/rest', $collection, '/', $child)}">{$child} {local:sitemap(concat($collection, '/', $child))} };

M D Copyright 2008 Dan McCreary & Associates20 Output

M D Copyright 2008 Dan McCreary & Associates21 Adding Level Add another parameter called “level” to the sitemap function that is of type integer. Start the root with level 0 and increment the level each time you call yourself {local:sitemap('/db/webroot')}

M D Copyright 2008 Dan McCreary & Associates22 Adding Titles Most Sitemaps create a “user friendly” title that might include mixed case and spaces. Create a lookup table that stores a label or title for each collection. The title might include spaces and other special characters that are not used in collection names. /db/webroot/training Training /db/webroot/faqs Frequently Asked Questions $title := $code-table/item[$path=path]/title

M D Copyright 2008 Dan McCreary & Associates23 Output

M D Copyright 2008 Dan McCreary & Associates24 Taxonomy A hieratical classification system based on subject areas Thing PersonLocationEventPublication BookBlogArticle

M D Copyright 2008 Dan McCreary & Associates25 Taxonomy Lab Create a simple hierarchical taxonomy management system similar to the Dewey decimal system for libraries. Put individual items in XML files. Call the root item “Thing”. Create narrower terms for “Person”, “Event”, “Organization”, “Place” and “Publication” Each “item” has one-and-only-one broader term. Create functions for get-narrower-items(), and get-hierarchy() 3 Person An individual Human Being 1

M D Copyright 2008 Dan McCreary & Associates26 Thank You! Please contact me for more information: Native XML Databases Metadata Management Metadata Registries Service Oriented Architectures Business Intelligence and Data Warehouse Semantic Web Dan McCreary, President Dan McCreary & Associates Metadata Strategy Development (952)