PadhaikoAll subjects

Past exam question: 2081 Chaitra (Regular), Q4(a)

Foundation of Data Science · 3 marks

Open in the Padhaiko app

Topic: Types of Data, Preprocessing Needs & Data Collection

Question

What is semi-structured data? How it is different than structured and unstructured data? Explain briefly.

Solution

Definition of Semi-Structured Data: Semi-structured data is information that does not conform to the rigid tabular format of relational database management systems (RDBMS with fixed rows and typed columns), but is not completely unorganized. Instead, it contains internal semantic tags, markers, key-value pairs, or hierarchical nesting that segregate data elements and enforce structural relationships.

Because each data record can carry its own self-describing schema, entities within the same dataset can possess varying attributes or optional fields without breaking a global schema. Common representations include JSON, XML, YAML, and document-oriented NoSQL databases (e.g., MongoDB, CouchDB).

Structural Comparison: Structured vs. Semi-Structured vs. Unstructured Data: The three data types differ fundamentally in schema rigidity, data modeling, storage, and querying flexibility:

CharacteristicStructured DataSemi-Structured DataUnstructured Data
Schema ParadigmSchema-on-write: Rigid, predefined schema required before inserting data.Schema-on-read / Self-describing: Schema is embedded within the data items.No schema: Lacks predefined conceptual data model or schema.
Data Organization2D relational tables (rows and columns).Hierarchical trees, key-value pairs, nested lists, graphs.Non-tabular, free-form binary or text sequences.
Formats & SourcesSQL databases (PostgreSQL, MySQL), CSV, relational spreadsheets.JSON, XML, YAML, NoSQL documents, REST API payloads, server logs.Raw text documents (PDF, Word), images, audio, video recordings.
Querying MechanismStructured Query Language (SQL) with strict joins and indexes.Path-based queries (JSONPath, XPath, XQuery, NoSQL aggregation pipelines).Full-text search, information retrieval, deep learning feature extractors (NLP, CNNs).
Schema EvolutionExpensive: requires ALTER TABLE migrations and downtime.Highly flexible: new fields can be added to individual records dynamically.Flexible: no schema constraints to maintain.
Answer:

Semi-structured data lacks a rigid tabular database schema but contains internal tags, keys, and hierarchical markers that make it self-describing (e.g., JSON, XML). It differs from structured data (which enforces a strict predefined relational table schema) and unstructured data (which possesses no formal structure, such as images, audio, or free-form text) by providing flexible, nested organization without requiring a rigid schema.

All past exam questions for Foundation of Data Science