XML Introduction Flashcards
Fully Structured Data
This is where data in a relational model is structured and has to fit a schema, like Module(code, name).
Unstructured Data
Things like music and image files, where it is completely free on how to organise data.
Semi-structured Data
This contains no schema, and it flexible, but is also self-describing in a way.
Semi-structured Data model
A data model for the semi-structured data may be thought as a collection of nodes and edges in a tree-like manner.
Applications for semi-structured data
- Storing and sharing data on the web
- Storage of documents
- Data analytics and big data
Forms of semi-structured data
- XML
- JSON
- Simple key-value relationships
- Graphs
XML
XML files have a very similar structure to HTML files, where you have items in backets, <>, which descend to represent lower details in the tree.
XML Elements
Anything that is contained within an elements start tag and end tag, and can contain text, attributes and/or other elements.
<price>1.99</1.99>
</price>
Element Parents
Since we work in a top-down structure, we can nest elements within each other to declare hierarchy.
<person>
<student>
</student>
</person>
Attributes
Things that help define elements.
<person hair=”blonde”
</person
They can be very helpful in defining references.
Two ways of defining XML file format
DTD and XML Schema.
DTD
Document type definitions.
Provided information about the structure of the document.
DTD includes
- elements
- sub-elements
- attributes
<!DOCTYPE lecturers [
]>
Beginning of XML document.
Lecturers is the root name.
<!ELEMENT lecturers (lecturer+)>
+ means that there must be one or more lecturer in lecturer.