Semistructured Data Flashcards
1
Q
XML
A
- A markup language that annotates documents with tags
- The set of possible tags and their meanings is not fixed
2
Q
XML Elements
A
- Typically of a begin and end tag
- Can include nested child elements
3
Q
XML Attributes
A
- Specified within the element’s begin tag
- Describe the element
4
Q
ID, IDREF, and IDREFS
A
- ID: an identifier that must be unique among all ID attributes
- IDREF: a single value that is the value of an ID attribute elsewhere
- IDREFS: a list of ID values from elsewhere
5
Q
Capturing XML Relationships
A
- Option 1: store references from one element to other elements using ID, IDREF, and IDREFS
- Option 2: use child elements
6
Q
XML Documents as Trees
A
- Root element = root node of the tree
- Child element = child of node
- Empty or childless elements = leaf nodes
- Start tags are edge labels
7
Q
XPath Expressions
A
- Specify 1+ elements or attributes by providing a path to relevant nodes
8
Q
XPath /
A
- Path starts at the root of the document
9
Q
XPath //
A
- Selects elements from anywhere in the document
10
Q
XPath @
A
- Attribute names are preceded by an @
11
Q
XPath Predicates
A
- Surrounded by square brackets
- Applied to elements selected by the preceding path expression
- Use . to represent nodes selected by the preceding path
- Use .. to represent the parents of the nodes selected by the preceding path
12
Q
FLWOR for
A
- Similar to the FROM clause in SQL
- Iterates over all combinations of values from its XPath expressions
13
Q
FLWOR let
A
- Applied to each combo from the for clause
- Each variable gets the full set produced by its XPath expression
14
Q
FLWOR where
A
- Applied to the results of for and let
15
Q
FLWOR order by
A
- Use to sort the results