H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

Similar documents
One of the main selling points of a database engine is the ability to make declarative queries---like SQL---that specify what should be done while

Semi-structured Data. 8 - XPath

XML & Databases. Tutorial. 3. XPath Queries. Universität Konstanz. Database & Information Systems Group Prof. Marc H. Scholl

XML databases. Jan Chomicki. University at Buffalo. Jan Chomicki (University at Buffalo) XML databases 1 / 9

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

TDDD43. Theme 1.2: XML query languages. Fang Wei- Kleiner h?p:// TDDD43

2.2 Syntax Definition

XPath Expression Syntax

XML Technologies. Doc. RNDr. Irena Holubova, Ph.D. Web pages:

Seleniet XPATH Locator QuickRef

Informatics 1: Data & Analysis

XPath Lecture 34. Robb T. Koether. Hampden-Sydney College. Wed, Apr 11, 2012

Course: The XPath Language

Query Languages for XML

XPath. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Introduction to XQuery. Overview. Basic Principles. .. Fall 2007 CSC 560: Management of XML Data Alexander Dekhtyar..

Navigating Input Documents Using Paths4

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Navigating an XML Document

XPath and XQuery. Introduction to Databases CompSci 316 Fall 2018

Progress Report on XQuery

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

(Refer Slide Time: 06:01)

Burrows & Langford Appendix D page 1 Learning Programming Using VISUAL BASIC.NET

Navigation. 3.1 Introduction. 3.2 Paths

XML Data Management. 5. Extracting Data from XML: XPath

COPYRIGHTED MATERIAL. Contents. Part I: Introduction 1. Chapter 1: What Is XML? 3. Chapter 2: Well-Formed XML 23. Acknowledgments

Comp 336/436 - Markup Languages. Fall Semester Week 9. Dr Nick Hayward

Informatics 1: Data & Analysis

The XQuery Data Model

XPath an XML query language

XML: Extensible Markup Language

Course: The XPath Language

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

516. XSLT. Prerequisites. Version 1.2

XML Data Management. 6. XPath 1.0 Principles. Werner Nutt

Index-Driven XQuery Processing in the exist XML Database

TMQL issues. October 14, slide 1

MarkLogic Server. Content Processing Framework Guide. MarkLogic 9 May, Copyright 2018 MarkLogic Corporation. All rights reserved.

Pre-Discussion. XQuery: An XML Query Language. Outline. 1. The story, in brief is. Other query languages. XML vs. Relational Data

StreamServe Persuasion SP5 XMLIN

Informatics 1: Data & Analysis

Part VII. Querying XML The XQuery Data Model. Marc H. Scholl (DBIS, Uni KN) XML and Databases Winter 2005/06 153

Compilers and computer architecture From strings to ASTs (2): context free grammars

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p.

An introduction to searching in oxygen using XPath

Querying XML. COSC 304 Introduction to Database Systems. XML Querying. Example DTD. Example XML Document. Path Descriptions in XPath

Introduction to XPath

(Refer Slide Time: 02.06)

Computer Science E-259

Information Systems. XML Essentials. Nikolaj Popov

XML in Databases. Albrecht Schmidt. al. Albrecht Schmidt, Aalborg University 1

Informatics 1: Data & Analysis

DOM Interface subset 1/ 2

4D2b Navigating an XML Document

Chapter 13 XML: Extensible Markup Language

Translating HornlogEq RuleML to Grailog for SVG Visualization. Leah Bidlake RuleML Webinar June 20, 2016

from XMLAttributes Author: Jan-Eike Michels Source: U.S.A. Status: SQL:2003 TC and SQL:200x WD change proposal Date: March 8, 2004

Trees (Part 1, Theoretical) CSE 2320 Algorithms and Data Structures University of Texas at Arlington

CSI33 Data Structures

RDF Twig Accessing RDF Graphs in XSLT

Chapter 2 XML, XML Schema, XSLT, and XPath

2006 Martin v. Löwis. Data-centric XML. XPath

Semistructured data, XML, DTDs

Computer Science 210 Data Structures Siena College Fall Topic Notes: Trees

Solution Sheet 5 XML Data Models and XQuery

CS 151. Binary Trees. Friday, October 5, 12

COMP9321 Web Application Engineering. Extensible Markup Language (XML)

CSE 12 Abstract Syntax Trees

Binary Trees

Semantic Characterizations of XPath

Algorithms. Deleting from Red-Black Trees B-Trees

Part XII. Mapping XML to Databases. Torsten Grust (WSI) Database-Supported XML Processors Winter 2008/09 321

Hypermedia and the Web XSLT and XPath

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University

XSLT: How Do We Use It?

Semistructured Data and XML

Intro to XML. Borrowed, with author s permission, from:

Trees. Carlos Moreno uwaterloo.ca EIT

Outline of this part (I) Part IV. Querying XML Documents. Querying XML Documents. Outline of this part (II)

6/3/2016 8:44 PM 1 of 35

FOUNDATIONS OF DATABASES AND QUERY LANGUAGES

Manipulating XML in Visual Basic

Programming II (CS300)

A new generation of tools for SGML

Transcript of Abel Braaksma's Talk on XSLT Streaming at XML Prague 2014

Example using multiple predicates

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University

CSC Web Technologies, Spring Web Data Exchange Formats

DBS2: Exkursus XQuery and XML-Databases. Jan Sievers Jens Hündling Lars Trieloff

Evaluating XPath Queries

CSCI2100B Data Structures Trees

Practice Problems for the Final

Flat triples approach to RDF graphs in JSON

EMERGING TECHNOLOGIES. XML Documents and Schemas for XML documents

An Algorithm for Streaming XPath Processing with Forward and Backward Axes

SMURF Language Reference Manual Serial MUsic Represented as Functions

Chapter 1 Readme.doc definitions you need to know 1

XML and Databases. Lecture 9 Properties of XPath. Sebastian Maneth NICTA and UNSW

March 20/2003 Jayakanth Srinivasan,

Transcription:

1. (4 points) Of the following statements, identify all that hold about architecture. A. DoDAF specifies a number of views to capture different aspects of a system being modeled Solution: A is true: B. We can abstract out the interactions and policy points from DoDAF operational views 2. (32 points) Of the following statements, identify all that hold about metadata and XML. A. Electronic documents were exchanged by businesses long before XML and even before the Internet came into being Solution: A is true: B. A major benefit of metadata is to facilitate the exchange of data over time C. A major disadvantage of Comma Separated Values with respect to XML is that XML better enables us to express nested structure Solution: C is true: there is no explicit nesting in CSV, but there is in XML D. Sometimes people can create different URIs for the same XML namespace and as a result what they think are different namespaces are treated by the XML processor as the same namespace Solution: D is false: the URI is simply a name of a namespace; an XML processor is not expected to determine whether two URIs refer to the same namespace E. Using a URI that includes the domain name of another company is not only bad form, it is risky because the other company could change the resource pointed to by that URI; for this reason, a URI such as http://www.ncsu.edu/fb77 is unsuitable as an identifier for a namespace for anyone not affiliated with NCSU Solution: E is false: which URI is used to identify a namespace is simply a matter of convention; no physical resource need exist; it means nothing other than what we want it to mean F. Using a URI such as http://localhost/fb77 that includes a relative address is risky because it means different things on different computers Solution: F is false: which URI is used to identify a namespace is simply a matter of convention; no physical resource need exist; it means nothing other than what we want it to mean and has no dependence on which computer we might be thinking of G. Whereas in most beginner tutorials an XML document has a single root, in real-life settings a complex XML document may have two or more roots, e.g., one for comments and one for the main body Page 1 of 5

Solution: G is false: always one root H. A limitation of XML is that although it expresses trees it cannot express complex data structures such as undirected, weighted graphs Solution: H is false: XML can be used to express any data structure I. The snippet <! <anelement /> > means that a node for element anelement is placed as a child of the given comment node Solution: I is false: J. An element node can enclose attribute nodes as well as comment nodes, but an attribute node cannot enclose a comment node Solution: J is true: K. To represent information about a directed graph, it is best to specify an element for each vertex V that takes an attribute for V s identifier and another attribute containing a string of the identifiers of the target vertices of the edges that emanate from V Solution: K is false: we shouldn t have to parse an attribute value to determine the vertices to which a given vertex is connected L. Using XML syntax for the XSLT language was an excellent design decision because it improved readability of XSLT stylesheets Solution: L is false: M. XML InfoSet specifies that comments may occur within attributes though most processors don t implement this feature Solution: M is false: N. By using a standard metadata language, programmers can avoid having to agree ahead of time on the specifics of the metadata they assign to the documents they exchange Solution: N is true: if programmers agree on the language, they and their programs can compute the meaning associated with a specific document as needed O. An element X may enclose two or more text nodes as long as any two consecutive text nodes are separated by other nodes, such as the subelements of X Solution: O is true: P. Text within elements is a convenience but anything that text can represent we can represent using attributes Page 2 of 5

Solution: P is true: 3. (22 points) Of the following statements, identify all that hold about XPath. A. The XPath expression child::song[@language] finds the attribute nodes named language that are children of the Song children of the context node Solution: A is false: it finds Song elements that are children of the context node and have an attribute named language B. Because the axis descendant is of principal type element, the XPath expression descendant::node() yields exactly the same nodes that descendant::element() yields Solution: B is false: C. Languages that are based on XPath derive part of their power from the ability to write loops in XPath using the * construct Solution: C is false: no loops in XPath D. For a context node that has one or more preceding siblings, the expression preceding::node()[1] finds the immediately preceding sibling Solution: D is true: E. The XPath descendant and ancestor axes are inverses of each other: each node is a descendant of each of its ancestors Solution: E is false: attributes are not F. In XPath, the descendant axis is the transitive closure of the child axis Solution: F is true: G. If an XPath expression E yields a node sequence consisting of exactly one element, then E[ 1] = E[last()] Solution: G is false: only integer filters from 1 to last() can produce a result; when there is an element, E[last()] produces an element H. For any XPath expression E, we have E[ 1 or 1] = E[true()] Solution: H is true: the effective Boolean value of 1 is true I. For any XPath expression E, we have E[ 1 + 1] = E[ 1 1] Solution: I is false: in general, E[ 2] E[1] J. For no XPath expression E, do we have E[ 1 or 1] = E[ 1] Page 3 of 5

Solution: J is false: when E yields the empty node sequence, all further selections from it yield the empty node sequence K. The self axis is defined for every element regardless of how deep it occurs in a tree Solution: K is true: 4. (16 points) Of the following statements, identify all that hold about XQuery. (Below, Set and Pred are functions and $x and $v are variables.) A. In XQuery, an easy way to increment a variable $x is to write let $x := $x + 1 Solution: A is false: no side effects in XQuery B. Because XQuery does not allow side effects on variables, we are sometimes forced to create solutions of exponential complexity for problems that would otherwise take solutions of polynomial complexity. An example is the problem of calculating the first n Fibonacci numbers. Fortunately, those problems are not real business problems Solution: B is false: C. Any XQuery query that produces a result must include exactly one return Solution: C is false: only each FLWOR expression must include exactly one return D. In XQuery, the collector variable paradigm works for a function that is recursive but not for two functions that are mutually recursive Solution: D is false: E. Given for $x in Sequence..., where Sequence is some expression whose evaluation terminates, if the body of the for terminates for each possible binding of $x, the entire for expression must terminate Solution: E is true: F. In XQuery, we can compute all the axes of XPath using no axes other than parent and child Solution: F is false: we can compute almost all of the axes; however, the attribute axis is not captured by any XQuery query involving just parent and child G. In for $x in Sequence..., the expression Sequence may seem to use $x but may not refer to the same $x that is declared in the current for construct Solution: G is true: Sequence should evaluate to the node sequence from which the values taken by $x are drawn and would be meaningless if it referred to the same $x H. In for $x in Sequence return Result, the expression Result may seem to use $x but may not refer to the same $x that is declared in the current for construct Page 4 of 5

Solution: H is false: Result should evaluate to the outputs for each binding of $x and not only may but usually must refer to the same $x (so as to access its binding value) 5. (16 points) Of the following statements, identify all that hold about XSLT. A. XSLT places many important expressions inside strings as values of attributes Solution: A is true: Much of the important work of XSLT is based on XPath expressions placed as values for the attributes match, test, and select B. In XSLT as studied in this course, XPath expressions occur only in three places: as values for the attributes match, test, and select C. Any XSLT stylesheet that does not explicitly use apply-templates is guaranteed to terminate Solution: C is true: by default, the application of templates would recurse down the tree and therefore terminate at nodes that have no children D. Any XSLT stylesheet that explicitly uses apply-templates on the context node s parent is guaranteed to terminate Solution: D is false: one could end up with a nonterminating execution where the parent invokes apply-templates on a child and the child on the parent E. It is possible to define an XSLT template that (i.e., the same template) handles both recursion going down the document tree and up the document tree Solution: E is true: F. In XSLT, we can generate element nodes whose names are not fixed a priori, but rather are determined programmatically at run time Solution: F is true: G. In XSLT, it is possible to have templates that match on the XPath expression / even though that expression corresponds to the unique root node that does not even occur within the main part of an XML document Solution: G is true: H. Any legal XPath expression, X, that evaluates to an element or set of elements may be used as a match pattern for an XSLT template Solution: H is true: Page 5 of 5