1 of 48

Unstructured Data - Interdisciplinary Perspectives

Course 2�Sources, Acquisition and Data Provenance

​

​

​

Diana Trandabat & Ionut Pistol�IIDT Master’s Programme · Faculty of Computer Science, UAIC Iași

​

​

2 of 48

2

Today's plan

Part

Focus

1

From question to source; found vs designed data

2

Web pages, APIs and access choices

3

Social media, archives, internal systems, sensors

4

Acquisition pipeline and provenance

5

Reproducibility, failure modes, claims and lab link

6

Exit ticket

3 of 48

3

By the end of today you can…

  • Choose a source that fits a research question, not simply one that is convenient.
  • Explain how unstructured data can be acquired from web pages, APIs, platforms, archives, internal systems and sensors.
  • Design a simple acquisition pipeline that preserves a raw layer and logs transformations.
  • Record enough provenance to say where an item came from, when, how, with what tool and under whose responsibility.
  • Distinguish an exact rerun from a reconstructable and auditable collection when sources change.

Core idea: every collection is an argument about what counts as relevant evidence.

4 of 48

4

Where we left off

From Lecture 1

Acquisition is already analysis: what is collected, how, and by whom shapes every later result.

  • Where can data come from, and who controls it?
  • How do we obtain it, and what can go wrong?
  • How do we keep a trail so that others — and our future selves — can inspect and repeat the work?

5 of 48

5

You need 10,000 complaints by Friday

Your turn

Question: what are the most common service problems reported by residents?

City website

Pick one first.

What does it make visible?

Open API

Pick one first.

What does it make visible?

Social media

Pick one first.

What does it make visible?

Internal CRM

Pick one first.

What does it make visible?

Call-centre audio

Pick one first.

What does it make visible?

Convenient ≠ representative · Accessible ≠ suitable · Large ≠ complete

6 of 48

6

Source choice is part of the method

Question

What exactly do we want to know?

Population

Whose behaviour or records should count?

Traces

Which observable traces can answer the question?

Sources

What can we actually collect?

Claim

What can we honestly say?

Selection bias can enter at acquisition, before any model is trained.

7 of 48

7

The landscape of sources I: public and platform sources

Source type

How you get it

Who controls it

Main risk

Public web

Browse, download, scrape

Site owner

Pages change or vanish

APIs

Requests to documented endpoints

Platform/provider

Access rules or schema change

Social media

API, export, research access

Platform

Algorithmic and user selection

Open-data portals

Bulk download / API

Public body

Aggregation, staleness, unclear method

Ask of every source: what is visible because of the source — and what is invisible because of it?

8 of 48

8

The landscape of sources II: institutional and machine-generated sources

Source type

How you get it

Who controls it

Main risk

Archives & libraries

Access request, catalogue, digitisation

Institution

Selection and preservation history

Internal documents

Exports from email, tickets, CRM

Organisation/data owner

Permissions, confidentiality, versions

Sensors & logs

Streams, device exports

Operator/vendor

Gaps, clock drift, device metadata

Different source families require different evidence about provenance and completeness.

9 of 48

9

Source hunt: find one real source

Your turn

  • In pairs, search for one real source that could contribute evidence about public lighting, complaints or urban services.
  • Record: source owner · access route · coverage/time span · one visible limitation · one provenance field you would save immediately.
  • Do not evaluate “interestingness”. Evaluate fit to a question.

Fast debrief: two sources that look similar may observe very different phenomena.

10 of 48

10

Found data vs designed data

Readymade / found data

Produced for another purpose and repurposed for research.

​

Example: a city complaint register exists to manage service requests, not to measure public trust.

Custom-made / designed data

Collected specifically for your question, with a research design.

​

Example: a survey designed to measure residents’ perceived safety and lighting quality.

Readymades often offer scale and low collection cost; custom-made data offer tighter fit to the question.

11 of 48

11

Readymade, custom-made, or hybrid?

Your turn

City complaint register

Vote: R · C · H

Explain the borderline case.

Survey of residents

Vote: R · C · H

Explain the borderline case.

Neighbourhood Facebook posts

Vote: R · C · H

Explain the borderline case.

Online complaint form redesigned for the study

Vote: R · C · H

Explain the borderline case.

Street-light sensor logs

Vote: R · C · H

Explain the borderline case.

Newspaper archive

Vote: R · C · H

Explain the borderline case.

12 of 48

12

What found data is often like

Characteristic

Example in the complaints case

Incomplete

Important contextual attributes may not be recorded

Non-representative

Only people who complain through available channels appear

Drifting

A new form or workflow changes who appears and how often

Algorithmically confounded

Platform ranking affects which posts are visible or engageable

Dirty

Duplicates, inconsistent fields, malformed dates, encoding issues

Sensitive

Names, addresses, health or family details may appear in free text

13 of 48

13

Which source fits the question?

Your turn

C

Question

Best first source?

What would it miss?

Service response time

?

?

Public perception

?

?

Historical change

?

?

Operational bottlenecks

?

?

Measured outages

?

?

There is rarely one correct source; there are better or worse source–question matches.

14 of 48

14

A web page is not one thing

What you see

Rendered text

Images and tables

Interactive elements

Download links

What the browser receives

HTML / DOM

CSS and JavaScript

Network requests

Embedded JSON

Headers and status codes

What you may need to keep

Text + metadata

Original files

Stable identifier / URL

Timestamp

Acquisition method

“Scrape the page” is underspecified until you say which representation you are collecting.

15 of 48

15

What would you capture?

Your turn

P

A city page shows a complaint summary, PDF attachment, map and “last updated” date.

Visible text

Keep · discard · depends?

HTML

Keep · discard · depends?

PDF attachment

Keep · discard · depends?

Map image

Keep · discard · depends?

Coordinates

Keep · discard · depends?

Last-updated date

Keep · discard · depends?

URL

Keep · discard · depends?

HTTP headers

Keep · discard · depends?

For each choice: what future question would make this representation matter?

16 of 48

16

Web acquisition: use the least fragile route that captures the evidence

Manual export / download

Small, bounded collections.

High control, low scale.

Underlying API

When an official or documented endpoint exposes equivalent evidence.

Usually cleaner than UI scraping.

Crawler / scraper

Many predictable public pages.

Requires careful request strategy and monitoring.

Browser automation

Dynamic pages or workflows.

Often the most fragile because interfaces change.

Prefer an official export or documented API when it preserves the same evidence with less ambiguity.

17 of 48

17

API, scraper, export, or something else?

Your turn

Public comments under local-news articles

Choose a route. What could fail?

A city portal with CSV export

Choose a route. What could fail?

A dashboard whose chart loads JSON requests

Choose a route. What could fail?

A logged-in internal ticket system

Choose a route. What could fail?

18 of 48

18

Accessible, permitted, ethical: three different tests

P

Technically accessible

Can my tool obtain it?

​

A URL or endpoint answering a request does not settle permission or appropriate use.

Permitted

Do applicable law, licence, contract and terms allow the intended collection and reuse?

Ethically defensible

Should we collect, link, retain and analyse it this way, even if access is technically possible?

robots.txt is a crawler-control protocol, not access authorisation and not a copyright/GDPR decision.

19 of 48

19

APIs: access by contract, not by page

Endpoint

Where to ask

Parameters

What to ask for

Authentication

Who may ask

Pagination

How to continue

Response schema

What comes back

Errors & limits

How access can fail

An API improves structure, not provenance automatically: the request and access context still need to be recorded.

20 of 48

20

API detective: inspect before you collect

Your turn

P

  • Open a public API documentation page (suggestion: Crossref REST API, OpenMeteo, OpenWeather, OpenAlex etc.).
  • Find: one endpoint · one query/filter parameter · pagination mechanism · response format · one access/error constraint.
  • Write the minimum request you would need to reproduce one small query.

21 of 48

21

Read an API response as evidence

GET /complaints?district=centre&page=3

200 OK

Content-Type: application/json

ETag: "7a31…"

​

{ "items": [ … ],

"page": 3,

"next": "/complaints?…page=4" }

Part

What it tells you

Request

Endpoint + parameters

Status/body

What came back

Headers/time

Context of the response

next/cursor

How to continue

ETag

Server-provided validator; may be strong or weak

22 of 48

22

Design the request before you code

Your turn

You need all complaints created in March, including later edits.

1

Which endpoint?

2

Which date field?

3

How will you paginate?

4

How will you detect or capture edits?

5

What request and response metadata will you log?

23 of 48

23

Social media: you observe a platform, not society

What is visible

Posts, comments, reactions, media and timestamps — only to the extent the platform exposes them.

What is mediated

Ranking, moderation, deletions, privacy settings, account behaviour and access rules.

What can be missing

Non-users, silent users, deleted content, private spaces, hidden metadata.

A platform sample is a sample of platform traces, not automatically a sample of a population.

24 of 48

24

Archives: acquisition starts before digitisation

1

What existed

→

2

What was kept

→

3

What was catalogued

→

4

What was digitised

→

5

What you can search

→

6

What you download

Trouillot’s framework: silences can enter as sources are produced, preserved, retrieved and narrated.

Ask for more than the files

Collection-level metadata · finding aids · digitisation notes · stable identifiers

25 of 48

25

Internal documents: rich context, difficult governance

Access

Who may retrieve what?

Ownership / stewardship

Who is responsible for the source system?

Versions

Which copy is authoritative?

Retention

What is kept, deleted or archived?

Confidentiality

What must not leave the organisation?

Linking

What changes when documents are joined to other records?

The most informative source may also require the strongest governance.

26 of 48

26

Sensors and IoT: a stream still has provenance

Device

Which sensor and firmware?

Time

Clock, time zone, synchronisation

Place

Where was it physically located?

Calibration

When and how was it calibrated?

Missing data

Dropouts, outages, buffering

Transformation

Aggregation, smoothing, unit conversion

A number without device, time, place and transformation history is a weak observation.

27 of 48

27

Same question, different sources

Your turn

“Are street-lighting problems getting worse?”

Complaints portal

reported problems

Social-media posts

publicly expressed concern

Maintenance tickets

operational incidents

Light sensors

measured outages / conditions

Before merging sources, check whether they measure compatible phenomena.

28 of 48

28

Acquisition through the five lenses

Your turn

Lens

Question it asks about acquisition

Computer science

Did we get everything? Duplicates, pagination, rate limits, silent failures

Social sciences

Who is missing? Sampling frame, platform effects, measurement fit

Humanities

How was the archive/source produced, preserved and silenced?

Business

What does access cost; who owns it; do we depend on one vendor?

Law

What legal basis, permissions, licences and obligations apply?

Who never appears in the complaints folder — and why?

29 of 48

29

Finding data is only half the problem

Now we keep the trail of how it became our dataset.

30 of 48

30

A minimal acquisition pipeline

Discover

source, scope

→

Acquire

request, download

→

Land raw

closest feasible copy

→

Validate

counts, integrity

→

Normalise

names, formats

→

Store

versioned

→

Log

provenance, errors

  • Resumable: restart after failure without silently duplicating data.
  • Scheduled: rerun when the research design requires another snapshot.
  • Logged: record what was requested, received and failed.
  • Versioned: trace analysis back to a specific acquisition state.

31 of 48

31

Raw, working and analytical layers

Raw / landing

Closest feasible copy of what was acquired: original files or responses, timestamps and request context.

Working / normalised

Decoded text, consistent metadata, extracted attachments, corrected encodings — derived from raw, not overwriting it.

Analytical

Filtered, joined, aggregated or feature-ready data prepared for one question or model.

A cleaned table is not “raw” merely because it was the first file you received from a colleague.

32 of 48

32

Build the pipeline

Your turn

Query API

Place in a defensible order.

Capture request metadata

Place in a defensible order.

Save raw response

Place in a defensible order.

Validate item count

Place in a defensible order.

Normalise fields

Place in a defensible order.

Create analysis table

Place in a defensible order.

Which step must happen before any destructive change?

33 of 48

33

Provenance is more than a citation

Citation

Where can I find or identify the source?

Provenance

How did this exact item become part of this dataset?

Lineage

Which upstream items and transformations produced this result?

A URL answers “where”. Provenance adds when, how, by whom and what changed.

34 of 48

34

A provenance model: Entity, Activity, Agent

Entity

A thing: page, API response, PDF, dataset version.

Activity

Something that happened: download, filtering, OCR, conversion.

Agent

A person, team, organisation or software agent associated with an activity.

Example: Team 3 (agent) exports complaints (activity) and generates complaints_raw.csv (entity).

35 of 48

35

Provenance record: one complaint, end to end

Field

Recorded value

Source

https://city.example/complaints/8431 (fictional example)

Retrieved

12 Oct 2026, 10:42 +03:00

Method/tool

GET request · collection script v0.3

Parameters

category=public-lighting; 2022–2025

Raw artifact

complaint_8431.html

Checksum

SHA-256 of the saved raw artifact

Derived artifact

complaint_8431.txt

Transformation

HTML → text · parser v2.1

Terms/licence

Recorded as observed at collection time

Responsible agent

Team 3 · data engineer

36 of 48

36

Minimum viable provenance: six questions

What?

Source/item identifier

When?

Retrieval time; source version if known

How?

Method, endpoint, query/parameters

With what?

Tool/version; relevant settings

By whom?

Responsible person/team/agent

What changed?

Transformations, filters, exclusions

These six questions are a minimum teaching heuristic, not a complete provenance standard.

37 of 48

37

Write a provenance record

Your turn

In pairs: answer the six questions for one item from the complaints folder (for example, a social-media post).

What

Known? Unknown? How would you obtain it?

When

Known? Unknown? How would you obtain it?

How

Known? Unknown? How would you obtain it?

With what

Known? Unknown? How would you obtain it?

By whom

Known? Unknown? How would you obtain it?

What changed

Known? Unknown? How would you obtain it?

Unknown provenance is itself information: mark it explicitly rather than inventing it.

38 of 48

38

Web and API data change

09:00

Page says “resolved”

12:00

Text edited

14:00

Attachment replaced

Next day

Page deleted

A stable URL is not a stable artefact. Preserve a snapshot when the observed state matters.

39 of 48

39

Identifiers, timestamps, checksums and versions

Identifier

Which item/resource?

URL · DOI · internal ID

Timestamp

Which observed state?

retrieved_at · modified_at

Checksum

Are the saved bytes identical?

SHA-256

Version

Which declared release/revision?

v1.2 · revision ID

No single field gives complete provenance; combine them according to the source.

40 of 48

40

Reproducibility for changing sources

Exact rerun

The same query today returns the same bytes.

​

Often impossible for live web/platform data.

Reconstructable process

Another team can repeat the documented procedure and understand differences caused by source change.

Auditable result

The original snapshot and transformation history behind the reported claim are preserved.

41 of 48

41

Could another team reproduce this?

Your turn

A

“We scraped 5,000 pages from the website in May.”

B

“API query saved; raw JSON kept; retrieval time and parameters logged.”

C

“We copied relevant posts into Excel and removed duplicates.”

What is missing for traceability? What would you add first?

42 of 48

42

Common acquisition failure modes

Endpoint/schema changed

Collection silently stops or fields shift

Page edited

Same URL, different evidence

Post deleted

Dataset shrinks over time

Pagination missed

Only the first segment is collected

Encoding changed

Text becomes corrupted

Over-eager deduplication

Distinct items are merged

Estimating what you did not collect

Compare counts with known totals · inspect a random sample · look for temporal gaps · log failed requests · report unknown coverage

43 of 48

43

What your team delivers after acquisition

1. Source inventory

Source, scope, access route, licence/terms and constraints.

2. Acquisition log

When, how, parameters, counts, errors and retries.

3. Raw snapshot

Original responses/files where permitted; identifiers and checksums.

4. Transformation log

Every conversion, filter, exclusion and tool/version.

5. Data dictionary

Meaning of each field and metadata element.

6. Rerun instructions

How another team repeats or audits the pipeline.

A defensible dataset comes with its history. Milestone 1 starts the documentation; later milestones deepen it.

44 of 48

44

What can we claim?

Your turn

Our collection

Only complaints submitted online, 2022–2025. The online form was introduced in 2023.

Which claim about street lighting can you make? �Which one can you NOT make?

More defensible

“Online complaints about street lighting increased after 2023.”

Overclaim

“Street-lighting problems in the city increased after 2023.”

45 of 48

45

The three threads, today

P · Provenance and reproducibility

Source → request → raw snapshot → transformation → version. Can another team trace every item?

E · Evaluation and uncertainty

Coverage, failed requests, duplicates, source changes. How incomplete might the collection be?

C · Question → claim

The source constrains which population or phenomenon the final claim can legitimately refer to.

46 of 48

46

Lab 2: from a source to a reproducible mini-collection

Goal: build a small collection that another team can audit and, as far as the source allows, reproduce.

1

Question + source card

2

Acquire 5–10 items

3

Preserve RAW

4

Write provenance log

5

Run one quality check

6

README + rerun recipe

7

Peer reproducibility audit

8

Revise after audit

47 of 48

47

Exit ticket

Your turn

1

One source I would now treat more cautiously is…

2

One provenance field I had underestimated is…

3

For our project, the first acquisition risk to check is…

48 of 48

48

Next steps and readings

Next

Lab 2: acquisition + provenance + peer audit

Milestone 1 (week 4): project proposal, source inventory and first datasheet

Lecture 3: PDF, OCR, layout, tables and speech-to-text

Core readings

Salganik (2018), Bit by Bit, Ch. 2

Gebru et al. (2021), Datasheets for Datasets

W3C PROV Primer

Optional context

Bruns (2019), After the “APIcalypse”

Trouillot (1995), Silencing the Past, Ch. 1

Standards to keep nearby

RFC 9309 · Robots Exclusion Protocol

RFC 9110 · HTTP Semantics

OpenAPI Specification 3.2.1 (2026)

W3C Data on the Web Best Practices